[IMP] pos_loyalty: add a loyalty resume at the end of the receipt

This commit is contained in:
Frederic van der Essen
2014-11-26 11:40:22 +01:00
committed by Frédéric van der Essen
parent 44253541e5
commit ba380c807e
3 changed files with 41 additions and 3 deletions
+6 -2
View File
@@ -675,7 +675,7 @@
<!-- Orderlines -->
<div line-ratio='0.6'>
<div class='orderlines' line-ratio='0.6'>
<t t-foreach='receipt.orderlines' t-as='line'>
<t t-set='simple' t-value='line.discount === 0 and line.unit_name === "Unit(s)" and line.quantity === 1' />
<t t-if='simple'>
@@ -727,7 +727,7 @@
<!-- Total -->
<line><right>--------</right></line>
<line size='double-height'>
<line class='total' size='double-height'>
<left><pre> TOTAL</pre></left>
<right><value><t t-esc='receipt.total_with_tax' /></value></right>
</line>
@@ -766,6 +766,8 @@
</t>
</t>
<div class='before-footer' />
<!-- Footer -->
<t t-if='receipt.footer_xml'>
<t t-raw='receipt.footer_xml' />
@@ -778,6 +780,8 @@
<br/>
</t>
<div class='after-footer' />
<br/>
<div font='b'>
<div><t t-esc='receipt.name' /></div>
+10 -1
View File
@@ -294,7 +294,16 @@ openerp.pos_loyalty = function(instance){
},
export_for_printing: function(){
var json = _super.prototype.export_for_printing.apply(this,arguments);
json.loyalty_points = this.get_new_points();
if (this.pos.loyalty && this.get_client()) {
json.loyalty = {
rounding: this.pos.loyalty.rounding || 1,
name: this.pos.loyalty.name,
client: this.get_client().name,
points_won : this.get_won_points(),
points_spent: this.get_spent_points(),
points_total: this.get_new_total_points(),
};
}
return json;
},
export_as_JSON: function(){
@@ -40,6 +40,31 @@
</t>
</t>
<t t-extend="XmlReceipt">
<t t-jquery='.before-footer' t-operation='append'>
<t t-if='receipt.loyalty'>
<div class='loyalty' value-decimals='2' value-autoint='on'>
<div>--------------------------------</div>
<br/>
<div size='double-height'><t t-esc='receipt.loyalty.name'/></div>
<br />
<div><t t-esc='receipt.loyalty.client' /></div>
<br/>
<t t-if='receipt.loyalty.points_won'>
<line><left>Points Won</left><right><value><t t-esc='receipt.loyalty.points_won' /></value></right></line>
</t>
<t t-if='receipt.loyalty.points_spent'>
<line><left>Points Spent</left><right><value><t t-esc='receipt.loyalty.points_spent' /></value></right></line>
</t>
<t t-if='receipt.loyalty.points_total'>
<line><left>Total Points</left><right><value><t t-esc='receipt.loyalty.points_total' /></value></right></line>
</t>
<br />
</div>
</t>
</t>
</t>
<t t-extend='ClientDetails'>
<t t-jquery='.client-details-right' t-operation='prepend'>
<div class='client-detail'>