From 3f89ae5545ccdb2c9c078dea774ad3776ec5ee4c Mon Sep 17 00:00:00 2001 From: rmolina Date: Fri, 20 Dec 2019 15:00:58 -0700 Subject: [PATCH] . --- Compras/Compras.aspx.vb | 2 +- Contabilidad2/CatCuentas.aspx.vb | 16 +++---- Inventarios/TraspasoAlmacen.aspx.vb | 68 +++++++++++++++-------------- 3 files changed, 45 insertions(+), 41 deletions(-) diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index cd671ec03..adf8c7f27 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -6382,7 +6382,7 @@ Partial Class Compras_Compras ' adfasdasd 'ChkNCInvNC - If Not RegistraConcepto225 AndAlso Not ChkNCInvNC.Checked AndAlso Not RegistroCuentaPuente Then + If Not RegistroCuentaPuente AndAlso Not ChkNCInvNC.Checked Then 'GASTO If UsuarioActual.CveEmpresa = 119 Then DT = TmpDT diff --git a/Contabilidad2/CatCuentas.aspx.vb b/Contabilidad2/CatCuentas.aspx.vb index 5c4a37541..5f0fb2f53 100644 --- a/Contabilidad2/CatCuentas.aspx.vb +++ b/Contabilidad2/CatCuentas.aspx.vb @@ -29,14 +29,14 @@ Partial Class Contabilidad2_CatCuentas If Not Page.IsPostBack Then 'inicio() 'RegistraScript("$('#Tsubcuenta').mask('00000-0000-0000-00000');") - If UsuarioActual.Empresa.UsaContabilidad Then - CargaMonedas() - CargaAgrupadorSAT() - CargaDatos() - Else - Alert("Este módulo requiere el uso de Contabilidad.", TipoMensaje.MsgAdvertencia) - MEECuenta.Enabled = False - End If + ' If UsuarioActual.Empresa.UsaContabilidad Then + CargaMonedas() + CargaAgrupadorSAT() + CargaDatos() + 'Else + ' Alert("Este módulo requiere el uso de Contabilidad.", TipoMensaje.MsgAdvertencia) + ' MEECuenta.Enabled = False + 'End If End If End Sub diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb index 14d8d6340..a3a8b677b 100644 --- a/Inventarios/TraspasoAlmacen.aspx.vb +++ b/Inventarios/TraspasoAlmacen.aspx.vb @@ -2546,57 +2546,61 @@ Partial Class Inventarios_TraspasoAlmacen Try Dim DtPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa) For Each RowExcel As DataRow In dt.Rows - Dim RowPS = DtPS.FiltroPrimero(String.Format("Codigo='{0}'", RowExcel("Codigo").ToString())) + If RowExcel("Codigo").ToString() <> "" Then - Dim CveProducto As Integer = RowPS("CvePS").ToString().ToEntero() - Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString().ToEntero() - Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal() - Dim SerieLote As String = RowExcel("SerieLote").ToString() - Dim Observaciones As String = RowExcel("Observaciones").ToString() + Dim RowPS = DtPS.FiltroPrimero(String.Format("Codigo='{0}'", RowExcel("Codigo").ToString())) - If CveProducto > 0 Then + Dim CveProducto As Integer = RowPS("CvePS").ToString().ToEntero() + Dim CveUnidadMedida As Integer = RowPS("CveUnidadMedida").ToString().ToEntero() - Dim Valido As Boolean = True + Dim Cantidad As Double = RowExcel("Cantidad").ToString().ToDecimal() + Dim SerieLote As String = RowExcel("SerieLote").ToString() + Dim Observaciones As String = RowExcel("Observaciones").ToString() - Dim CveMetodoInventario As Integer = RowPS("Inv_CveMetodoInventario").ToString().ToEntero() + If CveProducto > 0 Then - If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then - Valido = False - Alert($"El producto '{RowPS("PS")}' requiere 'SerieLote'", TipoMensaje.MsgAdvertencia) - ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString()) - End If + Dim Valido As Boolean = True - If CveMetodoInventario = 5 AndAlso Not String.IsNullOrEmpty(SerieLote.Trim()) Then - NoPSConSerieLote = NoPSConSerieLote + 1 - End If + Dim CveMetodoInventario As Integer = RowPS("Inv_CveMetodoInventario").ToString().ToEntero() - If Valido AndAlso (Cantidad > 0 AndAlso RowPS("VentaMinima").ToString.ToDecimal > 0) Then - If Cantidad Mod RowPS("VentaMinima").ToString.ToDecimal <> 0 Then + If CveMetodoInventario = 5 And (String.IsNullOrEmpty(SerieLote.Trim()) OrElse SerieLote = "-1") Then Valido = False + Alert($"El producto '{RowPS("PS")}' requiere 'SerieLote'", TipoMensaje.MsgAdvertencia) ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString()) End If - End If - If Valido Then - Valido = ValidaExistencia(Cantidad, CveProducto, CveUnidadMedida, If(Not String.IsNullOrEmpty(SerieLote), SerieLote, "-1"), "-1", "-1") - End If + If CveMetodoInventario = 5 AndAlso Not String.IsNullOrEmpty(SerieLote.Trim()) Then + NoPSConSerieLote = NoPSConSerieLote + 1 + End If + + If Valido AndAlso (Cantidad > 0 AndAlso RowPS("VentaMinima").ToString.ToDecimal > 0) Then + If Cantidad Mod RowPS("VentaMinima").ToString.ToDecimal <> 0 Then + Valido = False + ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString()) + End If + End If + + If Valido Then + Valido = ValidaExistencia(Cantidad, CveProducto, CveUnidadMedida, If(Not String.IsNullOrEmpty(SerieLote), SerieLote, "-1"), "-1", "-1") + End If + + If Valido Then + AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, If(Not String.IsNullOrEmpty(SerieLote), SerieLote, ""), "", "", False) + RowsCargados = RowsCargados + 1 + Else + RowsNoCargados = RowsNoCargados + 1 + ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString()) + End If - If Valido Then - AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, If(Not String.IsNullOrEmpty(SerieLote), SerieLote, ""), "", "", False) - RowsCargados = RowsCargados + 1 Else RowsNoCargados = RowsNoCargados + 1 - ProductosNoCargados.AppendFormat("{0},", RowPS("PS").ToString()) + ProductosNoCargados.AppendFormat("{0},", RowExcel("Producto").ToString()) End If - - Else - RowsNoCargados = RowsNoCargados + 1 - ProductosNoCargados.AppendFormat("{0},", RowExcel("Producto").ToString()) End If Next Catch ex As Exception - OnError("Ocurrió un error al cargar los productos.", ex) + OnError("Ocurrió un error al cargar los productos." & ProductosNoCargados.ToString(), ex) Finally If NoPSConSerieLote > 0 Then