From e1383f778275e6cae4bbc26fce1756204e2925dd Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Tue, 6 Jun 2023 19:31:00 -0700 Subject: [PATCH] VSH. Agregar numero de turnos al generar una venta --- App_Code/ClsVentas.vb | 3 +- Ventas/RepProductosServiciosDetalle.aspx | 5 +- Ventas/RepProductosServiciosDetalle.aspx.vb | 5 ++ Ventas/Ventas.aspx | 67 +++++++++++++++------ Ventas/Ventas.aspx.vb | 66 ++++++++++++++++++-- 5 files changed, 120 insertions(+), 26 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 776206141..a91bc04fa 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1343,7 +1343,7 @@ Public Class ClsVentas CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1, Optional CveContratoDetalle As Integer = -1, Optional PorcentajeIVA As Decimal = 0, Optional IEPS As Double = -1, Optional PorcentajeIEPS As Double = 0, Optional CvePromocionDetalle As Integer = -1, Optional CveMovimientoDetallePedido As Integer = -1, Optional ImporteRetIVA As Double = 0, Optional PorcentajeRetIVA As Double = 0, - Optional ImporteRetISR As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1) As Boolean + Optional ImporteRetISR As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional NumTurnos As Integer = 0) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_VentasDetalleAdd") @@ -1375,6 +1375,7 @@ Public Class ClsVentas .Add("@CuentaPredial", SqlDbType.VarChar).Value = CuentaPredial .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo + .Add("@NumTurnos", SqlDbType.Int).Value = NumTurnos End With Try diff --git a/Ventas/RepProductosServiciosDetalle.aspx b/Ventas/RepProductosServiciosDetalle.aspx index ee33c53cb..e7aac2a0a 100644 --- a/Ventas/RepProductosServiciosDetalle.aspx +++ b/Ventas/RepProductosServiciosDetalle.aspx @@ -427,7 +427,8 @@ <%--18--%> - + <%--19--%> + @@ -475,7 +476,7 @@ - + diff --git a/Ventas/RepProductosServiciosDetalle.aspx.vb b/Ventas/RepProductosServiciosDetalle.aspx.vb index 19dc8e898..cab107edb 100644 --- a/Ventas/RepProductosServiciosDetalle.aspx.vb +++ b/Ventas/RepProductosServiciosDetalle.aspx.vb @@ -85,6 +85,10 @@ Partial Class Ventas_RepProductosServiciosDetalle End If + If UsuarioActual.CveEmpresa.Contiene(7, 122) Then + ChkNumTurnos.Visible = True + End If + End If End Sub @@ -568,6 +572,7 @@ Partial Class Ventas_RepProductosServiciosDetalle GvDatos.Columns(16).Visible = ChkMetodoPago.Checked GvDatos.Columns(17).Visible = ChkFormaPago.Checked GvDatos.Columns(18).Visible = ChkFechaHoraEmision.Checked + GvDatos.Columns(19).Visible = ChkNumTurnos.Checked CargaDatos() UPDatos.Update() diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 0d08fa083..5b41cce53 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -948,7 +948,8 @@ <%--width="100%"--%> # - Cant + + Unidad
@@ -992,13 +993,24 @@   - - - - - - - + +
+
+ + + + + + +
+
+
+ +
+ + +
+
<%-- --%> @@ -1124,17 +1136,38 @@ <%--1--%> - + +
+
+ +
+
+
+
+ +
+
- - - - - - - - +
+
+ + + + + + + + +
+
+
+ +
+ + +
+
<%--2--%> diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index cb546ea45..998edea0a 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2748,6 +2748,8 @@ Partial Class Ventas TmpDT.Columns.Add("CveActivoFijo", GetType(Integer)) TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal)) TmpDT.Columns.Add("AFValorInicial", GetType(Decimal)) + TmpDT.Columns.Add("NumTurnos", GetType(Integer)) + TmpDT.Columns("NumTurnos").DefaultValue = 0 GvPS.DataSource = ObjVentas.DtResultados GvPS.DataBind() @@ -2778,6 +2780,8 @@ Partial Class Ventas TmpDT.Columns.Add("CveActivoFijo", GetType(Integer)) TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal)) TmpDT.Columns.Add("AFValorInicial", GetType(Decimal)) + TmpDT.Columns.Add("NumTurnos", GetType(Integer)) + TmpDT.Columns("NumTurnos").DefaultValue = 0 GvPS.DataSource = ObjVentas.DtResultados GvPS.DataBind() @@ -3151,6 +3155,11 @@ Partial Class Ventas CargaListasPrecios() End If + If CveVenta <= 0 AndAlso UsuarioActual.CveEmpresa.Contiene(7, 122) Then + TxtCantidad.Width = New Unit("100%") + DivNumTurnos.Visible = True + End If + 'SELECCIONA VENDEDOR DEL USUARIO CUANDO SEA VENTA NUEVA Y SIN CLIENTE 'If UsuarioActual.CveVendedor > 0 Then ' If CveVenta = -1 AndAlso Not DdlVendedor.SelectedValue.ToEntero() > 0 Then DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString()) @@ -8067,6 +8076,12 @@ Partial Class Ventas e.Row.FCLinkButton("imgD").Visible = False End If + If UsuarioActual.CveEmpresa.Contiene(7, 122) Then + e.Row.FCTextBox("TxtCantidad").Width = New Unit("100%") + e.Row.FCLabel("LblTurnoEditar").Visible = True + e.Row.FCTextBox("TxtNumTurnosEditar").Visible = True + End If + 'If UsuarioActual.CveEmpresa = 119 Then ' e.Row.FCTextBox("TxtDescuento").Enabled = False 'End If @@ -8150,6 +8165,10 @@ Partial Class Ventas e.Row.FCLiteral("LtlPrecioLista").Visible = True End If + If UsuarioActual.CveEmpresa.Contiene(7, 122) AndAlso e.Row.DBCampo("NumTurnos").ToEntero() > 0 Then + e.Row.FCLiteral("LtlNumTurnos").Visible = True + End If + 'CANTIDAD FACTURADA Select Case e.Row.DBCampo("TipoDocto") Case "Cot" @@ -8456,6 +8475,11 @@ Partial Class Ventas ObjDescuento = CalcularDescuentos(GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue.ToEntero(), Cantidad, PU) End If + Dim NumTurnos As Integer = 0 + If UsuarioActual.CveEmpresa.Contiene(7, 122) Then + NumTurnos = GvPS.Rows(e.RowIndex).FCTextBox("TxtNumTurnosEditar").Text.ToEntero() + End If + TmpDT.Rows.Remove(TmpDT.Rows(e.RowIndex)) CalculaUsados() AgregarProductoServicio(Cantidad, DdlUM.SelectedValue.ToEntero(), DdlUM.SelectedItem.Text, DdlCla.SelectedValue.ToEntero(), DdlCla.SelectedItem.Text, @@ -8463,7 +8487,8 @@ Partial Class Ventas GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim, PU, ObjDescuento.ImporteDescuento, GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedItem.Text, GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedItem.Text, - CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, ObjDescuento:=ObjDescuento) + CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, + ObjDescuento:=ObjDescuento, NumTurnos:=NumTurnos) ' TmpDT.Rows(e.RowIndex)("CveUM") = Ddl.SelectedValue ' TmpDT.Rows(e.RowIndex)("UM") = Ddl.SelectedItem.Text @@ -8532,8 +8557,11 @@ Partial Class Ventas TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR TmpDT.Rows(e.RowIndex)("CuentaPredial") = CuentaPredial - - + Dim NumTurnos As Integer = 0 + If UsuarioActual.CveEmpresa.Contiene(7, 122) Then + NumTurnos = GvPS.Rows(e.RowIndex).FCTextBox("TxtNumTurnosEditar").Text.ToEntero() + End If + TmpDT.Rows(e.RowIndex)("NumTurnos") = NumTurnos If ObjDescuento IsNot Nothing Then TmpDT.Rows(e.RowIndex)("CvePromocionDetalle") = ObjDescuento.CvePromocionDetalle @@ -13428,7 +13456,7 @@ Partial Class Ventas Row("PU").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6), Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(), CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDouble, - PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero()) Then + PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToEntero()) Then ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Exit For Else @@ -18815,11 +18843,16 @@ Partial Class Ventas End If End If + Dim NumTurnos As Integer = 0 + If UsuarioActual.CveEmpresa.Contiene(7, 122) Then + NumTurnos = TxtNumTurnos.Text.ToEntero() + End If + AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text, CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento, DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text, Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, - ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento, CvePrecioLista:=CvePrecioListaPS, PrecioLista:=PrecioListaPS) + ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento, CvePrecioLista:=CvePrecioListaPS, PrecioLista:=PrecioListaPS, NumTurnos:=NumTurnos) CalculaUsados() @@ -18941,6 +18974,7 @@ Partial Class Ventas End Sub Private Sub LimpiaAgregar() TxtCantidad.Text = "" + TxtNumTurnos.Text = "" HdnPS.Value = "-1" HdnCodigoPS.Value = "-1" HdnTipoPS.Value = "-1" @@ -19011,7 +19045,7 @@ Partial Class Ventas Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False, Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Modelos.VentaDescuentos = Nothing, Optional CvePrecioLista As Integer = -1, Optional PrecioLista As String = "", - Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D) As Boolean + Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D, Optional NumTurnos As Integer = 0) As Boolean Dim Retorno As Boolean = False Try @@ -19274,6 +19308,7 @@ Partial Class Ventas Row("AFDepreciacion") = AFDepreciacion Row("AFValorInicial") = AFValorInicial + Row("NumTurnos") = NumTurnos If UsuarioActual.CveEmpresa.Contiene(119, 13, 83) Then If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA @@ -19519,6 +19554,9 @@ Partial Class Ventas TmpDT.Columns("TieneProntoPago").DefaultValue = "No" TmpDT.Columns("ImporteProntoPago").DefaultValue = 0 + TmpDT.Columns.Add("NumTurnos", GetType(Integer)) + TmpDT.Columns("NumTurnos").DefaultValue = 0 + End Sub Private Sub CreaDTmpC() DTmpC = New DataTable @@ -33054,11 +33092,25 @@ Partial Class Ventas 'REMOVER EVENTO PARA RECARGAR ALMACEN 'spanAlmacen.Attributes.Remove("onclick") + If UsuarioActual.CveEmpresa.Contiene(7, 122) Then + TxtCantidad.Width = New Unit("100%") + DivNumTurnos.Visible = True + End If If UsuarioActual.Empresa.Funcionalidad(360) = "1" Then CargaListasPrecios() End If + BtnEditar.Visible = False + BtnEmitir.Visible = False + BtnPermisoEditarCotizacion.Visible = False + BtnEditarCotizacion.Visible = False + BtnPermisoEditarRemision.Visible = False + BtnEditarRemision.Visible = False + + BtnGenerarRemision.Visible = False + BtnGeneraAutorizacion.Visible = False + HdnCargarInventario.Value = "False" UpParametros.Update() @@ -35400,6 +35452,8 @@ Partial Class Ventas TmpDT.Columns.Add("CveActivoFijo", GetType(Integer)) TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal)) TmpDT.Columns.Add("AFValorInicial", GetType(Decimal)) + TmpDT.Columns.Add("NumTurnos", GetType(Integer)) + TmpDT.Columns("NumTurnos").DefaultValue = 0 Return TmpDT End Function