OrderItems.fromJson constructor
OrderItems.fromJson(
- Map<String, dynamic> json
)
Implementation
OrderItems.fromJson(Map<String, dynamic> json) {
id = json['id'];
description = json['description'];
name = json['name'];
materialCode = json['materialCode'];
currency = json['currency'];
label = json['label'];
quantity = json['quantity'];
initialQuantity = json['initialQuantity'];
productOrderItemType = json['productOrderItemType'];
brand = json['brand'];
if (json['discounts'] != null) {
discounts = <Discounts>[];
json['discounts'].forEach((v) {
discounts!.add(new Discounts.fromJson(v));
});
}
if (json['taxes'] != null) {
taxes = <Taxes>[];
json['taxes'].forEach((v) {
taxes!.add(new Taxes.fromJson(v));
});
}
if (json['adhocTaxes'] != null) {
adhocTaxes = <AdhocTaxes>[];
json['adhocTaxes'].forEach((v) {
adhocTaxes!.add(new AdhocTaxes.fromJson(v));
});
}
totalDiscountPercentage = json['totalDiscountPercentage'];
totalTaxPercentage = json['totalTaxPercentage'];
whtPercentage = json['whtPercentage'];
unitPrice = json['unitPrice'] != null
? new UnitPrice.fromJson(json['unitPrice'])
: null;
unitPriceWithoutTax = json['unitPriceWithoutTax'] != null
? new UnitPrice.fromJson(json['unitPriceWithoutTax'])
: null;
unitDiscount = json['unitDiscount'] != null
? new UnitPrice.fromJson(json['unitDiscount'])
: null;
unitTax = json['unitTax'] != null
? new UnitPrice.fromJson(json['unitTax'])
: null;
unitWht = json['unitWht'] != null
? new UnitPrice.fromJson(json['unitWht'])
: null;
priceWithoutTax = json['priceWithoutTax'] != null
? new UnitPrice.fromJson(json['priceWithoutTax'])
: null;
priceWithTax = json['priceWithTax'] != null
? new UnitPrice.fromJson(json['priceWithTax'])
: null;
priceWithoutDiscount = json['priceWithoutDiscount'];
priceWithDiscount = json['priceWithDiscount'];
priceWithoutTaxAndDiscount = json['priceWithoutTaxAndDiscount'];
priceWithoutTaxAndWithDiscount =
json['priceWithoutTaxAndWithDiscount'] != null
? new UnitPrice.fromJson(json['priceWithoutTaxAndWithDiscount'])
: null;
totalWht = json['totalWht'] != null
? new UnitPrice.fromJson(json['totalWht'])
: null;
totalTax = json['totalTax'] != null
? new UnitPrice.fromJson(json['totalTax'])
: null;
totalDiscount = json['totalDiscount'] != null
? new UnitPrice.fromJson(json['totalDiscount'])
: null;
totalDiscountWithoutTax = json['totalDiscountWithoutTax'] != null
? new UnitPrice.fromJson(json['totalDiscountWithoutTax'])
: null;
totalPrice = json['totalPrice'] != null
? new UnitPrice.fromJson(json['totalPrice'])
: null;
actualPriceWithTax = json['actualPriceWithTax'] != null
? new UnitPrice.fromJson(json['actualPriceWithTax'])
: null;
actualPriceWithoutTax = json['actualPriceWithoutTax'] != null
? new UnitPrice.fromJson(json['actualPriceWithoutTax'])
: null;
actualPricePerUnitWithTax = json['actualPricePerUnitWithTax'] != null
? new UnitPrice.fromJson(json['actualPricePerUnitWithTax'])
: null;
actualPricePerUnitWithoutTax = json['actualPricePerUnitWithoutTax'] != null
? new UnitPrice.fromJson(json['actualPricePerUnitWithoutTax'])
: null;
markupPrice = json['markupPrice'] != null
? new UnitPrice.fromJson(json['markupPrice'])
: null;
markupDiscountPercentage = json['markupDiscountPercentage'] != null
? new UnitPrice.fromJson(json['markupDiscountPercentage'])
: null;
netSalesAfterDiscountPerPiece =
json['netSalesAfterDiscountPerPiece'] != null
? new UnitPrice.fromJson(json['netSalesAfterDiscountPerPiece'])
: null;
netTaxPerPiece = json['netTaxPerPiece'] != null
? new UnitPrice.fromJson(json['netTaxPerPiece'])
: null;
netTaxPerOrderLine = json['netTaxPerOrderLine'] != null
? new UnitPrice.fromJson(json['netTaxPerOrderLine'])
: null;
netSalesAfterDiscount = json['netSalesAfterDiscount'] != null
? new UnitPrice.fromJson(json['netSalesAfterDiscount'])
: null;
netExcludedWithHeldTax = json['netExcludedWithHeldTax'] != null
? new UnitPrice.fromJson(json['netExcludedWithHeldTax'])
: null;
}