diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index bc5167d0e..4580b6c65 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1398,7 +1398,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.Contiene("INGRESO", "INGRESOS"), "Ing", IIf(TipoDocto = "EGRESO", "Egs", "Rem")).ToString + TipoDocto = IIf(TipoDocto.Contiene("INGRESO", "INGRESOS"), "Ing", IIf(TipoDocto.Contiene("EGRESO", "EGRESOS"), "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) @@ -1410,8 +1410,9 @@ Partial Class General_SaldosIniciales End If 'Moneda - If Moneda.ToUpper.Contiene("PESOS", "PESO", "MN") Then + If Moneda.ToUpper.Contiene("PESOS", "PESO", "MXN") Then CveMoneda = 1 + TipoCambio = "1" ElseIf Moneda.ToUpper.Contiene("DÓLARES", "DOLARES", "USD") Then CveMoneda = 2 End If @@ -1460,12 +1461,20 @@ Partial Class General_SaldosIniciales End If End If + Dim UsaComplementaria As Boolean = False + + 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, 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 '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 UsaComplementaria Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Total, Folio.ToString, 203, String.Format("{0}-{1}", Serie, Folio), Fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteME:=Total, ImporteMX:=Total * TipoCambio.ToDecimal, TipoCambio:=TipoCambio.ToDecimal) Then ErrorVentas = True : Exit For + + End If 'Saldo If Saldo < Total Then