示例#1
0
        private void BoletaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            boletaToolStripMenuItem.Enabled = false;
            ListaBoleta Check = new ListaBoleta();

            Check.Show();
        }
示例#2
0
        private void btn_Regresar_Click(object sender, EventArgs e)
        {
            this.Hide();
            ListaBoleta.operacionFactura = "Q";
            ListaBoleta Check = new ListaBoleta();

            Check.Show();
        }
示例#3
0
        public ListaBoleta()
        {
            InitializeComponent();
            this.ControlBox = false;
            this.Text       = "BOLETAS";
            formListaBoleta = this;
            gridParams();
            objDocumentoDao = new DocumentoDAO();
            DateTime d1, d2;

            d2 = DateTime.Now;
            d1 = new DateTime(d2.Year, d2.Month, 1);
            dpickerInicio.Value     = d1;
            objListaDocumentoCab    = objDocumentoDao.listarCabecera(d1, d2, txt_Ruc.Text, "03", Ventas.UNIDADNEGOCIO);
            grd_Facturas.DataSource = objListaDocumentoCab;
            grd_Facturas.Refresh();
            grd_Facturas.CellClick += Grd_Facturas_CellClick;
        }
 public MotivoAnulacion(String tipo)
 {
     InitializeComponent();
     objDocumentoDao = new DocumentoDAO();
     cargarCombo();
     tipoDocu = tipo;
     if (tipo == "F")
     {
         formFac = ListaFactura.formListaFactura;
     }
     else if (tipo == "B")
     {
         formBol = ListaBoleta.formListaBoleta;
     }
     else if (tipo == "C")
     {
         formCred = ListaNotaCredito.formListaCredito;
     }
     else if (tipo == "D")
     {
         formDeb = ListaNotaDebito.formListaDebito;
     }
 }
示例#5
0
        private void btn_SaveData_Click(object sender, EventArgs e)
        {
            btn_SaveData.Enabled = false;
            bool binsertar, bdetalle = true;

            objDocumentoCab = new DocumentoCab();
            objDocumentoCab.DocumentoCabSerie       = txt_Serie.Text;
            objDocumentoCab.DocumentoCabNro         = txt_Numero.Text;
            objDocumentoCab.DocumentoCabClienteCod  = txt_codcliente.Text;
            objDocumentoCab.DocumentoCabFecha       = dpick_Fecha.Value;
            objDocumentoCab.DocumentoCabGlosa       = txt_GlosaCab.Text;
            objDocumentoCab.DocumentoCabIGV         = convertToDouble(txt_IGV.Text);
            objDocumentoCab.DocumentoCabTotalSinIGV = convertToDouble(txt_ValorVenta.Text);
            objDocumentoCab.DocumentoCabTotal       = convertToDouble(txt_TotalPagar.Text);
            objDocumentoCab.DocumentoCabTipoDoc     = "03";
            objDocumentoCab.DocumentoCabTipoPago    = Convert.ToInt32(cmb_Pago.SelectedValue);
            objDocumentoCab.DocumentoCabTipoMoneda  = cmb_Moneda.SelectedValue.ToString();
            objDocumentoCab.DocumentoCabUsuAdd      = Ventas.UsuarioSession;
            objDocumentoCab.DocumentoCabFechaVcto   = dpck_Fechavcto.Value;
            objDocumentoCab.DocumentoCabFechaDocRef = new DateTime(2000, 1, 1);
            objDocumentoCab.DocumentoCabGuia        = txt_Guia.Text;
            objDocumentoCab.DocumentoCabOrdenCompra = txt_Pedido.Text;

            binsertar = objDocumento.insertarCabecera(objDocumentoCab, Ventas.UNIDADNEGOCIO);
            string msg = "";

            if (binsertar)
            {
            }
            else
            {
                msg = "Hubo un problema al guardar";
                MessageBox.Show(msg);
                btn_SaveData.Enabled = true;

                return;
            }
            for (int i = 0; i < objListDocumentoDet.Count; i++)
            {
                bdetalle = objDocumento.insertDetalle(objListDocumentoDet[i]);
                if (bdetalle == false)
                {
                    MessageBox.Show("Error al guardar");
                    btn_SaveData.Enabled = true;
                    break;
                }
            }
            if (bdetalle)
            {
                MessageBox.Show("Boleta Guardada exitosamente");

                btn_SaveData.Enabled = true;
            }
            DialogResult dialogResult = MessageBox.Show("Enviar a Sunat?", "ENVIAR DOCUMENTOS", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                objDocumentoElectronicoCab     = objDocumento.getDocumentoElectronicoCab(txt_Serie.Text, txt_Numero.Text, Ventas.UNIDADNEGOCIO);
                objListDocumentoElectronicoDet = objDocumento.getDocumentoElectronicoDet(txt_Serie.Text, txt_Numero.Text, Ventas.UNIDADNEGOCIO);
                String rutatext = objProceso.generarText(objDocumentoElectronicoCab, objListDocumentoElectronicoDet);
                String mess     = objProceso.sendTxt(rutatext);
                objDocumento.updateEstadoEnviado(txt_Serie.Text, txt_Numero.Text);
                String   mensajeMostrar = "";
                String[] array          = mess.Split('|');

                List <String> objListaString = array.ToList();
                if (objListaString.Count < 10)
                {
                    mensajeMostrar = objListaString[1];
                    objDocumento.updateObservacionSunat(txt_Serie.Text, txt_Numero.Text, mensajeMostrar);
                    objDocumento.updateEstadoAnulado(txt_Serie.Text, txt_Numero.Text);
                }
                else
                {
                    mensajeMostrar = objListaString[9];
                    if (mensajeMostrar == "true")
                    {
                        mensajeMostrar = "Documento Aceptado";
                        objDocumento.updateObservacionSunat(txt_Serie.Text, txt_Numero.Text, mensajeMostrar);
                        objDocumento.updateEstadoAceptado(txt_Serie.Text, txt_Numero.Text);
                    }
                    else
                    {
                        objDocumento.updateObservacionSunat(txt_Serie.Text, txt_Numero.Text, mensajeMostrar);
                    }
                }


                MessageBox.Show(mensajeMostrar);
            }
            else if (dialogResult == DialogResult.No)
            {
                //do something else
            }
            //nuevoRegistro();
            this.Hide();
            ListaBoleta.operacionFactura = "Q";
            ListaBoleta Check = new ListaBoleta();

            Check.Show();
        }