private void GetRegistroDocumento(String DcOrigen) { DocPuiRequisiciones rq = new DocPuiRequisiciones(db); rq.keyidMov = DcOrigen; rq.GetDocumento(); txtDescuento.Text = Util.FormtDouDec(rq.cmpDescuento); //txtTotDesc.Text = "0"; txtIVA.Text = Util.FormtDouDec(rq.cmpImpuesto); txtIeps.Text = Convert.ToString(rq.cmpTotalIEPS); txtSubTotal.Text = Util.FormtDouDec(rq.cmpSubTotal); txtTotal.Text = Util.FormtDouDec(rq.cmpTotal); }
private void getRegistro() { DocPuiRequisiciones sRq = new DocPuiRequisiciones(db); sRq.keyidMov = idmovimiento; sRq.GetDocumento(); txtDocumento.Text = sRq.keyDocumento; if (ConfigDoc.UsaSerie == 1) { cboSerie.SelectedValue = sRq.cmpSerie; } txtNumDoc.Text = Convert.ToString(sRq.cmpNumDoc); cboAlmacen.SelectedValue = sRq.cmpClaveAlmacen; FechaExpedicion.Value = sRq.cmpFechaExpedicion; txtObservaciones.Text = sRq.cmpObservaciones; if (ConfigDoc.UsaProveedor == 1) { cboProveedor.SelectedValue = sRq.cmpCveProveedor; } if (ConfigDoc.UsaAlmDestino == 1) { cboProveedor.SelectedValue = sRq.cmpCveSucursal; } txtNoFactura.Text = ""; if (ConfigDoc.UsaFactura == 1) { txtNoFactura.Text = sRq.cmpNoFactura; } SqlDataAdapter DatosTbl = sRq.GetDatelleDoc(idmovimiento); DataSet ds = new DataSet(); DatosTbl.Fill(ds); DataTable dt = ds.Tables[0]; //double subTotal = 0, impuesto = 0, total = 0, descpartida = 0, descuento = 0; foreach (DataRow row in dt.Rows) { DocPartidasReq partida = new DocPartidasReq(); partida.idMov = row["idMov"].ToString(); partida.Documento = row["Documento"].ToString(); partida.Serie = row["Serie"].ToString(); partida.Numdoc = long.Parse(row["Numdoc"].ToString()); partida.ClaveAlmacen = row["ClaveAlmacen"].ToString(); partida.Partida = int.Parse(row["Partida"].ToString()); partida.CveArticulo = row["CveArticulo"].ToString(); partida.CodigoBarra = row["CodigoBarra"].ToString(); partida.Descripcion = row["Descripcion"].ToString(); partida.Cantidad = double.Parse(row["Cantidad"].ToString()); partida.CveUmedida1 = row["CveUmedida1"].ToString(); partida.CveImpuesto = row["CveImpuesto"].ToString(); partida.ImpuestoValor = Convert.ToDouble(row["ImpuestoValor"].ToString()); partida.Precio = Convert.ToDouble(row["Precio"].ToString()); partida.Descuento = Convert.ToDouble(row["Descuento"].ToString()); partida.TotalDscto = Convert.ToDouble(row["TotalDscto"].ToString()); partida.DsctoEsPorcentaje = Convert.ToInt32(row["DsctoEsPorcentaje"].ToString()); partida.PrecioNeto = Convert.ToDouble(row["PrecioNeto"].ToString()); partida.Impuesto = Convert.ToDouble(row["Impuesto"].ToString()); partida.SubTotal = Convert.ToDouble(row["SubTotal"].ToString()); partida.Total = Convert.ToDouble(row["Total"].ToString()); partida.Autorizado = Boolean.Parse(row["Autorizado"].ToString()); partida.FechaCaptura = Convert.ToDateTime(row["FechaCaptura"].ToString()); partida.FechaModificacion = Convert.ToDateTime(row["FechaModificacion"].ToString()); partida.CveImpIEPS = row["CveImpIEPS"].ToString(); partida.ImpIEPSValor = Convert.ToDouble(row["ImpIEPSValor"].ToString()); partida.CveImpRetISR = ""; partida.ImpRetISRValor = 0; partida.CveImpRetIVA = ""; partida.ImpRetIVAValor = 0; partida.CveImpOtro = ""; partida.ImpValorOtro = 0; partida.TotalIEPS = Convert.ToDouble(row["TotalIEPS"].ToString()); partida.TotalRetISR = 0; partida.TotalRetIVA = 0; partida.TotalImpOtro = 0; PARTIDAS.Add(partida); } txtDescuento.Text = Convert.ToString(Util.FormtDouDec(sRq.cmpDescuento)); LLenaGrid(); }
private void getRegistro(String IdM) { DocPuiRequisiciones sRq = new DocPuiRequisiciones(db); sRq.keyidMov = IdM; sRq.GetDocumento(); if (ConfigDoc.UsaSerie == 1) { serieticket = sRq.cmpSerie; } /* * txtNumDoc.Text = Convert.ToString(sRq.cmpNumDoc); * cboAlmacen.SelectedValue = sRq.cmpClaveAlmacen; * FechaExpedicion.Value = sRq.cmpFechaExpedicion; */ txtDescuento.Text = Convert.ToString(sRq.cmpDescuento); /* * if (ConfigDoc.UsaProveedor == 1) * { * cboProveedor.SelectedValue = sRq.cmpCveProveedor; * } * if (ConfigDoc.UsaCliente == 0) * { * cboCliente.SelectedValue = sRq.cmpCveCliente; * } */ SqlDataAdapter DatosTbl = sRq.GetDatelleDoc(IdM); DataSet ds = new DataSet(); DatosTbl.Fill(ds); DataTable dt = ds.Tables[0]; double subTotal = 0, impuesto = 0, total = 0, ccant = 0; foreach (DataRow row in dt.Rows) { DocPartidasReq partida = new DocPartidasReq(); partida.idMov = row["idMov"].ToString(); partida.Documento = row["Documento"].ToString(); partida.Serie = row["Serie"].ToString(); partida.Numdoc = long.Parse(row["Numdoc"].ToString()); partida.ClaveAlmacen = row["ClaveAlmacen"].ToString(); partida.Partida = int.Parse(row["Partida"].ToString()); partida.CveArticulo = row["CveArticulo"].ToString(); partida.Descripcion = row["Descripcion"].ToString(); partida.Cantidad = double.Parse(row["Cantidad"].ToString()); partida.CveUmedida1 = row["CveUmedida1"].ToString(); partida.CveImpuesto = row["CveImpuesto"].ToString(); partida.ImpuestoValor = Convert.ToDouble(row["ImpuestoValor"].ToString()); partida.Precio = Convert.ToDouble(row["Precio"].ToString()); partida.Descuento = Convert.ToDouble(row["Descuento"].ToString()); partida.PrecioNeto = Convert.ToDouble(row["PrecioNeto"].ToString()); partida.Impuesto = Convert.ToDouble(row["Impuesto"].ToString()); partida.SubTotal = Convert.ToDouble(row["SubTotal"].ToString()); partida.Total = Convert.ToDouble(row["Total"].ToString()); partida.Autorizado = Boolean.Parse(row["Autorizado"].ToString()); subTotal = subTotal + Convert.ToDouble(row["SubTotal"].ToString()); impuesto = impuesto + Convert.ToDouble(row["Impuesto"].ToString()); total = total + Convert.ToDouble(row["Total"].ToString()); ccant = ccant + Convert.ToDouble(row["Cantidad"].ToString()); PARTIDAS.Add(partida); } lblSubTotal.Text = Util.FormtDouDec(subTotal); //subTotal.ToString("C2"); lblTotal.Text = Util.FormtDouDec(total); //total.ToString(); lblTotalArticulos.Text = "Artículos: " + Convert.ToInt32(ccant); LLenaGrid(); }