[IMP] point_of_sale: allow to force the display of prices tax included, even if the taxes are not included.\nThis is useful when you want to work without taxes for sales.orders and still sell with TVA Included. There is one limitation tough: the prices in the product list show the price without taxes.
Conflicts: addons/point_of_sale/static/src/js/models.js addons/point_of_sale/static/src/xml/pos.xml
This commit is contained in:
committed by
Frédéric van der Essen
parent
d58ee7c25e
commit
22c8db7fcb
@@ -77,6 +77,7 @@ class pos_config(osv.osv):
|
||||
'iface_fullscreen': fields.boolean('Fullscreen', help='Display the Point of Sale in full screen mode'),
|
||||
'iface_print_auto': fields.boolean('Automatic Receipt Printing', help='The receipt will automatically be printed at the end of each order'),
|
||||
'iface_precompute_cash': fields.boolean('Prefill Cash Payment', help='The payment input will behave similarily to bank payment input, and will be prefilled with the exact due amount'),
|
||||
'iface_tax_included': fields.boolean('Include Taxes in Prices', help='The displayed prices will always include all taxes, even if the taxes have been setup differently'),
|
||||
'receipt_header': fields.text('Receipt Header',help="A short text that will be inserted as a header in the printed receipt"),
|
||||
'receipt_footer': fields.text('Receipt Footer',help="A short text that will be inserted as a footer in the printed receipt"),
|
||||
'proxy_ip': fields.char('IP Address', help='The hostname or ip address of the hardware proxy, Will be autodetected if left empty', size=45),
|
||||
|
||||
@@ -691,6 +691,7 @@
|
||||
<field name="iface_fullscreen" />
|
||||
<field name="iface_big_scrollbars" />
|
||||
<field name="iface_print_auto" />
|
||||
<field name="iface_tax_included" />
|
||||
</group>
|
||||
</group>
|
||||
<group string="Hardware Proxy" >
|
||||
|
||||
@@ -878,7 +878,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
||||
return {
|
||||
quantity: this.get_quantity(),
|
||||
unit_name: this.get_unit().name,
|
||||
price: this.get_unit_price(),
|
||||
price: this.get_unit_display_price(),
|
||||
discount: this.get_discount(),
|
||||
product_name: this.get_product().display_name,
|
||||
price_display : this.get_display_price(),
|
||||
@@ -897,12 +897,28 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
||||
get_unit_price: function(){
|
||||
return this.price;
|
||||
},
|
||||
get_unit_display_price: function(){
|
||||
if (this.pos.config.iface_tax_included) {
|
||||
var quantity = this.quantity;
|
||||
this.quantity = 1.0;
|
||||
var price = this.get_all_prices().priceWithTax;
|
||||
this.quantity = quantity;
|
||||
return price;
|
||||
} else {
|
||||
return this.get_unit_price();
|
||||
}
|
||||
},
|
||||
get_base_price: function(){
|
||||
var rounding = this.pos.currency.rounding;
|
||||
return round_pr(round_pr(this.get_unit_price() * this.get_quantity(),rounding) * (1- this.get_discount()/100.0),rounding);
|
||||
},
|
||||
get_display_price: function(){
|
||||
return this.get_base_price();
|
||||
if (this.pos.config.iface_tax_included) {
|
||||
return this.get_all_prices().priceWithTax;
|
||||
} else {
|
||||
return this.get_base_price();
|
||||
}
|
||||
},
|
||||
get_price_without_tax: function(){
|
||||
return this.get_all_prices().priceWithoutTax;
|
||||
|
||||
@@ -1066,7 +1066,7 @@
|
||||
</em>
|
||||
<t t-esc="line.get_unit().name" />
|
||||
at
|
||||
<t t-esc="widget.format_currency(line.get_unit_price(),'Product Price')" />
|
||||
<t t-esc="widget.format_currency(line.get_unit_display_price(),'Product Price')" />
|
||||
/
|
||||
<t t-esc="line.get_unit().name" />
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user