This commit is contained in:
2025-01-09 07:37:29 -07:00
5 changed files with 155 additions and 69 deletions

View File

@@ -425,7 +425,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Código Prov.</Value>
<Value># Parte</Value>
<Style>
<FontFamily>MYRIAd Pro</FontFamily>
<FontSize>7.5pt</FontSize>

View File

@@ -359,7 +359,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Código Prov.</Value>
<Value># Parte</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>9.5pt</FontSize>
@@ -875,6 +875,7 @@
</TablixMembers>
</TablixRowHierarchy>
<DataSetName>DsOC</DataSetName>
<Top>0cm</Top>
<Left>0.04788in</Left>
<Height>0.34081in</Height>
<Width>8.21665in</Width>
@@ -1700,7 +1701,7 @@
<Height>3.83039in</Height>
<Style />
</Body>
<Width>8.26453in</Width>
<Width>8.29578in</Width>
<Page>
<PageHeader>
<Height>5.96613cm</Height>
@@ -1884,7 +1885,7 @@
<Top>0.98635in</Top>
<Left>0.16378cm</Left>
<Height>1.36252in</Height>
<Width>2.82301in</Width>
<Width>4.02093in</Width>
<Style>
<Border>
<Style>None</Style>
@@ -1902,7 +1903,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>=IIF(LEN(Parameters!SubProyectoEntrega.Value) &gt; 0,"Lugar de Entrega: " + Parameters!SubProyectoEntrega.Value,"")</Value>
<Value>=IIF(LEN(Parameters!SubProyectoEntrega.Value) &gt; 0 or LEN(Parameters!ProveedorLugar.Value) &gt; 0,"Lugar de Entrega: " + Parameters!SubProyectoEntrega.Value,"")</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>9.16pt</FontSize>
@@ -1932,6 +1933,14 @@
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>=Parameters!ProveedorLugar.Value</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Left</TextAlign>
@@ -1942,7 +1951,7 @@
<Top>2.50885cm</Top>
<Left>12.69644cm</Left>
<Height>3.45728cm</Height>
<Width>7.11877cm</Width>
<Width>8.00264cm</Width>
<ZIndex>1</ZIndex>
<Style>
<Border>

View File

@@ -1629,7 +1629,14 @@ Partial Class Inventarios_EntradasSalidas
Dim Existencia As Decimal = GetExistencias(CvePS, CveUM, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, -1, If(Serie = "", "-1", Serie), If(Lote = "", "-1", Lote), FechaCaducidadVal)
' LbAgregar.ToolTip = Existencia.ToString
If Existencia - Cantidad - DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(Serie <> "", $" AND Serie = '{Serie}'", "")}") < 0 Then
Dim Acunmulado As Decimal = DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} {If(Serie <> "", $" AND Serie = '{Serie}'", "")}")
If FechaCaducidadVal > MinFecha Then
Acunmulado = DtMovimientos.SUM("Cantidad", $"CvePS = {CvePS} AND CveUM = {CveUM} and Lote = '{Lote}' and FechaCaducidad = '{FechaCaducidadVal}' ")
End If
If Existencia - Cantidad - Acunmulado < 0 Then
If Existencia <= 0 Then
Alert("No hay existencia del producto: " & PS, TipoMensaje.MsgAdvertencia)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")

View File

@@ -1982,8 +1982,7 @@
<asp:TemplateField>
<HeaderTemplate>Producto</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
<asp:HyperLink ID="HlPS" runat="server" Text='<%# Eval("CodigoPS") %>' Visible="false" Target="_blank"></asp:HyperLink>
<asp:Literal ID="LtlPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Serie" Visible="false">

View File

@@ -10,7 +10,6 @@ Imports System.Security.Cryptography.X509Certificates
Imports ADSNetLibrary.SIGAPI.Models.CRM.Request
Imports ADSNetLibrary.SIGAPI.Services.CRM
Imports ADSTimbrado
Imports com.itextpdf.text.pdf.languages
Imports Extensiones
Imports Microsoft.Reporting.WebForms
Imports Modelos
@@ -2387,18 +2386,7 @@ Partial Class Ventas
End Set
End Property
Private Property TienePermisoKardex As Boolean
Get
If ViewState("TienePermisoKardex") Is Nothing Then
ViewState("TienePermisoKardex") = False
End If
Return Boolean.Parse(ViewState("TienePermisoKardex").ToString)
End Get
Set(value As Boolean)
ViewState("TienePermisoKardex") = value
End Set
End Property
#Region "VENTA MEDICA"
@@ -2457,7 +2445,7 @@ Partial Class Ventas
Exit Sub
End If
TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False)
Modalidad = ""
Opcion = ""
@@ -8300,7 +8288,7 @@ Partial Class Ventas
End If
'SOLO HABILITAR PARA GENERAR NOTAS DE CREDITO
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Not PermiteCredito AndAlso Not LnkSolicitarCredito.Visible Then
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso Not PermiteCredito AndAlso Not LnkSolicitarCredito.Visible Then
LnkSolicitarCredito.Visible = True
If DdlSolCreditoTipoDocto.Items.FindByValue("Ing") IsNot Nothing Then
@@ -9052,10 +9040,14 @@ Partial Class Ventas
Protected Sub GvPS_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvPS.RowEditing
GvPS.EditIndex = e.NewEditIndex
GvPS.DataSource = TmpDT
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
GvPS.DataBind()
Dim gvr As GridViewRow = GvPS.Rows(e.NewEditIndex)
If UsuarioActual.TienePermisoProceso(253) Then
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtPrecio").Enabled = True
End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
gvr.FCDropDownList("DdlUnidadMedida").Enabled = False
gvr.FCDropDownList("DdlClasificacion").Enabled = False
@@ -9137,9 +9129,27 @@ Partial Class Ventas
End Sub
Protected Sub GvPS_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvPS.RowCancelingEdit
GvPS.EditIndex = -1
GvPS.DataSource = TmpDT
OrdenarPS()
If GvPS.Columns(21).Visible Then
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCTextBox("TxtOrden").Visible = True
End If
Next
End If
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
GvPS.DataBind()
CargaGVInv(DtInv)
UpPS.Update()
End Sub
Protected Sub GvPS_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvPS.RowUpdating
@@ -9212,6 +9222,7 @@ Partial Class Ventas
'eliminar y cargar el ps ***
Dim ConsecutivoActual As Integer = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
Dim OrdenOriginal As Integer = TmpDT.Rows(e.RowIndex)("Orden").ToString().ToEntero()
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
ObjDescuento = CalcularDescuentos(CvePSNuevo, Cantidad, PU)
@@ -9270,14 +9281,14 @@ Partial Class Ventas
CveProyecto, Proyecto,
CveSubProyecto, SubProyecto,
CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
ObjDescuento:=ObjDescuento, NumTurnos:=NumTurnos, CvePrecioLista:=CvePrecioLista, PrecioLista:=PrecioLista, ConsecutivoManual:=ConsecutivoActual)
ObjDescuento:=ObjDescuento, NumTurnos:=NumTurnos, CvePrecioLista:=CvePrecioLista, PrecioLista:=PrecioLista, ConsecutivoManual:=ConsecutivoActual, OrdenManual:=OrdenOriginal)
' TmpDT.Rows(e.RowIndex)("CveUM") = Ddl.SelectedValue
' TmpDT.Rows(e.RowIndex)("UM") = Ddl.SelectedItem.Text
GvPS.EditIndex = -1
GvPS.DataSource = TmpDT
OrdenarPS(False)
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
GvPS.DataBind()
CargaGVInv(DtInv)
If UsuarioActual.Empresa.Funcionalidad(533).ToEntero() > 0 Then
@@ -9408,13 +9419,13 @@ Partial Class Ventas
CalculaPSPromocionFiltrosLubricantes(TmpDT.Rows(e.RowIndex))
DrPS = Nothing
GvPS.EditIndex = -1
GvPS.DataSource = TmpDT
OrdenarPS(False)
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
GvPS.DataBind()
CargaGVInv(DtInv)
CalculaUsados()
End If
@@ -9434,6 +9445,18 @@ Partial Class Ventas
'JJMQ 20160506: Se agrego para la validacion de pago de contado.
'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
If GvPS.Columns(21).Visible Then
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.Header Then
GvRow.FCLinkButton("LnkOrdenarGvPS").Visible = True
End If
If GvRow.RowType = DataControlRowType.DataRow Then
GvRow.FCTextBox("TxtOrden").Visible = True
End If
Next
End If
UpPS.Update()
UpContado.Update()
@@ -9546,11 +9569,7 @@ Partial Class Ventas
End If
End If
If TienePermisoKardex Then
e.Row.FCLiteral("LtlPS").Visible = False
e.Row.FCHyperLink("HlPS").Visible = True
e.Row.FCHyperLink("HLPS").NavigateUrl = $"../Inventarios/Kardex.aspx?CvePS={e.Row.DBCampo("CvePS").ToString}"
End If
End If
@@ -20139,6 +20158,8 @@ Partial Class Ventas
TxtCantidad.Text = "1"
End If
OrdenarPS()
UpPS.Update()
Catch ex As Exception
OnError("Ocurrió un error al agregar el producto", ex)
@@ -20384,7 +20405,7 @@ Partial Class Ventas
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, Optional NumTurnos As Decimal = 0D, Optional CantidadConversion As Decimal = 0,
Optional Costo As Decimal = 0, Optional PorcentajeIVAFijo As Decimal = -1, Optional ConsecutivoManual As Integer = 0) As Boolean
Optional Costo As Decimal = 0, Optional PorcentajeIVAFijo As Decimal = -1, Optional ConsecutivoManual As Integer = 0, Optional OrdenManual As Integer = 0) As Boolean
Dim Retorno As Boolean = False
Try
@@ -20428,17 +20449,17 @@ Partial Class Ventas
Row("Serie") = Serie
Row("TiempoEntrega") = TiempoEntrega
If ConsecutivoManual > 0 Then
Row("Orden") = ConsecutivoManual
If OrdenManual > 0 Then
Row("Orden") = OrdenManual
Else
If Modalidad = "U" Then
Row("Orden") = Index
Else
Dim ConsecutivoActual As Integer = TmpDT.MAX("Consec").ToEntero()
If ConsecutivoActual < 0 Then
ConsecutivoActual = 0
Dim OrdenActual As Integer = TmpDT.MAX("Orden").ToEntero()
If OrdenActual < 0 Then
OrdenActual = 0
End If
Row("Orden") = ConsecutivoActual + 1
Row("Orden") = OrdenActual + 1
End If
End If
@@ -21354,7 +21375,7 @@ Partial Class Ventas
ConfiguraTipoDocto()
End If
End Sub
Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False, Optional ValidarDescuentos As Boolean = False, Optional RecalcularTotalOriginal As Boolean = True)
Private Sub CalculaTotalesVenta(Optional RecalculaImpuestosLocales As Boolean = True, Optional NCDescuento As Boolean = False, Optional ValidarDescuentos As Boolean = False, Optional RecalcularTotalOriginal As Boolean = True, Optional Reordenar As Boolean = False)
Dim TotalSubTotal As Decimal = TmpDT.SUMD("TotalImporte")
Dim TotalSubTotalRef As Decimal = TotalSubTotal
@@ -21480,11 +21501,15 @@ Partial Class Ventas
Alert($"Los siguientes conceptos hace falta especificar clave SAT <br/><br/> {MensajeCveSAT.ToString()}", TipoMensaje.MsgAdvertencia)
MensajeCveSAT.Clear()
End If
Dim view As DataView = New DataView(TmpDT)
view.Sort = "Consec"
GvPS.DataSource = view
GvPS.DataBind()
If Reordenar Then
Dim view As DataView = New DataView(TmpDT)
view.Sort = "Orden"
GvPS.DataSource = view
GvPS.DataBind()
Else
GvPS.DataSource = TmpDT
GvPS.DataBind()
End If
'RECARGA GV INVENTARIO
If (Not CveVenta > 0 Or DdlTipoComprobante.SelectedValue = "Cot") OrElse (UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso EsCreaApartirDe) Then
@@ -23914,6 +23939,12 @@ Partial Class Ventas
LiCalcularPromociones.Visible = True
End If
'NO PERMITE EDITAR FECHA DEL PAGO
If Not UsuarioActual.TienePermisoProceso(260) Then
TxtFechaPago.Enabled = False
imgCalendario.Visible = False
End If
TxtAtencionA.Enabled = True
UpCliente.Update()
@@ -26348,22 +26379,34 @@ Partial Class Ventas
DdlPS_SelectedIndexChanged(Nothing, Nothing)
End If
End Sub
Protected Sub OrdenarGvPS(ByVal sender As Object, ByVal e As EventArgs)
For Each row As GridViewRow In GvPS.Rows
TmpDT.Rows(row.RowIndex)("Orden") = row.FCTextBox("TxtOrden").Text.ToEntero()
Next
Private Sub OrdenarPS(Optional Reeordenar As Boolean = True)
Dim resultados = From OrdenDT In TmpDT
Order By OrdenDT("Orden").ToString().ToEntero()
Select OrdenDT
TmpDT = resultados.CopyToDataTable
CalculaTotalesVenta()
If Reeordenar Then
For Each row As GridViewRow In GvPS.Rows
TmpDT.Rows(row.RowIndex)("Orden") = row.FCTextBox("TxtOrden").Text.ToEntero()
Next
TmpDT.AcceptChanges()
End If
'Dim resultados = From OrdenDT In TmpDT
' Order By OrdenDT("Orden").ToString().ToEntero()
' Select OrdenDT
'TmpDT = resultados.CopyToDataTable
TmpDT = TmpDT.FiltraParametros("", "Orden").Copy()
TmpDT.AcceptChanges()
GvPS.DataSource = TmpDT
GvPS.DataBind()
UpPS.Update()
End Sub
Protected Sub OrdenarGvPS(ByVal sender As Object, ByVal e As EventArgs)
OrdenarPS()
CalculaTotalesVenta()
UpPS.Update()
End Sub
Private Sub LkCotizacionAutorizar_Click(sender As Object, e As EventArgs) Handles LkCotizacionAutorizar.Click
EsSupervisor = True
@@ -33072,6 +33115,12 @@ Partial Class Ventas
LiCalcularPromociones.Visible = True
End If
'NO PERMITE EDITAR FECHA DEL PAGO
If Not UsuarioActual.TienePermisoProceso(260) Then
TxtFechaPago.Enabled = False
imgCalendario.Visible = False
End If
UpPS.Update()
UPPDescuento.Update()
UPObservaciones.Update()
@@ -34911,6 +34960,8 @@ Partial Class Ventas
CargaListasPrecios()
End If
'BloqueaCondicionesPago()
BtnEditar.Visible = False
BtnEmitir.Visible = False
BtnPermisoEditarCotizacion.Visible = False
@@ -35378,6 +35429,8 @@ Partial Class Ventas
dRowEliminar.Delete()
Next
TmpDT.AcceptChanges()
'SI ES VENTA NUEVA O SI VA SER DEVOLUCION CONSIDERAR TODOS
If Me.CveVenta <= 0 OrElse DtUsadosDevolucion IsNot Nothing Then
TmpDTCalculo = TmpDT.Rows.Cast(Of DataRow).ToArray()
@@ -35387,10 +35440,6 @@ Partial Class Ventas
End If
TmpDT.AcceptChanges()
Dim CveUnidadMedidaPSA As Integer = -1
Dim UnidadMedidaPSA As String = "Unidad"
Dim CveClasificacionPSA As Integer = -1
@@ -36667,6 +36716,12 @@ Partial Class Ventas
End If
End If
'NO PERMITE EDITAR FECHA DEL PAGO
If Not UsuarioActual.TienePermisoProceso(260) Then
TxtFechaPago.Enabled = False
imgCalendario.Visible = False
End If
UpCliente.Update()
UpParametros.Update()
UPObservaciones.Update()
@@ -39916,7 +39971,7 @@ Partial Class Ventas
RegistraScript("MuestraAnticipos();", "AE")
End Sub
Private Sub RecalculaPrecios(ByRef RecalculoPromociones As Boolean, Optional ForzarRecalculo As Boolean = False)
Private Sub RecalculaPrecios(ByRef RecalculoPromociones As Boolean, Optional AplicarPromociones As Boolean = False)
Dim PuedeRecalcular As Boolean = False
If CveVenta <= 0 OrElse EsCreaApartirDe OrElse (ModalidadEdicion AndAlso Not DdlTipoComprobante.SelectedValue = "Cot") Then
@@ -39928,7 +39983,7 @@ Partial Class Ventas
PuedeRecalcular = False
End If
If ForzarRecalculo Then
If AplicarPromociones Then
PuedeRecalcular = True
End If
@@ -39938,7 +39993,18 @@ Partial Class Ventas
Dim CveClasificacion As Integer = Row("CveClasificacion").ToString().ToEntero
Dim CvePS As Integer = Row("CvePS").ToString().ToEntero
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion)
Dim CvePrecioListaSugerido As Integer = -1
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = Nothing
If AplicarPromociones Then
ObjPrecioSugerido = New Modelos.MPrecioSugerido()
ObjPrecioSugerido.PrecioSugerido = Row("PU").ToString().ToDecimal()
ObjPrecioSugerido.CvePrecioLista = Row("CvePrecioLista").ToString().ToEntero()
Else
ObjPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion)
End If
If ObjPrecioSugerido.PrecioSugerido > 0 Then
Dim PU As Decimal = ObjPrecioSugerido.PrecioSugerido.RoundSQL(6)
@@ -39947,6 +40013,11 @@ Partial Class Ventas
PU = ObjDescuento.PU
End If
'SI NO TIENE PROMOCION, NO MODIFICAR NADA
If AplicarPromociones AndAlso ObjDescuento.CvePromocionDetalle <= 0 Then
Continue For
End If
Row("PU") = PU
Dim TotalCalculableImpuestos As Decimal = ((Cantidad * PU) - (ObjDescuento.ImporteDescuento))
@@ -40413,12 +40484,12 @@ Partial Class Ventas
Protected Sub LnkCalcularPromociones_Click(sender As Object, e As EventArgs)
Dim Recalculo As Boolean = False
RecalculaPrecios(Recalculo, ForzarRecalculo:=True)
RecalculaPrecios(Recalculo, AplicarPromociones:=True)
If Recalculo Then
Alert("Se han recalculado los precios y promociones en base a las condiciones actuales")
Else
Alert("No se han encontrado cambios para los precios y promociones")
Alert("No se han encontrado cambios para las promociones")
End If
End Sub