Data.fromJson constructor

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

Implementation

Data.fromJson(Map<String, dynamic> json) {
  createdByUserName = json['createdByUserName'];
  updatedByUserName = json['updatedByUserName'];
  createdBy = json['createdBy'];
  createdDate = json['createdDate'];
  updatedBy = json['updatedBy'];
  updatedDate = json['updatedDate'];
  id = json['id'];
  orderId = json['orderId'];
  organizationId = json['organizationId'];
  store = json['store'] != null ? Store.fromJson(json['store']) : null;
  customerName = json['customerName'];
  customerDetails =
  json['customerDetails'] != null ? CustomerDetails.fromJson(
      json['customerDetails']) : null;
  status = json['status'];
  dueDate = json['dueDate'];
  archived = json['archived'];
  type = json['type'];
  parentInvoiceId = json['parentInvoiceId'];
  mainOrderId = json['mainOrderId'];
  refundableAmount = json['refundableAmount'];
  credit =
  json['credit'] != null ? Credit.fromJson(json['credit']) : null;
  debit = json['debit'] != null ? Credit.fromJson(json['debit']) : null;
  balance =
  json['balance'] != null ? Credit.fromJson(json['balance']) : null;
  paymentDueDate = json['paymentDueDate'];
  saleDetail = json['saleDetail'] != null
      ? SaleDetail.fromJson(json['saleDetail'])
      : null;
  paymentOrderId = json['paymentOrderId'];
  if (json['orderApprovalMapping'] != null) {
    orderApprovalMapping = <OrderApprovalMapping>[];
    json['orderApprovalMapping'].forEach((v) {
      orderApprovalMapping!.add(OrderApprovalMapping.fromJson(v));
    });
  }
  transactionType = json['transactionType'];
  saleExtendedDetails =
  json['saleExtendedDetails'] != null ? SaleExtendedDetails.fromJson(
      json['saleExtendedDetails']) : null;
  soldToParty = json['soldToParty'] != null ? CustomerDetails.fromJson(
      json['soldToParty']) : null;
  billToParty = json['billToParty'] != null ? CustomerDetails.fromJson(
      json['billToParty']) : null;
  payerParty = json['payerParty'] != null ? CustomerDetails.fromJson(
      json['payerParty']) : null;
  soldByParty = json['soldByParty'] != null ? CustomerDetails.fromJson(
      json['soldByParty']) : null;
  if (json['attachments'] != null) {
    attachments = <Attachments>[];
    json['attachments'].forEach((v) {
      attachments!.add(Attachments.fromJson(v));
    });
  }
  paymentTransactionId = json['paymentTransactionId'];
  if (json['actionList'] != null) {
    actionList = <ActionList>[];
    json['actionList'].forEach((v) {
      actionList!.add(ActionList.fromJson(v));
    });
  }
  paymentDate = json['paymentDate'];
  if (json['details'] != null) {
    details = <Details>[];
    json['details'].forEach((v) {
      details!.add(Details.fromJson(v));
    });
  }
  if (json['headerTags'] != null) {
    headerTags = <HeaderTags>[];
    json['headerTags'].forEach((v) {
      headerTags!.add(HeaderTags.fromJson(v));
    });
  }
  totalPaymentCollected =
  json['totalPaymentCollected'] != null ? Credit.fromJson(
      json['totalPaymentCollected']) : null;
  overdue = json['overdue'];
  canceled = json['canceled'];
  creditInvoice = json['creditInvoice'];
  closed = json['closed'];
  open = json['open'];
  paymentStatus = json['paymentStatus'];
  allowModifyPayment = json['allowModifyPayment'];
  invoiceNumber = json['invoiceNumber'];
  ageing = json['ageing'];
  refundable = json['refundable'];
}