toMap method

Map<String, dynamic> toMap({
  1. bool withId = true,
})

Implementation

Map<String, dynamic> toMap({bool withId = true}) {
  return <String, dynamic>{
    if (withId) 'Id': id,
    'Line': line?.map((x) => x.toMap()).toList(),
    'PaymentType': paymentType,
    'AccountRef': accountRef?.toMap(),
    'SyncToken': syncToken,
    'CurrencyRef': currencyRef?.toMap(),
    'TxnDate':
        txnDate != null ? DateFormat('yyyy-MM-dd').format(txnDate!) : null,
    'PrintStatus': printStatus,
    'RemitToAddr': remitToAddr?.toMap(),
    'TxnSource': txnSource,
    'LinkedTxn': linkedTxn?.map((x) => x.toMap()).toList(),
    'GlobalTaxCalculation': globalTaxCalculation,
    'TransactionLocationType': transactionLocationType,
    'MetaData': metaData,
    'DocNumber': docNumber,
    'PrivateNote': privateNote,
    'Credit': credit,
    'TxnTaxDetail': txnTaxDetail?.toMap(),
    'PaymentMethodRef': paymentMethodRef?.toMap(),
    'ExchangeRate': exchangeRate,
    'DepartmentRef': departmentRef?.toMap(),
    'EntityRef': entityRef?.toMap(),
    'IncludeInAnnualTPAR': includeInAnnualTPAR,
    'TotalAmt': totalAmt,
    'RecurDataRef': recurDataRef?.toMap(),
  };
}