--FIX Varios

This commit is contained in:
2024-12-14 13:20:17 -07:00
parent 91094e0a42
commit fa8f39cb45
4 changed files with 19 additions and 6 deletions

View File

@@ -643,6 +643,8 @@ Partial Class Inventarios_EntregaAlmacen
If ObjInventario.EntregaAlmacenGet(CveVenta, UsuarioActual.CveEmpresa, CveAlmacen) Then
If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
Dim CveVentaPadre As Integer = -1
ArchivoBitacora = String.Format("{0}Temp\EntregaDT_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, CveVenta)
ArchivoBitacoraDetalle = String.Format("{0}Temp\EntregaDTD_{1}_{2}.xml", UsuarioActual.Empresa.Ruta, UsuarioActual.CveUsuario, CveVenta)
If ArchivoBitacora <> "" Then
@@ -672,6 +674,7 @@ Partial Class Inventarios_EntregaAlmacen
If DtDatos.Rows(0) IsNot Nothing Then
Dim drE As DataRow = DtDatos.Rows(0)
CveVentaPadre = DtDatos.Rows(0)("CveVentaPadre").ToString().ToEntero()
EsDevolucionVenta = drE("EsDevolucionVenta").ToString().ToEntero()
TipoDocto = DtDatos.Rows(0)("TipoDocto").ToString()
'TipoMovimiento = If(TipoDocto.Contiene({"Rem", "Ped", "Ing", "Ped", "PeC", "Ant"}) And (EsDevolucionVenta = 0 Or CveVentaAD > 0), 1, 2)
@@ -882,7 +885,7 @@ Partial Class Inventarios_EntregaAlmacen
If TipoMovimiento = 2 Then ' cuando es cancelación
Dim Filtro As String '= If(ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString().Contiene({"Ing", "Dev", "Ped"}), "CveConcepto = 3", "CveConcepto = 9")
Dim FiltroPS As String = ""
Select Case ObjInventario.DtResultados.Rows(0)("TipoDocto").ToString()
Select Case TipoDocto
Case "Ing"
Filtro = "CveConcepto IN (3,40,35)"
Case "Dev"
@@ -901,7 +904,8 @@ Partial Class Inventarios_EntregaAlmacen
Case Else
Filtro = "CveConcepto = 9"
End Select
If ObjInventario.GetInv_Mov(ObjInventario.DtResultados.Rows(0)("CveVentaPadre").ToString().ToEntero(), UsuarioActual.CveEmpresa) Then
If ObjInventario.GetInv_Mov(CveVentaPadre, UsuarioActual.CveEmpresa) Then
DtExistencias = ObjInventario.DtResultados.FiltraParametros($"CvePS Is Not NULL AND {Filtro} " & FiltroPS)
If Not DtExistencias.Rows.Count > 0 Then

View File

@@ -505,6 +505,7 @@ Partial Class Ventas_PVCobranza
VentaActual.UsuarioActual = UsuarioActual
VentaActual.CveSubProyecto = DbRowVenta("CveSubProyecto").ToString.ToEntero
Dim CveVendedor As Integer = DbRowVenta("CveVendedor").ToString.ToEntero
Dim ObservacionesAlmacen = DbRowVenta("ObservacionesAlmacen").ToString()
If tCveCorte <= 0 AndAlso DbRowVenta("CveCorte").ToString.ToEntero > 0 Then tCveCorte = DbRowVenta("CveCorte").ToString.ToEntero
@@ -530,7 +531,7 @@ Partial Class Ventas_PVCobranza
CveVentaRemision = HdnCveVenta.Value.ToEntero
respFactura = GenerarFactura(CveVendedor, VentaActual, ObjVentas2, ObjClientes)
respFactura = GenerarFactura(CveVendedor, VentaActual, ObjVentas2, ObjClientes, ObservacionesAlmacen)
If respFactura Is Nothing Then
MsgError = "Ocurrió un error al generar la factura"
@@ -761,7 +762,7 @@ Partial Class Ventas_PVCobranza
UpL.Update()
End Sub
Private Function GenerarFactura(CveVendedor As Integer, ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes) As Modelos.Factura.MMensajeFactura
Private Function GenerarFactura(CveVendedor As Integer, ByRef VentaRemision As Venta, ByRef ObjVentas As ClsVentas, ByRef ObjClientes As ClsClientes, ObservacionesAlmacen As String) As Modelos.Factura.MMensajeFactura
Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
Dim SbAlert As New StringBuilder()
@@ -828,7 +829,7 @@ Partial Class Ventas_PVCobranza
PorcentajeIVA:=Dr("PorcentajeIVA").ToString().ToDecimal())
Next
If UsuarioActual.Empresa.Funcionalidad(567) = "1" Then
If Not ValidateString(ObservacionesAlmacen.ToLower(), "parcial") Then
ObjFactura.GenerarSalidaAlmacen = True
ObjFactura.DtInventario = ObjFactura.DtDetalle.FiltraParametros("CveTipoPS = 2").Copy()
ObjFactura.CveAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 1 AND CveSubProyecto = {VentaRemision.CveSubProyecto}", "Orden").ToString().ToEntero()
@@ -948,6 +949,12 @@ Partial Class Ventas_PVCobranza
Return Retorno
End Function
Private Function ValidateString(texto As String, contenidoValidar As String) As Boolean
Dim regex As Text.RegularExpressions.Regex = New Text.RegularExpressions.Regex("\b" + contenidoValidar + "\b")
Return (regex.IsMatch(texto))
End Function
Private Function GenerarNC(CveVendedor As Integer, ByRef Venta As Venta, ByRef ObjVentas As ClsVentas) As Modelos.Factura.MMensajeFactura
Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
Dim SbAlert As New StringBuilder()

View File

@@ -1253,7 +1253,7 @@
</table>
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,Clasificacion,CveUM,UM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,ImporteIVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle,CvePromocionDetalle"
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,Clasificacion,CveUM,UM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,ImporteIVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle,CvePromocionDetalle,CvePrecioLista"
CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
<Columns>
<%--0--%>

View File

@@ -20033,6 +20033,7 @@ Partial Class Ventas
Else
If Me.CvePrecioLista > 0 Then
CvePrecioListaPS = Me.CvePrecioLista
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
PrecioListaPS = GlobalDTPrecioListas(UsuarioActual.CveEmpresa).FiltroPrimeroValor("PrecioLista", $"CvePrecioLista={CvePrecioListaPS}")
End If
@@ -20305,6 +20306,7 @@ Partial Class Ventas
'CODIGO BARRAS
TxtCodigoBarras.Text = ""
TxtCodigoSerie.Text = ""
TxtTiempoEntrega.Text = ""
'FOCUS DEPENDIENDO MODALIDAD DE CODIGO BARRAS
If DIVCod.Visible Then