Exemple #1
0
        protected override void doRevise(EventJournal events, Period p)
        {
            foreach (ReceiptItem item in events.EVENT_JOURNAL_ITEMS)
            {
                item.CURRENCY = events.CURRENCY;
                item.VENDOR   = events.VENDOR;
                SetVendorBalance(item, p);
                item.ProcessUnPosted();
                updateVendorBalances(item.VENDOR_BALANCE);
                deleteVendorBalanceEntry(item.VENDOR_BALANCE_ENTRY);
                item.CUSTOMER_INVOICE_JOURNAL_ITEM.UnSetOSAgainstReceiptItem(item);
                if (item.CUSTOMER_INVOICE_JOURNAL_ITEM is CustomerInvoiceJournalItem)
                {
                    CustomerInvoiceJournalRepository.UpdateAgainstStatus(m_command, item.CUSTOMER_INVOICE_JOURNAL_ITEM.GET_EVENT_JOURNAL,
                                                                         item.CUSTOMER_INVOICE_JOURNAL_ITEM);
                    CustomerInvoiceJournal cij = (CustomerInvoiceJournal)((CustomerInvoiceJournalItem)item.CUSTOMER_INVOICE_JOURNAL_ITEM).EVENT_JOURNAL;
                    if (cij.POS_INVOICE.ID > 0)
                    {
                        throw new Exception("POS Receipt can not revise, please revise POS");
                    }
                }
                if (item.CUSTOMER_INVOICE_JOURNAL_ITEM is CustomerOutStandingInvoiceItem)
                {
                    CustomerOutStandingInvoiceRepository.UpdateAgainstStatus(m_command, item.CUSTOMER_INVOICE_JOURNAL_ITEM.GET_EVENT_JOURNAL,
                                                                             item.CUSTOMER_INVOICE_JOURNAL_ITEM);
                }
                //if (item.PAYMENT_TYPE == ReceiptType.ARCreditNote)
                //{

                //}
            }
        }
Exemple #2
0
        protected override void doConfirm(EventJournal events, Period p)
        {
            foreach (ReceiptItem item in events.EVENT_JOURNAL_ITEMS)
            {
                assertConfirmedSIJ(item.CUSTOMER_INVOICE_JOURNAL_ITEM.GET_EVENT_JOURNAL);
                assertValidDate(item.CUSTOMER_INVOICE_JOURNAL_ITEM.GET_EVENT_JOURNAL, events);
                item.CURRENCY = events.CURRENCY;
                item.VENDOR   = events.VENDOR;
                SetVendorBalance(item, p);
                item.ProcessPosted();
                updateVendorBalances(item.VENDOR_BALANCE);
                saveVendorBalanceEntry(item.VENDOR_BALANCE_ENTRY);
                item.CUSTOMER_INVOICE_JOURNAL_ITEM.SetOSAgainstReceiptItem(item);
                if (item.CUSTOMER_INVOICE_JOURNAL_ITEM is CustomerInvoiceJournalItem)
                {
                    CustomerInvoiceJournalRepository.UpdateAgainstStatus(m_command, item.CUSTOMER_INVOICE_JOURNAL_ITEM.GET_EVENT_JOURNAL,
                                                                         item.CUSTOMER_INVOICE_JOURNAL_ITEM);
                }
                if (item.CUSTOMER_INVOICE_JOURNAL_ITEM is CustomerOutStandingInvoiceItem)
                {
                    CustomerOutStandingInvoiceRepository.UpdateAgainstStatus(m_command, item.CUSTOMER_INVOICE_JOURNAL_ITEM.GET_EVENT_JOURNAL,
                                                                             item.CUSTOMER_INVOICE_JOURNAL_ITEM);
                }
                // if (item.PAYMENT_TYPE == ReceiptType.ARCreditNote)
                //{

                //}
            }
        }