[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: 1px solid #cecbcb;
border-radius: 4px; border-radius: 4px;
} }
.point-of-sale .pos-disc-font {
font-size: 12px;
font-style:italic;
color: #808080;
}
/* ********* The black header bar ********* */ /* ********* 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(); return sum + orderLine.get_price_with_tax();
}), 0); }), 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() { getTotalTaxExcluded: function() {
return (this.get('orderLines')).reduce((function(sum, orderLine) { return (this.get('orderLines')).reduce((function(sum, orderLine) {
return sum + orderLine.get_price_without_tax(); return sum + orderLine.get_price_without_tax();

View File

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