public DepositAndWithdrawals GetDepositAndWithdrawalDetails(Guid ID)
        {
            DepositAndWithdrawals depositAndWithdrawalsObj = new DepositAndWithdrawals();

            depositAndWithdrawalsObj = _depositAndWithdrawalsRepository.GetDepositAndWithdrawalDetails(ID);
            if (depositAndWithdrawalsObj != null)
            {
                depositAndWithdrawalsObj.AmountFormatted = _commonBusiness.ConvertCurrency(depositAndWithdrawalsObj.Amount, 2);
            }
            return(depositAndWithdrawalsObj);
        }
        public CustomerCreditNotes GetCustomerCreditNoteDetails(Guid ID)
        {
            CustomerCreditNotes custCreditNotesObj = new CustomerCreditNotes();

            custCreditNotesObj = _customerCreditNotesRepository.GetCustomerCreditNoteDetails(ID);
            if (custCreditNotesObj != null)
            {
                custCreditNotesObj.creditAmountFormatted   = _commonBusiness.ConvertCurrency(custCreditNotesObj.Amount, 2);
                custCreditNotesObj.adjustedAmountFormatted = _commonBusiness.ConvertCurrency(custCreditNotesObj.adjustedAmount, 2);
            }
            return(custCreditNotesObj);
        }
Esempio n. 3
0
        public ActionResult OutstandingSummary(OutstandingSummaryViewModel data)
        {
            CustomerInvoiceSummaryViewModel CustomerInvoiceSummary = Mapper.Map <CustomerInvoiceSummary, CustomerInvoiceSummaryViewModel>(_customerInvoiceBusiness.GetCustomerInvoicesSummaryForSA());
            SupplierInvoiceSummaryViewModel SupplierInvoiceSummary = Mapper.Map <SupplierInvoiceSummary, SupplierInvoiceSummaryViewModel>(_supplierInvoicesBusiness.GetSupplierInvoicesSummary(data.IsInternal));

            data.OutstandingInv = CustomerInvoiceSummary.OpenAmount + CustomerInvoiceSummary.OverdueAmount;
            data.OuttandingPay  = SupplierInvoiceSummary.OpenAmount + SupplierInvoiceSummary.OverdueAmount;

            data.OutstandingInvFormatted = _commonBusiness.ConvertCurrency(data.OutstandingInv, 2);
            data.OuttandingPayFormatted  = _commonBusiness.ConvertCurrency(data.OuttandingPay, 2);

            data.invCount = CustomerInvoiceSummary.OpenInvoices + CustomerInvoiceSummary.OverdueInvoices;
            data.payCount = SupplierInvoiceSummary.OpenInvoices + SupplierInvoiceSummary.OverdueInvoices;

            return(PartialView("_OutstandingSummary", data));
        }
        public SpecialInvPayments GetOutstandingSpecialAmountByCustomer(string ID)
        {
            SpecialInvPayments SpecialObj = _SpecialInvPaymentsRepository.GetOutstandingSpecialAmountByCustomer(ID);
            decimal            temp       = Decimal.Parse(SpecialObj.InvoiceOutstanding);

            SpecialObj.InvoiceOutstanding = _commonBusiness.ConvertCurrency(temp, 0);
            return(SpecialObj);
        }
Esempio n. 5
0
        public CustomerPayments GetOutstandingAmountByCustomer(string CustomerID)
        {
            CustomerPayments CustomerPayObj = _customerPaymentsRepository.GetOutstandingAmountByCustomer(CustomerID);
            decimal          temp           = Decimal.Parse(CustomerPayObj.OutstandingAmount);

            CustomerPayObj.OutstandingAmount = _commonBusiness.ConvertCurrency(temp, 0);
            return(CustomerPayObj);
        }
 public string GetAllDepositAndWithdrawals(string FromDate, string ToDate, string DepositOrWithdrawal, string chqclr)
 {
     try
     {
         List <DepositAndWithdrwalViewModel> depositAndWithdrwalsList = Mapper.Map <List <DepositAndWithdrawals>, List <DepositAndWithdrwalViewModel> >(_depositAndWithdrawalsBusiness.GetAllDepositAndWithdrawals(FromDate, ToDate, DepositOrWithdrawal, chqclr));
         var    totalWdl          = depositAndWithdrwalsList.Where(amt => amt.TransactionType == "W").Sum(amt => amt.Amount);
         var    totalDpt          = depositAndWithdrwalsList.Where(amt => amt.TransactionType == "D").Sum(amt => amt.Amount);
         string totalWdlFormatted = _commonBusiness.ConvertCurrency(totalWdl, 2);
         string totalDptFormatted = _commonBusiness.ConvertCurrency(totalDpt, 2);
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = depositAndWithdrwalsList, totalWdl = totalWdlFormatted, totalDpt = totalDptFormatted }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
        public SupplierPayments GetOutstandingAmountBySupplier(string SupplierID)
        {
            SupplierPayments PayObj = _supplierPaymentsRepository.GetOutstandingAmountBySupplier(SupplierID);
            decimal          temp   = Decimal.Parse(PayObj.OutstandingAmount);

            PayObj.OutstandingAmount = _commonBusiness.ConvertCurrency(temp, 0);
            return(PayObj);
        }
Esempio n. 8
0
        public OtherIncome GetOtherIncomeDetails(Guid ID)
        {
            OtherIncome otherIncomeObj = new OtherIncome();

            otherIncomeObj = _iOtherIncomeRepository.GetOtherIncomeDetails(ID);
            if (otherIncomeObj != null)
            {
                otherIncomeObj.creditAmountFormatted = _commonBusiness.ConvertCurrency(otherIncomeObj.Amount, 2);
            }
            return(otherIncomeObj);
        }
Esempio n. 9
0
 public string GetSupplierInvoiceDetails(string ID)
 {
     try
     {
         SupplierInvoicesViewModel SupplierInvoiceObj = Mapper.Map <SupplierInvoices, SupplierInvoicesViewModel>(_supplierInvoicesBusiness.GetSupplierInvoiceDetails(Guid.Parse(ID)));
         if (SupplierInvoiceObj != null)
         {
             SupplierInvoiceObj.AccountCode = SupplierInvoiceObj.AccountCode + ":" + SupplierInvoiceObj.IsEmp;
             SupplierInvoiceObj.TotalInvoiceAmountstring = _commonBusiness.ConvertCurrency(SupplierInvoiceObj.TotalInvoiceAmount, 0);
             SupplierInvoiceObj.BalanceDuestring         = _commonBusiness.ConvertCurrency(SupplierInvoiceObj.BalanceDue, 0);
             SupplierInvoiceObj.PaidAmountstring         = _commonBusiness.ConvertCurrency((SupplierInvoiceObj.TotalInvoiceAmount - SupplierInvoiceObj.BalanceDue), 0);
         }
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = SupplierInvoiceObj }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
Esempio n. 10
0
        public MonthlyRecap GetMonthlyRecap(MonthlyRecap data)
        {
            MonthlyRecap Result = _dashboardRepository.GetMonthlyRecap(data);

            if (Result != null)
            {
                foreach (MonthlyRecapItem m in Result.MonthlyRecapItemList)
                {
                    Result.TotalIncome  = Result.TotalIncome + m.INAmount;
                    Result.TotalExpense = Result.TotalExpense + m.ExAmount;
                }

                Result.TotalProfit = Result.TotalIncome - Result.TotalExpense;
                //decimal n = (Result.MonthlyRecapItemList[11].INAmount - Result.MonthlyRecapItemList[0].INAmount);
                //decimal d = Result.MonthlyRecapItemList[0].INAmount;
                //if (d == 0) { d = 1; }
                //Result.IncomePercentage = n /d * 100;

                //n = (Result.MonthlyRecapItemList[11].ExAmount - Result.MonthlyRecapItemList[0].ExAmount);
                //d = Result.MonthlyRecapItemList[0].ExAmount;
                //if (d == 0) { d = 1; }
                //Result.ExpensePercentage = n/ d * 100;

                //n = ((Result.MonthlyRecapItemList[11].INAmount - Result.MonthlyRecapItemList[11].ExAmount) - (Result.MonthlyRecapItemList[0].INAmount - Result.MonthlyRecapItemList[0].ExAmount));
                //d = (Result.MonthlyRecapItemList[0].INAmount - Result.MonthlyRecapItemList[0].ExAmount);
                //if (d == 0) { d = 1; }

                //Result.ProfitPercentage =  n/d  * 100;
                Result.Caption = Result.MonthlyRecapItemList[0].Period + "-" + Result.MonthlyRecapItemList[11].Period;

                Result.FormattedTotalIncome  = _commonBusiness.ConvertCurrency(Result.TotalIncome, 2);
                Result.FormattedTotalExpense = _commonBusiness.ConvertCurrency(Result.TotalExpense, 2);
                Result.FormattedTotalProfit  = _commonBusiness.ConvertCurrency(Result.TotalProfit, 2);
            }

            return(Result);
        }
 public string GetAllOtherIncome(string IncomeDate, string DefaultDate)
 {
     try
     {
         List <OtherIncomeViewModel> otherIncomeList = Mapper.Map <List <OtherIncome>, List <OtherIncomeViewModel> >(_otherIncomeBusiness.GetAllOtherIncome(IncomeDate, DefaultDate));
         var    totalAmt          = otherIncomeList.Sum(amt => amt.Amount);
         string totalAmtFormatted = _commonBusiness.ConvertCurrency(totalAmt, 2);
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = otherIncomeList, TotalAmt = totalAmtFormatted }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
Esempio n. 12
0
 public string GetBankWiseBalance(string Date)
 {
     try
     {
         List <OtherExpenseViewModel> otherExpenseList = Mapper.Map <List <OtherExpense>, List <OtherExpenseViewModel> >(_otherExpenseBusiness.GetBankWiseBalance(Date));
         string TotalAmountFormatted      = _commonBusiness.ConvertCurrency(otherExpenseList.Sum(OE => OE.TotalAmount), 2);
         string TotalUnClrAmtFormatted    = _commonBusiness.ConvertCurrency(otherExpenseList.Sum(OE => OE.UnClearedAmount), 2);
         string TotalUnderClrAmtFormatted = _commonBusiness.ConvertCurrency(otherExpenseList.Sum(OE => OE.UnderClearingAmount), 2);
         string ActualBlnceFormatted      = _commonBusiness.ConvertCurrency(otherExpenseList.Sum(OE => OE.TotalAmount) + otherExpenseList.Sum(OE => OE.UnClearedAmount), 2);
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = otherExpenseList, TotalAmount = TotalAmountFormatted, TotalUnClrAmt = TotalUnClrAmtFormatted, TotalUnderClrAmt = TotalUnderClrAmtFormatted, ActualBlnce = ActualBlnceFormatted }));
     }
     catch (Exception ex)
     {
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = ex.Message }));
     }
 }
Esempio n. 13
0
 public string GetCustomerInvoiceDetails(string ID)
 {
     try
     {
         CustomerInvoicesViewModel CustomerInvoiceObj = Mapper.Map <CustomerInvoice, CustomerInvoicesViewModel>(_customerInvoicesBusiness.GetCustomerInvoiceDetails(Guid.Parse(ID)));
         if (CustomerInvoiceObj != null)
         {
             CustomerInvoiceObj.TotalInvoiceAmountstring = _commonBusiness.ConvertCurrency(CustomerInvoiceObj.TotalInvoiceAmount, 0);
             CustomerInvoiceObj.BalanceDuestring         = _commonBusiness.ConvertCurrency(CustomerInvoiceObj.BalanceDue, 0);
             CustomerInvoiceObj.PaidAmountstring         = _commonBusiness.ConvertCurrency((CustomerInvoiceObj.TotalInvoiceAmount - CustomerInvoiceObj.BalanceDue), 0);
         }
         return(JsonConvert.SerializeObject(new { Result = "OK", Records = CustomerInvoiceObj }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = c.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
     }
 }
Esempio n. 14
0
 public CustomerInvoiceSummary GetCustomerInvoicesSummaryForSA()
 {
     try
     {
         CustomerInvoiceSummary result = new CustomerInvoiceSummary();
         result = _customerInvoicesRepository.GetCustomerInvoicesSummaryForSA();
         if (result != null)
         {
             result.OpenAmountFormatted    = _commonBusiness.ConvertCurrency(result.OpenAmount, 2);
             result.PaidAmountFormatted    = _commonBusiness.ConvertCurrency(result.PaidAmount, 2);
             result.OverdueAmountFormatted = _commonBusiness.ConvertCurrency(result.OverdueAmount, 2);
         }
         return(result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public OtherExpSummary GetOtherExpSummary(int month, int year, string Company)
        {
            OtherExpSummary result = _otherExpenseRepository.GetOtherExpSummary(month, year, Company);



            if (result != null)
            {
                int    r     = 150;
                int    g     = 120;
                int    b     = 80;
                string color = "rgba($r$,$g$,$b$,0.6)";
                foreach (OtherExpSummaryItem s in result.ItemsList)
                {
                    Random rnd = new Random();

                    s.color = color.Replace("$r$", r.ToString()).Replace("$g$", g.ToString()).Replace("$b$", b.ToString());
                    b       = b + 50;
                    g       = g + 30;
                    r       = r + g;
                    if (b > 250)
                    {
                        b = 0;
                    }
                    if (g > 250)
                    {
                        g = 0;
                    }
                    if (r > 250)
                    {
                        r = 0;
                    }


                    s.AmountFormatted = _commonBusiness.ConvertCurrency(s.Amount, 2);
                    result.Total      = result.Total + s.Amount;
                }

                result.TotalFormatted = _commonBusiness.ConvertCurrency(result.Total, 2);
                result.Month          = new DateTime(2010, month, 1).ToString("MMM") + " " + year;
            }
            return(result);
        }
Esempio n. 16
0
        public PurchaseDetailReport GetPurchaseDetails(DateTime?FromDate, DateTime?ToDate, string CompanyCode, string search, Boolean IsInternal, Guid Supplier, string InvoiceType, Guid SubType, string AccountCode)
        {
            PurchaseDetailReport        purchasedetailObj        = new PurchaseDetailReport();
            List <PurchaseDetailReport> purchaseDetailReportList = null;

            try
            {
                purchaseDetailReportList = _reportRepository.GetPurchaseDetails(FromDate, ToDate, CompanyCode, search, IsInternal, Supplier, InvoiceType, SubType, AccountCode);
                decimal purchaseDetailSum              = purchaseDetailReportList.Where(PD => PD.RowType != "T").Sum(PD => PD.BalanceDue);
                decimal purchaseDetailInvoiceAmount    = purchaseDetailReportList.Where(PS => PS.RowType != "T").Sum(PS => PS.InvoiceAmount);
                decimal purchaseDetailPaidAmount       = purchaseDetailReportList.Where(PS => PS.RowType != "T").Sum(PS => PS.PaidAmount);
                decimal purchaseDetailPaymentProcessed = purchaseDetailReportList.Where(PS => PS.RowType != "T").Sum(PS => PS.PaymentProcessed);
                decimal purchaseDetailsTax             = purchaseDetailReportList.Where(PS => PS.RowType != "T").Sum(PS => PS.Tax);
                decimal purchaseDetailTotal            = purchaseDetailReportList.Where(PS => PS.RowType != "T").Sum(PS => PS.TotalInvoice);
                purchasedetailObj.purchaseDetailSum            = _commonBusiness.ConvertCurrency(purchaseDetailSum, 2);
                purchasedetailObj.purchaseDetailPaid           = _commonBusiness.ConvertCurrency(purchaseDetailPaidAmount, 2);
                purchasedetailObj.purchaseDetailInvoice        = _commonBusiness.ConvertCurrency(purchaseDetailInvoiceAmount, 2);
                purchasedetailObj.purchaseDetailPaymentProcess = _commonBusiness.ConvertCurrency(purchaseDetailPaymentProcessed, 2);
                purchasedetailObj.purchaseDetailsTaxAmount     = _commonBusiness.ConvertCurrency(purchaseDetailsTax, 2);
                purchasedetailObj.purchaseDetailsTotalAmount   = _commonBusiness.ConvertCurrency(purchaseDetailTotal, 2);
                purchasedetailObj.purchaseDetailReportList     = purchaseDetailReportList;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(purchasedetailObj);
        }