public ActionResult GetSaleOrderDetails(string paySN) { object footer = null; var list = SaleDetailService.GetSaleDetailsWithReturnFlag(paySN, ref footer); return(new JsonNetResult(new { rows = list, footer = footer })); }
public DateTime RefundAll(int reason, string paySn, decimal amount, string uid, string apicodes, string newOrderSn, string newCustomOrderSn, DateTime createdt) { var order = SaleOrdersService.CurrentRepository.Entities.FirstOrDefault(o => o.CompanyId == CompanyId && o.CustomOrderSn == paySn && o.StoreId == StoreId && o.State == 0); var newOrder = new SaleOrders() { StoreId = order.StoreId, //门店id MachineSN = order.MachineSN, //pos机号 PaySN = newOrderSn, //订单流水号 CustomOrderSn = newCustomOrderSn, //订单流水号 ReFundOrderCustomOrderSn = order.CustomOrderSn, //原订单流水号 TotalAmount = -order.TotalAmount, //优惠后金额 PreferentialPrice = order.PreferentialPrice, //优惠金额 ApiCode = apicodes, //支付方式 CreateUID = uid, //收银员工号 ReturnOrderUID = uid, ReturnDT = createdt, CreateDT = createdt, CompanyId = order.CompanyId, ProductCount = -order.ProductCount, Reason = reason, Type = 3, State = 1, MemberId = order.MemberId, ActivityId = order.ActivityId, Salesman = order.Salesman, Receive = -order.Receive, IsTest = IsSalesclerkTest, OrderDiscount = order.OrderDiscount, InInventory = 0, IsProcess = false }; var saleOrdersDetails = SaleDetailService.FindList(o => o.PaySN == order.PaySN).ToList(); foreach (var item in saleOrdersDetails) { SaleDetail _saleDetail = new SaleDetail() { PaySN = newOrderSn, ProductCode = item.ProductCode, AveragePrice = item.AveragePrice,//均价 CompanyId = CompanyId, Total = -item.Total, Barcode = item.Barcode, //商品条码 PurchaseNumber = -item.PurchaseNumber, //销售数量 BuyPrice = item.BuyPrice, //系统进价 SysPrice = item.SysPrice, //系统售价 ActualPrice = item.ActualPrice, //销售价 Title = item.Title, ScanBarcode = item.ScanBarcode, SalesClassifyId = item.SalesClassifyId,//销售分类id }; SaleDetailService.CurrentRepository.Add(_saleDetail, false); } SaleOrdersService.CurrentRepository.Add(newOrder); return(createdt); }
public ActionResult GetSaleDetailInput(string paySn, string barcode) { if (paySn.IsNullOrEmpty() || barcode.IsNullOrEmpty()) { return(new EmptyResult()); } var list = SaleDetailService.GetSaleDetailInput(paySn, barcode); return(ToDataGrid(list, 20)); }
private void Init() { _customer = new CustomerService(); _sale = new SaleService(); _saleDetail = new SaleDetailService(); _product = new ProductService(); _paymentMode = new PaymentModeService(); _tax = new TaxService(); _logger = new ErrorLogService(); }
private void Init() { _customer = new CustomerService(); _sale = new SaleService(); _saleDetail = new SaleDetailService(); _product = new ProductService(); _paymentMode = new PaymentModeService(); _tax = new TaxService(); _company = new CompanyService().GetAll().FirstOrDefault(); _logger = new ErrorLogService(); }
public ValueObject.DayReportResult DayMonthReport(DateTime from, DateTime to, Sale.Range range) { DayReportResult result = new DayReportResult(); result.Summary = new List <DayReportDetailItem>(); result.SalesmanRecords = new List <SalesmanDayReportResult>(); var machineParams = range == Range.Local ? MachineSN : ""; var users = SaleOrdersService.DayMonthReport(from, to, ref result, StoreId, machineParams, CompanyId, IsSalesclerkTest); SaleDetailService.DayMonthReport(from, to, ref result, StoreId, machineParams, CompanyId, IsSalesclerkTest, users); PosIncomePayoutService.DayMonthReport(from, to, ref result, StoreId, machineParams, CompanyId, IsSalesclerkTest); return(result); }
private void Init() { _customer = new CustomerService(); _sale = new SaleService(); _saleDetail = new SaleDetailService(); _product = new ProductService(); _paymentMode = new PaymentModeService(); _tax = new TaxService(); company = new GenericService <Company>().GetAll().FirstOrDefault(); _logger = new ErrorLogService(); SuscribeToEvent(); btnAddRow.Enabled = false; btnRemoveRow.Enabled = false; btnDone.Enabled = false; btnCancel.Enabled = false; btnSave.Enabled = false; }
public ActionResult GetConsumptionPayments(string paySN) { var list = SaleDetailService.GetConsumptionPayments(paySN); return(ToDataGrid(list, 0)); }