protected void btnDelete_Click(object sender, EventArgs e) { try { Acc_COA selectedNode = _COA.Find(p => p.COAKey == _SelectedCOAKey); if (selectedNode != null) { //selectedNode.COAKey Acc_VoucherDet obj = null; if (selectedNode.IsSubsidiary) { obj = Acc_VoucherDet.CheckToDelete(selectedNode.COAKey); } if (obj.IsAdded) { selectedNode.Delete(); if (SaveCOA()) { ((Hr.Web.UI.ACC.COA) this.Page).SuccessMessage = StaticInfo.DeletedSuccessfullyMsg; } } else { ((Hr.Web.UI.ACC.COA) this.Page).ErrorMessage = "Transaction has been occured to this head!"; } } } catch (Exception ex) { ((Hr.Web.UI.ACC.COA) this.Page).ErrorMessage = ex.Message; } }
protected void btnSave_Click(object sender, EventArgs e) { try { CustomList <Acc_Voucher> lstAccVoucher = AccVoucherList; if (lstAccVoucher.Count == 0) { Acc_Voucher newVoucher = new Acc_Voucher(); lstAccVoucher.Add(newVoucher); } SetDataFromControlToObject(ref lstAccVoucher); CustomList <Acc_VoucherDet> lstAccVoucherDet = (CustomList <Acc_VoucherDet>)Session["PFVoucher_AccVoucherDetList"]; if (lstAccVoucherDet.Count == 0) { Acc_VoucherDet voucherDet = new Acc_VoucherDet(); voucherDet.ContactID = Convert.ToInt32(ddlRecipient_nc.SelectedValue); voucherDet.COAKey = Convert.ToInt64(ddlCredit.SelectedValue); voucherDet.Cr = txtCreditAmount.Text.ToDecimal(); voucherDet.EntryDate = DateTime.Now; voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Criteria = "Purchase"; lstAccVoucherDet.Add(voucherDet); voucherDet = new Acc_VoucherDet(); // voucherDet.COAKey = Convert.ToInt64(ddlCredit.SelectedValue); voucherDet.ContactID = Convert.ToInt32(ddlRecipient_nc.SelectedValue); voucherDet.Dr = txtCreditAmount.Text.ToDecimal(); voucherDet.EntryDate = DateTime.Now; voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Criteria = "Purchase"; lstAccVoucherDet.Add(voucherDet); } else { foreach (Acc_VoucherDet vd in lstAccVoucherDet) { vd.LastUpdateDate = DateTime.Now; vd.LastUpdateUserKey = CurrentUserSession.UserKey; } } string prifix = ddlVoucherType_nc.SelectedItem.Text; manager.SavePFVoucher(ref lstAccVoucher, ref lstAccVoucherDet, prifix); txtVoucher.Text = manager.VoucherID; ddlRecipient_nc_SelectedIndexChanged(null, null); this.SuccessMessage = (StaticInfo.SavedSuccessfullyMsg + ". Voucher No: " + manager.VoucherID); } catch (SqlException ex) { this.ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex)); } catch (Exception ex) { this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex)); } }
public long GetExistingVoucher(String voucherDate, Int64 head, Int64 userKey) { return(Acc_VoucherDet.GetExistingVoucher(voucherDate, head, userKey)); }
public Decimal GetBal(Int64 UserKey) { return(Acc_VoucherDet.GetBal(UserKey)); }
public CustomList <Acc_VoucherDet> CheckBankAndCashVoucher(string searchStr) { return(Acc_VoucherDet.CheckBankAndCashVoucher(searchStr)); }
public Decimal GetBal(Int32 contactID) { return(Acc_VoucherDet.GetBal(contactID)); }
public CustomList <Acc_VoucherDet> GetReceiptHeadList(Int64 empKey) { return(Acc_VoucherDet.GetReceiptHeadList(empKey)); }
public CustomList <Acc_VoucherDet> GetAllAcc_VoucherDet(Int64 voucherKey) { return(Acc_VoucherDet.GetAllAcc_VoucherDet(voucherKey)); }
protected void btnSave_Click(object sender, EventArgs e) { try { CustomList <Acc_Voucher> lstAccVoucher = AccVoucherList; if (lstAccVoucher.Count == 0) { Acc_Voucher newVoucher = new Acc_Voucher(); lstAccVoucher.Add(newVoucher); } SetDataFromControlToObject(ref lstAccVoucher); CustomList <Acc_VoucherDet> lstAccVoucherDet = new CustomList <Acc_VoucherDet>(); if (lstAccVoucherDet.Count == 0) { //Receive From SO Acc_VoucherDet voucherDet = new Acc_VoucherDet(); voucherDet.UserKey = Convert.ToInt32(hfEmpKey.Value); voucherDet.COAKey = Convert.ToInt64(ddlReceiptFromAC_nc.SelectedValue); voucherDet.Cr = txtCreditAmount.Text.ToDecimal(); voucherDet.EntryDate = DateTime.Now; voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Criteria = "Sales"; lstAccVoucherDet.Add(voucherDet); //Cash Amount if (txtCashAmount.Text != "") { voucherDet = new Acc_VoucherDet(); voucherDet.UserKey = Convert.ToInt32(hfEmpKey.Value); voucherDet.COAKey = Convert.ToInt64(ddlCashDebit_nc.SelectedValue); voucherDet.Dr = txtCashAmount.Text.ToDecimal(); voucherDet.EntryDate = DateTime.Now; voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Criteria = "Sales"; lstAccVoucherDet.Add(voucherDet); } //Bank Amount if (txtBankAmount.Text != "") { voucherDet = new Acc_VoucherDet(); voucherDet.UserKey = Convert.ToInt32(hfEmpKey.Value); voucherDet.COAKey = Convert.ToInt64(ddlBankDeposit_nc.SelectedValue); voucherDet.Dr = txtBankAmount.Text.ToDecimal(); voucherDet.EntryDate = DateTime.Now; voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Criteria = "Sales"; lstAccVoucherDet.Add(voucherDet); } } else { foreach (Acc_VoucherDet vd in lstAccVoucherDet) { vd.LastUpdateDate = DateTime.Now; vd.LastUpdateUserKey = CurrentUserSession.UserKey; } } string prifix = "JV"; manager.SavePFVoucher(ref lstAccVoucher, ref lstAccVoucherDet, prifix); this.SuccessMessage = (StaticInfo.SavedSuccessfullyMsg + ". Voucher No: " + manager.VoucherID); btnNew_Click(null, null); txtVoucher.Text = manager.VoucherID; } catch (SqlException ex) { this.ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex)); } catch (Exception ex) { this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex)); } }
private void DisplayFileData(DataTable dt) { try { CustomList <Acc_VoucherDet> SOList = _manager.GetSOList(); DailySoWiseSalesList = new CustomList <SalesUploadFromExcel>(); CustomList <Hr_MasterSetup> CommissionAndVATList = Hr_MasterSetup.GetAllHr_MasterCommissionAndVATPercent(); errorList = new CustomList <ErrorList>(); foreach (DataRow d in dt.Rows) { ErrorList errorObj = new ErrorList(); SalesUploadFromExcel newObj = new SalesUploadFromExcel(); string SOName = d["Sales Officer(SO)"].ToString(); if (SOName == "") { continue; } Acc_VoucherDet checkSO = SOList.Find(f => f.EmpName.Trim() == SOName.Trim()); if (checkSO.IsNotNull()) { //if (d["Code"].ToString() != "") // newObj.Code = d["Code"].ToString(); if (d["Sales Officer(SO)"].ToString() != "") { newObj.SOName = d["Sales Officer(SO)"].ToString(); } if (d["Section"].ToString() != "") { newObj.Section = d["Section"].ToString(); } if (d["Gross Sales"].ToString() != "") { newObj.Gross = Convert.ToDecimal(d["Gross Sales"]); } if (d["Free Sales"].ToString() != "") { newObj.FreeSales = Convert.ToDecimal(d["Free Sales"]); } if (d["Commission"].ToString() != "") { newObj.Commission = Convert.ToDecimal(d["Commission"]); } if (d["Net Sales"].ToString() != "") { newObj.Cash = Convert.ToDecimal(d["Net Sales"]); } if (d["PD Commission"].ToString().IsNotNullOrEmpty()) { newObj.PDC = Convert.ToDecimal(d["PD Commission"]); } //newObj.DistributorCom = Math.Round((newObj.Gross * Convert.ToDecimal(CommissionAndVATList[0].ItemValue) / 100), 2);//Convert.ToDecimal("3.82299") / 100; decimal distributorCom = Math.Round((newObj.Gross * Convert.ToDecimal(CommissionAndVATList[0].ItemValue) / 100), 2); newObj.DistributorCom = distributorCom; newObj.VAT = Math.Round((newObj.Gross * Convert.ToDecimal(CommissionAndVATList[1].ItemValue) / 100), 2); // Convert.ToDecimal("0.60203") / 100; newObj.Inventory = Math.Round((newObj.Gross * Convert.ToDecimal(CommissionAndVATList[2].ItemValue) / 100), 2); // Convert.ToDecimal("95.57496") / 100; ; newObj.Cash = newObj.Cash - newObj.PDC; DailySoWiseSalesList.Add(newObj); } else { errorObj.EmpName = SOName; errorObj.Error = "Please Check Employee Name In database!"; errorList.Add(errorObj); } } } catch (Exception ex) { throw (ex); } }
public Decimal GetAllAcc_VoucherDet(Int32 orgKey, string fromDate, string toDate, Int32 head, string spName) { return(Acc_VoucherDet.GetAllAcc_VoucherDet(orgKey, fromDate, toDate, head, spName)); }
protected void btnSave_Click(object sender, EventArgs e) { try { CustomList <Acc_Voucher> lstAccVoucher = AccVoucherList; if (lstAccVoucher.Count == 0) { Acc_Voucher newVoucher = new Acc_Voucher(); lstAccVoucher.Add(newVoucher); } SetDataFromControlToObject(ref lstAccVoucher); CustomList <Acc_VoucherDet> lstAccVoucherDet = (CustomList <Acc_VoucherDet>)Session["PFVoucher_AccVoucherDetList"]; if (lstAccVoucherDet.Count == 0) { Acc_VoucherDet voucherDet = new Acc_VoucherDet(); voucherDet.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("Inventory"); voucherDet.UserKey = Convert.ToInt32(hfEmpKey.Value); voucherDet.Cr = txtCrAmount.Text.ToDecimal(); voucherDet.EntryDate = DateTime.Now; voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Criteria = "Sales"; lstAccVoucherDet.Add(voucherDet); voucherDet = new Acc_VoucherDet(); voucherDet.EntryDate = DateTime.Now; voucherDet.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("Dist Commission"); voucherDet.UserKey = Convert.ToInt32(hfEmpKey.Value); voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Cr = txtCommission.Text.ToDecimal(); voucherDet.Criteria = "Sales"; lstAccVoucherDet.Add(voucherDet); voucherDet = new Acc_VoucherDet(); voucherDet.EntryDate = DateTime.Now; voucherDet.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("VAT"); voucherDet.UserKey = Convert.ToInt32(hfEmpKey.Value); voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Cr = txtVAT.Text.ToDecimal(); voucherDet.Criteria = "Sales"; lstAccVoucherDet.Add(voucherDet); voucherDet = new Acc_VoucherDet(); voucherDet.EntryDate = DateTime.Now; voucherDet.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("GrossSales"); voucherDet.UserKey = Convert.ToInt32(hfEmpKey.Value); voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Dr = txtGrossSales.Text.ToDecimal(); voucherDet.Criteria = "Sales"; lstAccVoucherDet.Add(voucherDet); voucherDet = new Acc_VoucherDet(); voucherDet.EntryDate = DateTime.Now; voucherDet.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("GrossSales"); voucherDet.UserKey = Convert.ToInt32(hfEmpKey.Value); voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Cr = txtGrossSales.Text.ToDecimal(); voucherDet.Criteria = "Sales"; lstAccVoucherDet.Add(voucherDet); //Receivable to SO voucherDet = new Acc_VoucherDet(); voucherDet.EntryDate = DateTime.Now; voucherDet.UserKey = Convert.ToInt32(hfEmpKey.Value); voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Dr = txtReceivableAmount.Text.ToDecimal(); voucherDet.Criteria = "Sales"; lstAccVoucherDet.Add(voucherDet); //Unilever Commission voucherDet = new Acc_VoucherDet(); voucherDet.EntryDate = DateTime.Now; voucherDet.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("Commission"); voucherDet.UserKey = Convert.ToInt32(hfEmpKey.Value); voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Dr = txtUnileverComm.Text.ToDecimal(); voucherDet.Criteria = "Sales"; lstAccVoucherDet.Add(voucherDet); //Unilever Commission voucherDet = new Acc_VoucherDet(); voucherDet.EntryDate = DateTime.Now; voucherDet.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("FreeSales"); voucherDet.UserKey = Convert.ToInt32(hfEmpKey.Value); voucherDet.EntryUserKey = CurrentUserSession.UserKey; voucherDet.Dr = txtUnileverFreeSales.Text.ToDecimal(); voucherDet.Criteria = "Sales"; lstAccVoucherDet.Add(voucherDet); } else { foreach (Acc_VoucherDet vd in lstAccVoucherDet) { vd.LastUpdateDate = DateTime.Now; vd.LastUpdateUserKey = CurrentUserSession.UserKey; } } string prifix = "JV"; manager.SavePFVoucher(ref lstAccVoucher, ref lstAccVoucherDet, prifix); this.SuccessMessage = (StaticInfo.SavedSuccessfullyMsg + ". Voucher No: " + manager.VoucherID); txtVoucher.Text = manager.VoucherID; } catch (SqlException ex) { this.ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex)); } catch (Exception ex) { this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex)); } }
public CustomList <Acc_VoucherDet> GetAllAcc_VoucherDet(Int32 orgKey, string fromDate, string toDate, Int32 head) { return(Acc_VoucherDet.GetAllAcc_VoucherDet(orgKey, fromDate, toDate, head)); }
public CustomList <Acc_VoucherDet> GetAllAcc_VoucherDet(Int32 orgKey, Int32 isPost, string fromDate, string toDate) { return(Acc_VoucherDet.GetAllAcc_VoucherDet(orgKey, isPost, fromDate, toDate)); }
protected void btnSave_Click(object sender, EventArgs e) { try { CustomList <Acc_VoucherDet> empList = _manager.GetSOList(); //CustomList<Acc_VoucherDet> SOList = _manager.GetSOList(); CustomList <Acc_VoucherDet> VoucherList = new CustomList <Acc_VoucherDet>(); if (errorList.Count != 0) { this.ErrorMessage = "Please Upload Again!"; return; } errorList = new CustomList <ErrorList>(); Int64 freeSales = Hr_MasterSetup.GetAllHr_MasterSetup("FreeSales"); foreach (SalesUploadFromExcel vD in DailySoWiseSalesList) { ErrorList objErrorList = new ErrorList(); try { Acc_VoucherDet obj = empList.Find(f => f.EmpName.Trim() == vD.SOName.Trim()); objErrorList.EmpName = vD.SOName; long cOAKey = manager.GetExistingVoucher(txtVoucherDate_nc.Text.ToString(), Convert.ToInt64(freeSales), Convert.ToInt64(obj.UserKey)); CustomList <Acc_Voucher> lstAccVoucher = new CustomList <Acc_Voucher>(); if (lstAccVoucher.Count == 0) { Acc_Voucher newVoucher = new Acc_Voucher(); if (cOAKey != 0) { newVoucher.SetModified(); } lstAccVoucher.Add(newVoucher); } SetDataFromControlToObject(ref lstAccVoucher); Acc_VoucherDet createVoucher = new Acc_VoucherDet(); createVoucher.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("GrossSales"); createVoucher.UserKey = obj.UserKey; createVoucher.Dr = vD.Gross; createVoucher.EntryDate = DateTime.Now; createVoucher.EntryUserKey = CurrentUserSession.UserKey; createVoucher.Criteria = "Sales"; if (cOAKey != 0) { createVoucher.SetModified(); } VoucherList.Add(createVoucher); Acc_VoucherDet DistCommissionVoucher = new Acc_VoucherDet(); DistCommissionVoucher.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("Dist Commission"); DistCommissionVoucher.UserKey = obj.UserKey; DistCommissionVoucher.Cr = vD.DistributorCom; DistCommissionVoucher.EntryDate = DateTime.Now; DistCommissionVoucher.EntryUserKey = CurrentUserSession.UserKey; DistCommissionVoucher.Criteria = "Sales"; if (cOAKey != 0) { DistCommissionVoucher.SetModified(); } VoucherList.Add(DistCommissionVoucher); Acc_VoucherDet VATVoucher = new Acc_VoucherDet(); VATVoucher.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("VAT"); VATVoucher.UserKey = obj.UserKey; VATVoucher.Cr = vD.VAT; VATVoucher.EntryDate = DateTime.Now; VATVoucher.EntryUserKey = CurrentUserSession.UserKey; VATVoucher.Criteria = "Sales"; if (cOAKey != 0) { VATVoucher.SetModified(); } VoucherList.Add(VATVoucher); Acc_VoucherDet InventoryVoucher = new Acc_VoucherDet(); InventoryVoucher.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("Inventory"); InventoryVoucher.UserKey = obj.UserKey; InventoryVoucher.Cr = vD.Inventory; InventoryVoucher.EntryDate = DateTime.Now; InventoryVoucher.EntryUserKey = CurrentUserSession.UserKey; InventoryVoucher.Criteria = "Sales"; if (cOAKey != 0) { InventoryVoucher.SetModified(); } VoucherList.Add(InventoryVoucher); Acc_VoucherDet receivableToVoucher = new Acc_VoucherDet(); receivableToVoucher.COAKey = obj.COAKey; receivableToVoucher.UserKey = obj.UserKey; receivableToVoucher.Dr = vD.Cash; receivableToVoucher.EntryDate = DateTime.Now; receivableToVoucher.EntryUserKey = CurrentUserSession.UserKey; receivableToVoucher.Criteria = "Sales"; if (cOAKey != 0) { receivableToVoucher.SetModified(); } VoucherList.Add(receivableToVoucher); Acc_VoucherDet FreeSalesVoucher = new Acc_VoucherDet(); FreeSalesVoucher.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("FreeSales"); FreeSalesVoucher.UserKey = obj.UserKey; FreeSalesVoucher.Dr = vD.FreeSales; FreeSalesVoucher.EntryDate = DateTime.Now; FreeSalesVoucher.EntryUserKey = CurrentUserSession.UserKey; FreeSalesVoucher.Criteria = "Sales"; if (cOAKey != 0) { FreeSalesVoucher.SetModified(); } VoucherList.Add(FreeSalesVoucher); Acc_VoucherDet CommissionVoucher = new Acc_VoucherDet(); CommissionVoucher.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("Commission"); CommissionVoucher.UserKey = obj.UserKey; CommissionVoucher.Dr = vD.Commission; CommissionVoucher.EntryDate = DateTime.Now; CommissionVoucher.EntryUserKey = CurrentUserSession.UserKey; CommissionVoucher.Criteria = "Sales"; if (cOAKey != 0) { CommissionVoucher.SetModified(); } VoucherList.Add(CommissionVoucher); //by shantonu Acc_VoucherDet pdCommissionVoucher = new Acc_VoucherDet(); pdCommissionVoucher.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("PD Commission"); pdCommissionVoucher.UserKey = obj.UserKey; pdCommissionVoucher.Cr = vD.PDC; pdCommissionVoucher.EntryDate = DateTime.Now; pdCommissionVoucher.EntryUserKey = CurrentUserSession.UserKey; pdCommissionVoucher.Criteria = "Sales"; if (cOAKey != 0) { pdCommissionVoucher.SetModified(); } VoucherList.Add(pdCommissionVoucher); Acc_VoucherDet GrossVoucher = new Acc_VoucherDet(); GrossVoucher.COAKey = Hr_MasterSetup.GetAllHr_MasterSetup("GrossSales"); GrossVoucher.UserKey = obj.UserKey; GrossVoucher.Cr = vD.Gross; GrossVoucher.EntryDate = DateTime.Now; GrossVoucher.EntryUserKey = CurrentUserSession.UserKey; GrossVoucher.Criteria = "Sales"; if (cOAKey != 0) { GrossVoucher.SetModified(); } VoucherList.Add(GrossVoucher); string prifix = "JV"; manager.SavePFVoucher(ref lstAccVoucher, ref VoucherList, prifix); objErrorList.Error = "Upload Successfully."; errorList.Add(objErrorList); } catch (SqlException ex) { objErrorList.Error = ExceptionHelper.getSqlExceptionMessage(ex); errorList.Add(objErrorList); } catch (Exception ex) { objErrorList.Error = (ExceptionHelper.getExceptionMessage(ex)); errorList.Add(objErrorList); } // this.SuccessMessage = (StaticInfo.SavedSuccessfullyMsg + ". Voucher No: " + manager.VoucherID); } this.SuccessMessage = ("Sales Upload Compleated. Please See Log File."); } catch (SqlException ex) { this.ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex)); } catch (Exception ex) { this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex)); } }
public CustomList <Acc_VoucherDet> GetSOList() { return(Acc_VoucherDet.GetSOList()); }
public CustomList <Acc_VoucherDet> GetAllAcc_VoucherDet(Int64 voucherKey, string fromDate) { return(Acc_VoucherDet.GetAllAcc_VoucherDet(voucherKey, fromDate)); }
public CustomList <Acc_VoucherDet> GetAllAcc_VoucherDetBS(Int32 orgKey, string fromDate, string toDate, Int32 fYKey) { return(Acc_VoucherDet.GetAllAcc_VoucherDetBS(orgKey, fromDate, toDate, fYKey)); }
public void GetAllYearEndProcess(Int32 fYKey) { Acc_VoucherDet.GetAllYearEndProcess(fYKey); return; }