From e63f9c394a56769e83c4bca0ecc55c59cc3a2672 Mon Sep 17 00:00:00 2001 From: rrene Date: Thu, 4 Apr 2024 13:14:59 -0700 Subject: [PATCH] - mejora --- General/SaldosIniciales.aspx.vb | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 607b43dc6..76b6e6e28 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1802,19 +1802,28 @@ Partial Class General_SaldosIniciales Dim CveUnidadMedida As Integer = drr("CveUnidadMedida").ToString().ToEntero() Dim CveClasificacion As Integer = drr("CveClasificacion").ToString().ToEntero() - - If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorVentas = True ' If Not CveSucursal > 0 Then Alert("No se encontró la sucursal.", TipoMensaje.MsgError) : ErrorVentas = True If Not CveUnidadMedida > 0 Then Alert(String.Format("No se encontró la Unidad de Medida."), TipoMensaje.MsgError) : ErrorVentas = True Dim dtsubp As DataTable = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) + 'For Each drt As DataRow In dt.FiltraParametros("RFC <> ''", DistinctColumns:={"RFC"}).Rows + ' Dim RFC As String = drt("RFC").ToString().Trim.Replace("-", "").Replace(" ", "") + ' Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString().ToEntero() + ' If CveCliente <= 0 Then + ' Dim OBJ As New ClsClientes + ' OBJ.AgregarClienteNoFrecuente(RFC, RFC, "", "", "", "", "", 26, RFC, "", "", "", -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1) + ' OBJ.Dispose() + ' End If + 'Next + 'GlobalDTCliente(UsuarioActual.CveEmpresa) = Nothing + 'DtClientes = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1) Dim CountRow As Integer = 1 For Each Row As DataRow In dt.FiltraParametros("RFC <> ''").Rows Dim Sucursal As String = dtsubp.FiltroPrimeroValor("CveSubProyecto", $"SubProyecto = '{Row("Sucursal").ToString()}'") Dim TipoDocto As String = Row("Tipo Documento").ToString().Trim - Dim RFC As String = Row("RFC").ToString().Trim - Dim Serie As String = Row("Serie").ToString() + Dim RFC As String = Row("RFC").ToString().Trim.Replace("-", "").Replace(" ", "") + Dim Serie As String = Row("Serie").ToString().Trim Dim Folio As Integer = Row("Folio").ToString().ToEntero() Dim Fecha As Date = Row("Fecha").ToString().ToDate Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString().ToDate @@ -1839,14 +1848,11 @@ Partial Class General_SaldosIniciales IEPS = Row("IEPS").ToString().ToDecimal End If - - Dim CveClienteSucursal As Integer = 0 'Row("CveClienteSucursal").ToString().ToEntero() Dim FolioFiscal As String = If(dt.Columns.Contains("Folio Fiscal"), Row("Folio Fiscal").ToString(), "") Dim PorcentajeIVA As Decimal = If(dt.Columns.Contains("PorcentajeIVA"), Round(Row("PorcentajeIVA").ToString().ToDecimal, 4), 0) Dim PorcentajeRetIVA As Decimal = If(dt.Columns.Contains("PorcentajeRetIVA"), Round(Row("PorcentajeRetIVA").ToString().ToDecimal, 4), 0) Dim PorcentajeRetISR As Decimal = If(dt.Columns.Contains("PorcentajeRetISR"), Round(Row("PorcentajeRetISR").ToString().ToDecimal, 4), 0) - Dim PedidoContrato As String = If(dt.Columns.Contains("Pedido"), Row("Pedido").ToString(), "") GuardaLog(Sucursal + "-" + Row("Folio").ToString()) @@ -1855,7 +1861,6 @@ Partial Class General_SaldosIniciales Dim Folio2 As String = "" ' Row("Folio2").ToString() Dim CodCliente As String = "" 'Row("CodCliente2").ToString() - Dim IEPSDetalle As Decimal = 0 Dim CantidadDetalle As Decimal = 0 Dim PUDetalle As Decimal = 0 @@ -1880,13 +1885,11 @@ Partial Class General_SaldosIniciales Alert($"El código del producto no se encontro, error en registro {CountRow}") ErrorVentas = True End If - Else Alert($"El código es requerido, error en registro {CountRow}") ErrorVentas = True End If - IEPSDetalle = Row("IEPS").ToString.ToDecimal CantidadDetalle = Row("Cantidad").ToString.ToDecimal PUDetalle = Row("PU").ToString.ToDecimal @@ -1913,7 +1916,7 @@ Partial Class General_SaldosIniciales 'If Not CveCliente > 0 Then Alert(String.Format("No se encontró el cliente con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorVentas = True : RFC.GuardaLog : Exit For - TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESO", "INGRESOS", "ING"), "Ing", IIf(TipoDocto.ToUpper.Contiene("EGRESO", "EGRESOS", "EGS"), "Egs", "Rem")).ToString() + TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESO", "INGRESOS", "ING", "FACTURA", "FACTURAS"), "Ing", IIf(TipoDocto.ToUpper.Contiene("EGRESO", "EGRESOS", "EGS"), "Egs", "Rem")).ToString() 'PrePóliza Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Venta/SaldoInicial", 1, Total, Total, 1, Fecha, String.Format("{0}-{1}", Serie, Folio), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)