Data.fromJson constructor

Data.fromJson(
  1. Map<String, dynamic> json
)

Implementation

Data.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  saleOrderId = json['saleOrderId'];
  invoiceId = json['invoiceId'];
  orderUpdationId = json['orderUpdationId'];
  paymentTransactionId = json['paymentTransactionId'];
  cartId = json['cartId'];
  saleType = json['saleType'];
  saleDate = json['saleDate'];
  sellerDetails = json['sellerDetails'];
  buyerDetails = json['buyerDetails'] != null
      ? new BuyerDetails.fromJson(json['buyerDetails'])
      : null;
  partnerId = json['partnerId'];
  promos = json['promos'];
  saleOrderTpe = json['saleOrderTpe'];
  if (json['orderItems'] != null) {
    orderItems = <OrderItems>[];
    json['orderItems'].forEach((v) {
      orderItems!.add(new OrderItems.fromJson(v));
    });
  }
  attachments = json['attachments'];
  approvalTaskIds = json['approvalTaskIds'];
  wHT = json['WHT'] != null ? new UnitPrice.fromJson(json['WHT']) : null;
  absoluteTotal = json['absoluteTotal'] != null
      ? new UnitPrice.fromJson(json['absoluteTotal'])
      : null;
  totalDiscount = json['totalDiscount'] != null
      ? new UnitPrice.fromJson(json['totalDiscount'])
      : null;
  totalTax = json['totalTax'] != null
      ? new UnitPrice.fromJson(json['totalTax'])
      : null;
  totalPriceWithoutWHT = json['totalPriceWithoutWHT'] != null
      ? new UnitPrice.fromJson(json['totalPriceWithoutWHT'])
      : null;
  totalWithoutTaxAndDiscount = json['totalWithoutTaxAndDiscount'] != null
      ? new UnitPrice.fromJson(json['totalWithoutTaxAndDiscount'])
      : null;
  totalPriceWithoutTaxAndWithDiscount =
      json['totalPriceWithoutTaxAndWithDiscount'];
  overAllTaxPercentage = json['overAllTaxPercentage'];
  totalPriceWithoutTax = json['totalPriceWithoutTax'];
  totalWHT = json['totalWHT'] != null
      ? new UnitPrice.fromJson(json['totalWHT'])
      : null;
  totalPaymentCollected = json['totalPaymentCollected'];
  orderTotal = json['orderTotal'];
  grandTotal = json['grandTotal'] != null
      ? new UnitPrice.fromJson(json['grandTotal'])
      : null;
  remarks = json['remarks'];
  poReferenceNo = json['poReferenceNo'];
  totalNetPrice = json['totalNetPrice'] != null
      ? new UnitPrice.fromJson(json['totalNetPrice'])
      : null;
  overallSaleTax = json['overallSaleTax'] != null
      ? new UnitPrice.fromJson(json['overallSaleTax'])
      : null;
  taxClassification = json['taxClassification'];
  taxClassificationName = json['taxClassificationName'];
  withHeldTaxPercentage = json['withHeldTaxPercentage'];
  salesTaxPercentage = json['salesTaxPercentage'];
  netPriceWithOutTaxAndDiscountWithOutTax =
      json['netPriceWithOutTaxAndDiscountWithOutTax'];
  totalDiscountPercentage = json['totalDiscountPercentage'] != null
      ? new UnitPrice.fromJson(json['totalDiscountPercentage'])
      : null;
  totalNetExcludedWithHeldTax = json['totalNetExcludedWithHeldTax'] != null
      ? new UnitPrice.fromJson(json['totalNetExcludedWithHeldTax'])
      : null;
  totalVATableSalesVATAmount = json['totalVATableSalesVATAmount'] != null
      ? new UnitPrice.fromJson(json['totalVATableSalesVATAmount'])
      : null;
  totalNetTaxVATableSalesDiscount =
      json['totalNetTaxVATableSalesDiscount'] != null
          ? new UnitPrice.fromJson(json['totalNetTaxVATableSalesDiscount'])
          : null;
  totalConversionRate = json['totalConversionRate'] != null
      ? new UnitPrice.fromJson(json['totalConversionRate'])
      : null;
  totalNetTaxVATExemptSalesDiscount =
      json['totalNetTaxVATExemptSalesDiscount'] != null
          ? new UnitPrice.fromJson(json['totalNetTaxVATExemptSalesDiscount'])
          : null;
  totalNetTaxZeroRatedSalesDiscount =
      json['totalNetTaxZeroRatedSalesDiscount'] != null
          ? new UnitPrice.fromJson(json['totalNetTaxZeroRatedSalesDiscount'])
          : null;
  totalZeroRatedSale = json['totalZeroRatedSale'] != null
      ? new UnitPrice.fromJson(json['totalZeroRatedSale'])
      : null;
  totalVATExemptSale = json['totalVATExemptSale'] != null
      ? new UnitPrice.fromJson(json['totalVATExemptSale'])
      : null;
  totalFixed = json['totalFixed'] != null
      ? new UnitPrice.fromJson(json['totalFixed'])
      : null;
  saleTransactionId = json['saleTransactionId'];
  totalInitialPaymentCollected = json['totalInitialPaymentCollected'];
  promoCode = json['promoCode'];
  billingOrShippingAddressId = json['billingOrShippingAddressId'];
  overAllTax = json['overAllTax'] != null
      ? new UnitPrice.fromJson(json['overAllTax'])
      : null;
  buyerDetailInfo = json['buyerDetailInfo'] != null
      ? new BuyerDetailInfo.fromJson(json['buyerDetailInfo'])
      : null;
  sellerDetailInfo = json['sellerDetailInfo'];
  if (json['modeOfPaymentList'] != null) {
    modeOfPaymentList = <ModeOfPaymentList>[];
    json['modeOfPaymentList'].forEach((v) {
      modeOfPaymentList!.add(new ModeOfPaymentList.fromJson(v));
    });
  }
  if (json['headerDetailsList'] != null) {
    headerDetailsList = <HeaderDetailsList>[];
    json['headerDetailsList'].forEach((v) {
      headerDetailsList!.add(new HeaderDetailsList.fromJson(v));
    });
  }
  wht = json['wht'] != null ? new UnitPrice.fromJson(json['wht']) : null;
}