diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index c6cce12bd..3470619bb 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1233,14 +1233,14 @@ Partial Class General_SaldosIniciales 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 - Dim ImpuestoLocal As Double = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDouble, 0.0) + Dim ImpuestoLocal As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDecimal, 0D) Dim Amortizacion As Double = If(dt.Columns.Contains("Amort.Ant"), Row("Amort.Ant").ToString.ToDouble, 0.0) Dim SubTotal As Decimal = Row("SubTotal").ToString.ToDecimal Dim IVA As Decimal = Row("IVA").ToString.ToDecimal Dim Total As Decimal = Row("Total").ToString.ToDecimal Dim Saldo As Decimal = Row("Saldo").ToString.ToDecimal Dim CveCliente As Integer = DtClientes.FiltroPrimeroValor("CveCliente", $"RFC = '{RFC}'").ToString.ToEntero - Dim RetIVA As Double = Row("Ret IVA").ToString.ToDouble + Dim RetIVA As Decimal = Row("Ret IVA").ToString.ToDecimal Dim RetISR As Double = Row("Ret ISR").ToString.ToDouble Dim Moneda As String = Row("Moneda").ToString Dim TipoCambio As String = Row("Tipo Cambio").ToString @@ -1249,7 +1249,6 @@ Partial Class General_SaldosIniciales Dim CveVendedor As Integer = 0 Dim IEPS As Decimal = 0 'Row("IEPS").ToString.ToDecimal Dim CveClienteSucursal As Integer = 0 'Row("CveClienteSucursal").ToString.ToEntero - Dim ImpuestosLocales As Decimal = If(dt.Columns.Contains("ImpuestoLocal"), Row("ImpuestoLocal").ToString.ToDecimal, 0) 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) @@ -1300,7 +1299,7 @@ Partial Class General_SaldosIniciales 0, 0, 0, FechaVencimiento, Fecha, "", "", Fecha, CveVendedor, Folio2, "", "", 0, 0, 0, "-1".ToDate, "-1".ToDate, "-1".ToDate, -1, -1, 0, CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=Sucursal.ToEntero, CveSubProyectoEjecucion:=Sucursal.ToEntero, CveSubProyectoCobranza:=Sucursal.ToEntero, IEPS:=IEPS, - ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente, ImpuestoLocal:=ImpuestosLocales) Then + ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente, ImpuestoLocal:=ImpuestoLocal) Then ErrorVentas = True Exit For End If @@ -1329,14 +1328,22 @@ Partial Class General_SaldosIniciales If UsuarioActual.CveEmpresa.Contiene(119, 158) Then UsaComplementaria = True 'PrePólizaDetalle - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio.ToString, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=Sucursal.ToEntero) Then ErrorVentas = True : Exit For - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString, ConceptoContable, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total) Then ErrorVentas = True : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SubTotal, Folio.ToString, 4, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=Sucursal.ToEntero, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString, ConceptoContable, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For If IVA > 0 Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IVA, Folio.ToString, 13, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IVA, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For End If 'If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, IEPS, Folio.ToString, 38, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=IEPS) Then ErrorVentas = True : Exit For + If RetIVA > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, RetIVA, Folio.ToString, 8, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=RetIVA, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For + End If + If ImpuestoLocal > 0 Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImpuestoLocal, Folio.ToString, 27, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=ImpuestoLocal, PorcentajeImpuesto:=PorcentajeIVA) Then ErrorVentas = True : Exit For + End If + + If UsaComplementaria Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total * TipoCambio.ToDecimal - Total, Folio.ToString, 203, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteME:=Total, ImporteMX:=Total * TipoCambio.ToDecimal - Total, TipoCambio:=TipoCambio.ToDecimal) Then ErrorVentas = True : Exit For End If