[WIP] point_of_sale: in progress of solving bugs in taxes and order editing, part 2

bzr revid: fva@openerp.com-20130123183205-7krkee3ihqg1hhmo
This commit is contained in:
Frédéric van der Essen 2013-01-23 19:32:05 +01:00
parent 5883f32718
commit 2616386e3f
5 changed files with 24 additions and 22 deletions

View File

@ -993,12 +993,20 @@
margin-bottom:10px;
}
.point-of-sale .order .summary .line{
float: right;
margin-right:15px;
margin-left: 15px;
padding-top:5px;
border-top: solid 2px;
border-color:#777;
}
.point-of-sale .order .summary .line .subentry{
font-size: 10px;
font-weight: normal;
text-align: center;
}
.point-of-sale .order .summary .line.empty{
text-align: right;
border-color:#BBB;
color:#999;
}

View File

@ -704,10 +704,10 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
}), 0);
},
getChange: function() {
return this.getPaidTotal() - this.getTotal();
return this.getPaidTotal() - this.getTotalTaxIncluded();
},
getDueLeft: function() {
return this.getTotal() - this.getPaidTotal();
return this.getTotalTaxIncluded() - this.getPaidTotal();
},
// sets the type of receipt 'receipt'(default) or 'invoice'
set_receipt_type: function(type){
@ -763,7 +763,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
return {
orderlines: orderlines,
paymentlines: paymentlines,
total_with_tax: this.getTotal(),
total_with_tax: this.getTotalTaxIncluded(),
total_without_tax: this.getTotalTaxExcluded(),
total_tax: this.getTax(),
total_paid: this.getPaidTotal(),
@ -808,7 +808,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
return {
name: this.getName(),
amount_paid: this.getPaidTotal(),
amount_total: this.getTotal(),
amount_total: this.getTotalTaxIncluded(),
amount_tax: this.getTax(),
amount_return: this.getChange(),
lines: orderLines,

View File

@ -973,13 +973,13 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
this.$('#payment-paid-total').html(paidTotal.toFixed(2));
this.$('#payment-remaining').html(remaining.toFixed(2));
this.$('#payment-change').html(change.toFixed(2));
if((currentOrder.selected_orderline == undefined))
remaining = 1
if(currentOrder.selected_orderline === undefined){
remaining = 1; // What is this ?
}
if(this.pos_widget.action_bar){
this.pos_widget.action_bar.set_button_disabled('validation', remaining > 0);
}
this.$('.paymentline-amount input:last').focus();
},
set_numpad_state: function(numpadState) {
if (this.numpadState) {

View File

@ -269,12 +269,10 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
},
update_summary: function(){
var order = this.pos.get('selectedOrder');
var subtotal = order ? order.getSubtotal() : 0;
var total = order ? order.getTotalTaxIncluded() : 0;
var taxes = order ? total - order.getTotalTaxExcluded() : 0;
this.$('.summary .value.subtotal').html(this.format_currency(subtotal));
this.$('.summary .value.taxes').html(this.format_currency(taxes));
this.$('.summary .value.total').html(this.format_currency(total));
this.$('.summary .total > .value').html(this.format_currency(total));
this.$('.summary .total .subentry .value').html(this.format_currency(taxes));
},
set_display_mode: function(mode){
if(this.display_mode !== mode){

View File

@ -437,17 +437,13 @@
</ul>
<div class="summary">
<span t-attf-class="line #{widget.pos.get('selectedOrder').get('orderLines').length === 0 ? 'empty' : ''}">
<span class='entry subtotal'>
<span class="label subtotal">Subtotal:</span> <span class="value subtotal">0.00 €</span>
</span>
<span class='entry taxes'>
<span class="label taxes">Taxes:</span> <span class="value taxes">0.00€</span>
</span>
<span class='entry total'>
<span class="label total">Total:</span> <span class="value total">0.00 €</span>
</span>
</span>
<div t-attf-class="line #{widget.pos.get('selectedOrder').get('orderLines').length === 0 ? 'empty' : ''}">
<div class='entry total'>
<span class="label">Total: </span> <span class="value">0.00 €</span>
<div class='subentry'>Taxes: <span class="value">0.00€</span></div>
</div>
</div>
<div class='clear'></div>
</div>
</div>
</div>