public AgregarCajaChica(String ruc, String Tipo /*,String moneda,String monedadoc*/)
        {
            InitializeComponent();
            TipoDocumento      = Tipo;
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(50, 20);
            gridParams();

            gridParamsDetalle();
            objVoucherDao  = new VoucherDAO();
            formEmision    = EmisionVoucher.formEmision;
            formCanjeLetra = CanjeLetraNuevo.canjeletranuevo;
            if (Tipo == "CARGO")
            {
                this.Text     = "CARGO";
                objListVentas = objVoucherDao.listarDocumentosVentas(ruc, Ventas.UNIDADNEGOCIO /*,moneda,monedadoc*/);
            }
            else
            {
                this.Text     = "Facturas Compras";
                objListVentas = objVoucherDao.listarDocumentosVentasForLeter(ruc, Ventas.UNIDADNEGOCIO);
            }
            grdDocumento.DataSource          = objListVentas;
            objListBusquedaTotal             = objListVentas;
            txt_BuscarDocumento.TextChanged += Txt_BuscarDocumento_TextChanged;
            grdDocumento.Refresh();
        }
        public ListaEmisionVoucher()
        {
            InitializeComponent();
            this.ControlBox    = false;
            this.Text          = "LISTA CAJA BANCO";
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(50, 20);
            objMonedaDao       = new MonedaDAO();
            DateTime d1, d2;

            d2 = DateTime.Now;
            d1 = new DateTime(d2.Year, d2.Month, 1);
            dpickerInicio.Value = d1;
            gridParams();
            objEstado = new EstadoVoucher();
            //objVoucher = new Voucher();
            objVoucherDao     = new VoucherDAO();
            objPagoVoucherDao = new PagoVoucherDAO();
            objDocumentoDAO   = new DocumentoDAO();
            objListVoucher    = objVoucherDao.listarVoucher(Ventas.UNIDADNEGOCIO, dpickerInicio.Value, dpickerFin.Value, "NN");

            grd_Voucher.DataSource = objListVoucher;
            objListBusquedaTotal   = objListVoucher;
            grd_Voucher.Refresh();
            grd_Voucher.DoubleClick += Grd_Voucher_DoubleClick;
            cmbEstado();
        }
示例#3
0
        public ReporteVoucher()
        {
            InitializeComponent();
            formReporteCheques = this;
            this.ControlBox    = false;
            this.Text          = "Reporte de Voucher";
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(50, 10);
            objVoucherDAO      = new VoucherDAO();
            objMonedaDao       = new MonedaDAO();
            DateTime d1, d2, d11, d22;

            d2  = DateTime.Now;
            d22 = DateTime.Now;
            d11 = new DateTime(d22.Year, d22.Month, 1);
            d1  = new DateTime(d2.Year, d2.Month, 1);
            dpickerInicio.Value  = d1;
            dpickerInicio1.Value = d11;
            gridParams2();
            gridParams();
            gridParams3();
            gridParams4();
            cmbMoneda();
            dgv_cobranza.DataSource = null;
            grd_Voucher.DataSource  = null;
            dgv_personal.DataSource = null;
            //grd_Voucher.DataSource = objListVoucher;
            grd_Voucher.Refresh();
            dgv_cobranza.Refresh();
            dgv_personal.Refresh();
            llenarSumatorias();
        }
示例#4
0
        public CuentasPorPagar()
        {
            InitializeComponent();
            this.ControlBox    = false;
            this.Text          = "REPORTE DOCUMENTOS POR PAGAR";
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new System.Drawing.Point(20, 20);
            DateTime d1, d2;

            d2 = DateTime.Now;
            d1 = new DateTime(d2.Year, d2.Month, 1);
            dpickerInicio.Value = d1;
            gridParams();
            gridParams2();
            cmbUnidadNegocio();
            cmbUnidadNegocio2();
            objVoucherDao = new VoucherDAO();
            /*pagar por vencimiento*/
            objListVentas2             = objVoucherDao.ListarCuentasPorPagarVencer(Ventas.UNIDADNEGOCIO, 0);
            grd_Documentos2.DataSource = null;
            grd_Documentos2.DataSource = objListVentas2;
            sumatorias2();
            /**/
            grd_Documentos.DataSource = objListVentas;
            grd_Documentos.Refresh();
            cbxanio();
            cbxanio2();
            cbxmes();
            sumatorias();
        }
示例#5
0
 private void LoadAccountTypes()
 {
     try
     {
         //
         // Fill Customer Code
         //
         DataSet dsAccountTypes = new VoucherDAO().GetAllAccountTypes();
         if (dsAccountTypes == null || dsAccountTypes.Tables.Count == 0)
         {
             ddlAccountTypes.Items.Add(new ListItem("--No Data Found--", "-1"));
         }
         else
         {
             ddlAccountTypes.DataSource     = dsAccountTypes;
             ddlAccountTypes.DataTextField  = "AccountName";
             ddlAccountTypes.DataValueField = "AccountID";
             ddlAccountTypes.DataBind();
             //ddlAccountTypes.Items.Add(new ListItem("--Please Select--", "-1"));
             //ddlAccountTypes.SelectedValue = "-1";
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public CanjeLetraNuevo()
 {
     InitializeComponent();
     this.ControlBox  = false;
     txt_tipodoc.Text = "LT";
     objLetra         = new LetraCab();
     objMonedaDao     = new MonedaDAO();
     objVoucherDao    = new VoucherDAO();
     objDocumentoDAO  = new DocumentoDAO();
     objMonedaDao.tipoCambio();
     comboMoneda();
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(50, 20);
     canjeletranuevo    = this;
     txt_Tcambio.Text   = objMonedaDao.getTipoCambioVenta(dpick_Fecha.Value.ToString("dd/MM/yyyy")).ToString().PadRight(5, '0');
     if (CanjeLetra.operacionLetra == "V")
     {
         objLetra = CanjeLetra.objVoucher;
         llenarCabecera(objLetra);
         objListaLetraDet = objVoucherDao.listarLetraDet(objLetra.NroRegistro, Ventas.UNIDADNEGOCIO);
         llenarDetalle(objListaLetraDet);
         sumatoria();
         btn_SaveData.Enabled  = false;
         btn_Modificar.Visible = true;
     }
     else if (CanjeLetra.operacionLetra == "A")
     {
         objLetra = CanjeLetra.objVoucher;
         llenarCabecera(objLetra);
         objListaLetraDet = objVoucherDao.listarLetraDet(objLetra.NroRegistro, Ventas.UNIDADNEGOCIO);
         llenarDetalle(objListaLetraDet);
         sumatoria();
         btn_Add.Enabled        = false;
         btn_Anular.Enabled     = false;
         btn_Buscar.Enabled     = false;
         btn_Modificar.Enabled  = false;
         btn_SaveData.Enabled   = false;
         grd_facturas.Enabled   = false;
         dpck_Fechavcto.Enabled = false;
         dpick_Fecha.Enabled    = false;
         dtp_compromiso.Enabled = false;
         cmb_Moneda.Enabled     = false;
         btn_Modificar.Visible  = false;
     }
     else if (CanjeLetra.operacionLetra == "N")
     {
         Modificar = "N";
         if (Ventas.UNIDADNEGOCIO == "01")
         {
             txt_SerieDcto.Text = "0001";
         }
         else
         {
             txt_SerieDcto.Text = "0001";
         }
         habilitarBotones(true, false);
     }
 }
 public AgregarPrestamoBancario(String CodBanco, String Moneda)
 {
     InitializeComponent();
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(50, 20);
     gridParams();
     objVoucherDao           = new VoucherDAO();
     formEmision             = EmisionVoucher.formEmision;
     objListPrestamoBancario = objVoucherDao.getPrestamoBancarioVoucher(CodBanco, Moneda);
     grdDocumento.DataSource = objListPrestamoBancario;
     grdDocumento.Refresh();
 }
 public AgregarImpuestos()
 {
     InitializeComponent();
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(50, 20);
     gridParams();
     objVoucherDao                    = new VoucherDAO();
     formEmision                      = EmisionVoucher.formEmision;
     objListImpuestos                 = objVoucherDao.getImpuestosVoucher();
     grdDocumento.DataSource          = objListImpuestos;
     objListBusquedaTotal             = objListImpuestos;
     txt_BuscarDocumento.TextChanged += Txt_BuscarDocumento_TextChanged;
     grdDocumento.Refresh();
 }
示例#9
0
 public AgregarDetracciones()
 {
     InitializeComponent();
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(50, 20);
     gridParams();
     objVoucherDao                    = new VoucherDAO();
     formEmision                      = EmisionVoucher.formEmision;
     objListVentas                    = objVoucherDao.listarDocumentosVentasDetraccion("NN", Ventas.UNIDADNEGOCIO);
     grdDocumento.DataSource          = objListVentas;
     objListBusquedaTotal             = objListVentas;
     txt_BuscarDocumento.TextChanged += Txt_BuscarDocumento_TextChanged;
     grdDocumento.Refresh();
 }
示例#10
0
 public InsertarPrestamoBancario()
 {
     InitializeComponent();
     this.Text          = "Cargo Bancario";
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(50, 10);
     objVoucherDao      = new VoucherDAO();
     objMonedaDao       = new MonedaDAO();
     formEmision        = EmisionVoucher.formEmision;
     cmbMoneda();
     cmbBanco();
     cmb_Banco.SelectedIndexChanged  += Cmb_Banco_SelectedIndexChanged;
     cmb_Moneda.SelectedIndexChanged += Cmb_Moneda_SelectedIndexChanged;
     txt_NroCuenta.Text = objVoucherDao.getNroCuenta(cmb_Banco.SelectedValue.ToString(), cmb_Moneda.SelectedValue.ToString());
 }
示例#11
0
        public ReporteChueques()
        {
            InitializeComponent();
            this.ControlBox    = false;
            this.Text          = "Reporte de Voucher";
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(50, 10);
            objVoucherDAO      = new VoucherDAO();
            DateTime d1, d2;

            d2 = DateTime.Now;
            d1 = new DateTime(d2.Year, d2.Month, 1);
            dpickerInicio.Value = d1;
            gridParams();
        }
示例#12
0
 public ReporteDiario()
 {
     InitializeComponent();
     this.ControlBox    = false;
     this.Text          = "Reporte Diario";
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(50, 10);
     objVoucherDAO      = new VoucherDAO();
     //objListBusquedaTotal = objListaReporte;
     gridParams();
     /*objListaFactura = objVoucherDAO.FacturaCReporte(Ventas.UNIDADNEGOCIO, dpickerInicio.Value, dpickerFin.Value);*/
     grd_Voucher.DataSource = objListaFactura;
     objListBusquedaTotal   = objListaFactura;
     grd_Voucher.Refresh();
     impresos();
 }
示例#13
0
 public AgregarAbonoFactura(String ruc /*,String moneda*/, String monedadoc)
 {
     InitializeComponent();
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(50, 20);
     gridParams();
     objVoucherDao                    = new VoucherDAO();
     formEmision                      = EmisionVoucher.formEmision;
     objListFacturaAbono              = objVoucherDao.listarDocumentosAbonoVoucher(ruc, Ventas.UNIDADNEGOCIO /*,moneda,monedadoc*/);
     grdDocumento.DataSource          = objListFacturaAbono;
     objListBusquedaTotal             = objListFacturaAbono;
     txt_BuscarDocumento.TextChanged += Txt_BuscarDocumento_TextChanged;
     monedavalor                      = monedadoc;
     grdDocumento.Refresh();
     btn_Aceptar.Enabled = true;
 }
 public AgregarDetracionFactura(String ruc)
 {
     InitializeComponent();
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(50, 20);
     gridParams();
     objVoucherDao                     = new VoucherDAO();
     formEmision                       = EmisionVoucher.formEmision;
     txt_ruc.Text                      = ruc;
     objListFacturaAbono               = objVoucherDao.listarDocumentosFacturaDetraccion(ruc, Ventas.UNIDADNEGOCIO /*,moneda,monedadoc*/);
     grdDocumento.DataSource           = objListFacturaAbono;
     objListBusquedaTotal              = objListFacturaAbono;
     txt_BuscarDocumentoD.TextChanged += txt_BuscarDocumentoD_TextChanged;
     grdDocumento.Refresh();
     button1.Enabled = true;
 }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        try
        {
            VoucherSearch search = new VoucherSearch();
            if (dtpFromDate.Text == string.Empty)
            {
                search.FromDate = null;
            }
            else
            {
                search.FromDate = dtpFromDate.Date;
            }

            if (dtpToDate.Text == string.Empty)
            {
                search.ToDate = null;
            }
            else
            {
                search.ToDate = dtpToDate.Date;
            }

            DataSet ds = new VoucherDAO().GetExpencesForReportingByDateRange(search);
            Session["VoucherExpencesReport"] = ds;
            dxgvExpenseReport.DataSource     = ds;
            dxgvExpenseReport.DataBind();
        }
        catch (Exception ex)
        {
            ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnSearch_Click(object sender, EventArgs e)");
            if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty)
            {
                Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false);
            }
            else
            {
                Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false);
            }
        }
    }
示例#16
0
        public BuscarDocVoucher(String Ruc, String operacion)
        {
            InitializeComponent();
            TipoBusqueda    = operacion;
            objVoucherDao   = new VoucherDAO();
            objFacturaAbono = new FacturaAbono();
            objBancoDAO     = new BancoDAO();


            ojbVentas = new ContabilidadDTO.Ventas();
            if (operacion == "C")
            {
                formCaja = Caja.CajaChica.formCajachica;
            }
            else if (operacion == "V")
            {
                formVoucher = Caja.EmisionVoucher.formEmision;
                TipoBanco   = Caja.EmisionVoucher.TipoOperacionBanco;
            }
            if (TipoBanco == "A")
            {
                objListBusquedaAbono = objVoucherDao.geetDocumentoVoucherAbono(Ventas.UNIDADNEGOCIO, Ruc);
                gridParamsAbono();
                grdDocumento.DataSource   = objListBusquedaAbono;
                objListBusquedaTotalAbono = objListBusquedaAbono;
            }
            else
            {
                objListVentas = objVoucherDao.listarDocumentosVentas(Ruc, Ventas.UNIDADNEGOCIO /*,moneda,monedadoc*/);
                gridParams();
                grdDocumento.DataSource = objListVentas;
                objListBusquedaTotal    = objListVentas;
            }


            grdDocumento.Refresh();
            grdDocumento.DoubleClick += GrdDocumento_DoubleClick;

            txt_BuscarDocumento.TextChanged += Txt_BuscarDocumento_TextChanged;
        }
示例#17
0
        public LiquidacionVoucher()
        {
            InitializeComponent();
            this.ControlBox        = false;
            this.Text              = "LISTA VOUCHER";
            this.StartPosition     = FormStartPosition.Manual;
            this.Location          = new Point(50, 20);
            liquidacionVoucherForm = this;
            DateTime d1, d2;

            d2 = DateTime.Now;
            d1 = new DateTime(d2.Year, d2.Month, 1);
            dpickerInicio.Value = d1;
            gridParams();
            //objVoucher = new Voucher();
            objVoucherDao = new VoucherDAO();

            objListVoucher         = objVoucherDao.listarVoucher(Ventas.UNIDADNEGOCIO, dpickerInicio.Value, dpickerFin.Value, "P");
            grd_Voucher.DataSource = objListVoucher;
            grd_Voucher.Refresh();
            grd_Voucher.CellClick += Grd_Voucher_CellClick;
        }
示例#18
0
 private void LoadAccountTypes()
 {
     try
     {
         //
         // Fill Customer Code
         //
         DataSet dsAccountTypes = new VoucherDAO().GetAllAccountTypes();
         if (dsAccountTypes == null || dsAccountTypes.Tables.Count == 0)
         {
             ddlAccountTypes.Items.Add(new ListItem("--No Data Found--", "-1"));
         }
         else
         {
             Master.BindDropdown("AccountName", "AccountID", dsAccountTypes, ddlAccountTypes);
             ddlAccountTypes.Items.Add(new ListItem("--Please Select--", "-1"));
             ddlAccountTypes.SelectedValue = "-1";
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#19
0
        public CanjeLetra()
        {
            InitializeComponent();
            formReporteProveedor = this;
            this.Text            = "CANJE LETRAS";
            this.ControlBox      = false;
            this.StartPosition   = FormStartPosition.Manual;
            this.Location        = new Point(50, 20);
            DateTime d1, d2;

            d2 = DateTime.Now;
            d1 = new DateTime(d2.Year, d2.Month, 1);
            dpickerInicio.Value = d1;
            gridParams();
            gridParams2();
            objVoucherDao          = new VoucherDAO();
            objListLetra           = objVoucherDao.listarLetra(Ventas.UNIDADNEGOCIO, dpickerInicio.Value, dpickerFin.Value, "NN", txt_Ruc.Text);
            objReporteListLetra    = objVoucherDao.ReportelistarLetra(Ventas.UNIDADNEGOCIO, dpickerInicio.Value, dpickerFin.Value, "NN", txt_Ruc.Text);
            dgv_reporte.DataSource = objReporteListLetra;
            grd_letra.DataSource   = objListLetra;
            dgv_reporte.Refresh();
            grd_letra.Refresh();
            cmbEstado();
        }
示例#20
0
        public bool SaveVoucher_Detail(List <VoucherDetail> saveData, Voucher voucher)
        {
            using (DbContextTransaction transaction = Context.Database.BeginTransaction())
            {
                try
                {
                    long seq       = VoucherDAO.GetVoucherSEQ();
                    long seqDetail = VoucherDetailDAO.GetVoucherDetailSEQ();
                    switch (voucher.Status)
                    {
                    case ModifyMode.Insert:
                        seq++;
                        voucher.VouchersID = GenerateID.GetVoucherID(seq);
                        this.VoucherDAO.InsertVouchers(voucher);
                        voucher.CreateUser = UserInfo.UserID;
                        voucher.CompanyID  = CommonInfo.CompanyInfo.CompanyID;
                        //Select voucher vừa insert để lấy voucherno
                        foreach (VoucherDetail data in saveData)
                        {
                            seqDetail++;
                            data.VouchersID       = voucher.VouchersID;
                            data.CreateUser       = UserInfo.UserID;
                            data.CompanyID        = CommonInfo.CompanyInfo.CompanyID;
                            data.VouchersDetailID = GenerateID.VoucherDetailID(seqDetail);
                            this.VoucherDetailDAO.InsertVouchersDetail(data);
                        }
                        break;

                    // Update
                    case ModifyMode.Update:
                        this.VoucherDAO.UpdateVoucher(voucher);
                        voucher.UpdateUser = UserInfo.UserID;
                        voucher.CompanyID  = CommonInfo.CompanyInfo.CompanyID;
                        if (saveData.Count > 0)
                        {
                            foreach (VoucherDetail voucherDetail in saveData)
                            {
                                //thực hiện nhiệm vụ update với các chi tiết
                                if (voucherDetail.Status == ModifyMode.Update)
                                {
                                    #region Update dataDetail
                                    if (!string.IsNullOrEmpty(voucherDetail.VouchersDetailID))
                                    {
                                        if (voucherDetail.Amount == 0)
                                        {
                                            this.VoucherDetailDAO.DeleteVoucherDetail(voucherDetail.VouchersDetailID, voucherDetail.CompanyID);
                                            voucherDetail.Status = ModifyMode.Delete;
                                        }
                                        else
                                        {
                                            voucherDetail.UpdateUser = UserInfo.UserID;
                                            voucherDetail.CompanyID  = CommonInfo.CompanyInfo.CompanyID;
                                            this.VoucherDetailDAO.UpdateVoucherDetail(voucherDetail);
                                        }
                                    }
                                    #endregion Update dataDetail
                                }
                                else if (voucherDetail.Status == ModifyMode.Insert)
                                {
                                    //thêm mới Detail
                                    #region insert Detail khi thêm detail mới cho S35 đã có sẵn
                                    if (string.IsNullOrEmpty(voucherDetail.VouchersDetailID))
                                    {
                                        seqDetail++;
                                        voucherDetail.VouchersDetailID = GenerateID.VoucherDetailID(seqDetail);    // GenerateID.InvoiceS35DetailID(seqDetail);
                                        voucherDetail.VouchersID       = voucher.VouchersID;
                                        voucherDetail.CompanyID        = voucher.CompanyID;
                                        voucherDetail.CreateUser       = UserInfo.UserID;
                                        this.VoucherDetailDAO.InsertVouchersDetail(voucherDetail);
                                    }
                                    #endregion insert Detail khi thêm detail mới cho S35 đã có sẵn
                                }
                            }
                        }
                        break;

                    // Delete
                    case ModifyMode.Delete:
                        this.VoucherDAO.DeleteVoucher(voucher.VouchersID, voucher.CompanyID);
                        break;
                    }
                    transaction.Commit();
                    return(true);
                }
                catch (Exception e)
                {
                    transaction.Rollback();
                    Console.WriteLine("Update data fail.\r\n" + e.Message);
                    return(false);
                }
            }
        }
示例#21
0
        public List <VoucherDTO> LoadVoucher(int MaTV)
        {
            VoucherDAO voucher = new VoucherDAO();

            return(voucher.LoadVoucher(MaTV));
        }
示例#22
0
 public VoucherController()
 {
     this.Context      = new BSContext();
     this.VoucherDAO   = new VoucherDAO(this.Context);
     this.VoucherLogic = new VoucherLogic(this.Context);
 }
示例#23
0
        public List <VoucherDTO> LoadVoucher()
        {
            VoucherDAO voucher = new VoucherDAO();

            return(voucher.LoadVoucher());
        }