mirror of
https://bitbucket.org/presik/presik_pos.git
synced 2023-12-14 06:03:00 +01:00
Minor fix
This commit is contained in:
parent
8a3e99bde2
commit
d167c8208a
|
@ -657,6 +657,7 @@ class MainWindow(FrontWindow):
|
|||
return False
|
||||
if self._current_line_id:
|
||||
self._sale_line['quantity'] = float(quantity)
|
||||
print('LINEA ENVIADA ', self._sale_line)
|
||||
rec = self.SaleLine.faster_set_quantity(self._sale_line)
|
||||
except:
|
||||
return self.message_bar.set('quantity_not_valid')
|
||||
|
@ -958,7 +959,6 @@ class MainWindow(FrontWindow):
|
|||
)
|
||||
self.set_unit_price(list_price)
|
||||
self.update_total_amount()
|
||||
pass
|
||||
|
||||
def action_salesman(self):
|
||||
if self._state in ['cash']:
|
||||
|
@ -1081,9 +1081,10 @@ class MainWindow(FrontWindow):
|
|||
data = {
|
||||
'delivery_amount': value
|
||||
}
|
||||
res = self.Sale.write([self._sale['id']], data)
|
||||
print('Res Util???', res)
|
||||
self.update_net_amount(res)
|
||||
print('Res Util???', value)
|
||||
if self._sale.get('id') and value:
|
||||
res = self.Sale.write([self._sale['id']], data)
|
||||
self.update_net_amount(res)
|
||||
|
||||
def action_delivery_charge_selection_changed(self, index):
|
||||
val = self.field_delivery_charge.get_id()
|
||||
|
@ -1246,6 +1247,7 @@ class MainWindow(FrontWindow):
|
|||
orders, sale_number = self.Sale.get_order2print(args)
|
||||
self._sale['number'] = sale_number
|
||||
self.field_order_number.setText(self._sale['number'])
|
||||
print(' orders ....', orders)
|
||||
result = self.receipt_order.print_orders(orders, reversion, kind)
|
||||
except:
|
||||
logging.error('Printing order fail!')
|
||||
|
@ -2028,6 +2030,7 @@ class MainWindow(FrontWindow):
|
|||
def sale_line_selected(self, line):
|
||||
if self._state == 'cash':
|
||||
return
|
||||
print('Selecccionas esta linea ', line)
|
||||
self._current_line_id = line['id']
|
||||
product_id = None
|
||||
if isinstance(line['product'], int):
|
||||
|
@ -2524,6 +2527,7 @@ class MainWindow(FrontWindow):
|
|||
def update_sale_line(self, field):
|
||||
value = None
|
||||
self.state_line['id'] = self._current_line_id
|
||||
print( ' self.state_line -id ', self.state_line['id'])
|
||||
if field == 'quantity':
|
||||
value = Decimal(self.row_field_qty.value())
|
||||
if field == 'unit_price':
|
||||
|
@ -2552,6 +2556,7 @@ class MainWindow(FrontWindow):
|
|||
self.state_line[field] = value
|
||||
|
||||
def dialog_product_edit_accepted(self):
|
||||
print('self.state_line ', self.state_line, self._current_line_id)
|
||||
if not self.state_line:
|
||||
return
|
||||
_record = None
|
||||
|
@ -2564,11 +2569,11 @@ class MainWindow(FrontWindow):
|
|||
|
||||
if self.state_line.get('quantity'):
|
||||
quantity = self.state_line.pop('quantity')
|
||||
if self._process_quantity(str(quantity)):
|
||||
_record = self.SaleLine.faster_set_quantity({
|
||||
'id': self._current_line_id,
|
||||
'quantity': to_float(quantity, 2)
|
||||
})
|
||||
# self._process_quantity(str(quantity))
|
||||
_record = self.SaleLine.faster_set_quantity({
|
||||
'id': self._current_line_id,
|
||||
'quantity': to_float(quantity, 2)
|
||||
})
|
||||
|
||||
if self.state_line.get('description'):
|
||||
_record = self.SaleLine.write([self._current_line_id], {
|
||||
|
|
|
@ -390,10 +390,11 @@ class Receipt(object):
|
|||
if sale['cash_received']:
|
||||
self.print_split('Recibido:', money(sale['cash_received']))
|
||||
else:
|
||||
self.print_split('Recibido:', money(sale['paid_amount']))
|
||||
residual_amount = net_amount - sale['paid_amount']
|
||||
self.print_split('Saldo Pendiente:', money(residual_amount))
|
||||
self.print_split('Cambio:', money(net_amount - sale['change']))
|
||||
#self.print_split('Recibido:', money(sale['paid_amount']))
|
||||
#residual_amount = net_amount - sale['paid_amount']
|
||||
#self.print_split('Saldo Pendiente:', money(residual_amount))
|
||||
pass
|
||||
# self.print_split('Cambio:', money(sale['change']))
|
||||
self.print_horinzontal_line()
|
||||
self.print_enter()
|
||||
if self._printing_taxes:
|
||||
|
@ -631,9 +632,9 @@ class Receipt(object):
|
|||
|
||||
self.print_enter()
|
||||
self._printer.set(custom_size=True, width=1, height=2)
|
||||
|
||||
print('order_lines >>>>> ', order['lines'])
|
||||
for line in order['lines']:
|
||||
qty = ' ' + str(int(Decimal(line['quantity'])))
|
||||
qty = str(int(line['quantity']))
|
||||
self._printer.set(custom_size=True, width=1, height=2)
|
||||
self.print_col(qty, self.order_col_1)
|
||||
self.print_col(line['name'], col_width_name)
|
||||
|
|
Loading…
Reference in a new issue