This commit is contained in:
2022-10-19 09:17:32 -07:00
31 changed files with 2311 additions and 1526 deletions

View File

@@ -650,7 +650,7 @@ Partial Class General_SaldosIniciales
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
Dim ObjConta As New ClsContabilidad
If ObjConta.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
DTCuentasContables = ObjConta.DtResultados
End If
ObjConta.Dispose()
@@ -1502,8 +1502,8 @@ Partial Class General_SaldosIniciales
Dim CveProveedorSucursal As Integer = Row("CveProveedorSucursal").ToString.ToEntero
Dim PorcentajeIVA As String = Row("PorcentajeIVA").ToString
Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestosLocales"), Row("ImpuestosLocales").ToString, "0").ToDecimal
Dim RetIVAPorcentaje As Decimal = Row("RetIVAPorcentaje").ToString.ToDecimal
Dim RetISRPorcentaje As Decimal = Row("RetISRPorcentaje").ToString.ToDecimal
If Not CvePS > 0 Then Alert(String.Format("No se encontró el Producto Servicio"), TipoMensaje.MsgError) : ErrorCompras = True
@@ -1514,6 +1514,7 @@ Partial Class General_SaldosIniciales
TipoDocto = IIf(TipoDocto.ToUpper.Contiene("INGRESOS", "INGRESO", "ING", "FACTURA"), "Fac", "NC").ToString
'Temporalmente SE BORRARA
Dim Transaccion As String = "" 'Row("Transaccion2").ToString
Dim Folio2 As String = "" 'Row("Folio2").ToString
@@ -1550,7 +1551,7 @@ Partial Class General_SaldosIniciales
CveCompra = ObjCompras.CveCompra
'Compra Detalle
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, Sucursal.ToEntero, -1, 0, 1, SubTotal, PorcentajeIVA.ToDecimal, SubTotal, 0, "Carga Inicial", -1) Then
If Not ObjCompras.AddCompraDetalle(CveCompra, CveUnidadMedida, CvePS, Sucursal.ToEntero, -1, 0, 1, SubTotal, 0.16D, SubTotal, 0, "Carga Inicial", -1, IVAPorcentaje:=PorcentajeIVA.ToDecimal, RetIVAPorcentaje:=RetIVAPorcentaje, RetISRPorcentaje:=RetISRPorcentaje) Then
ErrorCompras = True
Exit For
End If
@@ -1560,7 +1561,13 @@ Partial Class General_SaldosIniciales
'PrePólizaDetalle
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio, IIf(TipoDocto = "Fac", 5, 18).ToString.ToEntero, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=Total, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, Folio, 6, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=SubTotal, CveClasificacion:=CveClasificacion, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Folio, 14, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=IVA, CveSubProyecto:=Sucursal.ToEntero, PorcentajeImpuesto:=PorcentajeIVA.ToDecimal) Then ErrorCompras = True : Exit For
If IVA > 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Folio, 14, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=IVA, CveSubProyecto:=Sucursal.ToEntero, CveClasificacion:=CveClasificacion, PorcentajeImpuesto:=PorcentajeIVA.ToDecimal) Then ErrorCompras = True : Exit For
End If
If IEPS > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, IEPS, Folio, 25, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=IEPS, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
If RetIVA > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, RetIVA, Folio, 15, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=RetIVA, CveSubProyecto:=Sucursal.ToEntero) Then ErrorCompras = True : Exit For
@@ -1569,8 +1576,8 @@ Partial Class General_SaldosIniciales
'Saldo
If Saldo < Total Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, Folio, 17, Folio, Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=Total - Saldo) Then ErrorCompras = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, Folio, 95, Folio, Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=Total - Saldo) Then ErrorCompras = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total - Saldo, $"{Folio} SALDO INICIAL", 17, Folio, Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=Total - Saldo) Then ErrorCompras = True : Exit For
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total - Saldo, $"{Folio} SALDO INICIAL", 95, Folio, Fecha, -1, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, ImporteMX:=Total - Saldo) Then ErrorCompras = True : Exit For
End If
Encontrados = Encontrados + 1
@@ -2364,8 +2371,8 @@ Partial Class General_SaldosIniciales
Dim Clasificacion As String = dRow("Clasificacion").ToString.Trim
Dim Categoria As String = dRow("Categoria").ToString.Trim
Dim UsoClasificacion As String = dRow("UsoClasificacion").ToString.Trim.ToUpper
Dim CuentaContableIngreso As String = dRow("CuentaContableIngreso").ToString.Trim
Dim CuentaContableGasto As String = dRow("CuentaContableGasto").ToString.Trim
Dim CuentaContableIngreso As String = dRow("CuentaContableIngreso").ToString.Trim.Replace("-", "")
Dim CuentaContableGasto As String = dRow("CuentaContableGasto").ToString.Trim.Replace("-", "")
Dim CveClasificacion As Integer = -1
Dim CveUsoClasificacion As Integer = -1