Data.fromJson constructor
Implementation
Data.fromJson(Map<String, dynamic> json) {
totalDiscount = json['totalDiscount'];
totalDiscountPercentage = json['totalDiscountPercentage'];
totalSellingPrice = json['totalSellingPrice'];
totalNetPrice = json['totalNetPrice'];
totalPriceWithoutWHT = json['totalPriceWithoutWHT'];
totalPriceWithoutTax = json['totalPriceWithoutTax'];
totalWHT = json['totalWHT'];
overallTax = json['overallTax'];
overallSaleTax = json['overallSaleTax'];
overallTaxPercentage = json['overallTaxPercentage'];
overallSaleTaxPercentage = json['overallSaleTaxPercentage'];
totalPriceWithoutTaxAndDiscount = json['totalPriceWithoutTaxAndDiscount'];
totalPriceWithOutTaxAndWithDiscount =
json['totalPriceWithOutTaxAndWithDiscount'];
totalRetailPrice = json['totalRetailPrice'];
grandTotal = json['grandTotal'];
grandTotalInLocalCurrency = json['grandTotalInLocalCurrency'] != null
? new GrandTotalInLocalCurrency.fromJson(
json['grandTotalInLocalCurrency'])
: null;
cartId = json['cartId'];
contextParameters = json['contextParameters'] != null
? new ContextParameters.fromJson(json['contextParameters'])
: null;
if (json['selectedCartoffers'] != null) {
selectedCartoffers = <SelectedCartoffers>[];
json['selectedCartoffers'].forEach((v) {
selectedCartoffers!.add(new SelectedCartoffers.fromJson(v));
});
}
if (json['products'] != null) {
products = <Products>[];
json['products'].forEach((v) {
products!.add(new Products.fromJson(v));
});
}
creditLimitDetails = json['creditLimitDetails'] != null
? new CreditLimitDetails.fromJson(json['creditLimitDetails'])
: null;
rechargeInfo = json['rechargeInfo'];
evcInfo = json['evcInfo'];
if (json['taxes'] != null) {
taxes = <Taxes>[];
json['taxes'].forEach((v) {
taxes!.add(new Taxes.fromJson(v));
});
}
if (json['saleTaxes'] != null) {
saleTaxes = <SaleTaxes>[];
json['saleTaxes'].forEach((v) {
saleTaxes!.add(new SaleTaxes.fromJson(v));
});
}
resellerDiscount = json['resellerDiscount'];
billingOrShippingAddressId = json['billingOrShippingAddressId'];
category = json['category'];
if (json['relatedParty'] != null) {
relatedParty = <RelatedParty>[];
json['relatedParty'].forEach((v) {
relatedParty!.add(new RelatedParty.fromJson(v));
});
}
if (json['payment'] != null) {
payment = <Payment>[];
json['payment'].forEach((v) {
payment!.add(new Payment.fromJson(v));
});
}
aggregatedDiscountsList = json['aggregatedDiscountsList'];
if (json['adhocTax'] != null) {
adhocTax = <AdhocTax>[];
json['adhocTax'].forEach((v) {
adhocTax!.add(new AdhocTax.fromJson(v));
});
}
if (json['cartDiscountsList'] != null) {
cartDiscountsList = <CartDiscountsList>[];
json['cartDiscountsList'].forEach((v) {
cartDiscountsList!.add(new CartDiscountsList.fromJson(v));
});
}
adhocDiscountsList = json['adhocDiscountsList'];
cartOverviewList = json['cartOverviewList'];
withHeldTaxPercentage = json['withHeldTaxPercentage'];
cartDiscountId = json['cartDiscountId'];
cartDiscountValue = json['cartDiscountValue'];
paymentCollect = json['paymentCollect'];
currency = json['currency'];
paymentCollected = json['paymentCollected'];
netPriceWithOutTaxAndDiscountWithOutTax =
json['netPriceWithOutTaxAndDiscountWithOutTax'];
invoiceAttachmentNumber = json['invoiceAttachmentNumber'];
validationDetails = json['validationDetails'] != null
? new ValidationDetails.fromJson(json['validationDetails'])
: null;
parentOrderId = json['parentOrderId'];
externalParentTransactionId = json['externalParentTransactionId'];
taxClassificationKey = json['taxClassificationKey'];
taxClassificationName = json['taxClassificationName'];
}