private void cmdBuscarFactura_Click(object sender, EventArgs e) { if (IsNumeric(txtCFDI.Text)) { FacturaComplementoPago f = new FacturaComplementoPago(); ComplementoPago cp = f.getFactura(Convert.ToDouble(txtCFDI.Text)); cargarValores(cp); } else { MessageBox.Show("Por favor indique un folio de factura válido"); txtCFDI.Text = string.Empty; } }
private void btnComplemento_Click(object sender, EventArgs e) { FacturaComplementoPago F = new FacturaComplementoPago(oComprobante); F.nuevoPago(DateTime.Now.ToString("yyyy-MM-dd"), Convert.ToDecimal(lblSaldo.Text), ctaEmisor.Text, ctaBeneficiario.Text, txtFolio.Text, txtSerie.Text, txtUUID.Text, 0, Convert.ToDouble(lblSaldo.Text), 0, "moneda", cmbMetodopago.Text.Substring(0, 2), txtReceptor.Text.Trim(), dgDetPagos.RowCount + 1, Convert.ToDecimal(lblSaldo.Text), dgFacturas); List <ComplementoPago> cp = F.getPagos(txtUUID.Text.Trim()); llenardetallePagos(cp); Int32 folioUltimo = metodos_VENTA.ultimoIdVenta(); frmMail mail = new frmMail(ConfigurationManager.AppSettings["rutaXML"] + txtReceptor.Text.Trim() + "\\" + txtSerie.Text + txtFolio.Text + ".xml", txtReceptor.Text.Trim() + "_" + txtSerie.Text + "_" + folioUltimo, txtEmail.Text, true); mail.ShowDialog(); System.Diagnostics.Process.Start("http://eostechnology.com.mx/EOSFACT/pagofiscal.php?idventa=" + folioUltimo); }
private void cargarValores(ComplementoPago result) { txtFecha.Text = result.FECHA.ToString(); txtReceptor.Text = result.Receptor; txtFolio.Text = result.Folio; txtSerie.Text = result.Serie; // txtUsoCFDI.Text = result.Receptor.UsoCFDI; //txtSubtotal.Text = result.SubTotal.ToString(); txtTotal.Text = result.MONTO; lblMetodoPago.Text = result.metodoPago.Substring(0, 3); //txtIVA.Text = result.Impuestos.TotalImpuestosTrasladados.ToString(); if (result.UUIDRELACIONADO != null) { txtUUID.Text = result.UUIDRELACIONADO; FacturaComplementoPago factura = new FacturaComplementoPago(oComprobante); List <ComplementoPago> cp = factura.getPagos(txtUUID.Text.Trim()); llenardetallePagos(cp); } //foreach(ComprobanteConcepto c in result.Conceptos) //{ // dgConceptos.Rows.Add(c.ClaveProdServ,c.Cantidad,c.ClaveUnidad,c.Unidad,c.Descripcion,c.ValorUnitario,c.Importe); //} }
private void button2_Click(object sender, EventArgs e) { if (txtCFDI.Text.Trim() == string.Empty) { MessageBox.Show("Por favor indique un número de folio"); return; } FacturaComplementoPago f = new FacturaComplementoPago(); ComplementoPago cp = f.getFactura(Convert.ToDouble(txtCFDI.Text)); if (cp == null) { MessageBox.Show("El folio " + txtCFDI.Text + " no existe o ya fue cobrada anteriormente"); return; } if (txtReceptor.Text == string.Empty || txtReceptor.Text == cp.Receptor) { cargarValores(cp); if (existeFactura(cp.UUIDRELACIONADO)) { MessageBox.Show("La factura ya fue agregada a este pago"); return; } dgFacturas.Rows.Add(cp.UUIDRELACIONADO, cp.FECHA, cp.MONTO, cp.Serie, cp.Folio); decimal saldo = 0; foreach (DataGridViewRow r in dgFacturas.Rows) { saldo += Convert.ToDecimal(r.Cells[2].Value.ToString()); } lblSaldo.Text = saldo.ToString(); txtCFDI.Text = ""; } else { MessageBox.Show("El RFC receptor no correponde con los proporcionados anteriormente"); } }