Ejemplo n.º 1
0
        public async Task <Report> CompleteCashDraw(CompleteCashDraw completeCashDraw)
        {
            var response = await _seralizeManager.CompleteCashDraw(completeCashDraw);

            await _reportsBusinessLogic.SaveReport(response);

            return(response);
        }
Ejemplo n.º 2
0
        public async Task <FuelPrices> LoadPrices(bool grouped)
        {
            var result = await _fuelPumpSerializeManager.LoadPrices(grouped);

            if (result?.Report != null)
            {
                await _reportsBussinessLogic.SaveReport(result.Report);
            }
            return(result);
        }
Ejemplo n.º 3
0
        public async Task <SetPriceDecrement> SetPriceDecrement(PriceDecrement price, bool taxExempt)
        {
            var result = await _fuelPriceSerializeManager.SetPriceDecrement(price, taxExempt);

            if (result?.Report != null)
            {
                await _reportsBussinessLogic.SaveReport(result.Report);
            }
            return(result);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Voids the ongoing sale
        /// </summary>
        /// <param name="reason">Reason for voiding sale</param>
        /// <returns>Updated sale model</returns>
        public async Task <VoidSale> VoidSale(Reasons reason)
        {
            var response = await _serializeManager.VoidSale(reason);

            if (response.Receipt != null)
            {
                await _reportsBusinessLogic.SaveReport(response.Receipt);
            }

            return(response);
        }
Ejemplo n.º 5
0
        //TODO: Move this to Sale business logic
        /// <summary>
        /// Completes a Bottle Return Sale
        /// </summary>
        /// <param name="sale">Bottle Return Sale</param>
        /// <returns>True when sale is completed and False if not</returns>
        public async Task <BottleReturn> CompleteBottleReturnSale(BottleReturnSale sale)
        {
            var response = await _serializeManager.AddBottleReturnSale(sale);

            await _reportBussinessLogic.SaveReport(response.Receipt);

            return(response);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Closes the batch
        /// </summary>
        /// <returns>Success model</returns>
        public async Task <Report> CloseBatch()
        {
            var report = await _serializeManager.CloseBatch();

            await _reportsBusinessLogic.SaveReport(report);

            return(report);
        }
Ejemplo n.º 7
0
        public async Task <Report> GetDipInputReport()
        {
            var report = await _serializeManager.GetDipInputReport();

            await _reportsBusinessLogic.SaveReport(report);

            return(report);
        }
Ejemplo n.º 8
0
        public async Task <ExactChange> PayByExactChange()
        {
            var response = await _seralizemanager.PayByExactCash();

            await _reportBusinessLogic.SaveReport(response.Report);

            return(response);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Updates the tenders used in the Sale
        /// </summary>
        /// <param name="code">Code of the Tender</param>
        /// <param name="amount">Amount to be updated</param>
        /// <returns></returns>
        public async Task <TenderSummary> UpdateTender(string code, decimal?amount,
                                                       string transactionType, bool isAmountEnteredManually = false)
        {
            // null is to be send if amount value if 0
            //if (amount.HasValue)
            //{
            //    amount = null;
            //}
            var response = await _serializeManager.UpdateTender(code, amount, transactionType, isAmountEnteredManually);

            foreach (var report in response.Report)
            {
                await _reportsBusinessLogic.SaveReport(report);
            }

            return(response);
        }
Ejemplo n.º 10
0
        private async Task GetReportSales()
        {
            var timer = new Stopwatch();

            timer.Restart();

            try
            {
                var response = await _reprintBusinessLogic.GetReprintReportSale(_selectedReportType,
                                                                                SelectedDate.Date.ToString(CultureInfo.InvariantCulture));

                if (response.IsCloseBatchSale)
                {
                    IsSearchBoxVisible = false;
                    MapCloseBatchSale(response.CloseBatchSales);
                    ShowCloseBacthSale();
                    var report = new Report
                    {
                        ReportContent = ReportContent,
                        ReportName    = "CloseBatch.txt",
                        Copies        = 0
                    };

                    await _reportsBussinessLogic.SaveReport(report);
                }
                else if (response.IsPayAtPumpSale)
                {
                    IsSearchBoxVisible = true;
                    MapPayAtPumpSales(response.PayAtPumpSales);
                    ShowPayAtPumpSale();
                }
                else if (response.IsPayInsideSale)
                {
                    IsSearchBoxVisible = true;
                    MapPayInsideSales(response.PayInsideSales);
                    ShowPayInsideSale();
                }
                else if (response.IsPaymentSale)
                {
                    IsSearchBoxVisible = true;
                    MapPaymentSale(response.PaymentSales);
                    ShowPaymentSale();
                }
            }
            catch (Exception)
            {
                IsCloseBatchSaleVisible = false;
                IsPaymentSaleVisible    = false;
                IsPayAtPumpSaleVisible  = false;
                IsPayInsideSaleVisible  = false;
                throw;
            }
            finally
            {
                timer.Stop();
                Log.Info(string.Format("Time taken in getting report sales is {0}ms ", timer.ElapsedMilliseconds));
            }
        }
Ejemplo n.º 11
0
        public async Task <FinishTillClose> FinishTillClose(bool?readTankDip, bool?readTotalizer)
        {
            var response = await _serializeManager.FinishTillClose(readTankDip, readTotalizer);

            foreach (var report in response.Reports)
            {
                if (report.ReportName.Contains(ReportType.EodDetailsFile))
                {
                    await _reportsBusinessLogic.SaveReport(report);
                }
                else if (report.ReportName.Contains(ReportType.TillCloseFile))
                {
                    await _reportsBusinessLogic.SaveReport(report);
                }
            }

            return(response);
        }
Ejemplo n.º 12
0
        public async Task<List<Report>> GetReprintReport(string saleNumber, string saleDate, string reportType)
        {
            var response = await _reprintSerializeManager.GetReprintReport(saleNumber, saleDate, reportType);

            foreach(var report in response)
            {
                await _reportsBusinessLogic.SaveReport(report);
            }

            return response;
        }
Ejemplo n.º 13
0
        public async Task <CommonPaymentComplete> CompletePayout(List <Tax> taxes,
                                                                 string vendorCode, string amount, string reasonCode)
        {
            var response = await _seralizemanager.CompletePayout(taxes,
                                                                 string.IsNullOrEmpty(vendorCode)?string.Empty : vendorCode,
                                                                 string.IsNullOrEmpty(amount)?string.Empty : amount,
                                                                 string.IsNullOrEmpty(reasonCode)?string.Empty : reasonCode);

            await _reportBussinessLogic.SaveReport(response.Receipt);

            return(response);
        }
Ejemplo n.º 14
0
        public async Task <List <Report> > CloseBatch()
        {
            var reports = await _seralizeManager.CloseBatch();

            foreach (var report in reports)
            {
                if (report.ReportName.Contains(ReportType.EodDetailsFile))
                {
                    await _reportsBusinessLogic.SaveReport(report);
                }
            }
            return(reports);
        }