Пример #1
0
        public void getCabecera()
        {
            try
            {
                infoBodega   = UCfaBodega.get_bodega();
                infoSucursal = UCfaBodega.get_sucursal();

                infocotizacion.IdBodega       = infoBodega.IdBodega;
                infocotizacion.IdSucursal     = infoBodega.IdSucursal;
                infocotizacion.IdCliente      = Convert.ToInt32(UCfaCliente.cmb_cliente.EditValue);
                infocotizacion.cc_tipopago    = (rbtnContado.Checked == true) ? "CON" : "CRE";
                infocotizacion.cc_fecha       = dateFecha.Value;
                infocotizacion.cc_diasPlazo   = Convert.ToInt32(spinEditDiasPlazo.Value);
                infocotizacion.cc_observacion = txtObservacion.Text;
                infocotizacion.cc_interes     = Convert.ToDouble(txtInteres.EditValue);
                infocotizacion.cc_transporte  = Convert.ToDouble(txtTransporte.EditValue);
                infocotizacion.cc_otroValor1  = Convert.ToDouble(txtOtro1.EditValue);
                infocotizacion.cc_otroValor2  = Convert.ToDouble(txtOtro2.EditValue);
                infocotizacion.CodCotizacion  = txtCodigoCot.Text;
                infocotizacion.IdVendedor     = Convert.ToInt32(UCfaCliente.cmb_vendedor.EditValue);
                fa_Cliente_Bus   clientebus = new fa_Cliente_Bus();
                fa_Vendedor_Info vendedor   = new fa_Vendedor_Info();
                infoCliente.IdCliente = Convert.ToInt32(UCfaCliente.cmb_cliente.EditValue);
                clientebus.ConsultarClienteVendedor(param.IdEmpresa, ref infoCliente, ref vendedor);
                infocotizacion.cc_dirigidoA        = UCfaCliente.cmb_cliente.Text;
                infocotizacion.cc_fechaVencimiento = dateFechaVencimiento.Value;
                infocotizacion.IdEmpresa           = param.IdEmpresa;
                infocotizacion.IdUsuario           = param.IdUsuario;
                infocotizacion.ip     = param.ip;
                infocotizacion.nom_pc = param.nom_pc;
                infocotizacion.iva    = param.iva.porcentaje;
                infocotizacion.total  = Convert.ToDouble(txtTotal.EditValue);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        public void set(int IdEmpresa, int IdSucursal, int IdBodega, string TipoDoc, decimal IdCbteCble, Cl_Enumeradores.eTipo_action Accion)
        {
            try
            {
                cartera_I           = cartera_B.Get_Info_cartera_x_cobrar(IdEmpresa, IdSucursal, IdBodega, IdCbteCble, TipoDoc);
                txt_sucursal.Text   = (cartera_I.Su_Descripcion != null) ? cartera_I.Su_Descripcion.Trim() : "";
                txt_bodega.Text     = (cartera_I.Bodega != null) ? cartera_I.Bodega.Trim() : "";
                txe_total.EditValue = Convert.ToDouble(cartera_I.vt_total);
                lbl_IdBodega.Text   = cartera_I.IdBodega.ToString();

                //haac 23/01/2014
                this.txtSubtotal.EditValue = cartera_I.vt_Subtotal;
                this.txtIva.EditValue      = cartera_I.vt_iva;

                //haac 23/01/2014
                txe_saldo.EditValue = Convert.ToDouble(cartera_I.Saldo);
                dtp_fecha.Value     = Convert.ToDateTime(cartera_I.vt_fecha);
                txt_NDoc.Text       = cartera_I.vt_NunDocumento;
                txtObservacion.Text = cartera_I.Referencia;
                Cliente_I.IdCliente = cartera_I.IdCliente;
                Cliente_B.ConsultarClienteVendedor(IdEmpresa, ref Cliente_I, ref Vendedor_I);
                txt_cliente.Text = (Cliente_I.Nombre_Cliente != "" || Cliente_I.Nombre_Cliente != null) ? Cliente_I.Nombre_Cliente.Trim() : Cliente_I.Persona_Info.pe_razonSocial;

                //haac 23/01/2014
                this.txtSubtotal.Enabled   = false;
                this.txtSubtotal.BackColor = System.Drawing.Color.White;
                this.txtSubtotal.ForeColor = System.Drawing.Color.Black;

                this.txtIva.Enabled   = false;
                this.txtIva.BackColor = System.Drawing.Color.White;
                this.txtIva.ForeColor = System.Drawing.Color.Black;
                //haac 23/01/2014

                if (!(Accion == Cl_Enumeradores.eTipo_action.grabar))
                {
                    ucGe_Menu.Visible_btnGuardar         = false;
                    ucGe_Menu.Visible_bntGuardar_y_Salir = false;
                }

                if (Accion == Cl_Enumeradores.eTipo_action.grabar)
                {
                    this.txtCXC.Enabled   = false;
                    this.txtCXC.BackColor = System.Drawing.Color.White;
                    this.txtCXC.ForeColor = System.Drawing.Color.Black;

                    this.txtCHQF.Enabled   = false;
                    this.txtCHQF.BackColor = System.Drawing.Color.White;
                    this.txtCHQF.ForeColor = System.Drawing.Color.Black;

                    this.txtEfectivo.Enabled   = false;
                    this.txtEfectivo.BackColor = System.Drawing.Color.White;
                    this.txtEfectivo.ForeColor = System.Drawing.Color.Black;

                    this.txtChq_Tarj.Enabled   = false;
                    this.txtChq_Tarj.BackColor = System.Drawing.Color.White;
                    this.txtChq_Tarj.ForeColor = System.Drawing.Color.Black;

                    this.txtOtros.Enabled   = false;
                    this.txtOtros.BackColor = System.Drawing.Color.White;
                    this.txtOtros.ForeColor = System.Drawing.Color.Black;

                    this.txtDeposito.Enabled   = false;
                    this.txtDeposito.BackColor = System.Drawing.Color.White;
                    this.txtDeposito.ForeColor = System.Drawing.Color.Black;

                    this.txtTotalCobrado.Enabled   = false;
                    this.txtTotalCobrado.BackColor = System.Drawing.Color.White;
                    this.txtTotalCobrado.ForeColor = System.Drawing.Color.Black;
                }


                if (Accion == Cl_Enumeradores.eTipo_action.consultar)
                {
                    this.gridView_detalle.OptionsBehavior.Editable = false;

                    this.cmbCaja.Enabled   = false;
                    this.cmbCaja.BackColor = System.Drawing.Color.White;
                    this.cmbCaja.ForeColor = System.Drawing.Color.Black;

                    this.txtCXC.Enabled   = false;
                    this.txtCXC.BackColor = System.Drawing.Color.White;
                    this.txtCXC.ForeColor = System.Drawing.Color.Black;

                    this.txtCHQF.Enabled   = false;
                    this.txtCHQF.BackColor = System.Drawing.Color.White;
                    this.txtCHQF.ForeColor = System.Drawing.Color.Black;

                    this.txtEfectivo.Enabled   = false;
                    this.txtEfectivo.BackColor = System.Drawing.Color.White;
                    this.txtEfectivo.ForeColor = System.Drawing.Color.Black;

                    this.txtChq_Tarj.Enabled   = false;
                    this.txtChq_Tarj.BackColor = System.Drawing.Color.White;
                    this.txtChq_Tarj.ForeColor = System.Drawing.Color.Black;

                    this.txtOtros.Enabled   = false;
                    this.txtOtros.BackColor = System.Drawing.Color.White;
                    this.txtOtros.ForeColor = System.Drawing.Color.Black;

                    this.txtDeposito.Enabled   = false;
                    this.txtDeposito.BackColor = System.Drawing.Color.White;
                    this.txtDeposito.ForeColor = System.Drawing.Color.Black;

                    this.txtTotalCobrado.Enabled   = false;
                    this.txtTotalCobrado.BackColor = System.Drawing.Color.White;
                    this.txtTotalCobrado.ForeColor = System.Drawing.Color.Black;

                    this.txtObservacion.Enabled   = false;
                    this.txtObservacion.BackColor = System.Drawing.Color.White;
                    this.txtObservacion.ForeColor = System.Drawing.Color.Black;
                }

                list_datasour          = new BindingList <cxc_cobro_Info>(cobro_B.Get_List_cobros_x_Factura(IdEmpresa, IdSucursal, IdBodega, IdCbteCble, TipoDoc));
                griddetalle.DataSource = list_datasour;

                lista = new BindingList <cxc_cobro_x_caj_Caja_Movimiento_Info>();
                int     idCaja  = 0;
                decimal idCobro = 0;
                foreach (var item in list_datasour)
                {
                    idCaja  = item.IdCaja;
                    idCobro = item.IdCobro;
                }
                cmbCaja.EditValue = idCaja;
                cargarGridContable(IdEmpresa, IdSucursal, idCobro);
                //haac 07-FEB-2014
                List <cxc_cobro_x_caj_Caja_Movimiento_Info> lista1     = new List <cxc_cobro_x_caj_Caja_Movimiento_Info>();
                cxc_cobro_x_caj_Caja_Movimiento_Bus         Bus_cajMov = new cxc_cobro_x_caj_Caja_Movimiento_Bus();
                lista1 = Bus_cajMov.Get_List_cobro_x_caj_Caja_Movimiento(IdEmpresa);
                this.gridControl_NCND.DataSource = lista1;
                //haac 07-FEB-2014

                if (list_datasour != null)
                {
                    this.Calcula_Totales();
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }