toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  data['id'] = this.id;
  data['description'] = this.description;
  data['name'] = this.name;
  data['materialCode'] = this.materialCode;
  data['currency'] = this.currency;
  data['label'] = this.label;
  data['quantity'] = this.quantity;
  data['initialQuantity'] = this.initialQuantity;
  data['productOrderItemType'] = this.productOrderItemType;
  data['brand'] = this.brand;
  if (this.discounts != null) {
    data['discounts'] = this.discounts!.map((v) => v.toJson()).toList();
  }
  if (this.taxes != null) {
    data['taxes'] = this.taxes!.map((v) => v.toJson()).toList();
  }
  if (this.adhocTaxes != null) {
    data['adhocTaxes'] = this.adhocTaxes!.map((v) => v.toJson()).toList();
  }
  data['totalDiscountPercentage'] = this.totalDiscountPercentage;
  data['totalTaxPercentage'] = this.totalTaxPercentage;
  data['whtPercentage'] = this.whtPercentage;
  if (this.unitPrice != null) {
    data['unitPrice'] = this.unitPrice!.toJson();
  }
  if (this.unitPriceWithoutTax != null) {
    data['unitPriceWithoutTax'] = this.unitPriceWithoutTax!.toJson();
  }
  if (this.unitDiscount != null) {
    data['unitDiscount'] = this.unitDiscount!.toJson();
  }
  if (this.unitTax != null) {
    data['unitTax'] = this.unitTax!.toJson();
  }
  if (this.unitWht != null) {
    data['unitWht'] = this.unitWht!.toJson();
  }
  if (this.priceWithoutTax != null) {
    data['priceWithoutTax'] = this.priceWithoutTax!.toJson();
  }
  if (this.priceWithTax != null) {
    data['priceWithTax'] = this.priceWithTax!.toJson();
  }
  data['priceWithoutDiscount'] = this.priceWithoutDiscount;
  data['priceWithDiscount'] = this.priceWithDiscount;
  data['priceWithoutTaxAndDiscount'] = this.priceWithoutTaxAndDiscount;
  if (this.priceWithoutTaxAndWithDiscount != null) {
    data['priceWithoutTaxAndWithDiscount'] =
        this.priceWithoutTaxAndWithDiscount!.toJson();
  }
  if (this.totalWht != null) {
    data['totalWht'] = this.totalWht!.toJson();
  }
  if (this.totalTax != null) {
    data['totalTax'] = this.totalTax!.toJson();
  }
  if (this.totalDiscount != null) {
    data['totalDiscount'] = this.totalDiscount!.toJson();
  }
  if (this.totalDiscountWithoutTax != null) {
    data['totalDiscountWithoutTax'] = this.totalDiscountWithoutTax!.toJson();
  }
  if (this.totalPrice != null) {
    data['totalPrice'] = this.totalPrice!.toJson();
  }
  if (this.actualPriceWithTax != null) {
    data['actualPriceWithTax'] = this.actualPriceWithTax!.toJson();
  }
  if (this.actualPriceWithoutTax != null) {
    data['actualPriceWithoutTax'] = this.actualPriceWithoutTax!.toJson();
  }
  if (this.actualPricePerUnitWithTax != null) {
    data['actualPricePerUnitWithTax'] =
        this.actualPricePerUnitWithTax!.toJson();
  }
  if (this.actualPricePerUnitWithoutTax != null) {
    data['actualPricePerUnitWithoutTax'] =
        this.actualPricePerUnitWithoutTax!.toJson();
  }
  if (this.markupPrice != null) {
    data['markupPrice'] = this.markupPrice!.toJson();
  }
  if (this.markupDiscountPercentage != null) {
    data['markupDiscountPercentage'] =
        this.markupDiscountPercentage!.toJson();
  }
  if (this.netSalesAfterDiscountPerPiece != null) {
    data['netSalesAfterDiscountPerPiece'] =
        this.netSalesAfterDiscountPerPiece!.toJson();
  }
  if (this.netTaxPerPiece != null) {
    data['netTaxPerPiece'] = this.netTaxPerPiece!.toJson();
  }
  if (this.netTaxPerOrderLine != null) {
    data['netTaxPerOrderLine'] = this.netTaxPerOrderLine!.toJson();
  }
  if (this.netSalesAfterDiscount != null) {
    data['netSalesAfterDiscount'] = this.netSalesAfterDiscount!.toJson();
  }
  if (this.netExcludedWithHeldTax != null) {
    data['netExcludedWithHeldTax'] = this.netExcludedWithHeldTax!.toJson();
  }
  return data;
}