private void btnFilter_Click(object sender, EventArgs e)
        {
            if (uvValidar.Validate(true, false).IsValid)
            {
                var id2 = cbCustomerOrganization.SelectedValue.ToString().Split('|');

                frmBuscarServicioPendiente frm = new frmBuscarServicioPendiente(id2[0], id2[1]);
                frm.ShowDialog();

                if (frm.DialogResult == System.Windows.Forms.DialogResult.Cancel)
                {
                    return;
                }

                if (frm._ListaFacturacionList == null)
                {
                    return;
                }

                _ListaFacturacionDetalle = frm._ListaFacturacionList;
                DateTime?FechaInicio = frm._FechaInicio;
                DateTime?FechaFin    = frm._FechaFin;

                var Result = oFacturacionBL.LlenarGrillaSigesfot("", id2[0], id2[1], FechaInicio.Value.Date, FechaFin.Value.Date, -1);

                _EmpresaCliente = id2[0];
                _EmpresaSede    = id2[1];
                _FechaInicio    = FechaInicio.Value.Date;
                _FechaFin       = FechaFin.Value.Date;

                double Total = double.Parse(Result.Sum(p => p.Total).ToString());
                double Igv;
                double SubTotal;

                if (Total > 700)
                {
                    txtDetraccion.Text = (Total * 0.1).ToString();
                }
                else
                {
                    txtDetraccion.Text = "0.00";
                }

                Igv      = (Total * 1.18) - Total;
                SubTotal = Total - Igv;

                txtTotalFacturar.Text = Total.ToString();
                txtIgv.Text           = Igv.ToString();
                txtSubTotal.Text      = SubTotal.ToString();
                grdData.DataSource    = _ListaFacturacionDetalle;
            }
            else
            {
                MessageBox.Show("Por favor corrija la información ingresada. Vea los indicadores de error.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 2
0
        private void CalcularTotales(double pTotal)
        {
            double Total = pTotal;
            double Igv;
            double SubTotal;

            if (Total > 700)
            {
                txtDetraccion.Text = (Total * 0.1).ToString();
            }
            else
            {
                txtDetraccion.Text = "0.00";
            }

            Igv      = (Total * 1.18) - Total;
            SubTotal = Total;

            txtTotalFacturar.Text = (Total + Igv).ToString();
            txtIgv.Text           = Igv.ToString();
            txtSubTotal.Text      = SubTotal.ToString();
            grdData.DataSource    = _ListaFacturacionDetalle;
        }