This commit is contained in:
2019-11-25 17:03:29 -07:00
13 changed files with 209 additions and 93 deletions

View File

@@ -145,13 +145,14 @@ Public Class ClsGralFolios
End Function
Public Function AddFolios(CveSubProyecto As Integer, TipoDocto As String, FInicial As Integer, FActual As Integer, FFinal As Integer, CBB As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Public Function AddFolios(CveSubProyecto As Integer, TipoDocto As String, Serie As String, FInicial As Integer, FActual As Integer, FFinal As Integer, CBB As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_FoliosAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@Serie", SqlDbType.VarChar).Value = Serie
.Add("@FInicial", SqlDbType.Int).Value = FInicial
.Add("@FActual", SqlDbType.Int).Value = FActual
.Add("@FFinal", SqlDbType.Int).Value = FFinal

View File

@@ -1244,7 +1244,7 @@ Public Class ClsVentas
Public Function GetRepVentas(FechaI As Date, FechaF As Date, FechaIEjec As Date, FechaFEjec As Date, CveCliente As Integer, CveSubProyectoEjecucion As Integer,
CveVendedor As String, CveUsuario As Integer, CveEstatus As String, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1",
Optional CveProyecto As Integer = -1, Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1,
Optional CveClienteClasificacion As Integer = -1) As Boolean
Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasGetRep")
@@ -1269,6 +1269,7 @@ Public Class ClsVentas
.Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
End With
Try
@@ -1372,7 +1373,7 @@ Public Class ClsVentas
Vendedor As String, CveUsuario As Integer, CveEstatus As String, FechaI As Date, FechaF As Date, CveCorte As Integer, TipoDocto As String,
CveSubProyectoEjecucion As Integer, CveEmpresa As Integer, FechaIEjec As Date, FechaFEjec As Date, Optional CveProyecto As Integer = -1,
Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveMoneda As Integer = -1, Optional CveUsuarioConsulta As Integer = -1,
Optional CveClienteClasificacion As Integer = -1) As Boolean
Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasGetRepDetalle")
@@ -1402,6 +1403,7 @@ Public Class ClsVentas
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
End With
Try

View File

@@ -1424,12 +1424,14 @@ Partial Class Bancos_PopIECompras
End If
'inserto las compras que voy a pagar
If ObjMov.GetPlantillaConceptos(2, CvePlantillaPoliza) Then
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
For Each Row As DataRow In ObjMov.DtResultados.Rows
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
Dim ImporteMovimiento As Decimal = 0
Dim ImporteMX As Decimal = 0
Dim ImporteMovimientoNoDeducible As Decimal = 0
Dim ImporteMXNoDeducible As Decimal = 0
Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0
Dim ConceptoMovimiento = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreProveedor, TxtObservaciones.Text, TxtFolio.Text.Trim)
@@ -2275,6 +2277,7 @@ Partial Class Bancos_PopIECompras
ImporteMovimiento = 0
ImporteMX = 0
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVADeducible * PorcentajePago
@@ -2296,80 +2299,65 @@ Partial Class Bancos_PopIECompras
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
End If
PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
Dim IdCtaIVAXAcreditar As Integer = 0
Dim IdCtaIVAAcreditable As Integer = 0
If MovimientoPagar.IVANoDeducible.ToString.ToDecimal > 0 Then
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
Dim TotalImporte As Decimal
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
End If
IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
End If
End If
Case 280 'Iva Acreditable No Deducible
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
Dim TotalImporte As Decimal
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
TotalImporte = ImportePagado.ToString.ToDecimal
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
TotalImporte = ImportePagado.ToString.ToDecimal
End If
If TotalImporte = CompraSaldo Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVANoDeducible
ImporteMX = ImporteMovimiento
TotalImporte = ImportePagado.ToString.ToDecimal
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
ImporteMX = ImporteMovimiento * tipoCambioCompra
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
TotalImporte = ImportePagado.ToString.ToDecimal
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2)
If TotalImporte = CompraSaldo Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = MovimientoPagar.IVANoDeducible
ImporteMXNoDeducible = ImporteMovimientoNoDeducible
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2)
ImporteMXNoDeducible = Math.Round(ImporteMX, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimientoNoDeducible.FormatoNumero(2)}"
Else
ImporteMovimientoNoDeducible = 0
ImporteMXNoDeducible = 0
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = MovimientoPagar.IVANoDeducible * PorcentajePago
ImporteMXNoDeducible = ImporteMovimientoNoDeducible
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimientoNoDeducible = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMXNoDeducible = ImporteMovimientoNoDeducible * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimientoNoDeducible = Math.Round(ImporteMovimientoNoDeducible, 2)
ImporteMXNoDeducible = Math.Round(ImporteMXNoDeducible, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
Else
ImporteMovimiento = 0
ImporteMX = 0
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimientoNoDeducible.FormatoNumero(2)}"
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
ImporteMX = Math.Round(ImporteMX, 2)
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
End If
PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
@@ -2389,6 +2377,89 @@ Partial Class Bancos_PopIECompras
CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
End If
End If
If MovimientoPagar.IVANoDeducible > 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), 280, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMXNoDeducible, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
'Case 280 'Iva Acreditable No Deducible
' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
' 'funcionalidad que toma el 100% del pago para acreditamiento de iva
' Dim TotalImporte As Decimal
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' TotalImporte = ImportePagado.ToString.ToDecimal
' End If
' If TotalImporte = CompraSaldo Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' Else
' ImporteMovimiento = 0
' ImporteMX = 0
' End If
' Else
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
' ImporteMX = Math.Round(ImporteMX, 2)
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' End If
' PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
' Dim IdCtaIVAXAcreditar As Integer = 0
' Dim IdCtaIVAAcreditable As Integer = 0
' If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
' End If
' IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
' If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
' End If
' End If
Case 25 'IEPS por Acreditar
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IEPS * PorcentajePago
@@ -3066,6 +3137,7 @@ Partial Class Bancos_PopIECompras
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
Next

View File

@@ -272,7 +272,7 @@ Partial Class Bancos_RepIngresosPorComprobar
MsgError = "Ocurrio un error al saldar el movimiento"
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, gr.DataKey("Saldo").ToDecimal, "", 78, "Saldo de IxC por Sistema", TxtFecha.Text.ToDate, -1, IdCuentaContableOtrosIngresos, gr.DataKey("CveIE").ToEntero, ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveCuenta:=-1) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, gr.DataKey("Saldo").ToDecimal, "", 78, "Saldo de IxC por Sistema", TxtFecha.Text.ToDate, IdCuentaContableOtrosIngresos, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=gr.DataKey("Saldo").ToDecimal, CveCuenta:=-1) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If

View File

@@ -8700,12 +8700,13 @@ Partial Class Compras_Compras
If Not ObjConta.PrePolizaUnificacion(CvePrepolizaPadre, CvePrePolizaNueva) Then
ErrorMovtosCxP = 1
Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError)
End If
End If
CvePrePolizaNueva = CvePrepolizaPadre 'para que se unifique siempre la prepolizanueva
End If
'Simplificacion de PrePolizas
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjConta.PrePolizaSimplificacion(CvePrepolizaPadre, UsuarioActual.CveEmpresa) Then
If Not ObjConta.PrePolizaSimplificacion(CvePrePolizaNueva, UsuarioActual.CveEmpresa) Then
ErrorMovtosCxP = 1
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
End If

View File

@@ -687,23 +687,27 @@ Partial Class Compras_ReembolsosComprobaciones
End If
'Agrego el IVA
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVA").ToDecimal, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal), ImporteMX:=(gvr.DataKey("IVA").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
If gvr.DataKey("IVADeducible").ToDecimal > 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVADeducible").ToDecimal, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVADeducible").ToDecimal), ImporteMX:=(gvr.DataKey("IVADeducible").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
End If
End If
End If
Else
'Agrego el IVA
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
End If
Dim ImporteNOIVA As Decimal = gvr.DataKey("IVA").ToDecimal * PorcentajePago
'Agrego el IVA
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
If gvr.DataKey("IVADeducible").ToDecimal > 0 Then
Dim ImporteIVA As Decimal = gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago
If ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, ImporteIVA, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, ImporteIVA), ImporteMX:=(ImporteIVA) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
MsgError = "Detalle"
End If
End If
End If
If gvr.DataKey("NoDeducible") Then
If gvr.DataKey("IVANoDeducible").ToDecimal > 0 Then
Dim ImporteNOIVA As Decimal = gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago

View File

@@ -1323,6 +1323,7 @@ Partial Class General_SaldosIniciales
Dim CveVendedor As Integer = 0
Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal
Dim CveClienteSucursal As Integer = Row("CveClienteSucursal").ToString.ToEntero
Dim ImpuestosLocales As Decimal = Row("ImpuestoLocal").ToString.ToDecimal
GuardaLog(Sucursal + "-" + Row("Sucursal").ToString)
'Temporalmente SE BORRARA
@@ -1357,9 +1358,10 @@ Partial Class General_SaldosIniciales
If FechaVencimiento = "".ToDate Or FechaVencimiento < "1900/01/01".ToDate Then
FechaVencimiento = Fecha
End If
'Venta
End If
'Venta
If CveCliente > 0 Then
@@ -1368,7 +1370,7 @@ Partial Class General_SaldosIniciales
If Not ObjVentas.AddVenta(TipoDocto, Folio, CveCliente.ToEntero, CveClienteSucursal, SubTotal, 0, 0, IVA, RetIVA, RetISR, Total, CveMoneda, TipoCambio.ToDouble,
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,
CveSubProyectoCobranza:=Sucursal.ToEntero, IEPS:=IEPS, ImpuestoLocal:=ImpuestosLocales,
ObservacionesAlmacen:=Transaccion, Entrega:=CodCliente) Then
ErrorVentas = True
Exit For

View File

@@ -2405,7 +2405,7 @@ Partial Class Inventarios_RecepcionUsados
End If
End If
AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "Inv/RecepcionUsados", SubTotal, 0, -1, "",
AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "Inv/RecepcionUsados", PU, 0, -1, "",
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA)
End If
Next

View File

@@ -2541,15 +2541,30 @@ Partial Class Clientes
If EstatusAnteriorCliente <> ChkEstado.Checked Then
Dim DTVendedor As New DataTable
DTVendedor = GlobalDTVendedores(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(" CveVendedor = " & DdlVendedor.SelectedValue.ToEntero)
DTVendedor = GlobalDTVendedores(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(" CveVendedor = " & DdlVendedor.SelectedValue.ToEntero)
Dim ObjVendedores As New ClsVtaVendedores
Dim DtVendedores As DataTable = Nothing
If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
DtVendedores = ObjVendedores.DtResultados
End If
ObjVendedores.Dispose()
If DTVendedor.Rows.Count > 0 Then
Dim _CorreoVendedor As String = DTVendedor(0)("Correo").ToString
Dim _CorreoVendedor As String = DTVendedor(0)("Correo").ToString
Dim _CorreoAsistente As String = ""
Dim _CorreoCoordinador As String = ""
Dim CveSuperior As Integer = DTVendedor(0)("CveSuperior").ToString.ToEntero
If DTVendedor.Rows.Count > 0 Then
_CorreoAsistente = DtVendedores.FiltroPrimeroValor("Correo", "CveSuperior = " & DdlVendedor.SelectedValue.ToEntero)
_CorreoCoordinador = DtVendedores.FiltroPrimeroValor("Correo", "CveVendedor = " & CveSuperior)
End If
If _CorreoVendedor.Length > 0 And UsuarioActual.Empresa.Funcionalidad(571).ToEntero > 0 Then
If (_CorreoVendedor.Length > 0 Or _CorreoAsistente.Length > 0 Or _CorreoCoordinador.Length > 0) And UsuarioActual.Empresa.Funcionalidad(571).ToEntero > 0 Then
Dim Asunto As String = ""
Dim Para As String = _CorreoVendedor
Dim Para As String = If(_CorreoVendedor.Length > 0, _CorreoVendedor & ";", "") & If(_CorreoAsistente.Length > 0, _CorreoAsistente & ";", "") & _CorreoCoordinador
Dim SBBody As New StringBuilder
If ChkEstado.Checked Then

View File

@@ -283,6 +283,14 @@
<div class="col-md-2">
<asp:DropDownList ID="DdlClienteClasificacion" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteClasificacion_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" DataTextField="ClienteClasificacion" DataValueField="CveClienteClasificacion"></asp:DropDownList>
</div>
<label title="Condiciones de Pago" data-toggle="tooltip" class="col-md-1 truncate">Condiciones Pago:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlCondicionesPago" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Crédito" Value="1"></asp:ListItem>
<asp:ListItem Text="Contado" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -106,7 +106,7 @@ Partial Class RepVentaDetalle
Private Sub InicializaValores()
Dim Grupo, CveCliente, CveSucursal, CveSubProyectoEjecucion, CveVendedor, CveUsuario, CveEstatusFactura, CveCorte, IVA, TipoDocto, CveClienteClasificacion As String
Dim Grupo, CveCliente, CveSucursal, CveSubProyectoEjecucion, CveVendedor, CveUsuario, CveEstatusFactura, CveCorte, IVA, TipoDocto, CveClienteClasificacion, CveCondicionesPago As String
Dim Anio, Mes, AnioMes, Fecha, FechaI, FechaF As String
Dim AnioEjec, MesEjec, AnioMesEjec, FechaEjec, FechaIEjec, FechaFEjec As String
'Dim CveSubProyecto As Integer
@@ -148,11 +148,13 @@ Partial Class RepVentaDetalle
CveSubProyecto = If(Request("CveSubProyecto") IsNot Nothing, Request("CveSubProyecto").ToString, "-1").ToString
CveVendedor = If(Request("CveVendedor") IsNot Nothing AndAlso Request("CveVendedor") <> "", Request("CveVendedor"), "-1").ToString
CveEstatusFactura = If(Request("CveEstatusFactura") IsNot Nothing AndAlso Request("CveEstatusFactura") <> "", Request("CveEstatusFactura"), "-1").ToString
CveCondicionesPago = If(Request("CveCondicionesPago") IsNot Nothing AndAlso Request("CveCondicionesPago") <> "", Request("CveCondicionesPago"), "-1").ToString
DdlTipoComprobante.SelectedValuesIfExistM(TipoDocto)
CargaEstatus()
DdlEstatus.SelectedValuesIfExistM(CveEstatusFactura)
DdlCondicionesPago.SelectedValueExist(CveCondicionesPago)
DdlProyecto.SelectedValueExist(CveProyecto)
If DivProyecto.Visible Then CargaSubProyecto()
@@ -441,7 +443,8 @@ Partial Class RepVentaDetalle
'PARAMETROS DE LOS LISTBOXS
Dim TipoComprobante As String = If(DdlTipoComprobante.GetSelectedValuesM = "", "-1", DdlTipoComprobante.GetSelectedValuesM)
Dim Sucursales As String = If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM)
Dim Estatus As String = If(DdlEstatus.GetSelectedValuesM = "", "-1", DdlEstatus.GetSelectedValuesM)
Dim Estatus As String = If(DdlEstatus.GetSelectedValuesM = "", "-1", DdlEstatus.GetSelectedValuesM)
Dim CveCondicionesPago As Integer = If(DdlCondicionesPago.SelectedValue = "", -1, DdlCondicionesPago.SelectedValue.ToEntero)
Dim Vendedores As String = If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM)
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
@@ -458,7 +461,7 @@ Partial Class RepVentaDetalle
If ObjVentas.GetRepVentasDetalle(DdlGrupo.SelectedValue.ToEntero, Anio.ToEntero, Mes.ToEntero, AnioMes, Fecha, CveCliente,
IVA, Vendedores, DdlUsuario.SelectedValue.ToEntero, Estatus, FechaI, FechaF,
CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec,
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero) Then
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=CveCondicionesPago) Then
DtVentas = AddRows(ObjVentas.DtResultados)
ImgImprimir.Enabled = True
GvDatos.DataSource = AddRows(ObjVentas.DtResultados)

View File

@@ -276,6 +276,14 @@
<div class="col-md-2">
<asp:DropDownList ID="DdlClienteClasificacion" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteClasificacion_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" DataTextField="ClienteClasificacion" DataValueField="CveClienteClasificacion"></asp:DropDownList>
</div>
<label title="Condiciones de Pago" data-toggle="tooltip" class="col-md-1 truncate">Condiciones Pago:</label>
<div class="col-md-2">
<asp:DropDownList ID="DdlCondicionesPago" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Crédito" Value="1"></asp:ListItem>
<asp:ListItem Text="Contado" Value="0"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -320,7 +320,7 @@ Partial Class Ventas_RepVentas
If ObjVentas.GetRepVentas(FechaI, FechaF, FechaIEjec, FechaFEjec, CveCliente, DdlSubProyectoEjecucion.SelectedValue.ToEntero, Vendedores,
DdlUsuario.SelectedValue.ToEntero, Estatus, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, TipoComprobante, DdlProyecto.SelectedValue.ToEntero, Sucursales, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, CveUsuarioConsulta:=UsuarioActual.CveUsuario,
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero) Then
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjVentas.DtResultados
DtVentas = ObjVentas.DtResultados
Else
@@ -420,7 +420,7 @@ Partial Class Ventas_RepVentas
'LIGA A DETALLE
Dim Liga As String = $"/Ventas/RepVentaDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&AnioEjec={e.Row.DBCampo("AnioEjec")}&MesEjec={e.Row.DBCampo("MesEjec")}&AnioMesEjec={e.Row.DBCampo("AnioMesEjec")}&FechaEjec={e.Row.DBCampo("FechaEjec")}&CveCliente={e.Row.DBCampo("CveCliente")}&CveVendedor={ e.Row.DBCampo("CveVendedor")}&CveUsuario={e.Row.DBCampo("CveUsuario")}&CveEstatusFactura={e.Row.DBCampo("CveEstatusFactura")}&FechaI={FechaI}&FechaF={FechaF}&FechaIEjec={FechaIEjec}&FechaFEjec={FechaFEjec}&IVA={e.Row.DBCampo("GPO_IVA")}&CveCorte={ e.Row.DBCampo("CveCorte")}&TipoDocto={ DdlTipoComprobante.GetSelectedValuesM}&CveSubProyectoEjecucion={e.Row.DBCampo("CveSubProyectoEjecucion")}&CveSubProyecto={CveSubProyecto}&CveProyecto={CveProyecto}&TipoCambio={TipoCambio}&TCEspecifico={TCEspecifico}&CveMoneda={CveMoneda}&CveClienteClasificacion={e.Row.DBCampo("CveClienteClasificacion")}"
Dim Liga As String = $"/Ventas/RepVentaDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&AnioEjec={e.Row.DBCampo("AnioEjec")}&MesEjec={e.Row.DBCampo("MesEjec")}&AnioMesEjec={e.Row.DBCampo("AnioMesEjec")}&FechaEjec={e.Row.DBCampo("FechaEjec")}&CveCliente={e.Row.DBCampo("CveCliente")}&CveVendedor={ e.Row.DBCampo("CveVendedor")}&CveUsuario={e.Row.DBCampo("CveUsuario")}&CveEstatusFactura={e.Row.DBCampo("CveEstatusFactura")}&FechaI={FechaI}&FechaF={FechaF}&FechaIEjec={FechaIEjec}&FechaFEjec={FechaFEjec}&IVA={e.Row.DBCampo("GPO_IVA")}&CveCorte={ e.Row.DBCampo("CveCorte")}&TipoDocto={ DdlTipoComprobante.GetSelectedValuesM}&CveSubProyectoEjecucion={e.Row.DBCampo("CveSubProyectoEjecucion")}&CveSubProyecto={CveSubProyecto}&CveProyecto={CveProyecto}&TipoCambio={TipoCambio}&TCEspecifico={TCEspecifico}&CveMoneda={CveMoneda}&CveClienteClasificacion={e.Row.DBCampo("CveClienteClasificacion")}&CveCondicionesPago={DdlCondicionesPago.SelectedValue}"
e.Row.FCLiteral("LtlGrupo").Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.FCLiteral("LtlGrupo").Text & "</a>"