public async Task TestCustomerCashPayment2() { int customerId = 2; GeneralLedgerView ledgerView = new GeneralLedgerView(); CustomerModule custMod = new CustomerModule(); long? addressId = await custMod.AddressBook.Query().GetAddressIdByCustomerId(customerId); ChartOfAccountModule coaMod = new ChartOfAccountModule(); ChartOfAccount coa = await coaMod.ChartOfAccount.Query().GetEntity("1000", "1200", "101", ""); ledgerView.GeneralLedgerId = -1; ledgerView.DocNumber = 1; ledgerView.DocType = "PV"; ledgerView.Amount = 250M; ledgerView.LedgerType = "AA"; ledgerView.GLDate = DateTime.Parse("8/10/2018"); ledgerView.AccountId = coa.AccountId; ledgerView.CreatedDate = DateTime.Parse("8/10/2018"); ledgerView.AddressId = addressId ?? 0; ledgerView.Comment = "First installment payment for dashboard"; ledgerView.DebitAmount = 250; ledgerView.CreditAmount = 0; ledgerView.FiscalPeriod = 8; ledgerView.FiscalYear = 2018; ledgerView.CheckNumber = "112"; AccountReceivableModule acctRecMod = new AccountReceivableModule(); bool result = await acctRecMod.CreateCustomerLedger(ledgerView); Assert.True(result); }
public List <ChartOfAccount> ChartOfAccountsTreee(List <AccountGroup> groups, AccountGroup group, int level, int si, List <ChartOfAccount> ress) { var subHead = groups.Where(a => a.GroupUnder == group.Id).ToList(); if (subHead.Any()) { foreach (AccountGroup item in subHead) { var charOfAccount = new ChartOfAccount(); charOfAccount.level = level + 1; charOfAccount.parent = item.Id; charOfAccount.expanded = true; charOfAccount.isLeaf = false; charOfAccount.SI = si; charOfAccount.Particular = item.AccountGroupName; charOfAccount.ParentName = item.AccountGroupName; charOfAccount.Id = item.Id; charOfAccount.DrOrCr = item.Nature; ress.Add(charOfAccount); chartOfAccounts(item, ress, si, level + 1); ChartOfAccountsTreee(groups, item, level + 1, si, ress); si++; } } else { chartOfAccounts(group, ress, si, level + 1); } return(ress); }
public string insertChartOfAccount(ChartOfAccount chartOfAccount) { String result; result = AllRecord("I", chartOfAccount); return(result); }
public WorkSheetUI() { InitializeComponent(); loChartOfAccount = new ChartOfAccount(); loJournalEntryDetail = new JournalEntryDetail(); loWorkSheetRpt = new WorkSheetRpt(); //Datatables WorkSheetTable = new DataTable(); WorkSheetTable.Columns.Add("AccountCode", typeof(string)); WorkSheetTable.Columns.Add("AccountTitle", typeof(string)); WorkSheetTable.Columns.Add("BegBalDebit", typeof(decimal)); WorkSheetTable.Columns.Add("BegBalCredit", typeof(decimal)); WorkSheetTable.Columns.Add("TrialBalanceDebit", typeof(decimal)); WorkSheetTable.Columns.Add("TrialBalanceCredit", typeof(decimal)); WorkSheetTable.Columns.Add("AdjustmentDebit", typeof(decimal)); WorkSheetTable.Columns.Add("AdjustmentCredit", typeof(decimal)); WorkSheetTable.Columns.Add("AdjustedTrialBalanceDebit", typeof(decimal)); WorkSheetTable.Columns.Add("AdjustedTrialBalanceCredit", typeof(decimal)); WorkSheetTable.Columns.Add("BalanceSheetDebit", typeof(decimal)); WorkSheetTable.Columns.Add("BalanceSheetCredit", typeof(decimal)); WorkSheetTable.Columns.Add("IncomeStatementDebit", typeof(decimal)); WorkSheetTable.Columns.Add("IncomeStatementCredit", typeof(decimal)); WorkSheetTable.Columns.Add("ClosingEntryDebit", typeof(decimal)); WorkSheetTable.Columns.Add("ClosingEntryCredit", typeof(decimal)); WorkSheetTable.Columns.Add("PostClosingDebit", typeof(decimal)); WorkSheetTable.Columns.Add("PostClosingCredit", typeof(decimal)); }
public string updateChartOfAccount(ChartOfAccount chartOfAccount) { String result; result = AllRecord("U", chartOfAccount); return(result); }
public override async Task <ProjectManagementTaskView> MapToView(ProjectManagementTask inputObject) { Mapper mapper = new Mapper(); ProjectManagementTaskView outObject = mapper.Map <ProjectManagementTaskView>(inputObject); ProjectManagementProject project = await _unitOfWork.projectManagementProjectRepository.GetEntityById(inputObject.ProjectId); ProjectManagementMilestone milestone = await _unitOfWork.projectManagementMilestoneRepository.GetEntityById(1); Udc udc = await _unitOfWork.udcRepository.GetEntityById(21); ProjectManagementWorkOrder workOrder = await _unitOfWork.projectManagementWorkOrderRepository.GetEntityById(7); ChartOfAccount account = await _unitOfWork.chartOfAccountRepository.GetEntityById(4); FluentProjectManagementWorkOrderToEmployee WorkToEmployee = new FluentProjectManagementWorkOrderToEmployee(_unitOfWork); IList <ProjectManagementWorkOrderToEmployeeView> views = await WorkToEmployee.Query().GetViewsByWorkOrderId(workOrder.WorkOrderId); outObject.ProjectName = project.ProjectName; outObject.Status = udc.Value; outObject.Instructions = workOrder.Instructions; outObject.Account = account.Account; outObject.WorkOrderToEmployeeViews = views; return(outObject); }
public ActionResult InsertChartOfAccountInfo(ChartOfAccount chart) { //var list = _dalCompany.AddCompany(company); var response = new DBResponse(); try { var job = _dalChartOfAccount.InsertChartOfAccount(chart); if (job.FirstOrDefault().Id > 0) { response.Id = job.FirstOrDefault().Id; response.StatusCode = "200"; response.StatusMessage = "Data Insert Successfully"; } else { response.Id = -1; response.StatusCode = "501"; response.StatusMessage = job.FirstOrDefault().StatusMessage; } } catch (Exception ex) { response.Id = -1; response.StatusCode = "500"; response.StatusMessage = ex.Message.ToString(); } var camelCaseFormatter = new JsonSerializerSettings(); camelCaseFormatter.ContractResolver = new CamelCasePropertyNamesContractResolver(); return(Json(JsonConvert.SerializeObject(response, camelCaseFormatter), JsonRequestBehavior.AllowGet)); }
public FinancialYearOpeningUI() { InitializeComponent(); loChartOfAccount = new ChartOfAccount(); loJournalEntry = new JournalEntry(); loJournalEntryDetail = new JournalEntryDetail(); }
internal static ChartOfAccountList getChartOfAccountList(HttpResponseMessage responce) { var chartOfAccountList = new ChartOfAccountList(); var jsonObj = JsonConvert.DeserializeObject <Dictionary <string, object> >(responce.Content.ReadAsStringAsync().Result); if (jsonObj.ContainsKey("chartofaccounts")) { var chartOfAccountsArray = JsonConvert.DeserializeObject <List <object> >(jsonObj["chartofaccounts"].ToString()); foreach (var chartOfAccountObj in chartOfAccountsArray) { var chartOfAccount = new ChartOfAccount(); chartOfAccount = JsonConvert.DeserializeObject <ChartOfAccount>(chartOfAccountObj.ToString()); chartOfAccountList.Add(chartOfAccount); } } if (jsonObj.ContainsKey("page_context")) { var pageContext = new PageContext(); pageContext = JsonConvert.DeserializeObject <PageContext>(jsonObj["page_context"].ToString()); chartOfAccountList.page_context = pageContext; } return(chartOfAccountList); }
public async Task ProcessAccount(string json) { try { ChartOfAccount chartOfAcct = JsonConvert.DeserializeObject <ChartOfAccount>(json); Company company = await unitOfWork.companyRepository.GetEntityById(chartOfAcct.CompanyId); //chartOfAcct.Company = company; ChartOfAccountView view = await MapToView(chartOfAcct); IList <ChartOfAccount> list = await unitOfWork.chartOfAccountRepository.GetEntitiesByAccount(company.CompanyCode, view.BusUnit, view.ObjectNumber, view.Subsidiary); if (list.Count == 0) { AddChartOfAccount(chartOfAcct); } else { //foreach (var item in query) for (int i = 0; i < list.Count; i++) { var item = list[i]; UpdateChartOfAccount(item); } } } catch (Exception ex) { throw new Exception(GetMyMethodName(), ex); } }
public async Task <bool> CreateIncome(GeneralLedgerView glView) { try { //ChartOfAccts coa = await unitOfWork.generalLedgerRepository.GetChartofAccount("1000", "1200", "300", ""); ChartOfAccount coa = await ChartOfAccounts.Query().GetEntity("1000", "1200", "300", ""); //Udc udcLedgerType = await unitOfWork.generalLedgerRepository.GetUdc("GENERALLEDGERTYPE", "AA"); Udc udcLedgerType = await UDC.Query().GetUdc("GENERALLEDGERTYPE", "AA"); Udc udcDocType = await UDC.Query().GetUdc("DOCTYPE", "PV"); //Udc udcDocType = await unitOfWork.generalLedgerRepository.GetUdc("DOCTYPE","PV"); //AddressBook addressBook = await unitOfWork.addressBookRepository.GetAddressBookByAddressId(addressId); AddressBook addressBook = await AddressBook.Query().GetEntityById(glView.AddressId); glView.DocType = udcDocType.KeyCode; glView.AccountId = coa.AccountId; glView.LedgerType = udcLedgerType.KeyCode; glView.CreatedDate = DateTime.Now; glView.AddressId = addressBook.AddressId; glView.FiscalPeriod = glView.GLDate.Month; glView.FiscalYear = glView.GLDate.Year; glView.DebitAmount = glView.Amount; glView.CreditAmount = 0; GeneralLedgerView glLookup = null; if (String.IsNullOrEmpty(glView.CheckNumber) == false) { glLookup = await GeneralLedger.Query().GetLedgerViewByExpression( e => e.AccountId == glView.AccountId && e.AddressId == glView.AddressId && e.Amount == glView.Amount && e.CheckNumber == glView.CheckNumber && e.DocType == glView.DocType && e.Gldate == glView.GLDate ); } if (glLookup == null) { //create income GeneralLedger.CreateGeneralLedgerByView(glView).Apply(); GeneralLedger.UpdateAccountBalances(glView); GeneralLedgerView glViewLookup = await GeneralLedger.Query().GetViewByDocNumber(glView.DocNumber, glView.DocType); return(glViewLookup != null); } else { glView.DocNumber = glLookup.DocNumber; } return(true); } catch (Exception ex) { throw new Exception("CreateCash", ex); } }
public TrialBalanceUI() { InitializeComponent(); loChartOfAccount = new ChartOfAccount(); loJournalEntryDetail = new JournalEntryDetail(); loTrialBalanceRpt = new TrialBalanceRpt(); }
public List <ChartOfAccount> ChartOfAccounts() { List <ChartOfAccount> ress = new List <ChartOfAccount>(); var accountGroupss = groupService.GetAll().ToList(); var primaryAccounts = accountGroupss.Where(a => a.GroupUnder == 0); var si = 1; int level = 0; foreach (AccountGroup item in primaryAccounts) { var charOfAccount = new ChartOfAccount(); charOfAccount.level = level; charOfAccount.parent = 0; charOfAccount.expanded = true; charOfAccount.isLeaf = false; charOfAccount.SI = si; charOfAccount.Particular = item.AccountGroupName; charOfAccount.Id = item.Id; charOfAccount.DrOrCr = item.Nature; ress.Add(charOfAccount); ChartOfAccountsTreee(accountGroupss, item, level, si, ress); si++; } return(ress); }
public BalanceSheetUI() { InitializeComponent(); loChartOfAccount = new ChartOfAccount(); loJournalEntryDetail = new JournalEntryDetail(); loBalanceSheetRpt = new BalanceSheetRpt(); ldtAssetSubClassification = new DataTable(); ldtAssetMainAccount = new DataTable(); loReportViewer = new ReportViewerUI(); lTotalLiability = 0; lTotalEquity = 0; //Datatables AssetTable = new DataTable(); AssetTable.Columns.Add("SubClass", typeof(string)); AssetTable.Columns.Add("MainAccount", typeof(string)); AssetTable.Columns.Add("Total", typeof(decimal)); LiabilityTable = new DataTable(); LiabilityTable.Columns.Add("SubClass", typeof(string)); LiabilityTable.Columns.Add("MainAccount", typeof(string)); LiabilityTable.Columns.Add("Total", typeof(decimal)); EquityTable = new DataTable(); EquityTable.Columns.Add("SubClass", typeof(string)); EquityTable.Columns.Add("MainAccount", typeof(string)); EquityTable.Columns.Add("Total", typeof(decimal)); }
private async Task <ChartOfAccountView> MapToView(ChartOfAccount inputObject) { Mapper mapper = new Mapper(); ChartOfAccountView outObject = mapper.Map <ChartOfAccountView>(inputObject); await Task.Yield(); return(outObject); }
public GeneralLedgerUI() { InitializeComponent(); loJournalEntryDetail = new JournalEntryDetail(); loChartOfAccount = new ChartOfAccount(); ldtJournalEntryDetail = new DataTable(); loGeneralLedgerRpt = new GeneralLedgerRpt(); }
/// <summary> /// Creates an account with the given account type. /// </summary> /// <param name="new_account_info"> /// The new_account_info is the ChartOfAccount object which contains the specified /// information to create an account with account_type as mandatory parameter. /// </param> /// <returns>ChartOfAccount object.</returns> public ChartOfAccount Create(ChartOfAccount new_account_info) { var url = baseAddress; var json = JsonConvert.SerializeObject(new_account_info); var jsonstring = new Dictionary<object, object>(); jsonstring.Add("JSONString", json); var responce = ZohoHttpClient.post(url, getQueryParameters(jsonstring)); return ChartofaccountParser.getChartOfAccount(responce); }
public bool ChartOfAccountDelete(ChartOfAccount chart_of_account) { return(ExecuteFaultHandledOperation(() => { var chart_of_accounts_data = _chart_of_accounts_es.Map(chart_of_account); _chart_of_accounts_repo.Delete(chart_of_accounts_data); return true; })); }
public async Task TestTaskToProjectRollup() { ProjectManagementModule pmMod = new ProjectManagementModule(); ProjectManagementProject project = await pmMod.Project.Query().GetEntityById(1); ProjectManagementMilestone milestone = await pmMod.Milestone.Query().GetEntityById(1); Udc udc = await pmMod.Udc.Query().GetEntityById(21); ChartOfAccount account = await pmMod.ChartOfAccount.Query().GetEntityById(4); ProjectManagementTaskView view = new ProjectManagementTaskView() { Wbs = "1.3", TaskName = "test rollup", Description = "task to project rollup", EstimatedStartDate = DateTime.Parse("12/1/2019"), EstimatedHours = 1, EstimatedEndDate = DateTime.Parse("12/31/2019"), ActualStartDate = DateTime.Parse("12/23/2019"), ActualHours = 1, ActualEndDate = DateTime.Parse("12/23/2020"), Cost = 31, MileStoneId = milestone.MilestoneId, MilestoneName = milestone.MilestoneName, StatusXrefId = udc.XrefId, EstimatedCost = 29, ActualDays = 1, EstimatedDays = 1, ProjectId = project.ProjectId, AccountId = account.AccountId, Account = account.Account, ProjectName = project.ProjectName, }; NextNumber nnNextNumber = await pmMod.ProjectManagementTask.Query().GetNextNumber(); view.TaskNumber = nnNextNumber.NextNumberValue; ProjectManagementTask projectManagementTask = await pmMod.ProjectManagementTask.Query().MapToEntity(view); pmMod.ProjectManagementTask.AddProjectManagementTask(projectManagementTask).Apply(); RollupTaskToProjectView rollup = await pmMod.Project.Query().GetTaskToProjectRollupViewById(milestone.MilestoneId); ProjectManagementTask newProjectManagementTask = await pmMod.ProjectManagementTask.Query().GetEntityByNumber(view.TaskNumber); if (rollup.Cost < 3000) { Assert.True(false); } pmMod.ProjectManagementTask.DeleteProjectManagementTask(newProjectManagementTask).Apply(); }
public HttpResponseMessage UpdateChartOfAccount(HttpRequestMessage request, [FromBody] ChartOfAccount chartOfAccountModel) { return(GetHttpResponse(request, () => { var chartOfAccount = _CoreService.UpdateChartOfAccount(chartOfAccountModel); return request.CreateResponse <ChartOfAccount>(HttpStatusCode.OK, chartOfAccount); })); }
private void AddChartOfAccount() { ChartOfAccount coa_to_add = new ChartOfAccount() { CompanyKey = CurrentCompanyKey }; ChangeChartOfAccount(coa_to_add, ApplicationStrings.NotificationAdd); }
public SystemConfigurationUI() { InitializeComponent(); lSystemConfigHash = new Hashtable(); loSystemConfiguration = new SystemConfiguration(); loCryptorEngine = new CryptorEngine(); loLocation = new Location(); loChartOfAccount = new ChartOfAccount(); }
public SubsidiaryLedgerUI() { InitializeComponent(); loJournalEntryDetail = new JournalEntryDetail(); loChartOfAccount = new ChartOfAccount(); ldtJournalEntryDetail = new DataTable(); loSubsidiaryLedgerRpt = new SubsidiaryLedgerRpt(); loReportViewer = new ReportViewerUI(); }
public LookUpAccountUI() { InitializeComponent(); loChartOfAccount = new ChartOfAccount(); loMainAccount = new MainAccount(); loClassification = new Classification(); loSubClassification = new SubClassification(); lFromSelection = false; }
public async Task TestAddUpdatDelete() { BudgetModule BudgetMod = new BudgetModule(); ChartOfAccount chartOfAccount = await BudgetMod.ChartOfAccount.Query().GetEntityById(42); BudgetRange budgetRange = await BudgetMod.BudgetRange.Query().GetEntityById(1); BudgetView view = new BudgetView() { BudgetAmount = 5216M, ActualHours = 0M, ActualAmount = 768M, AccountId = chartOfAccount.AccountId, RangeId = budgetRange.RangeId, ProjectedAmount = 9600, ProjectedHours = 0, ActualsAsOfDate = DateTime.Parse("12/9/2019"), AccountDescription = chartOfAccount.Description, CompanyCode = chartOfAccount.CompanyCode, BusUnit = chartOfAccount.BusUnit, ObjectNumber = chartOfAccount.ObjectNumber, Subsidiary = chartOfAccount.Subsidiary, RangeIsActive = budgetRange.IsActive, RangeStartDate = budgetRange.StartDate, RangeEndDate = budgetRange.EndDate, SupervisorCode = budgetRange.SupervisorCode }; NextNumber nnNextNumber = await BudgetMod.Budget.Query().GetNextNumber(); view.BudgetNumber = nnNextNumber.NextNumberValue; Budget budget = await BudgetMod.Budget.Query().MapToEntity(view); BudgetMod.Budget.AddBudget(budget).Apply(); Budget newBudget = await BudgetMod.Budget.Query().GetEntityByNumber(view.BudgetNumber); Assert.NotNull(newBudget); newBudget.BudgetAmount = 100M; BudgetMod.Budget.UpdateBudget(newBudget).Apply(); BudgetView updateView = await BudgetMod.Budget.Query().GetViewById(newBudget.BudgetId); if (updateView.BudgetAmount == 100M) { Assert.True(true); } BudgetMod.Budget.DeleteBudget(newBudget).Apply(); Budget lookupBudget = await BudgetMod.Budget.Query().GetEntityById(view.BudgetId); Assert.Null(lookupBudget); }
public ActionResult Create([Bind(Include = "AccountNumber,AccountDescription,NormalSide,Category,Subcategory,InitialBalance,Debit,Credit,DateCreated,Balance,UserID,Orders,Statements,Comment,AccountName")] ChartOfAccount chartOfAccount) { Boolean nameExists = false; Boolean numExists = false; if (ModelState.IsValid) { foreach (ChartOfAccount c in db.ChartOfAccounts) { if (c.AccountName != chartOfAccount.AccountName) { continue; } else { nameExists = true; break; } } foreach (ChartOfAccount c in db.ChartOfAccounts) { if (c.AccountNumber != chartOfAccount.AccountNumber) { continue; } else { numExists = true; break; } } if (!nameExists && !numExists) { db.ChartOfAccounts.Add(chartOfAccount); db.SaveChanges(); return(RedirectToAction("Index")); } if (nameExists && !numExists) { ModelState.AddModelError("AccountName", "An account with this name already exists"); } if (!nameExists && numExists) { ModelState.AddModelError("AccountNumber", "An account with this number already exists"); } if (nameExists && numExists) { ModelState.AddModelError("AccountName", "An account with this name already exists"); ModelState.AddModelError("AccountNumber", "An account with this number already exists"); } } return(View(chartOfAccount)); }
public HomePageModel() { /* Dummy seed */ ChartOfAccount coa = ChartOfAccount.GetFirst(); if (coa != null) { AccountName = coa.AccountName; } }
public static ChartOfAccount GetAccountType(string accountCode) { ChartOfAccount chartOfAccount = new ChartOfAccount(); chartOfAccount.AccountCode = accountCode; chartOfAccount.BranchID = Utility.SsnBranch; var accountType = new POSAccount.BusinessFactory.ChartOfAccountBO().GetChartOfAccount(chartOfAccount); return(accountType); }
private void EditChartOfAccount() { var coa_to_edit = COASelectedItem as ChartOfAccountWrapper; if (coa_to_edit != null) { ChartOfAccount coa_copy = coa_to_edit.Model.Copy(); ChangeChartOfAccount(coa_copy, ApplicationStrings.NotificationEdit); } }
public void Delete(ChartOfAccount ObjToSave) { var ObjToDelete = _context.ChartOfAccounts.FirstOrDefault(m => m.AccountNumber == ObjToSave.AccountNumber && m.CompanyID == ObjToSave.CompanyID); if (ObjToDelete != null) { _context.ChartOfAccounts.Remove(ObjToDelete); } }
protected ChartOfAccount GetObject(DataRow dr) { ChartOfAccount objChartOfAccount = new ChartOfAccount(); objChartOfAccount.CoaId = (dr["CoaId"] == DBNull.Value) ? 0 : (Int32)dr["CoaId"]; objChartOfAccount.CoaType = (dr["CoaType"] == DBNull.Value) ? "" : (String)dr["CoaType"]; objChartOfAccount.CoaGroupId = (dr["CoaGroupId"] == DBNull.Value) ? 0 : (Int32)dr["CoaGroupId"]; objChartOfAccount.CoaCode = (dr["CoaCode"] == DBNull.Value) ? "" : (String)dr["CoaCode"]; objChartOfAccount.CoaTitle = (dr["CoaTitle"] == DBNull.Value) ? "" : (String)dr["CoaTitle"]; objChartOfAccount.ParentId = (dr["ParentId"] == DBNull.Value) ? 0 : (Int32)dr["ParentId"]; objChartOfAccount.IsActive = (dr["IsActive"] == DBNull.Value) ? false : (Boolean)dr["IsActive"]; objChartOfAccount.UpdateBy = (dr["UpdateBy"] == DBNull.Value) ? 0 : (Int32)dr["UpdateBy"]; objChartOfAccount.UpdateDate = (dr["UpdateDate"] == DBNull.Value) ? DateTime.MinValue : (DateTime)dr["UpdateDate"]; objChartOfAccount.CompanyId = (dr["CompanyId"] == DBNull.Value) ? 0 : (Int32)dr["CompanyId"]; return objChartOfAccount; }