public PedidoDet(stocks stock, PedidoCab cabecera, int item) { List <artasoc> artasoc; using (GestionEntities bd = new GestionEntities()) artasoc = bd.artasoc.Where(a => a.codpro == stock.codpro && a.componen == stock.asociado).ToList(); if (artasoc.Count == 0) { this.canasoc = 0; } else { this.canasoc = Convert.ToInt32(artasoc.First().cantid *stock.cantidad); } this.cabeceraid = cabecera.id; this.item = Convert.ToInt16(item); this.articulo = stock.codpro; this.descri = stock.descri; this.cantidad = stock.cantidad; this.parafecha = stock.parafecha; this.pendientes = stock.cantidad; this.preparado = 0; this.precio = stock.precioVenta; this.precorig = 0;//rrrrrrrrrrrr this.bonif = stock.bonif; this.bonif1 = stock.bonif1; this.total = (this.precio * this.cantidad) + impint - this.precio * this.cantidad * stock.bonif / 100 - this.precio * this.cantidad * stock.bonif1 / 100; this.impint = stock.impint; this.orden = 0;//aaaaaaaaaaa this.marca = stock.marca; this.rubro = stock.rubro; this.nropro = stock.proveed; this.asociado = stock.asociado; this.detalle = stock.detalle;//aaaaa this.precioesp = 0; this.envase = stock.envase; this.unimed = stock.unimed; this.moneda = cabecera.monfac; this.ivaporc1 = Convert.ToDecimal(stock.iva); this.ivaporc2 = 0; this.deta = ""; this.listo = false; this.codorigi = ""; this.uxbulto = stock.uxbulto; this.costoest = 0; this.bajostk = false; this.impiva1 = stock.getIvaIGeneral(ControladorTotales.getCTotales().getIvaTasaGral()); this.impiva2 = stock.getIvaIDif(ControladorTotales.getCTotales().getIvaTasaGral()); }
public presupd(stocks stock, presupc cabecera, int numerador) { var m = new MiProvee(); try { int id; List <artasoc> artasoc; decimal cotInicio; using (GestionEntities bd = new GestionEntities()) { cotInicio = bd.monedas.Single(a => a.codigo == stock.moneda).ncotiza; this.cotizacion = bd.monedas.Single(a => a.codigo == cabecera.monfac).ncotiza;//configen.GetConfigen().GnCotizaCl;//arregalar artasoc = bd.artasoc.Where(a => a.codpro == stock.codpro && a.componen == stock.asociado).ToList(); if (bd.presupd.Count() > 0) { id = bd.presupd.ToArray().Last().id; } else { id = 0; } if (artasoc.Count == 0) { this.canasoc = 0; } else { this.canasoc = artasoc.First().cantid *stock.cantidad; } } this.id = id; this.cabeceraid = cabecera.id; this.fecha = DateTime.Now; this.hora = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); this.tipodoc = cabecera.tipodoc; this.letra = cabecera.letra; this.punto = cabecera.punto; this.numero = cabecera.numero; this.remito = cabecera.remito; this.codpro = stock.codpro; this.descri = stock.descri; this.cant = stock.cantidad; this.precio = stock.precioVenta; this.bonif = stock.bonif; this.bonif1 = stock.bonif1; this.prexcant = (this.precio * this.cant) - this.precio * this.cant * stock.bonif / 100 - this.precio * this.cant * stock.bonif1 / 100; this.ivartins = stock.getIvaIGeneral(ControladorTotales.getCTotales().getIvaTasaGral()); this.ivartinoi = stock.getIvaIDif(ControladorTotales.getCTotales().getIvaTasaGral()); this.bonito = stock.getBonifTotal(); this.nrocli = cabecera.nrocli; this.asociado = stock.asociado; this.cantenv = stock.cantenv; this.pedido = 0; //arregalar this.despacho = ""; //arregalar this.envase = stock.simboloEnvase; //arregalar; this.unimed = stock.unimed.ToString(); //arregalar this.pins = 21; //arregalar this.pnoi = 0; //arregalar this.deta = ""; //arregalar this.aprobados = 0; //arregalar this.detalle = stock.detalle; this.impint = stock.impint; this.precorig = 0;//arregalar this.ivaporc1 = stock.getIvaGral(ControladorTotales.getCTotales().getIvaTasaGral()); this.ivaporc2 = stock.getIvaDif(ControladorTotales.getCTotales().getIvaTasaGral()); this.moneda = cabecera.monfac; this.costo = stock.costo * stock.cantidad * (cotInicio / this.cotizacion); this.simbolo = cabecera.simbolo.Substring(0, 2); } catch (Exception) { } }