diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index 90bf0620b..864c9de7e 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -1605,6 +1605,15 @@ Partial Class General_SaldosIniciales #Region "C L I E N T E S - F A C T U R A S" + + Dim NoEncontrados As Integer = 0 + Dim Encontrados As Integer = 0 + Dim StrRFCNoencontrados As New StringBuilder + Dim drr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero("AplicaParaVenta = 1") + If drr Is Nothing Then + Alert("No existen productos para venta. favor de crear uno e intentar de nuevo", TipoMensaje.MsgAdvertencia) + Exit Sub + End If Dim ObjVentas As New ClsVentas Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL()) Dim ObjIE As New ClsBancos(ObjVentas.IniciaTransacSQL()) @@ -1614,10 +1623,6 @@ Partial Class General_SaldosIniciales 'Dim ExisteVenta As Boolean = False 'Dim Contador As Integer = 0 DtClientes = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1) - Dim NoEncontrados As Integer = 0 - Dim Encontrados As Integer = 0 - Dim StrRFCNoencontrados As New StringBuilder - Dim drr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimero("AplicaParaVenta = 1") Dim CvePS As Integer = drr("CvePS").ToString().ToEntero() Dim CveUnidadMedida As Integer = drr("CveUnidadMedida").ToString().ToEntero() Dim CveClasificacion As Integer = drr("CveClasificacion").ToString().ToEntero() @@ -1712,7 +1717,7 @@ Partial Class General_SaldosIniciales End If CveVenta = ObjVentas.CveVenta - If Not ObjVentas.AddVentaDetalle(CveVenta, CvePS, 1, CveUnidadMedida, SubTotal, IVA, SubTotal * PorcentajeIVA, "Saldo Inicial", 0, 0, Sucursal.ToEntero(), 0, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, ImporteRetIVA:=RetIVA) Then + If Not ObjVentas.AddVentaDetalle(CveVenta, CvePS, 1, CveUnidadMedida, SubTotal, IVA, SubTotal * PorcentajeIVA, "Saldo Inicial", 0, 0, Sucursal.ToEntero(), 0, PorcentajeIVA:=PorcentajeIVA, PorcentajeRetIVA:=PorcentajeRetIVA, ImporteRetIVA:=RetIVA, IEPS:=0) Then ErrorVentas = True Exit For End If