Esempio n. 1
0
 public MakePayment(List <AppPayments> adyenPayments, string dbpath)
 {
     _adyenPayments = adyenPayments;
     _dbpath        = dbpath;
     _arpm          = new Arpm(dbpath);
     _gltrans       = new Gltrans(dbpath);
     _khReceipts    = new List <Officialreceipts>();
 }
Esempio n. 2
0
 public UpdateBills(List <OutstandingBill> outstandingBills, string dbpath)
 {
     _outStandingBills = outstandingBills;
     _dbpath           = dbpath;
     _updatedBills     = new List <OutstandingBill>();
     _arpm             = new Arpm(_dbpath);
     _ariv             = new Ariv(_dbpath);
     _checkPayment();
 }
Esempio n. 3
0
        private int _addPayment(AppPayments payment, string code, int gltransid)
        {
            Arpm             arpm      = new Arpm(_dbpath);
            Officialreceipts oreceipts = new Officialreceipts();

            // Get next Official receipt number
            Sysdocnodtl sysdocnodtl = new Sysdocnodtl(_dbpath);

            sysdocnodtl.nxtOffclrcpt();

            int    dockey    = arpm.nextDockey();
            string offclrcpt = $"OR-{sysdocnodtl.NEXTNUMBER.ToString().PadLeft(5,'0')}";

            arpm.DOCKEY = dockey;
            arpm.CODE   = $"'{code}'";
            // arpm.DOCNO = $"'{arpm.nextOR()}'";
            arpm.DOCNO         = $"'{offclrcpt}'";
            arpm.GLTRANSID     = gltransid;
            arpm.DOCDATE       = $"'{payment.billing_date}'";
            arpm.POSTDATE      = $"'{payment.billing_date}'";
            arpm.TAXDATE       = $"'{payment.billing_date}'";
            arpm.DESCRIPTION   = $"'{payment.description}'";
            arpm.AREA          = $"'{code.Substring(0, code.IndexOf("-"))}'";
            arpm.AGENT         = "'----'";
            arpm.CANCELLED     = "'F'";
            arpm.PROJECT       = $"'{payment.project_code}'";
            arpm.PAYMENTMETHOD = "'310-000'";
            arpm.JOURNAL       = "'BANK'";
            arpm.CURRENCYRATE  = 1;
            arpm.BANKCHARGE    = 0;
            arpm.DOCAMT        = _convertAmount(payment.amount_paid);
            arpm.LOCALDOCAMT   = _convertAmount(payment.amount_paid);
            arpm.UNAPPLIEDAMT  = 0;
            arpm.GLTRANSID     = gltransid;
            arpm.CHEQUENUMBER  = "'KIPLEHOME - ONLINE'";
            arpm.UDF_POSTDN    = "'F'";
            arpm.UDF_TAXRATE   = "'0%'";
            arpm.Add();

            // Increment for next official reciept
            sysdocnodtl.NEXTNUMBER += 1;
            sysdocnodtl.Update(sysdocnodtl.AUTOKEY);

            oreceipts.adyen_uuid = payment.uuid;
            oreceipts.or_no      = offclrcpt;
            _khReceipts.Add(oreceipts);

            _addGlcb(payment, offclrcpt, gltransid, code);

            return(dockey);
        }