toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
data['id'] = id;
data['orderId'] = orderId;
data['saleOrderId'] = saleOrderId;
data['invoiceId'] = invoiceId;
data['orderUpdationId'] = orderUpdationId;
data['paymentTransactionId'] = paymentTransactionId;
data['cartId'] = cartId;
data['saleType'] = saleType;
data['transactionType'] = transactionType;
data['saleDate'] = saleDate;
if (sellerDetails != null) {
data['sellerDetails'] = sellerDetails!.toJson();
}
if (buyerDetails != null) {
data['buyerDetails'] = buyerDetails!.toJson();
}
data['partnerId'] = partnerId;
data['promos'] = promos;
data['saleOrderTpe'] = saleOrderTpe;
if (orderItems != null) {
data['orderItems'] = orderItems!.map((v) => v.toJson()).toList();
}
data['attachments'] = attachments;
data['approvalTaskIds'] = approvalTaskIds;
if (wHT != null) {
data['WHT'] = wHT!.toJson();
}
if (absoluteTotal != null) {
data['absoluteTotal'] = absoluteTotal!.toJson();
}
if (totalDiscount != null) {
data['totalDiscount'] = totalDiscount!.toJson();
}
if (totalTax != null) {
data['totalTax'] = totalTax!.toJson();
}
if (totalPriceWithoutWHT != null) {
data['totalPriceWithoutWHT'] = totalPriceWithoutWHT!.toJson();
}
if (totalWithoutTaxAndDiscount != null) {
data['totalWithoutTaxAndDiscount'] = totalWithoutTaxAndDiscount!.toJson();
}
data['totalPriceWithoutTaxAndWithDiscount'] = totalPriceWithoutTaxAndWithDiscount;
data['overAllTaxPercentage'] = overAllTaxPercentage;
if (totalPriceWithoutTax != null) {
data['totalPriceWithoutTax'] = totalPriceWithoutTax!.toJson();
}
if (totalWHT != null) {
data['totalWHT'] = totalWHT!.toJson();
}
if (totalPaymentCollected != null) {
data['totalPaymentCollected'] = totalPaymentCollected!.toJson();
}
if (orderTotal != null) {
data['orderTotal'] = orderTotal!.toJson();
}
if (grandTotal != null) {
data['grandTotal'] = grandTotal!.toJson();
}
data['remarks'] = remarks;
data['poReferenceNo'] = poReferenceNo;
if (totalNetPrice != null) {
data['totalNetPrice'] = totalNetPrice!.toJson();
}
if (overallSaleTax != null) {
data['overallSaleTax'] = overallSaleTax!.toJson();
}
data['taxClassification'] = taxClassification;
data['taxClassificationName'] = taxClassificationName;
data['withHeldTaxPercentage'] = withHeldTaxPercentage;
data['salesTaxPercentage'] = salesTaxPercentage;
data['netPriceWithOutTaxAndDiscountWithOutTax'] = netPriceWithOutTaxAndDiscountWithOutTax;
if (totalDiscountPercentage != null) {
data['totalDiscountPercentage'] = totalDiscountPercentage!.toJson();
}
if (totalNetExcludedWithHeldTax != null) {
data['totalNetExcludedWithHeldTax'] = totalNetExcludedWithHeldTax!.toJson();
}
if (totalVATableSalesVATAmount != null) {
data['totalVATableSalesVATAmount'] = totalVATableSalesVATAmount!.toJson();
}
if (totalNetTaxVATableSalesDiscount != null) {
data['totalNetTaxVATableSalesDiscount'] = totalNetTaxVATableSalesDiscount!.toJson();
}
if (totalConversionRate != null) {
data['totalConversionRate'] = totalConversionRate!.toJson();
}
if (totalNetTaxVATExemptSalesDiscount != null) {
data['totalNetTaxVATExemptSalesDiscount'] = totalNetTaxVATExemptSalesDiscount!.toJson();
}
if (totalNetTaxZeroRatedSalesDiscount != null) {
data['totalNetTaxZeroRatedSalesDiscount'] = totalNetTaxZeroRatedSalesDiscount!.toJson();
}
if (totalZeroRatedSale != null) {
data['totalZeroRatedSale'] = totalZeroRatedSale!.toJson();
}
if (totalVATExemptSale != null) {
data['totalVATExemptSale'] = totalVATExemptSale!.toJson();
}
if (totalFixed != null) {
data['totalFixed'] = totalFixed!.toJson();
}
data['saleTransactionId'] = saleTransactionId;
data['totalInitialPaymentCollected'] = totalInitialPaymentCollected;
data['promoCode'] = promoCode;
data['billingOrShippingAddressId'] = billingOrShippingAddressId;
if (overAllTax != null) {
data['overAllTax'] = overAllTax!.toJson();
}
if (buyerDetailInfo != null) {
data['buyerDetailInfo'] = buyerDetailInfo!.toJson();
}
data['sellerDetailInfo'] = sellerDetailInfo;
if (modeOfPaymentList != null) {
data['modeOfPaymentList'] = modeOfPaymentList!.map((v) => v.toJson()).toList();
}
if (headerDetailsList != null) {
data['headerDetailsList'] = headerDetailsList!.map((v) => v.toJson()).toList();
}
data['assetDeliveryDetails'] = assetDeliveryDetails;
data['deliveryOrderId'] = deliveryOrderId;
data['externalInvoiceId'] = externalInvoiceId;
data['subInvoiceId'] = subInvoiceId;
if (totalCommission != null) {
data['totalCommission'] = totalCommission!.toJson();
}
if (totalNetCommission != null) {
data['totalNetCommission'] = totalNetCommission!.toJson();
}
data['exchangeRate'] = exchangeRate;
data['whtPercentage'] = whtPercentage;
data['whtBearer'] = whtBearer;
data['invoiceDocType'] = invoiceDocType;
if (totalCommissionWithOutGrossUp != null) {
data['totalCommissionWithOutGrossUp'] = totalCommissionWithOutGrossUp!.toJson();
}
if (totalNetPriceInLocalCurrency != null) {
data['totalNetPriceInLocalCurrency'] = totalNetPriceInLocalCurrency!.toJson();
}
if (grandTotalInLocalCurrency != null) {
data['grandTotalInLocalCurrency'] = grandTotalInLocalCurrency!.toJson();
}
if (shippingMethod != null) {
data['shippingMethod'] = shippingMethod!.toJson();
}
data['deliveryType'] = deliveryType;
data['deliveryOption'] = deliveryOption;
if (absoluteTotalInLocalCurrency != null) {
data['absoluteTotalInLocalCurrency'] = absoluteTotalInLocalCurrency!.toJson();
}
if (totalPriceWithoutWHTInLocalCurrency != null) {
data['totalPriceWithoutWHTInLocalCurrency'] = totalPriceWithoutWHTInLocalCurrency!.toJson();
}
if (totalDiscountPercentageInLocalCurrency != null) {
data['totalDiscountPercentageInLocalCurrency'] = totalDiscountPercentageInLocalCurrency!.toJson();
}
if (totalDiscountInLocalCurrency != null) {
data['totalDiscountInLocalCurrency'] = totalDiscountInLocalCurrency!.toJson();
}
if (totalCommissionInLocalCurrency != null) {
data['totalCommissionInLocalCurrency'] = totalCommissionInLocalCurrency!.toJson();
}
if (totalNetCommissionInLocalCurrency != null) {
data['totalNetCommissionInLocalCurrency'] = totalNetCommissionInLocalCurrency!.toJson();
}
if (totalCommissionWithOutGrossUpInLocalCurrency != null) {
data['totalCommissionWithOutGrossUpInLocalCurrency'] = totalCommissionWithOutGrossUpInLocalCurrency!.toJson();
}
if (deliveryCharge != null) {
data['deliveryCharge'] = deliveryCharge!.toJson();
}
if (deliveryChargeInLocalCurrency != null) {
data['deliveryChargeInLocalCurrency'] = deliveryChargeInLocalCurrency!.toJson();
}
if (totalWHTInLocalCurrency != null) {
data['totalWHTInLocalCurrency'] = totalWHTInLocalCurrency!.toJson();
}
data['deliveryChargeWithOutTax'] = deliveryChargeWithOutTax;
if (wht != null) {
data['wht'] = wht!.toJson();
}
return data;
}