Ejemplo n.º 1
0
        protected override void doConfirm(Event events, Period p)
        {
            foreach (EventItem item in events.EVENT_ITEMS)
            {
                SetStockCard(item, p);
            }
            CustomerInvoice si = (CustomerInvoice)events;

            CustomerInvoiceJournal sij = new CustomerInvoiceJournal();

            // sij.LastUpdate = DateTime.Now;
            // sij.ByTransaction = true;
            sij.CODE = si.CODE;
            //sij.ComputerName = si.ComputerName;
            sij.CURRENCY         = si.CURRENCY;
            sij.EVENT_STATUS     = EventStatus.Entry;
            sij.NOTES            = si.NOTES;
            sij.NOTICE_DATE      = si.NOTICE_DATE;
            sij.TRANSACTION_DATE = si.TRANSACTION_DATE;
            // sij.UserName = si.UserName;
            sij.VENDOR                    = si.CUSTOMER;
            sij.CUSTOMER_INVOICE          = si;
            sij.NET_AMOUNT                = si.NET_TOTAL;
            sij.EMPLOYEE                  = si.EMPLOYEE;
            sij.VENDOR_BALANCE_ENTRY_TYPE = VendorBalanceEntryType.CustomerInvoice;

            CustomerInvoiceJournalItem siji = new CustomerInvoiceJournalItem();

            siji.AMOUNT                    = si.NET_TOTAL;
            siji.CURRENCY                  = si.CURRENCY;
            siji.EVENT_JOURNAL             = sij;
            siji.VENDOR                    = si.CUSTOMER;
            siji.INVOICE_NO                = si.CODE;
            siji.INVOICE_DATE              = si.TRANSACTION_DATE;
            siji.TOP                       = si.TOP;
            siji.EMPLOYEE                  = si.EMPLOYEE;
            siji.DUE_DATE                  = si.DUE_DATE;
            siji.OUTSTANDING_AMOUNT        = si.NET_TOTAL;
            siji.VENDOR_BALANCE_ENTRY_TYPE = VendorBalanceEntryType.CustomerInvoice;

            sij.EVENT_JOURNAL_ITEMS.Add(siji);
            r_sij.SaveNoTransaction(sij);
            r_sij.ConfirmNoTransaction(sij.ID);
        }
Ejemplo n.º 2
0
        protected override void doConfirm(Event events, Period p)
        {
            foreach (EventItem item in events.EVENT_ITEMS)
            {
                SetStockCard(item, p);
            }
            POS pos = (POS)events;

            CustomerInvoiceJournal cij = new CustomerInvoiceJournal();

            // sij.LastUpdate = DateTime.Now;
            // sij.ByTransaction = true;
            cij.CODE = pos.CODE;
            //sij.ComputerName = si.ComputerName;
            cij.CURRENCY         = pos.CURRENCY;
            cij.EVENT_STATUS     = EventStatus.Entry;
            cij.NOTES            = pos.NOTES;
            cij.NOTICE_DATE      = pos.NOTICE_DATE;
            cij.TRANSACTION_DATE = pos.TRANSACTION_DATE;
            // sij.UserName = si.UserName;
            cij.VENDOR      = pos.CUSTOMER;
            cij.POS_INVOICE = pos;
            cij.NET_AMOUNT  = pos.NET_TOTAL;
            cij.EMPLOYEE    = pos.EMPLOYEE;
            cij.VENDOR_BALANCE_ENTRY_TYPE = VendorBalanceEntryType.CustomerInvoice;


            CustomerInvoiceJournalItem ciji = new CustomerInvoiceJournalItem();

            ciji.AMOUNT                    = pos.NET_TOTAL;
            ciji.CURRENCY                  = pos.CURRENCY;
            ciji.EVENT_JOURNAL             = cij;
            ciji.VENDOR                    = pos.CUSTOMER;
            ciji.INVOICE_NO                = pos.CODE;
            ciji.INVOICE_DATE              = pos.TRANSACTION_DATE;
            ciji.TOP                       = pos.TOP;
            ciji.EMPLOYEE                  = pos.EMPLOYEE;
            ciji.DUE_DATE                  = pos.DUE_DATE;
            ciji.OUTSTANDING_AMOUNT        = pos.NET_TOTAL;
            ciji.VENDOR_BALANCE_ENTRY_TYPE = VendorBalanceEntryType.CustomerInvoice;

            cij.EVENT_JOURNAL_ITEMS.Add(ciji);
            r_cij.SaveNoTransaction(cij);
            r_cij.ConfirmNoTransaction(cij.ID);

            Receipt rc = new Receipt();

            rc.CURRENCY                  = cij.CURRENCY;
            rc.NET_AMOUNT                = cij.NET_AMOUNT;
            rc.NOTES                     = "Auto generate from POS Transaction";
            rc.NOTICE_DATE               = cij.NOTICE_DATE;
            rc.OTHER_EXPENSE             = cij.OTHER_EXPENSE;
            rc.SUBTOTAL_AMOUNT           = cij.SUBTOTAL_AMOUNT;
            rc.TRANSACTION_DATE          = cij.TRANSACTION_DATE;
            rc.VENDOR                    = cij.VENDOR;
            rc.VENDOR_BALANCE_ENTRY_TYPE = VendorBalanceEntryType.Receipt;
            rc.EMPLOYEE                  = cij.EMPLOYEE;

            ReceiptItem rci = new ReceiptItem();

            rci.EVENT_JOURNAL = rc;
            rci.AMOUNT        = ciji.AMOUNT;
            rci.CURRENCY      = rc.CURRENCY;
            rci.DUE_DATE      = rc.TRANSACTION_DATE;
            rci.EMPLOYEE      = rc.EMPLOYEE;
            rci.EVENT_JOURNAL = cij;
            rci.INVOICE_DATE  = cij.TRANSACTION_DATE;
            rci.INVOICE_NO    = cij.CODE;
            rci.NOTES         = "Autogenerate Payment from POS transaction";
            rci.PAYMENT_TYPE  = ReceiptType.Cash;
            rci.VENDOR_BALANCE_CUSTOMER_INVOICE_TYPE = VendorBalanceEntryType.Receipt;
            rci.VENDOR_BALANCE_ENTRY_TYPE            = VendorBalanceEntryType.Receipt;
            rci.VENDOR_BALANCE_TYPE           = VendorBalanceType.Customer;
            rci.CUSTOMER_INVOICE_JOURNAL_ITEM = ciji;
            rci.VENDOR = cij.VENDOR;
            rc.EVENT_JOURNAL_ITEMS.Add(rci);

            r_receipt.SaveNoTransaction(rc);
            r_receipt.ConfirmNoTransaction(rc.ID);
        }