Exemplo n.º 1
0
        public static tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetRow GetByPk(string IdCondicionDeVentaDet, short Cuota)
        {
            tsa_CondicionesDeVentaDetDataset data = new tsa_CondicionesDeVentaDetDataset();

            SqlCommand cmd = new SqlCommand("Pr_tsa_CondicionesDeVentaDet_GetByPk", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdCondicionDeVentaDet", SqlDbType.VarChar));
            cmd.Parameters["@IdCondicionDeVentaDet"].Value = IdCondicionDeVentaDet;

            cmd.Parameters.Add(new SqlParameter("@Cuota", SqlDbType.SmallInt));
            cmd.Parameters["@Cuota"].Value = Cuota;

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

            adapter.TableMappings.Add("Table", "tsa_CondicionesDeVentaDet");

            adapter.Fill(data);

            if (data.tsa_CondicionesDeVentaDet.Rows.Count == 1)
            {
                return((tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetRow)data.tsa_CondicionesDeVentaDet.Rows[0]);
            }

            return(null);
        }
Exemplo n.º 2
0
 public void Commit()
 {
     _condicionDeVenta.Commit();
     _dataCondVenta    = _condicionDeVenta.DataCondicionDeVenta;
     _dataCondVentaDet = _condicionDeVenta.DataCondicionDeVentaDet;
     _dataTDCompTesoreria_CondVenta            = _condicionDeVenta.DataTDComp_Tesoreria_CondDeVenta;
     _dataTiposDeCompTDCompTesoreriaCondVentas = _condicionDeVenta.DataTiposDeComp_Tesoreria_CondVenta;
     _dataCuentasTDCompTesoreriaCondVentas     = _condicionDeVenta.DataCuenta_TDComp_Tesoreria;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Determina como se deben componer las cuotas según el monto total del comprobante
        /// </summary>
        /// <param name="idCondicionDeVenta"></param>
        private void FillNewData(string idCondicionDeVenta)
        {
            if (idCondicionDeVenta != null && idCondicionDeVenta != String.Empty)
            {
                tsa_CondicionesDeVentasDataset.tsa_CondicionesDeVentasRow row = tsa_CondicionesDeVentas.GetByPk(idCondicionDeVenta);
                if (row != null)
                {
                    _descripcion             = row.Descripcion;
                    this._idCondicionDeVenta = idCondicionDeVenta;
                    tsa_CondicionesDeVentaDetDataset data = mz.erp.dataaccess.tsa_CondicionesDeVentaDet.GetListByIdCondicionDeVenta(this._idCondicionDeVenta);
                    tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetDataTable table = data.tsa_CondicionesDeVentaDet;
                    System.DateTime fechaActual = mz.erp.businessrules.Sistema.DateTime.Now;
                    DateTime        fechaAux    = this.Comprobante.FechaComprobante;
                    System.DateTime fecha       = new DateTime(fechaAux.Year, fechaAux.Month, fechaAux.Day, fechaActual.Hour, fechaActual.Minute, fechaActual.Second);
                    _recargo = row.Recargo;
                    this.Comprobante.RecargoFinancieroPorCondicionDeVenta = _recargo;
                    this._esCuentaCorriente = false;
                    decimal monto = this.Comprobante.Total;
                    List.Clear();
                    foreach (tsa_CondicionesDeVentaDetDataset.tsa_CondicionesDeVentaDetRow rowDet in table.Rows)
                    {
                        DetalleCuotas dt = new DetalleCuotas();
                        dt.SetIdCuota(rowDet.Cuota);
                        dt.SetFechaVencimiento(fecha.AddDays(rowDet.DiasVencimiento));
                        dt.SetMonto((monto * rowDet.Porcentual / 100));
                        dt.SetPorcentaje(rowDet.Porcentual);
                        if (rowDet.DiasVencimiento > 0 && !this._esCuentaCorriente)
                        {
                            this._esCuentaCorriente = true;
                        }
                        //German 20101119 - Tarea 943
                        dt.DiasVencimiento = rowDet.DiasVencimiento;
                        //Fin German 20101119 - Tarea 943
                        Add(dt);

                        //				return tsa_CondicionesDeVentaDet.GetListByIdCondicionDeVenta( _idCondicionDeVenta, this.comprobante.FechaComprobante, this.comprobante.Total );
                    }
                }
                else
                {
                    _idCondicionDeVenta = string.Empty;
                }
            }
            else
            {
                _idCondicionDeVenta = string.Empty;
            }
        }
Exemplo n.º 4
0
        public static tsa_CondicionesDeVentaDetDataset GetListByIdCondicionDeVenta(string IdCondicionDeVenta)
        {
            tsa_CondicionesDeVentaDetDataset data = new tsa_CondicionesDeVentaDetDataset();

            SqlCommand cmd = new SqlCommand("Pr_tsa_CondicionesDeVentaDet_GetListByIdCondicionDeVenta", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdCondicionDeVenta", SqlDbType.VarChar));
            cmd.Parameters["@IdCondicionDeVenta"].Value = IdCondicionDeVenta;


            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

            adapter.TableMappings.Add("Table", "tsa_CondicionesDeVentaDet");

            adapter.Fill(data);
            return(data);
        }
Exemplo n.º 5
0
        public static tsa_CondicionesDeVentaDetDataset GetList(string IdCondicionDeVentaDet, short Cuota, short DiasVencimiento, decimal Porcentual, DateTime FechaCreacion, long IdConexionCreacion, byte[] UltimaModificacion, long IdConexionUltimaModificacion, long IdReservado, Guid RowId, long IdEmpresa)
        {
            tsa_CondicionesDeVentaDetDataset data = new tsa_CondicionesDeVentaDetDataset();

            SqlDataAdapter adapter = new SqlDataAdapter();

            adapter.TableMappings.Add("Table", "tsa_CondicionesDeVentaDet");

            SqlCommand cmd = new SqlCommand("Pr_tsa_CondicionesDeVentaDet_Search", dbhelper.Connection.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@IdCondicionDeVentaDet", SqlDbType.VarChar));
            cmd.Parameters["@IdCondicionDeVentaDet"].Value = IdCondicionDeVentaDet;
            cmd.Parameters.Add(new SqlParameter("@Cuota", SqlDbType.SmallInt));
            cmd.Parameters["@Cuota"].Value = Cuota;
            cmd.Parameters.Add(new SqlParameter("@DiasVencimiento", SqlDbType.SmallInt));
            cmd.Parameters["@DiasVencimiento"].Value = DiasVencimiento;
            cmd.Parameters.Add(new SqlParameter("@Porcentual", SqlDbType.Decimal));
            cmd.Parameters["@Porcentual"].Value = Porcentual;
            cmd.Parameters.Add(new SqlParameter("@FechaCreacion", SqlDbType.DateTime));
            cmd.Parameters["@FechaCreacion"].Value = FechaCreacion;
            cmd.Parameters.Add(new SqlParameter("@IdConexionCreacion", SqlDbType.BigInt));
            if (IdConexionCreacion == long.MinValue)
            {
                cmd.Parameters["@IdConexionCreacion"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdConexionCreacion"].Value = IdConexionCreacion;
            }
            cmd.Parameters.Add(new SqlParameter("@UltimaModificacion", SqlDbType.Timestamp));
            cmd.Parameters["@UltimaModificacion"].Value = UltimaModificacion;
            cmd.Parameters.Add(new SqlParameter("@IdConexionUltimaModificacion", SqlDbType.BigInt));
            if (IdConexionUltimaModificacion == long.MinValue)
            {
                cmd.Parameters["@IdConexionUltimaModificacion"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdConexionUltimaModificacion"].Value = IdConexionUltimaModificacion;
            }
            cmd.Parameters.Add(new SqlParameter("@IdReservado", SqlDbType.BigInt));
            if (IdReservado == long.MinValue)
            {
                cmd.Parameters["@IdReservado"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdReservado"].Value = IdReservado;
            }
            cmd.Parameters.Add(new SqlParameter("@RowId", SqlDbType.UniqueIdentifier));
            cmd.Parameters["@RowId"].Value = RowId;
            cmd.Parameters.Add(new SqlParameter("@IdEmpresa", SqlDbType.BigInt));
            if (IdEmpresa == long.MinValue)
            {
                cmd.Parameters["@IdEmpresa"].Value = System.DBNull.Value;
            }
            else
            {
                cmd.Parameters["@IdEmpresa"].Value = IdEmpresa;
            }
            adapter.SelectCommand = cmd;

            adapter.Fill(data);

            return(data);
        }
Exemplo n.º 6
0
        public static tsa_CondicionesDeVentaDetDataset GetList()
        {
            tsa_CondicionesDeVentaDetDataset data = new tsa_CondicionesDeVentaDetDataset();

            return(( tsa_CondicionesDeVentaDetDataset )GetList(data));
        }
Exemplo n.º 7
0
 public static void Update(tsa_CondicionesDeVentaDetDataset dataSet)
 {
     Update(dataSet.tsa_CondicionesDeVentaDet);
 }