Exemplo n.º 1
0
        public static List <ReconcilationReport> GetReconcilation(string clientBin, string contractNumber, DateTime startDate, DateTime endDate)
        {
            List <ReconcilationReport> reconcilationReport = new List <ReconcilationReport>();

            RRSelection rRSelection = new RRSelection();

            rRSelection.ClientIIN = clientBin;
            //rRSelection.ContractName = contractNumber;
            //rRSelection.EndDate = endDate;
            //rRSelection.StartDate = startDate;

            var reconcilationReportRows = baseConn.getReconciliationReport(rRSelection);

            if (reconcilationReportRows != null)
            {
                foreach (var item in reconcilationReportRows)
                {
                    reconcilationReport.Add(new ReconcilationReport()
                    {
                        clientName  = item.Client,
                        contractNum = item.Contract,
                        credit      = (decimal)item.Credit,
                        debit       = (decimal)item.Debit,
                        docDate     = item.DocDate,
                        docName     = item.DocName,
                        currency    = item.Сurrency,
                    });
                }
                return(reconcilationReport);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        public static List <DebtorReport> GetDebtors(int baseType, DateTime startDate, DateTime endDate, string[] clientBins)
        {
            AppJournal.Write("1C Transport", "Get debtors", true);

            ChooseBaseType(baseType);

            RRSelection         rRSelection  = new RRSelection();
            List <DebtorReport> debtorReport = new List <DebtorReport>();

            rRSelection.StartDate = startDate;
            rRSelection.EndDate   = endDate;

            foreach (var item in clientBins)
            {
                rRSelection.ClientIIN = item;

                var reconcilationReportRows = baseConn.getDebitorsReport(rRSelection);

                if (reconcilationReportRows != null)
                {
                    foreach (var subItem in reconcilationReportRows)
                    {
                        if (subItem.Credit != subItem.Debit)
                        {
                            debtorReport.Add(new DebtorReport()
                            {
                                clientBIN  = subItem.Client,
                                credit     = Convert.ToDecimal(subItem.Credit) > Convert.ToDecimal(subItem.Debit) ? Convert.ToDecimal(subItem.Credit) - Convert.ToDecimal(subItem.Debit) : 0,
                                debit      = Convert.ToDecimal(subItem.Debit) > Convert.ToDecimal(subItem.Credit) ? Convert.ToDecimal(subItem.Debit) - Convert.ToDecimal(subItem.Credit) : 0,
                                result     = Convert.ToDecimal(subItem.Debit) - Convert.ToDecimal(subItem.Credit),
                                brokerName = baseType == 1 ? "ТОО Альта и К" : baseType == 2 ? "Корунд-777" : "Ак Алтын Ко",
                                balance    = (Convert.ToDecimal(subItem.Debit) - Convert.ToDecimal(subItem.Credit)) > 0 ? true : false
                            });
                        }
                    }
                }
            }

            return(debtorReport);
        }