projects
/
photoprint.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
24f21ff
)
Bugfix : reduce sur une liste d'un élément provoque des effets de bords.
author
Benoît Pin
<benoit.pin@gmail.com>
Thu, 3 Oct 2013 05:38:58 +0000
(07:38 +0200)
committer
Benoît Pin
<benoit.pin@gmail.com>
Thu, 3 Oct 2013 05:38:58 +0000
(07:38 +0200)
order.py
patch
|
blob
|
history
diff --git
a/order.py
b/order.py
index
2948aaf
..
9323dd3
100755
(executable)
--- a/
order.py
+++ b/
order.py
@@
-337,9
+337,10
@@
class PrintOrder(PortalContent, DefaultDublinCoreImpl) :
'PAYMENTREQUEST_0_SHIPTOPHONENUM' : self.billing['phone'],
}
'PAYMENTREQUEST_0_SHIPTOPHONENUM' : self.billing['phone'],
}
- quantitySum = reduce(lambda a, b : a['quantity'] + b['quantity'], self.items)
- priceSum = reduce(lambda a, b : a['unit_price'] * a['quantity'] + b['unit_price'] * b['quantity'], self.items)
- priceValues = priceSum.getValues()
+ if len(self.items) > 1 :
+ quantitySum = reduce(lambda a, b : a['quantity'] + b['quantity'], self.items)
+ else :
+ quantitySum = self.items[0]['quantity']
total = round(self.amountWithFees.getValues()['taxed'], 2)
options['L_PAYMENTREQUEST_0_NAME0'] = 'Commande realis photo ref. %s' % self.getId()
total = round(self.amountWithFees.getValues()['taxed'], 2)
options['L_PAYMENTREQUEST_0_NAME0'] = 'Commande realis photo ref. %s' % self.getId()