public VendorBalanceEntry(VendorBalance vendorBalance, EventJournalItem item) { VENDOR_BALANCE = vendorBalance; VENDOR_BALANCE_ENTRY_TYPE = item.VENDOR_BALANCE_ENTRY_TYPE; TRANSACTION_DATE = item.EVENT_JOURNAL.TRANSACTION_DATE; CURRENCY = item.CURRENCY; item.VENDOR_BALANCE_ENTRY = this; EVENT_JOURNAL_ITEM = item; AMOUNT = item.AMOUNT; }
protected void SetVendorBalance(EventJournalItem item, Period period) { VendorBalance sc = VendorBalanceRepository.FindVendorBalanceHeader(m_command, item.VENDOR.ID, item.CURRENCY.ID, period.ID, item.VENDOR_BALANCE_TYPE); if (sc == null) { sc = VendorBalance.CreateVendorBalance(item, period); } item.VENDOR_BALANCE = sc; }
public void ProcessPosting(EventJournalItem eventItem) { assertSameCurrency(eventItem.CURRENCY); assertPeriodIsCurrent(); assertInPeriodRange(eventItem.EVENT_JOURNAL.TRANSACTION_DATE); double qty = eventItem.AMOUNT; switch (eventItem.VENDOR_BALANCE_ENTRY_TYPE) { case VendorBalanceEntryType.SupplierOutStandingInvoice: BALANCE += qty; break; case VendorBalanceEntryType.CustomerOutStandingInvoice: BALANCE += qty; break; case VendorBalanceEntryType.SupplierInvoice: BALANCE += qty; break; case VendorBalanceEntryType.CustomerInvoice: BALANCE += qty; break; case VendorBalanceEntryType.Payment: BALANCE -= qty; assertNotMinusBalanceAmount(); break; case VendorBalanceEntryType.Receipt: BALANCE -= qty; assertNotMinusBalanceAmount(); break; default: break; } VendorBalanceEntry sce = new VendorBalanceEntry(this, eventItem); VENDOR_BALANCE_ENTRIES.Add(sce); }
public static VendorBalance CreateVendorBalance(EventJournalItem item, Period period) {// return(new VendorBalance(period, item.VENDOR, item.CURRENCY, item.VENDOR_BALANCE_TYPE)); }