--correciones de saldos iniciales

This commit is contained in:
2023-11-24 10:44:29 -07:00
parent 47b6b929aa
commit 12a4383803

View File

@@ -294,20 +294,20 @@ Partial Class General_SaldosIniciales
Exit Sub Exit Sub
End If End If
If Not dt.Columns(15).ColumnName = "IEPS" Then 'If Not dt.Columns(15).ColumnName = "IEPS" Then
Alert("El nombre de la decimosexta columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError) ' Alert("El nombre de la decimosexta columna debe ser 'IEPS'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub ' Exit Sub
End If 'End If
If Not dt.Columns(16).ColumnName = "RetIVAPorcentaje" Then 'If Not dt.Columns(16).ColumnName = "RetIVAPorcentaje" Then
Alert("El nombre de la decimoséptima columna debe ser 'RetIVAPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError) ' Alert("El nombre de la decimoséptima columna debe ser 'RetIVAPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub ' Exit Sub
End If 'End If
If Not dt.Columns(17).ColumnName = "RetISRPorcentaje" Then 'If Not dt.Columns(17).ColumnName = "RetISRPorcentaje" Then
Alert("El nombre de la decimoctava columna debe ser 'RetISRPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError) ' Alert("El nombre de la decimoctava columna debe ser 'RetISRPorcentaje'. Favor de corregirlo", TipoMensaje.MsgError)
Exit Sub ' Exit Sub
End If 'End If
'If RblFormato.SelectedValue = "4" Then 'If RblFormato.SelectedValue = "4" Then
' If Not dt.Columns(15).ColumnName = "ImpuestoLocal" Then ' If Not dt.Columns(15).ColumnName = "ImpuestoLocal" Then
@@ -1491,12 +1491,12 @@ Partial Class General_SaldosIniciales
Dim IVA As Decimal = Row("IVA").ToString().ToDecimal Dim IVA As Decimal = Row("IVA").ToString().ToDecimal
Dim Total As Decimal = Row("Total").ToString().ToDecimal Dim Total As Decimal = Row("Total").ToString().ToDecimal
Dim Saldo As Decimal = Row("Saldo").ToString().ToDecimal Dim Saldo As Decimal = Row("Saldo").ToString().ToDecimal
Dim TipoDocto As String = Row("Tipo Documento").ToString() Dim TipoDocumento As String = Row("Tipo Documento").ToString().Trim()
Dim CveProveedor As Integer = DtProveedores.FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString().ToEntero() Dim CveProveedor As Integer = DtProveedores.FiltroPrimeroValor("CveProveedor", $"RFC = '{RFC}'").ToString().ToEntero()
GuardaLog(Sucursal + " - " + Row("Sucursal").ToString()) GuardaLog(Sucursal + " - " + Row("Sucursal").ToString())
Dim RetIVA As Decimal = Row("Ret IVA").ToString().ToDecimal Dim RetIVA As Decimal = Row("Ret IVA").ToString().ToDecimal
Dim RetISR As Decimal = Row("Ret ISR").ToString().ToDecimal Dim RetISR As Decimal = Row("Ret ISR").ToString().ToDecimal
Dim IEPS As Decimal = Row("IEPS").ToString().ToDecimal Dim IEPS As Decimal = If(dt.Columns.Contains("IEPS"), Row("IEPS").ToString(), "0").ToDecimal
Dim Moneda As String = Row("Moneda").ToString() Dim Moneda As String = Row("Moneda").ToString()
Dim TipoCambio As String = Row("Tipo Cambio").ToString() Dim TipoCambio As String = Row("Tipo Cambio").ToString()
Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString().ToDate Dim FechaVencimiento As Date = Row("Fecha Vencimiento").ToString().ToDate
@@ -1504,8 +1504,8 @@ Partial Class General_SaldosIniciales
Dim CveProveedorSucursal As Integer = Row("CveProveedorSucursal").ToString().ToEntero() Dim CveProveedorSucursal As Integer = Row("CveProveedorSucursal").ToString().ToEntero()
Dim PorcentajeIVA As String = Row("PorcentajeIVA").ToString() Dim PorcentajeIVA As String = Row("PorcentajeIVA").ToString()
Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestosLocales"), Row("ImpuestosLocales").ToString(), "0").ToDecimal Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestosLocales"), Row("ImpuestosLocales").ToString(), "0").ToDecimal
Dim RetIVAPorcentaje As Decimal = Row("RetIVAPorcentaje").ToString().ToDecimal Dim RetIVAPorcentaje As Decimal = If(dt.Columns.Contains("RetIVAPorcentaje"), Row("RetIVAPorcentaje").ToString(), "0").ToDecimal
Dim RetISRPorcentaje As Decimal = Row("RetISRPorcentaje").ToString().ToDecimal Dim RetISRPorcentaje As Decimal = If(dt.Columns.Contains("RetISRPorcentaje"), Row("RetISRPorcentaje").ToString(), "0").ToDecimal
If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorCompras = True If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorCompras = True
@@ -1513,7 +1513,7 @@ Partial Class General_SaldosIniciales
If Not CveProveedor > 0 Then Alert(String.Format("No se encontró el Proveedor con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorCompras = True : Exit For If Not CveProveedor > 0 Then Alert(String.Format("No se encontró el Proveedor con el RFC: {0}", {RFC}), TipoMensaje.MsgError) : ErrorCompras = True : Exit For
If Not CveProveedorSucursal > 0 Then CveProveedorSucursal = -1 If Not CveProveedorSucursal > 0 Then CveProveedorSucursal = -1
TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESOS", "INGRESO", "ING", "FACTURA"), "Fac", "NC").ToString() Dim TipoDocto = IIf(TipoDocumento.ToUpper.Contiene("INGRESOS", "INGRESO", "ING", "FACTURA"), "Fac", "NC").ToString()
@@ -1546,7 +1546,7 @@ Partial Class General_SaldosIniciales
'Compra 'Compra
If Not ObjCompras.AddCompra(TipoDocto, "", Serie, Folio, Folio2, CveProveedor.ToEntero(), SubTotal, 0, 0, IVA, RetIVA, RetISR, IEPS, 0, 0, Total, Fecha, CveMoneda, TipoCambio.ToDecimal, FechaVencimiento, If Not ObjCompras.AddCompra(TipoDocto, "", Serie, Folio, Folio2, CveProveedor.ToEntero(), SubTotal, 0, 0, IVA, RetIVA, RetISR, IEPS, 0, 0, Total, Fecha, CveMoneda, TipoCambio.ToDecimal, FechaVencimiento,
False, CodProvee, 1, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorSucursal:=CveProveedorSucursal, False, CodProvee, 1, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorSucursal:=CveProveedorSucursal,
NumeroReembolso:=Transaccion, PorcentajeIVA:=PorcentajeIVA.ToDecimal, TotalOriginal:=Total) Then NumeroReembolso:=Transaccion, PorcentajeIVA:=PorcentajeIVA.ToDecimal, TotalOriginal:=Total, CveSubProyecto:=Sucursal.ToEntero()) Then
ErrorCompras = True ErrorCompras = True
Exit For Exit For
End If End If