fromMap static method

Implementation

static SettingsGeneralSettingsPurchase? fromMap(Object? body) {
  final source = readRecord(body);
  if (source == null) return null;
  return SettingsGeneralSettingsPurchase(
    allowModificationOfFollowingPurchaseCreditNoteFields:
        SettingsGeneralSettingsPurchaseAllowModificationOfFollowingPurchaseCreditNoteFields
            .fromMap(source[
                'allow_modification_of_following_purchase_credit_note_fields']),
    allowModificationOfFollowingPurchaseInvoiceFields:
        SettingsGeneralSettingsPurchaseAllowModificationOfFollowingPurchaseInvoiceFields
            .fromMap(source[
                'allow_modification_of_following_purchase_invoice_fields']),
    allowModificationOfFollowingPurchasePaymentFields:
        SettingsGeneralSettingsPurchaseAllowModificationOfFollowingPurchasePaymentFields
            .fromMap(source[
                'allow_modification_of_following_purchase_payment_fields']),
    allowModificationOfFollowingPurchaseRefundFields:
        SettingsGeneralSettingsPurchaseAllowModificationOfFollowingPurchaseRefundFields
            .fromMap(source[
                'allow_modification_of_following_purchase_refund_fields']),
    enableLastPurchasePriceLookUp:
        readText(source['enable_last_purchase_price_look_up']),
    enablePurchaseQuote: readText(source['enable_purchase_quote']),
    enableWorkflowApprovalForPurchaseCreditNote:
        readText(source['enable_workflow_approval_for_purchase_credit_note']),
    enableWorkflowApprovalForPurchaseInvoice:
        readText(source['enable_workflow_approval_for_purchase_invoice']),
    enableWorkflowApprovalForPurchaseOrder:
        readText(source['enable_workflow_approval_for_purchase_order']),
    enableWorkflowApprovalForPurchasePayment:
        readText(source['enable_workflow_approval_for_purchase_payment']),
    enableWorkflowApprovalForPurchaseRefund:
        readText(source['enable_workflow_approval_for_purchase_refund']),
    inventoryIsAdjustedWhen: readText(source['inventory_is_adjusted_when']),
    supplierInvoiceIdShouldBeUnique:
        readText(source['supplier_invoice_id_should_be_unique']),
    useGlobalWarehouse: readText(source['use_global_warehouse']),
  );
}