Example #1
0
 public void Revise(int id)
 {
     MySql.Data.MySqlClient.MySqlTransaction trc = m_connection.BeginTransaction();
     m_command.Transaction = trc;
     try
     {
         EventJournal events = this.Get(id);
         if (events == null)
         {
             throw new Exception("Transaction is deleted");
         }
         if (events.EVENT_STATUS == EventStatus.Entry)
         {
             throw new Exception("Status is already Unposted/Entry");
         }
         Period p = AssertValidPeriod(events.TRANSACTION_DATE);
         doRevise(events, p);
         events.ProcessUnPosted();
         this.UpdateStatus(events, false);
         //deleteVendorBalanceEntry(events.DELETED_VENDORBALANCEENTRY);
         //updateVendorBalances(events.EVENT_JOURNAL_ITEMS);
         trc.Commit();
     }
     catch (Exception x)
     {
         trc.Rollback();
         throw x;
     }
 }
Example #2
0
 public void ReviseNoTransaction(int id)
 {
     try
     {
         EventJournal events = this.Get(id);
         if (events.EVENT_STATUS == EventStatus.Entry)
         {
             throw new Exception("Status is already Unposted/Entry");
         }
         Period p = AssertValidPeriod(events.TRANSACTION_DATE);
         doRevise(events, p);
         events.ProcessUnPosted();
         this.UpdateStatus(events, false);
         //deleteVendorBalanceEntry(events.DELETED_VENDORBALANCEENTRY);
         // updateVendorBalances(events.EVENT_JOURNAL_ITEMS);
     }
     catch (Exception x)
     {
         throw x;
     }
 }
Example #3
0
 public void ReviseForPOSNoTransaction(int id)
 {
     try
     {
         EventJournal events = this.Get(id);
         if (events.EVENT_STATUS == EventStatus.Entry)
         {
             throw new Exception("Status is already Unposted/Entry");
         }
         Period p = AssertValidPeriod(events.TRANSACTION_DATE);
         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 (item.CUSTOMER_INVOICE_JOURNAL_ITEM is CustomerOutStandingInvoiceItem)
             //{
             //    CustomerOutStandingInvoiceRepository.UpdateAgainstStatus(m_command, item.CUSTOMER_INVOICE_JOURNAL_ITEM.GET_EVENT_JOURNAL,
             //        item.CUSTOMER_INVOICE_JOURNAL_ITEM);
             //}
         }
         events.ProcessUnPosted();
         this.UpdateStatus(events, false);
     }
     catch (Exception x)
     {
         throw x;
     }
 }