public void Post(long GJournalID) { try { GetConnection(); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(Connection, Transaction); MySqlDataReader myReader = List(GJournalID, "GJournalDebitID", SortOption.Ascending); while (myReader.Read()) { int ChartOfAccountID = myReader.GetInt32("ChartOfAccountID"); decimal Amount = myReader.GetDecimal("Amount"); clsChartOfAccount.UpdateDebit(ChartOfAccountID, Amount); } myReader.Close(); } catch (Exception ex) { { } throw base.ThrowException(ex); } }
private void UpdateAccounts(long CreditMemoID) { try { CreditMemoDetails clsCreditMemoDetails = Details(CreditMemoID); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(base.Connection, base.Transaction); // update ChartOfAccountIDARTracking as credit clsChartOfAccount.UpdateCredit(clsCreditMemoDetails.ChartOfAccountIDARTracking, clsCreditMemoDetails.SubTotal); // update Deposit & APContra clsChartOfAccount.UpdateDebit(clsCreditMemoDetails.ChartOfAccountIDARContra, clsCreditMemoDetails.Discount); // update Freight & APTracking clsChartOfAccount.UpdateDebit(clsCreditMemoDetails.ChartOfAccountIDARTracking, clsCreditMemoDetails.Freight); clsChartOfAccount.UpdateCredit(clsCreditMemoDetails.ChartOfAccountIDARFreight, clsCreditMemoDetails.Freight); // update Deposit & APTracking clsChartOfAccount.UpdateDebit(clsCreditMemoDetails.ChartOfAccountIDARTracking, clsCreditMemoDetails.Deposit); clsChartOfAccount.UpdateCredit(clsCreditMemoDetails.ChartOfAccountIDARVDeposit, clsCreditMemoDetails.Deposit); CreditMemoItems clsCreditMemoItems = new CreditMemoItems(base.Connection, base.Transaction); System.Data.DataTable dt = clsCreditMemoItems.ListAsDataTable(CreditMemoID); foreach (System.Data.DataRow dr in dt.Rows) { int iChartOfAccountIDPurchase = Int16.Parse(dr["ChartOfAccountIDPurchase"].ToString()); int iChartOfAccountIDTaxPurchase = Int16.Parse(dr["ChartOfAccountIDTaxPurchase"].ToString()); decimal decVAT = decimal.Parse(dr["VAT"].ToString()); decimal decVATABLEAmount = decimal.Parse(dr["Amount"].ToString()) - decVAT; // update purchase as debit clsChartOfAccount.UpdateCredit(iChartOfAccountIDPurchase, decVATABLEAmount); // update tax as debit clsChartOfAccount.UpdateCredit(iChartOfAccountIDTaxPurchase, decVAT); } //myReader.Close(); } catch (Exception ex) { throw base.ThrowException(ex); } }
public void Post(long BankDepositID, decimal Amount) { try { string SQL = "UPDATE tblBankDeposit SET " + "DepositStatus = @DepositStatus " + "WHERE BankDepositID = @BankDepositID;"; MySqlCommand cmd = new MySqlCommand(); cmd.CommandType = System.Data.CommandType.Text; cmd.CommandText = SQL; cmd.Parameters.AddWithValue("@DepositStatus", BankDepositStatus.Posted.ToString("d")); cmd.Parameters.AddWithValue("@BankDepositID", BankDepositID); base.ExecuteNonQuery(cmd); BankDepositDetails clsBankDepositDetails = Details(BankDepositID); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(base.Connection, base.Transaction); clsChartOfAccount.UpdateDebit(clsBankDepositDetails.DepositInAccountID, clsBankDepositDetails.DepositItemAmount); clsChartOfAccount.UpdateCredit(clsBankDepositDetails.DepositInAccountID, clsBankDepositDetails.CashBackAmount); clsChartOfAccount.UpdateDebit(clsBankDepositDetails.CashBackAccountID, clsBankDepositDetails.CashBackAmount); clsChartOfAccount.UpdateCredit(clsBankDepositDetails.DepositItemAccountID, clsBankDepositDetails.DepositItemAmount); } catch (Exception ex) { throw base.ThrowException(ex); } }
public void Post(long GJournalID) { try { GetConnection(); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(Connection, Transaction); MySqlDataReader myReader = List(GJournalID, "GJournalDebitID",SortOption.Ascending); while (myReader.Read()) { int ChartOfAccountID = myReader.GetInt32("ChartOfAccountID"); decimal Amount = myReader.GetDecimal("Amount"); clsChartOfAccount.UpdateDebit(ChartOfAccountID, Amount); } myReader.Close(); } catch (Exception ex) { { } throw base.ThrowException(ex); } }
private void UpdateAccounts(long DebitMemoID) { try { DebitMemoDetails clsDebitMemoDetails = Details(DebitMemoID); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(base.Connection, base.Transaction); // update ChartOfAccountIDAPTracking as credit clsChartOfAccount.UpdateCredit(clsDebitMemoDetails.ChartOfAccountIDAPTracking, clsDebitMemoDetails.SubTotal); // update Deposit & APContra clsChartOfAccount.UpdateCredit(clsDebitMemoDetails.ChartOfAccountIDAPContra, clsDebitMemoDetails.Discount); // update Freight & APTracking clsChartOfAccount.UpdateDebit(clsDebitMemoDetails.ChartOfAccountIDAPTracking, clsDebitMemoDetails.Freight); clsChartOfAccount.UpdateCredit(clsDebitMemoDetails.ChartOfAccountIDAPFreight, clsDebitMemoDetails.Freight); // update Deposit & APTracking clsChartOfAccount.UpdateDebit(clsDebitMemoDetails.ChartOfAccountIDAPTracking, clsDebitMemoDetails.Deposit); clsChartOfAccount.UpdateCredit(clsDebitMemoDetails.ChartOfAccountIDAPVDeposit, clsDebitMemoDetails.Deposit); DebitMemoItems clsDebitMemoItems = new DebitMemoItems(base.Connection, base.Transaction); System.Data.DataTable dt = clsDebitMemoItems.ListAsDataTable(DebitMemoID); foreach(System.Data.DataRow dr in dt.Rows) { int iChartOfAccountIDPurchase = Int16.Parse(dr["ChartOfAccountIDPurchase"].ToString()); int iChartOfAccountIDTaxPurchase = Int16.Parse(dr["ChartOfAccountIDTaxPurchase"].ToString()); decimal decVAT = decimal.Parse(dr["VAT"].ToString()); decimal decVATABLEAmount = decimal.Parse(dr["Amount"].ToString())-decVAT; // update purchase as debit clsChartOfAccount.UpdateCredit(iChartOfAccountIDPurchase, decVATABLEAmount); // update tax as debit clsChartOfAccount.UpdateCredit(iChartOfAccountIDTaxPurchase, decVAT); } } catch (Exception ex) { throw base.ThrowException(ex); } }
private void UpdateAccounts(long SOID) { try { SODetails clsSODetails = Details(SOID); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(base.Connection, base.Transaction); // update ChartOfAccountIDARTracking as credit clsChartOfAccount.UpdateCredit(clsSODetails.ChartOfAccountIDARTracking, clsSODetails.SubTotal); // update Deposit & APContra clsChartOfAccount.UpdateCredit(clsSODetails.ChartOfAccountIDARContra, clsSODetails.Discount); // update Freight & APTracking clsChartOfAccount.UpdateCredit(clsSODetails.ChartOfAccountIDARTracking, clsSODetails.Freight); clsChartOfAccount.UpdateDebit(clsSODetails.ChartOfAccountIDARFreight, clsSODetails.Freight); // update Deposit & APTracking clsChartOfAccount.UpdateCredit(clsSODetails.ChartOfAccountIDARTracking, clsSODetails.Deposit); clsChartOfAccount.UpdateDebit(clsSODetails.ChartOfAccountIDARVDeposit, clsSODetails.Deposit); SOItem clsSOItem = new SOItem(base.Connection, base.Transaction); System.Data.DataTable dt = clsSOItem.ListAsDataTable(SOID, "SOItemID", SortOption.Ascending); foreach (System.Data.DataRow dr in dt.Rows) { int iChartOfAccountIDSold = Int16.Parse(dr["ChartOfAccountIDSold"].ToString()); int iChartOfAccountIDTaxSold = Int16.Parse(dr["ChartOfAccountIDTaxSold"].ToString()); decimal decVAT = decimal.Parse(dr["VAT"].ToString()); decimal decVATABLEAmount = decimal.Parse(dr["Amount"].ToString()) - decVAT; // update purchase as debit clsChartOfAccount.UpdateDebit(iChartOfAccountIDSold, decVATABLEAmount); // update tax as debit clsChartOfAccount.UpdateDebit(iChartOfAccountIDTaxSold, decVAT); } } catch (Exception ex) { base.ThrowException(ex); } }
private void UpdateAccounts(long POID) { try { PODetails clsPODetails = Details(POID); ChartOfAccounts clsChartOfAccount = new ChartOfAccounts(base.Connection, base.Transaction); // update ChartOfAccountIDAPTracking as credit clsChartOfAccount.UpdateCredit(clsPODetails.ChartOfAccountIDAPTracking, clsPODetails.SubTotal); // update Deposit & APContra clsChartOfAccount.UpdateCredit(clsPODetails.ChartOfAccountIDAPContra, clsPODetails.Discount); // update Freight & APTracking clsChartOfAccount.UpdateCredit(clsPODetails.ChartOfAccountIDAPTracking, clsPODetails.Freight); clsChartOfAccount.UpdateDebit(clsPODetails.ChartOfAccountIDAPFreight, clsPODetails.Freight); // update Deposit & APTracking clsChartOfAccount.UpdateCredit(clsPODetails.ChartOfAccountIDAPTracking, clsPODetails.Deposit); clsChartOfAccount.UpdateDebit(clsPODetails.ChartOfAccountIDAPVDeposit, clsPODetails.Deposit); POItem clsPOItem = new POItem(base.Connection, base.Transaction); System.Data.DataTable dt = clsPOItem.ListAsDataTable(POID, "POItemID", SortOption.Ascending); foreach (System.Data.DataRow dr in dt.Rows) { int iChartOfAccountIDPurchase = Convert.ToInt16(dr["ChartOfAccountIDPurchase"]); int iChartOfAccountIDTaxPurchase = Convert.ToInt16(dr["ChartOfAccountIDTaxPurchase"]); decimal decVAT = Convert.ToDecimal(dr["VAT"]); decimal decVATABLEAmount = Convert.ToDecimal(dr["Amount"]) - decVAT; // update purchase as debit clsChartOfAccount.UpdateDebit(iChartOfAccountIDPurchase, decVATABLEAmount); // update tax as debit clsChartOfAccount.UpdateDebit(iChartOfAccountIDTaxPurchase, decVAT); } } catch (Exception ex) { throw base.ThrowException(ex); } }