thirdPartyFunc function

dynamic thirdPartyFunc(
  1. dynamic datamodel,
  2. dynamic param,
  3. dynamic context
)

Implementation

thirdPartyFunc(datamodel, param, context) {
  if (param[gFunction] == 'thirdContinuepay') {
    thirdContinuepay(datamodel, context);
  } else if (param[gFunction] == 'thirdPrintReceipttrue') {
    dynamic orderno = datamodel.getValueByCol({gValue: gOrderno}, context);
    if (isNull(orderno)) {
      return;
    }
    dynamic amount =
        fromMoney(datamodel.getValueByCol({gValue: gAmount}, context));
    dynamic tip = fromMoney(datamodel.getValueByCol({gValue: gTip}, context));
    amount =
        '${datamodel.getInt(datamodel.expressValue({}, '$amount + $tip'))}';
    dynamic paid = fromMoney(datamodel.getValueByCol({gValue: gPaid}, context));
    datamodel.myLog(
        'thirdPartyFunc orderno: $orderno, amount:$amount,tip:$tip, paid:$paid');
    Navigator.of(context).pop();

    datamodel.myNotifyListeners();

    paymentReceipt(orderno, amount, tip, paid, datamodel, context);
  } else if (param[gFunction] == 'thirdPrintReceiptfalse') {
    dynamic orderno = datamodel.getValueByCol({gValue: gOrderno}, context);
    if (isNull(orderno)) {
      return;
    }
    dynamic amount =
        fromMoney(datamodel.getValueByCol({gValue: gAmount}, context));
    dynamic tip = fromMoney(datamodel.getValueByCol({gValue: gTip}, context));
    amount =
        '${datamodel.getInt(datamodel.expressValue({}, '$amount + $tip'))}';
    dynamic paid = fromMoney(datamodel.getValueByCol({gValue: gPaid}, context));
    datamodel.myLog(
        'thirdPartyFunc orderno: $orderno, amount:$amount,tip:$tip, paid:$paid');
    Navigator.of(context).pop();

    datamodel.myNotifyListeners();
    Map dataRow = getPaymentDatarow(orderno, amount, tip, paid, datamodel);
    printReceipt(dataRow, context, datamodel, false);

    //resetPaymentGui(datamodel, context);
  } else if (param[gFunction] == 'thirdPrintReceiptCancel') {
    Navigator.of(context).pop();
    datamodel.backContext(1, context);
    /*datamodel.myNotifyListeners();
    resetPaymentGui(datamodel, context);*/
  }
}