[IMP]discount shows grey and small font under product and total discount amt shows after tax

bzr revid: sgo@tinyerp.com-20121005110504-63l1uzxi0fomn4ic
This commit is contained in:
Sanjay Gohel (Open ERP) 2012-10-05 16:35:04 +05:30
parent 87e3d19a54
commit 5b48e0894e
3 changed files with 16 additions and 8 deletions

View File

@ -102,6 +102,11 @@
border: 1px solid #cecbcb;
border-radius: 4px;
}
.point-of-sale .pos-disc-font {
font-size: 12px;
font-style:italic;
color: #808080;
}
/* ********* The black header bar ********* */

View File

@ -614,6 +614,11 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
return sum + orderLine.get_price_with_tax();
}), 0);
},
getDiscountTotal: function() {
return (this.get('orderLines')).reduce((function(sum, orderLine) {
return sum + (orderLine.get_list_price() * (orderLine.get_discount()/100) * orderLine.get_quantity());
}), 0);
},
getTotalTaxExcluded: function() {
return (this.get('orderLines')).reduce((function(sum, orderLine) {
return sum + orderLine.get_price_without_tax();

View File

@ -555,8 +555,8 @@
<td>
<t t-esc="order.get_product().get('name')"/>
<t t-if="order.get_discount() > 0">
<li>
<t t-esc="order.get_discount()"/>% discount
<li class="pos-disc-font">
With a <t t-esc="order.get_discount()"/>% discount
</li>
</t>
</td>
@ -564,12 +564,7 @@
<t t-esc="order.get_quantity().toFixed(0)"/>
</td>
<td class="pos-right-align">
<t t-esc="widget.format_currency(order.get_list_price() * order.get_quantity().toFixed(2))"/>
<t t-if="order.get_discount() > 0">
<li class="pos-right-align">
-<t t-esc="widget.format_currency(order.get_list_price() * (order.get_discount()/100) * order.get_quantity().toFixed(2))"/>
</li>
</t>
<t t-esc="widget.format_currency(order.get_list_price() * (1 - order.get_discount()/100) * order.get_quantity().toFixed(2))"/>
</td>
</tr>
</table>
@ -578,6 +573,9 @@
<tr><td>Tax:</td><td class="pos-right-align">
<t t-esc="widget.format_currency(widget.currentOrder.getTax().toFixed(2))"/>
</td></tr>
<tr><td>Discount:</td><td class="pos-right-align">
<t t-esc="widget.format_currency(widget.currentOrder.getDiscountTotal().toFixed(2))"/>
</td></tr>
<tr class="emph"><td>Total:</td><td class="pos-right-align">
<t t-esc="widget.format_currency(widget.currentOrder.getTotal().toFixed(2))"/>
</td></tr>