Attached Files | issue22033.diff [^] (13,497 bytes) 2012-12-11 15:44 [Show Content] [Hide Content]diff --git a/src-db/database/sourcedata/AD_MESSAGE.xml b/src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml
@@ -573,6 +573,17 @@
<!--32D8FA0EB5B941BFB3DCEFCF78436063--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
<!--32D8FA0EB5B941BFB3DCEFCF78436063--></AD_MESSAGE>
+<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--><AD_MESSAGE>
+<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--> <AD_MESSAGE_ID><![CDATA[33EB3C24BDFF4ED5B6CE71744DAD1B98]]></AD_MESSAGE_ID>
+<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--> <VALUE><![CDATA[OBPOS_LblTotalQtyToKeep]]></VALUE>
+<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--> <MSGTEXT><![CDATA[Total to Keep]]></MSGTEXT>
+<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--> <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
+<!--33EB3C24BDFF4ED5B6CE71744DAD1B98--></AD_MESSAGE>
+
<!--341FD775942F423297A4ECB193B0FAD1--><AD_MESSAGE>
<!--341FD775942F423297A4ECB193B0FAD1--> <AD_MESSAGE_ID><![CDATA[341FD775942F423297A4ECB193B0FAD1]]></AD_MESSAGE_ID>
<!--341FD775942F423297A4ECB193B0FAD1--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -3127,6 +3138,17 @@
<!--E07821D2206347338138EA0881F23A90--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
<!--E07821D2206347338138EA0881F23A90--></AD_MESSAGE>
+<!--E1D2A17B3FED4DDEBFD93BBD758B6EAD--><AD_MESSAGE>
+<!--E1D2A17B3FED4DDEBFD93BBD758B6EAD--> <AD_MESSAGE_ID><![CDATA[E1D2A17B3FED4DDEBFD93BBD758B6EAD]]></AD_MESSAGE_ID>
+<!--E1D2A17B3FED4DDEBFD93BBD758B6EAD--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E1D2A17B3FED4DDEBFD93BBD758B6EAD--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E1D2A17B3FED4DDEBFD93BBD758B6EAD--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E1D2A17B3FED4DDEBFD93BBD758B6EAD--> <VALUE><![CDATA[OBPOS_LblTotalQtyToDepo]]></VALUE>
+<!--E1D2A17B3FED4DDEBFD93BBD758B6EAD--> <MSGTEXT><![CDATA[Total to Deposit]]></MSGTEXT>
+<!--E1D2A17B3FED4DDEBFD93BBD758B6EAD--> <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--E1D2A17B3FED4DDEBFD93BBD758B6EAD--> <AD_MODULE_ID><![CDATA[FF808181326CC34901326D53DBCF0018]]></AD_MODULE_ID>
+<!--E1D2A17B3FED4DDEBFD93BBD758B6EAD--></AD_MESSAGE>
+
<!--E3A513EA4850464C8B373BB4989F479E--><AD_MESSAGE>
<!--E3A513EA4850464C8B373BB4989F479E--> <AD_MESSAGE_ID><![CDATA[E3A513EA4850464C8B373BB4989F479E]]></AD_MESSAGE_ID>
<!--E3A513EA4850464C8B373BB4989F479E--> <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff --git a/web/org.openbravo.retail.posterminal/js/closecash/model/cashup-model.js b/web/org.openbravo.retail.posterminal/js/closecash/model/cashup-model.js
--- a/web/org.openbravo.retail.posterminal/js/closecash/model/cashup-model.js
+++ b/web/org.openbravo.retail.posterminal/js/closecash/model/cashup-model.js
@@ -211,36 +211,71 @@
},
//Step 4
getCountCashSummary: function () {
- var countCashSummary, counter, enumConcepts, enumSummarys, i;
+ var countCashSummary, counter, enumConcepts, enumSecondConcepts, enumSummarys, i, undf, model, value = OB.DEC.Zero,
+ second = OB.DEC.Zero;
countCashSummary = {
expectedSummary: [],
countedSummary: [],
differenceSummary: [],
+ qtyToKeepSummary: [],
+ qtyToDepoSummary: [],
totalCounted: this.get('totalCounted'),
totalExpected: this.get('totalExpected'),
- totalDifference: this.get('totalDifference')
+ totalDifference: this.get('totalDifference'),
+ totalQtyToKeep: _.reduce(this.get('paymentList').models, function (total, model) {
+ if (model.get('qtyToKeep')) {
+ return OB.DEC.add(total, OB.DEC.mul(model.get('qtyToKeep'), model.get('rate')));
+ } else {
+ return total;
+ }
+ }, 0),
+ totalQtyToDepo: _.reduce(this.get('paymentList').models, function (total, model) {
+ if (model.get('qtyToKeep') !== null && model.get('qtyToKeep') !== undf) {
+ return OB.DEC.add(total, OB.DEC.mul(OB.DEC.sub(model.get('foreignCounted'), model.get('qtyToKeep')), model.get('rate')));
+ } else {
+ return total;
+ }
+ }, 0)
};
- enumSummarys = ['expectedSummary', 'countedSummary', 'differenceSummary'];
- enumConcepts = ['expected', 'counted', 'difference'];
- for (counter = 0; counter < 3; counter++) {
+ enumSummarys = ['expectedSummary', 'countedSummary', 'differenceSummary', 'qtyToKeepSummary', 'qtyToDepoSummary'];
+ enumConcepts = ['expected', 'counted', 'difference', 'qtyToKeep', 'foreignCounted'];
+ enumSecondConcepts = ['foreignExpected', 'foreignCounted', 'foreignDifference', 'qtyToKeep', 'qtyToKeep'];
+ for (counter = 0; counter < 5; counter++) {
for (i = 0; i < this.get('paymentList').models.length; i++) {
- if (!this.get('paymentList').models[i].get(enumConcepts[counter])) {
+ model = this.get('paymentList').models[i];
+ if (!model.get(enumConcepts[counter])) {
countCashSummary[enumSummarys[counter]].push({
- name: this.get('paymentList').models[i].get('name'),
+ name: model.get('name'),
value: 0,
- foreignExpected: 0,
- foreignCounted: 0,
- foreignDifference: 0,
- isocode: this.get('paymentList').models[i].get('isocode')
+ second: 0,
+ isocode: ''
});
} else {
+ switch (enumSummarys[counter]) {
+ case 'qtyToKeepSummary':
+ value = OB.DEC.mul(model.get(enumConcepts[counter]), model.get('rate'));
+ second = model.get(enumSecondConcepts[counter]);
+ break;
+ case 'qtyToDepoSummary':
+ if (model.get(enumSecondConcepts[counter]) !== null && model.get(enumSecondConcepts[counter]) !== undf && model.get('rate') !== '1') {
+ second = OB.DEC.sub(model.get(enumConcepts[counter]), model.get(enumSecondConcepts[counter]));
+ } else {
+ second = OB.DEC.Zero;
+ }
+ if (model.get(enumSecondConcepts[counter]) !== null && model.get(enumSecondConcepts[counter]) !== undf) {
+ value = OB.DEC.mul(OB.DEC.sub(model.get(enumConcepts[counter]), model.get(enumSecondConcepts[counter])), model.get('rate'));
+ }
+
+ break;
+ default:
+ value = model.get(enumConcepts[counter]);
+ second = model.get(enumSecondConcepts[counter]);
+ }
countCashSummary[enumSummarys[counter]].push({
- name: this.get('paymentList').models[i].get('name'),
- value: this.get('paymentList').models[i].get(enumConcepts[counter]),
- foreignExpected: this.get('paymentList').models[i].get('foreignExpected'),
- foreignCounted: this.get('paymentList').models[i].get('foreignCounted'),
- foreignDifference: this.get('paymentList').models[i].get('foreignDifference'),
- isocode: this.get('paymentList').models[i].get('isocode')
+ name: model.get('name'),
+ value: value,
+ second: second,
+ isocode: model.get('isocode')
});
}
}
diff --git a/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js b/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js
--- a/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js
+++ b/web/org.openbravo.retail.posterminal/js/closecash/view/closecash.js
@@ -219,6 +219,7 @@
//if the new step is 2 or 4 we should set the step number
if (nextStep < 0 || nextStep > this.model.get('paymentList').length - 1) {
//change the step and not change the substep
+ this.$.postPrintClose.setSummary(this.model.getCountCashSummary());
this.model.set('step', this.model.get('step') + inEvent.originator.stepCount);
} else {
if (this.model.isStep3Needed(nextStep) === false) {
diff --git a/web/org.openbravo.retail.posterminal/js/closecash/view/tabpostprintclose.js b/web/org.openbravo.retail.posterminal/js/closecash/view/tabpostprintclose.js
--- a/web/org.openbravo.retail.posterminal/js/closecash/view/tabpostprintclose.js
+++ b/web/org.openbravo.retail.posterminal/js/closecash/view/tabpostprintclose.js
@@ -83,6 +83,8 @@
label: '',
value: '',
classes: 'row-fluid',
+ convertedValues: ['expected', 'counted', 'difference', 'qtyToKeep', 'qtyToDepo'],
+ valuestoConvert: ['deposits', 'drops', 'startings'],
components: [{
classes: 'span12',
components: [{
@@ -120,17 +122,13 @@
render: function () {
this.$.itemLbl.setContent(this.label);
this.$.itemQty.setContent(OB.I18N.formatCurrency(this.value));
- if (this.foreignExpected && this.type === 'expected' && this.foreignExpected !== this.value) {
- this.$.foreignItemQty.setContent('(' + OB.I18N.formatCurrency(this.foreignExpected) + ' ' + this.isocode + ')');
- } else if (this.foreignCounted && this.type === 'counted' && this.foreignCounted !== this.value) {
- this.$.foreignItemQty.setContent('(' + OB.I18N.formatCurrency(this.foreignCounted) + ' ' + this.isocode + ')');
- } else if (this.foreignDifference && this.type === 'difference' && this.foreignDifference !== this.value) {
- this.$.foreignItemQty.setContent('(' + OB.I18N.formatCurrency(this.foreignDifference) + ' ' + this.isocode + ')');
- } else if (this.rate && this.rate !== '1' && (this.type === 'deposits' || this.type === 'drops')) {
- this.$.foreignItemQty.setContent('(' + OB.I18N.formatCurrency(this.value) + ' ' + this.isocode + ')');
- this.$.itemQty.setContent(OB.I18N.formatCurrency(OB.DEC.mul(this.value, this.rate)));
- } else if (this.rate && this.rate !== '1' && this.type === 'startings') {
- this.$.foreignItemQty.setContent('(' + OB.I18N.formatCurrency(this.value) + ' ' + this.isocode + ')');
+
+ if (this.second && this.second !== this.value && this.convertedValues.indexOf(this.type) != -1) {
+ this.$.foreignItemQty.setContent('(' + OB.I18N.formatCurrency(this.second) + ' ' + this.isocode + ')');
+ } else if (this.rate && this.rate !== '1' && this.valuestoConvert.indexOf(this.type) != -1) {
+ if(this.value){
+ this.$.foreignItemQty.setContent('(' + OB.I18N.formatCurrency(this.value) + ' ' + this.isocode + ')');
+ }
this.$.itemQty.setContent(OB.I18N.formatCurrency(OB.DEC.mul(this.value, this.rate)));
} else {
this.$.foreignItemQty.setContent('');
@@ -142,10 +140,7 @@
this.label = this.model[this.lblProperty];
this.value = this.model[this.qtyProperty];
this.type = this.owner.typeProperty;
- //FIXME
- this.foreignExpected = this.model.foreignExpected;
- this.foreignCounted = this.model.foreignCounted;
- this.foreignDifference = this.model.foreignDifference;
+ this.second = this.model.second;
this.rate = this.model.rate;
this.isocode = this.model.isocode;
}
@@ -361,8 +356,49 @@
}
});
+enyo.kind({
+ kind: 'OB.OBPOSCashUp.UI.ppc_table',
+ name: 'OB.OBPOSCashUp.UI.ppc_cashQtyToKeepTable',
+ components: [{
+ kind: 'OB.OBPOSCashUp.UI.ppc_collectionLines',
+ name: 'qtyToKeepPerPayment',
+ lblProperty: 'name',
+ qtyProperty: 'value',
+ typeProperty: 'qtyToKeep'
+ }, {
+ kind: 'OB.OBPOSCashUp.UI.ppc_totalsLine',
+ name: 'totalqtyToKeep',
+ label: OB.I18N.getLabel('OBPOS_LblTotalQtyToKeep')
+ }, {
+ kind: 'OB.OBPOSCashUp.UI.ppc_lineSeparator',
+ name: 'separator'
+ }],
+ setCollection: function (col) {
+ this.$.qtyToKeepPerPayment.setCollection(col);
+ }
+});
-
+enyo.kind({
+ kind: 'OB.OBPOSCashUp.UI.ppc_table',
+ name: 'OB.OBPOSCashUp.UI.ppc_cashQtyToDepoTable',
+ components: [{
+ kind: 'OB.OBPOSCashUp.UI.ppc_collectionLines',
+ name: 'qtyToDepoPerPayment',
+ lblProperty: 'name',
+ qtyProperty: 'value',
+ typeProperty: 'qtyToDepo'
+ }, {
+ kind: 'OB.OBPOSCashUp.UI.ppc_totalsLine',
+ name: 'totalqtyToDepo',
+ label: OB.I18N.getLabel('OBPOS_LblTotalQtyToDepo')
+ }, {
+ kind: 'OB.OBPOSCashUp.UI.ppc_lineSeparator',
+ name: 'separator'
+ }],
+ setCollection: function (col) {
+ this.$.qtyToDepoPerPayment.setCollection(col);
+ }
+});
enyo.kind({
@@ -455,6 +491,12 @@
}, {
kind: 'OB.OBPOSCashUp.UI.ppc_cashDifferenceTable',
name: 'differenceTable'
+ }, {
+ kind: 'OB.OBPOSCashUp.UI.ppc_cashQtyToKeepTable',
+ name: 'qtyToKeepTable'
+ }, {
+ kind: 'OB.OBPOSCashUp.UI.ppc_cashQtyToDepoTable',
+ name: 'qtyToDepoTable'
}]
}, {
classes: 'row-fluid',
@@ -492,6 +534,12 @@
this.$.differenceTable.setCollection(this.summary.differenceSummary);
this.$.differenceTable.setValue('totaldifference', this.summary.totalDifference);
+
+ this.$.qtyToKeepTable.setCollection(this.summary.qtyToKeepSummary);
+ this.$.qtyToKeepTable.setValue('totalqtyToKeep', this.summary.totalQtyToKeep);
+
+ this.$.qtyToDepoTable.setCollection(this.summary.qtyToDepoSummary);
+ this.$.qtyToDepoTable.setValue('totalqtyToDepo', this.summary.totalQtyToDepo);
},
modelChanged: function () {
|