getOrderItemsList function

dynamic getOrderItemsList(
  1. dynamic datamodel,
  2. dynamic orderno,
  3. dynamic amount,
  4. dynamic amountpaid,
  5. dynamic isUser,
)

Implementation

getOrderItemsList(datamodel, orderno, amount, amountpaid, isUser) {
  isUser = isUser ?? true;
  amount = fromMoney(amount);
  amountpaid = fromMoney(amountpaid);
  var unpaid =
      '${datamodel.getInt(datamodel.expressValue({}, '$amount-$amountpaid'))}';
  Map itemList = {
    100: {
      gItem: {gType: '$gText$gValue', gLabel: 'Order #', gValue: orderno}
    },
    200: {
      gItem: {gType: gSizedbox, gHeight: 15.0}
    },
    300: {
      gItem: {
        gType: '$gText$gValue',
        gLabel: 'Total',
        gValue: toMoney(amount),
        gFontWeight: FontWeight.bold
      }
    },
    400: {
      gItem: {
        gType: '$gText$gValue',
        gLabel: 'Paid',
        gValue: toMoney(amountpaid),
        gFontWeight: FontWeight.bold
      }
    },
    500: {
      gItem: {
        gType: gSizedbox,
        gValue: 10.0,
      }
    },
    600: {
      gItem: {
        gType: '$gText$gValue',
        gLabel: 'Unpaid',
        gValue: toMoney(unpaid),
        gFontWeight: FontWeight.bold
      }
    },
    700: {
      gItem: {
        gType: gSizedbox,
        gValue: 20.0,
      }
    },
    1000: {
      gItem: {
        gType: gBtn,
        gLabel: 'Print receipt',
        gFunction: 'thirdPrintReceipt$isUser',
        gAfter: gPaid
      }
    },
    1100: {
      gItem: {
        gType: gSizedbox,
        gValue: 20.0,
      }
    },
    1200: {
      gItem: {
        gType: gBtn,
        gLabel: 'Cancel',
        gFunction: 'thirdPrintReceiptCancel',
      }
    },
  };
  return itemList;
}