Amit Parik (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-951009-amp into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #951009 in OpenERP Addons: "Point of Sales 6.1 - Statement lines"
  https://bugs.launchpad.net/openobject-addons/+bug/951009

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-951009-amp/+merge/100073

Some problems in POS statement line for touch-screen pos.

For this example:

  Total: 9.00 €
  - Bank Journal - (test) (EUR) 5.00 €
  - Cash Journal - (test) (EUR) 5.00 €
  Paid: 10.00 €
  Change: 1.00 €

Currently entry created only for 1st journal with total amount like Bank 
Journal - (test) (EUR)10.00 €
and also order is in new state (doesn't goes into paid state after validate). 
It should be goes in to paid state because for touch-screen pos order no need 
to manually pay it. It will paid at the time of validate.

So According to this fix entry will created like 

  - Bank Journal - (test) (EUR) 5.00 €
  - Cash Journal - (test) (EUR) 4.00 € also the order goes in to paid state.

Thanks!
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-951009-amp/+merge/100073
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-951009-amp.
=== modified file 'point_of_sale/point_of_sale.py'
--- point_of_sale/point_of_sale.py	2012-02-28 14:08:16 +0000
+++ point_of_sale/point_of_sale.py	2012-03-30 05:59:20 +0000
@@ -64,13 +64,14 @@
             list.append(order_id)
             # call add_payment; refer to wizard/pos_payment for data structure
             # add_payment launches the 'paid' signal to advance the workflow to the 'paid' state
-            data = {
-                'journal': statement_ids[0][2]['journal_id'],
-                'amount': order['amount_paid'],
-                'payment_name': order['name'],
-                'payment_date': statement_ids[0][2]['name'],
-            }
-            order_obj.add_payment(cr, uid, order_id, data, context=context)
+            for statement_id in statement_ids:
+                data = {
+                    'journal': statement_id[2]['journal_id'],
+                    'amount': statement_id[2]['amount'],
+                    'payment_name': order['name'],
+                    'payment_date': statement_ids[0][2]['name'],
+                }
+                order_obj.add_payment(cr, uid, order_id, data, context=context)
         return list
 
     def unlink(self, cr, uid, ids, context=None):
@@ -278,8 +279,13 @@
         curr_company = curr_c.id
         order = self.browse(cr, uid, order_id, context=context)
         ids_new = []
+        
+        if data['amount'] + order.amount_paid > order.amount_total:
+            amount = order.amount_total - order.amount_paid
+        else:
+            amount = data['amount']
         args = {
-            'amount': data['amount'],
+            'amount': amount,
         }
         if 'payment_date' in data.keys():
             args['date'] = data['payment_date']

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to