@pmcretail/mapper-library 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/pmcretail-mapper-library.umd.js +31 -12
- package/bundles/pmcretail-mapper-library.umd.js.map +1 -1
- package/bundles/pmcretail-mapper-library.umd.min.js +1 -1
- package/bundles/pmcretail-mapper-library.umd.min.js.map +1 -1
- package/esm2015/lib/RJ-mapper.class.js +32 -13
- package/esm5/lib/RJ-mapper.class.js +33 -13
- package/fesm2015/pmcretail-mapper-library.js +31 -12
- package/fesm2015/pmcretail-mapper-library.js.map +1 -1
- package/fesm5/pmcretail-mapper-library.js +32 -13
- package/fesm5/pmcretail-mapper-library.js.map +1 -1
- package/lib/RJ-mapper.class.d.ts +0 -1
- package/package.json +1 -1
|
@@ -4871,7 +4871,6 @@
|
|
|
4871
4871
|
*/
|
|
4872
4872
|
var RJMapperBuilderClass = /** @class */ (function () {
|
|
4873
4873
|
function RJMapperBuilderClass(transactionDoc) {
|
|
4874
|
-
this.productQuantity = 0;
|
|
4875
4874
|
this.itemCount = 0;
|
|
4876
4875
|
this.largestNumber = 0;
|
|
4877
4876
|
this.rjObject = {};
|
|
@@ -5059,6 +5058,15 @@
|
|
|
5059
5058
|
function (element) {
|
|
5060
5059
|
/** @type {?} */
|
|
5061
5060
|
var data = (/** @type {?} */ (_this)).returnProduct(element, (element.hasOwnProperty('lineDiscount') ? element.lineDiscount : null));
|
|
5061
|
+
/** @type {?} */
|
|
5062
|
+
var obj = {
|
|
5063
|
+
"OriginalReceiptSupplied": 0,
|
|
5064
|
+
"OriginalBranchID": 0,
|
|
5065
|
+
"OriginalTerminalNumber": 0,
|
|
5066
|
+
"OriginalTransactionNumber": 0,
|
|
5067
|
+
"OriginalCashierNumber": 0
|
|
5068
|
+
};
|
|
5069
|
+
data['Return'] = __assign({}, data['Return'], obj);
|
|
5062
5070
|
(/** @type {?} */ (_this)).rjObject['ProductReturn'].push(data);
|
|
5063
5071
|
(/** @type {?} */ (_this)).getModifierItem(element.lineDiscount, element.itemLineId);
|
|
5064
5072
|
}));
|
|
@@ -5077,6 +5085,15 @@
|
|
|
5077
5085
|
if (element.refundedQuantity > 0) {
|
|
5078
5086
|
/** @type {?} */
|
|
5079
5087
|
var returnProduct = (/** @type {?} */ (_this)).returnProduct(element, (element.hasOwnProperty('lineDiscount') ? element.lineDiscount : null));
|
|
5088
|
+
/** @type {?} */
|
|
5089
|
+
var obj = {
|
|
5090
|
+
"OriginalReceiptSupplied": 0,
|
|
5091
|
+
"OriginalBranchID": 0,
|
|
5092
|
+
"OriginalTerminalNumber": 0,
|
|
5093
|
+
"OriginalTransactionNumber": 0,
|
|
5094
|
+
"OriginalCashierNumber": 0
|
|
5095
|
+
};
|
|
5096
|
+
returnProduct['Return'] = __assign({}, returnProduct['Return'], obj);
|
|
5080
5097
|
(/** @type {?} */ (_this)).rjObject['ProductReturn'].push(returnProduct);
|
|
5081
5098
|
}
|
|
5082
5099
|
else {
|
|
@@ -5862,6 +5879,12 @@
|
|
|
5862
5879
|
* @return {?}
|
|
5863
5880
|
*/
|
|
5864
5881
|
function (element, lineDiscount) {
|
|
5882
|
+
/** @type {?} */
|
|
5883
|
+
var taxTotal = this.transactionDocument.basket['taxBreakdown']['taxLines'].find((/**
|
|
5884
|
+
* @param {?} item
|
|
5885
|
+
* @return {?}
|
|
5886
|
+
*/
|
|
5887
|
+
function (item) { return item.itemLineId == element['itemLineId']; }));
|
|
5865
5888
|
/** @type {?} */
|
|
5866
5889
|
var obj = {
|
|
5867
5890
|
XMLSchemaVersion: this.xmlSchemaVersion,
|
|
@@ -5881,14 +5904,15 @@
|
|
|
5881
5904
|
Quantity: element.quantity.toFixed(1),
|
|
5882
5905
|
SalespersonID: this.transactionDocument.userId,
|
|
5883
5906
|
SalespersonName: this.transactionDocument.userName,
|
|
5884
|
-
TaxCode:
|
|
5885
|
-
|
|
5907
|
+
TaxCode: this.transactionDocument.basket['taxBreakdown']['taxLines'].find((/**
|
|
5908
|
+
* @param {?} item
|
|
5909
|
+
* @return {?}
|
|
5910
|
+
*/
|
|
5911
|
+
function (item) { return item.itemLineId == element['itemLineId']; })).VATCode,
|
|
5886
5912
|
TaxModifiable: 1,
|
|
5887
5913
|
//todo
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
OriginalTaxAmount: 0,
|
|
5891
|
-
//todo
|
|
5914
|
+
OriginalTaxAmount: taxTotal.taxLineTotal < 0 ? this.removeDecimal(taxTotal.taxLineTotal) : this.removeDecimal(-taxTotal.taxLineTotal),
|
|
5915
|
+
TaxAmount: taxTotal.taxLineTotal < 0 ? this.removeDecimal(taxTotal.taxLineTotal) : this.removeDecimal(-taxTotal.taxLineTotal),
|
|
5892
5916
|
OriginalTaxAmountSet: 1,
|
|
5893
5917
|
//todo
|
|
5894
5918
|
ProductID: element.SKU,
|
|
@@ -6007,11 +6031,6 @@
|
|
|
6007
6031
|
* @private
|
|
6008
6032
|
*/
|
|
6009
6033
|
RJMapperBuilderClass.prototype.transactionDocument;
|
|
6010
|
-
/**
|
|
6011
|
-
* @type {?}
|
|
6012
|
-
* @private
|
|
6013
|
-
*/
|
|
6014
|
-
RJMapperBuilderClass.prototype.productQuantity;
|
|
6015
6034
|
/**
|
|
6016
6035
|
* @type {?}
|
|
6017
6036
|
* @private
|