public void cancelarCambio(string sucursal, string folio) { var request = new Common.Entities.CancelSaleRequest { Sucursal = sucursal, Folio = folio }; _process.CancelSale(request, 0); var ctx = new SirCoPVDataContext(); var pagos = ctx.PagosDetalle.Where(i => i.sucursal == sucursal && i.pago == folio && i.idformapago == (int)Common.Constants.FormaPago.DV); foreach (var item in pagos) { var suc = item.referencia.Substring(0, 2); var fol = item.referencia.Substring(2); var dev = ctx.Devoluciones.Where(i => i.sucursal == suc && i.devolvta == fol).Single(); _process.CancelReturn(dev.sucursal, dev.devolvta, 0); } }
public Response CancelSale(CancelSaleRequest item) { var uid = this.GetUserId(); return(this.Reply(() => _process.CancelSale(item, uid))); }
//[ExpectedException(typeof(NotSupportedException))] public void CancelSaleTest() { var request = new Common.Entities.CancelSaleRequest { Sucursal = "01", Folio = "414628" }; var now = DateTime.Parse("2018-06-16"); Shim shim = Shim.Replace(() => DateTime.UtcNow).With(() => now.ToUniversalTime()); using (ShimsContext.Create()) //PoseContext.Isolate(() => { System.Fakes.ShimDateTime.UtcNowGet = () => now.ToUniversalTime(); _context.CancelSale(request, 0); } //, shim); }