diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb
index a86e2c02a..ad042738c 100644
--- a/App_Code/ClsClientes.vb
+++ b/App_Code/ClsClientes.vb
@@ -544,7 +544,7 @@ Public Class ClsClientes
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0,
Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1", Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False,
Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional UsaProductoAlterno As Boolean = False,
- Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False) As Boolean
+ Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False, Optional CveSubProyectoCobranza As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -682,6 +682,7 @@ Public Class ClsClientes
.Add("@GastosEnvio", SqlDbType.SmallMoney).Value = GastosEnvio
.Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial
.Add("@Aseguradora", SqlDbType.Bit).Value = Aseguradora
+ .Add("@CveSubProyectoCobranza", SqlDbType.Int).Value = CveSubProyectoCobranza
End With
Try
SqlAdapter.Fill(Data)
@@ -728,7 +729,7 @@ Public Class ClsClientes
Optional LT As String = "0", Optional LG As String = "0", Optional EsDistribuidor As Boolean = False, Optional TipoCliente As Integer = 1, Optional CargoUsado As Boolean = False, Optional BonificacionUsado As Boolean = False, Optional CveTipoRetencion As Integer = 0, Optional CorreoEntregaCompras As String = "-1", Optional CorreoEntregaAlmacen As String = "-1",
Optional CveSATEstado As Integer = -1, Optional CveAdminTrayecto As Integer = -1, Optional NoDesglosaIVA As Boolean = False, Optional CveRegimenFiscal As Integer = 0, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False,
Optional RepresentanteLegal As String = "", Optional FechaLimiteCredito As Date = MinFecha, Optional ComExtCalle As String = "-1", Optional ComExtNumExt As String = "-1", Optional ComExtCP As String = "-1", Optional Genero As Boolean = True, Optional CveAlmacenAsignado As Integer = -1, Optional CveAlmacenAlterno As Integer = -1, Optional CveAlmacenConsignacion As Integer = -1, Optional UsaProductoAlterno As Boolean = False,
- Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False) As Boolean
+ Optional EnDemanda As Boolean = False, Optional EnQuebranto As Boolean = False, Optional CreditoRegistroFirmas As String = "", Optional GastosEnvio As Decimal = 0, Optional EsFilial As Boolean = False, Optional Aseguradora As Boolean = False, Optional CveSubProyectoCobranza As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -876,6 +877,7 @@ Public Class ClsClientes
.Add("@GastosEnvio", SqlDbType.SmallMoney).Value = GastosEnvio
.Add("@EsFilial", SqlDbType.VarChar).Value = EsFilial
.Add("@Aseguradora", SqlDbType.Bit).Value = Aseguradora
+ .Add("@CveSubProyectoCobranza", SqlDbType.Int).Value = CveSubProyectoCobranza
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb
index 08575e3ae..afc719fed 100644
--- a/App_Code/ClsMovimientos.vb
+++ b/App_Code/ClsMovimientos.vb
@@ -240,7 +240,7 @@ Public Class ClsMovimientos
TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1",
Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional EstatusCliente As Integer = -1, Optional CveUsuarioConsulta As Integer = -1,
Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional TipoCliente As Integer = -1, Optional CveMoneda As Integer = -1,
- Optional TieneLineaAdicional As Integer = -1, Optional CveContrato As Integer = -1, Optional Aseguradora As Integer = -1) As Boolean
+ Optional TieneLineaAdicional As Integer = -1, Optional CveContrato As Integer = -1, Optional Aseguradora As Integer = -1, Optional CveSubProyectoCobranza As Integer = -1) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -277,6 +277,7 @@ Public Class ClsMovimientos
.Add("@TieneLineaAdicional", SqlDbType.Int).Value = TieneLineaAdicional
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@Aseguradora", SqlDbType.Int).Value = Aseguradora
+ .Add("@CveSubProyectoCobranza", SqlDbType.Int).Value = CveSubProyectoCobranza
End With
Try
@@ -329,7 +330,7 @@ Public Class ClsMovimientos
Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1,
Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional LimiteCredito As Decimal = -1,
Optional TipoCliente As Integer = -1, Optional CveMoneda As Integer = -1, Optional EstatusCliente As Integer = -1,
- Optional TieneLineaAdicional As Integer = -1, Optional CveContrato As Integer = -1, Optional Aseguradora As Integer = -1) As Boolean
+ Optional TieneLineaAdicional As Integer = -1, Optional CveContrato As Integer = -1, Optional Aseguradora As Integer = -1, Optional CveSubProyectoCobranza As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DS = New DataSet
@@ -371,6 +372,7 @@ Public Class ClsMovimientos
.Add("@TieneLineaAdicional", SqlDbType.Int).Value = TieneLineaAdicional
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@Aseguradora", SqlDbType.Int).Value = Aseguradora
+ .Add("@CveSubProyectoCobranza", SqlDbType.Int).Value = CveSubProyectoCobranza
End With
Try
@@ -1587,7 +1589,7 @@ Public Class ClsMovimientos
Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1,
Optional EsDistribuidor As Integer = -1, Optional FechaAplicadoI As Date = MinFecha, Optional FechaAplicadoF As Date = MaxFecha,
Optional FechaRegistroIEI As Date = MinFecha, Optional FechaRegistroIEF As Date = MaxFecha,
- Optional CveCondicionesPago As Integer = -1, Optional CveTipoTransaccion As Integer = -1, Optional CveMoneda As Integer = -1) As Boolean
+ Optional CveCondicionesPago As Integer = -1, Optional CveTipoTransaccion As Integer = -1, Optional CveMoneda As Integer = -1, Optional CveSubProyectoCobranza As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_RepRecuperacion")
SqlAdapter.SelectCommand.CommandTimeout = 0
@@ -1621,7 +1623,8 @@ Public Class ClsMovimientos
.Add("@FechaRegistroIEI", SqlDbType.Date).Value = FechaRegistroIEI.ToShortDateString
.Add("@FechaRegistroIEF", SqlDbType.Date).Value = FechaRegistroIEF.ToShortDateString
- .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
+ .Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
+ .Add("@CveSubProyectoCobranza", SqlDbType.Int).Value = CveSubProyectoCobranza
End With
Try
SqlAdapter.Fill(Data)
@@ -1678,7 +1681,7 @@ Public Class ClsMovimientos
Optional CveMoneda As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional Tipo As Integer = -1,
Optional EsDistribuidor As Integer = -1, Optional FechaAplicadoI As Date = Nothing, Optional FechaAplicadoF As Date = Nothing,
Optional FechaRegistroIEI As Date = MinFecha, Optional FechaRegistroIEF As Date = MaxFecha,
- Optional CveCondicionesPago As Integer = -1, Optional CveTipoTransaccion As Integer = -1) As Boolean
+ Optional CveCondicionesPago As Integer = -1, Optional CveTipoTransaccion As Integer = -1, Optional CveSubProyectoCobranza As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1715,8 +1718,8 @@ Public Class ClsMovimientos
.Add("@FechaAplicadoI", SqlDbType.Date).Value = FechaAplicadoI.ToShortDateString
.Add("@FechaAplicadoF", SqlDbType.Date).Value = FechaAplicadoF.ToShortDateString
.Add("@FechaRegistroIEI", SqlDbType.Date).Value = FechaRegistroIEI.ToShortDateString
- .Add("@FechaRegistroIEF", SqlDbType.Date).Value = FechaRegistroIEF.ToShortDateString
-
+ .Add("@FechaRegistroIEF", SqlDbType.Date).Value = FechaRegistroIEF.ToShortDateString
+ .Add("@CveSubProyectoCobranza", SqlDbType.Int).Value = CveSubProyectoCobranza
End With
Try
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 15b28aa7f..6e916f791 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -9544,91 +9544,93 @@ Public Class ClsPaginas
If Pago.TipoPago = "NC" Then ConPreP.CveConcepto = If(VentaActual.CveMoneda <> 1, 301, 251)
'movimiento de pago cliente
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, Pago.ImportePagoVenta, ConPreP.CveConcepto, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada, Contabilizable:=Contabilizable) Then ErrorMovtos = True
- 'movimiento de pago cliente Complementaria
- If Not ErrorMovtos AndAlso VentaActual.CveMoneda > 1 Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, (ImporteME * TCValuacionVenta - ImporteME).RoundSQL, CveConceptoContableComplementaria, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada, Contabilizable:=Contabilizable) Then ErrorMovtos = True
- End If
-
- If Pago.AplicaTraslado Then
- 'si tiene iva y su proporcion
- If Not ErrorMovtos AndAlso VentaActual.IVA <> 0 Then
- ImporteMovimiento = (PorcentajePago * VentaActual.IVA).RoundSQL
- ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
- If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
-
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 13, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
-
- 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
- If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 61, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ If Pago.ImportePagoVenta > 0 Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, Pago.ImportePagoVenta, ConPreP.CveConcepto, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada, Contabilizable:=Contabilizable) Then ErrorMovtos = True
+ 'movimiento de pago cliente Complementaria
+ If Not ErrorMovtos AndAlso VentaActual.CveMoneda > 1 Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePagoVenta, (ImporteME * TCValuacionVenta - ImporteME).RoundSQL, CveConceptoContableComplementaria, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveVentaAmortizacion:=Pago.CveVentaAmortizacion, TipoCambio:=TCValuacionVenta, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada, Contabilizable:=Contabilizable) Then ErrorMovtos = True
End If
- 'si tiene RET IVA y su proporcion
- If Not ErrorMovtos AndAlso VentaActual.RetIVA > 0 Then
- ImporteMovimiento = (PorcentajePago * VentaActual.RetIVA).RoundSQL
- ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
- If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
- 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
- If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 62, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+
+
+ If Pago.AplicaTraslado Then
+ 'si tiene iva y su proporcion
+ If Not ErrorMovtos AndAlso VentaActual.IVA <> 0 Then
+ ImporteMovimiento = (PorcentajePago * VentaActual.IVA).RoundSQL
+ ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
+ If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
+
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 13, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+
+ 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
+ If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 61, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ End If
+ 'si tiene RET IVA y su proporcion
+ If Not ErrorMovtos AndAlso VentaActual.RetIVA > 0 Then
+ ImporteMovimiento = (PorcentajePago * VentaActual.RetIVA).RoundSQL
+ ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
+ If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
+ If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 62, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ End If
+ 'si tiene Ret ISR y su proporcion
+ If Not ErrorMovtos AndAlso VentaActual.RetISR > 0 Then
+ ImporteMovimiento = (PorcentajePago * VentaActual.RetISR).RoundSQL
+ ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
+ If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
+ If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 63, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ End If
+ 'si tiene IEPS y su proporcion
+ If Not ErrorMovtos AndAlso VentaActual.IEPS > 0 Then
+ ImporteMovimiento = (PorcentajePago * VentaActual.IEPS).RoundSQL
+ ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
+ If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
+ Dim Ret As New ConceptosRetenciones
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
+ If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 39, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ End If
End If
- 'si tiene Ret ISR y su proporcion
- If Not ErrorMovtos AndAlso VentaActual.RetISR > 0 Then
- ImporteMovimiento = (PorcentajePago * VentaActual.RetISR).RoundSQL
- ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
- If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
- 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
- If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * TCValuacionPago).RoundSQL
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 63, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
- End If
- 'si tiene IEPS y su proporcion
- If Not ErrorMovtos AndAlso VentaActual.IEPS > 0 Then
- ImporteMovimiento = (PorcentajePago * VentaActual.IEPS).RoundSQL
- ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
- If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
- Dim Ret As New ConceptosRetenciones
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
- 'si tiene funcionalidad para tomar el TC de pago. se recalcula el importe
- If FuncionalidadFluctuacionImpuestos Then ImporteMN = (ImporteMovimiento * Pago.TCPago).RoundSQL
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 39, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+
+ If Pago.AplicaConceptoImpuestoPendiente Then
+ 'si tiene iva y su proporcion
+ If Not ErrorMovtos AndAlso VentaActual.IVA <> 0 Then
+ ImporteMovimiento = (PorcentajePago * VentaActual.IVA).RoundSQL
+ ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
+ If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
+
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 13, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ End If
+ 'si tiene RET IVA y su proporcion
+ If Not ErrorMovtos AndAlso VentaActual.RetIVA > 0 Then
+ ImporteMovimiento = (PorcentajePago * VentaActual.RetIVA).RoundSQL
+ ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
+ If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ End If
+ 'si tiene Ret ISR y su proporcion
+ If Not ErrorMovtos AndAlso VentaActual.RetISR > 0 Then
+ ImporteMovimiento = (PorcentajePago * VentaActual.RetISR).RoundSQL
+ ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
+ If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ End If
+ 'si tiene IEPS y su proporcion
+ If Not ErrorMovtos AndAlso VentaActual.IEPS > 0 Then
+ ImporteMovimiento = (PorcentajePago * VentaActual.IEPS).RoundSQL
+ ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
+ If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
+ Dim Ret As New ConceptosRetenciones
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
+ End If
End If
End If
-
- If Pago.AplicaConceptoImpuestoPendiente Then
- 'si tiene iva y su proporcion
- If Not ErrorMovtos AndAlso VentaActual.IVA <> 0 Then
- ImporteMovimiento = (PorcentajePago * VentaActual.IVA).RoundSQL
- ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
- If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
-
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 13, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, PorcentajeImpuesto:=VentaActual.PorcentajeIVA, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
- End If
- 'si tiene RET IVA y su proporcion
- If Not ErrorMovtos AndAlso VentaActual.RetIVA > 0 Then
- ImporteMovimiento = (PorcentajePago * VentaActual.RetIVA).RoundSQL
- ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
- If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteMovimiento, ImporteMN, 8, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
- End If
- 'si tiene Ret ISR y su proporcion
- If Not ErrorMovtos AndAlso VentaActual.RetISR > 0 Then
- ImporteMovimiento = (PorcentajePago * VentaActual.RetISR).RoundSQL
- ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
- If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 9, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
- End If
- 'si tiene IEPS y su proporcion
- If Not ErrorMovtos AndAlso VentaActual.IEPS > 0 Then
- ImporteMovimiento = (PorcentajePago * VentaActual.IEPS).RoundSQL
- ImporteMN = (ImporteMovimiento * VentaActual.TC).RoundSQL
- If VentaActual.CveMoneda > 1 Then ImporteME = ImporteMovimiento
- Dim Ret As New ConceptosRetenciones
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteMovimiento, ImporteMN, 38, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, TipoCambio:=VentaActual.TC, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=VentaActual.CveSubProyecto, CveCompra:=Pago.CveCompraRelacionada) Then ErrorMovtos = True
- End If
- End If
-
'concepto pago
If Pago.TipoPago = "B" AndAlso Not ErrorMovtos AndAlso AplicarConceptoAplicacion Then ' B A N C O S
Concepto = String.Format("{0} NC:{1}", VentaActual.ClienteNombre, Pago.Referencia)
diff --git a/App_Code/ClsPuntoVenta.vb b/App_Code/ClsPuntoVenta.vb
index 729fc7426..a0d04f707 100644
--- a/App_Code/ClsPuntoVenta.vb
+++ b/App_Code/ClsPuntoVenta.vb
@@ -400,11 +400,31 @@ Public Class ClsPuntoVenta
End Try
Return Retorno
- End Function
+ End Function
+
+ Public Function GetVta_EstadoCajas(CveCuenta As Integer, CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_VentasEstadoCajasGet")
+
+ SqlAdapter.SelectCommand.Parameters.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
+ SqlAdapter.SelectCommand.Parameters.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ SqlAdapter.SelectCommand.Parameters.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ SqlAdapter.SelectCommand.Parameters.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener los Cortes del Punto de Venta.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
#Region "IDisposable Support"
-
-
- ' IDisposable
+
+
+ ' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb
index 7617ad869..241ce2730 100644
--- a/App_Code/ClsRH.vb
+++ b/App_Code/ClsRH.vb
@@ -1555,8 +1555,8 @@ Public Class ClsRH
Public Property SalarioDiarioSS As Decimal
Public Property NumDiasAguinaldo As Integer
Public Property PorPrimaVacacional As Decimal
- 'Public Property Bono As Double
Public Property CveMetodoPago As Integer
+ Public Property CveFormaPago As Integer
Public Property MetodoPago As String
Public Property MetodoPagoSAT As String
Public Property CLABE As String
@@ -1603,7 +1603,7 @@ Public Class ClsRH
Public Function GetPersonal(CvePersonal As Integer, Codigo As String, Nombre As String, NSS As String, RFC As String, CveTurno As Integer, CvePuesto As Integer,
CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, CveEstadoCivil As Integer, CveGenero As Integer,
CveEstatusPersonal As Integer, CveSubProyecto As Integer, CveClienteAsignado As Integer, HorarioTrabajo As String, CveSupervisor As Integer,
- CveTipoPeriodo As Integer, CveMetodoPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer,
+ CveTipoPeriodo As Integer, CveFormaPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer,
FechaIFinContrato As String, FechaFFinContrato As String, FechaIIngreso As String, FechaFIngreso As String, CveEmpresa As Integer, Optional EsReserva As Integer = -1) As Boolean
Dim Retorno As Boolean = False
@@ -1628,7 +1628,7 @@ Public Class ClsRH
.Add("@HorarioTrabajo", SqlDbType.VarChar).Value = HorarioTrabajo
.Add("@CveSupervisor", SqlDbType.Int).Value = CveSupervisor
.Add("@CveTipoPeriodo", SqlDbType.Int).Value = CveTipoPeriodo
- .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago
+ .Add("@CveFormaPago", SqlDbType.Int).Value = CveFormaPago
.Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
.Add("@CveMotivoBaja", SqlDbType.Int).Value = CveMotivoBaja
.Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto
@@ -1668,8 +1668,9 @@ Public Class ClsRH
'Me.Bono = Data.Rows(0)("Bono").ToString.ToDouble
Me.SalarioDiarioSS = Data.Rows(0)("SalarioDiarioSS").ToString.ToDecimal
Me.NumDiasAguinaldo = Data.Rows(0)("NumDiasAguinaldo").ToString.ToEntero
- Me.PorPrimaVacacional = Data.Rows(0)("PorPrimaVacacional").ToString.ToDecimal
+ Me.PorPrimaVacacional = Data.Rows(0)("PorPrimaVacacional").ToString.ToDecimal
Me.CveMetodoPago = Data.Rows(0)("CveMetodoPago").ToString.ToEntero
+ Me.CveFormaPago = Data.Rows(0)("CveFormaPago").ToString.ToEntero
Me.MetodoPago = Data.Rows(0)("MetodoPago").ToString
Me.MetodoPagoSAT = Data.Rows(0)("MetodoPagoSAT").ToString
@@ -1780,7 +1781,7 @@ Public Class ClsRH
Public Function GetPersonal2(CvePersonal As Integer, Codigo As String, Nombre As String, NSS As String, RFC As String, CveTurno As Integer, CvePuesto As Integer,
CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer, CveEstadoCivil As Integer, CveGenero As Integer,
CveEstatusPersonal As Integer, CveSubProyecto As Integer, CveClienteAsignado As Integer, HorarioTrabajo As String, CveSupervisor As Integer,
- CveTipoPeriodo As Integer, CveMetodoPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer,
+ CveTipoPeriodo As Integer, CveFormaPago As Integer, CveTipoContrato As Integer, CveMotivoBaja As Integer, CveProyecto As Integer,
FechaIFinContrato As String, FechaFFinContrato As String, FechaIIngreso As String, FechaFIngreso As String, SqlStr As String, NCaracteristicas As Integer,
CveEmpresa As Integer, Optional TopSelect As Integer = 10000, Optional EsReserva As Integer = -1) As Boolean
@@ -1806,7 +1807,7 @@ Public Class ClsRH
.Add("@HorarioTrabajo", SqlDbType.VarChar).Value = HorarioTrabajo
.Add("@CveSupervisor", SqlDbType.Int).Value = CveSupervisor
.Add("@CveTipoPeriodo", SqlDbType.Int).Value = CveTipoPeriodo
- .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago
+ .Add("@CveFormaPago", SqlDbType.Int).Value = CveFormaPago
.Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
.Add("@CveMotivoBaja", SqlDbType.Int).Value = CveMotivoBaja
.Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto
@@ -1846,7 +1847,7 @@ Public Class ClsRH
Me.SalarioDiarioSS = Data.Rows(0)("SalarioDiarioSS").ToString.ToDecimal
Me.NumDiasAguinaldo = Data.Rows(0)("NumDiasAguinaldo").ToString.ToEntero
Me.PorPrimaVacacional = Data.Rows(0)("PorPrimaVacacional").ToString.ToDecimal
- Me.CveMetodoPago = Data.Rows(0)("CveMetodoPago").ToString.ToEntero
+ Me.CveFormaPago = Data.Rows(0)("CveFormaPago").ToString.ToEntero
Me.MetodoPago = Data.Rows(0)("MetodoPago").ToString
Me.MetodoPagoSAT = Data.Rows(0)("MetodoPagoSAT").ToString
@@ -1975,7 +1976,7 @@ Public Class ClsRH
Return Retorno
End Function
Public Function AddPersonal(Codigo As String, APaterno As String, AMaterno As String, Nombres As String, Correo As String, FechaIngreso As Date, CveTipoPeriodo As Integer, NumeroSS As String, SeInscribioSS As Boolean, SalarioDiarioPago As Double, SalarioDiario As Double, SDI As Double,
- SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveMetodoPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String,
+ SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveFormaPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String,
CveTipoContrato As Integer, Ubicacion As String, CveTurno As Integer, CvePuesto As Integer, CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer,
CveEstadoCivil As Integer, CveGenero As Integer, CveMotivoBaja As Integer, FechaBaja As String, CveEstatusPersonal As Integer, FechaNacimiento As Date, LugarNacimiento As String,
Calle As String, NumExt As String, NumInt As String, Colonia As String, CP As String, Ciudad As String, CveEstado As Integer, Telefono As String, TelefonoEmergencia As String, Celular As String, RFC As String, CURP As String, CredencialElector As String,
@@ -2008,7 +2009,7 @@ Public Class ClsRH
.Add("@Bono", SqlDbType.Money).Value = Bono
.Add("@NumDiasAguinaldo", SqlDbType.Int).Value = NumDiasAguinaldo
.Add("@PorPrimaVacacional", SqlDbType.Float).Value = PorPrimaVacacional
- .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago
+ .Add("@CveFormaPago", SqlDbType.Int).Value = CveFormaPago
.Add("@FechaInicioContrato", SqlDbType.Date).Value = FechaInicioContrato
.Add("@FechaFinContrato", SqlDbType.VarChar).Value = FechaFinContrato
.Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
@@ -2130,7 +2131,7 @@ Public Class ClsRH
Public Function UpdatePersonal(Codigo As String, APaterno As String, AMaterno As String, Nombres As String, Correo As String, FechaIngreso As Date, CveTipoPeriodo As Integer, NumeroSS As String, SeInscribioSS As Boolean, SalarioDiarioPago As Double, SalarioDiario As Double, SDI As Double,
- SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveMetodoPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String,
+ SalarioDiarioSS As Double, Bono As Double, NumDiasAguinaldo As Integer, PorPrimaVacacional As Double, CveFormaPago As Integer, FechaInicioContrato As Date, FechaFinContrato As String,
CveTipoContrato As Integer, Ubicacion As String, CveTurno As Integer, CvePuesto As Integer, CveDepartamento As Integer, CveRuta As Integer, CveEscolaridad As Integer,
CveEstadoCivil As Integer, CveGenero As Integer, CveMotivoBaja As Integer, FechaBaja As String, CveEstatusPersonal As Integer, FechaNacimiento As Date, LugarNacimiento As String,
Calle As String, NumExt As String, NumInt As String, Colonia As String, CP As String, Ciudad As String, CveEstado As Integer, Telefono As String, TelefonoEmergencia As String, Celular As String, RFC As String, CURP As String, CredencialElector As String,
@@ -2165,7 +2166,7 @@ Public Class ClsRH
.Add("@Bono", SqlDbType.Money).Value = Bono
.Add("@NumDiasAguinaldo", SqlDbType.Int).Value = NumDiasAguinaldo
.Add("@PorPrimaVacacional", SqlDbType.Float).Value = PorPrimaVacacional
- .Add("@CveMetodoPago", SqlDbType.Int).Value = CveMetodoPago
+ .Add("@CveFormaPago", SqlDbType.Int).Value = CveFormaPago
.Add("@FechaInicioContrato", SqlDbType.Date).Value = FechaInicioContrato
.Add("@FechaFinContrato", SqlDbType.VarChar).Value = FechaFinContrato
.Add("@CveTipoContrato", SqlDbType.Int).Value = CveTipoContrato
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 484068c11..966cac521 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -2482,7 +2482,8 @@ Public Class ClsVentas
#Region " PROMOCIONES "
Public Function GetPromociones(CvePromocion As Integer, Fecha As Date, CveVendedor As Integer, CveCliente As Integer, Estatus As Integer, CveEmpresa As Integer,
- CveSubProyecto As Integer, Optional CveMarca As Integer = -1, Optional CveUsuario As Integer = -1) As Boolean
+ CveSubProyecto As Integer, Optional CveMarca As Integer = -1, Optional CveUsuario As Integer = -1, Optional CvePS As Integer = -1) As Boolean
+
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_PromocionesGet")
@@ -2496,6 +2497,7 @@ Public Class ClsVentas
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuario
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
End With
Try
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 419794e5b..a80ace836 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -5664,9 +5664,9 @@ Namespace Modelos
'''
'''
'''
- Public Function CancelarFactura(RealizarDevolucionAlmacen As Integer, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional CancelarBoletos As Boolean = False, Optional ForzarDevolucion As Boolean = False, Optional CancelacionPagos As OpcionesCancelacionPagos = OpcionesCancelacionPagos.SinPagos, Optional CveEstatusFacturaAsignado As Integer = -1, Optional CvePACEspecifico As Integer = -1) As MCancelacionVentaMensaje
+ Public Function CancelarFactura(RealizarDevolucionAlmacen As Integer, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing, Optional CveMotivoCancelacion As Integer = -1, Optional Motivo As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0, Optional CancelarBoletos As Boolean = False, Optional ForzarDevolucion As Boolean = False, Optional CancelacionPagos As OpcionesCancelacionPagos = OpcionesCancelacionPagos.SinPagos, Optional CveEstatusFacturaAsignado As Integer = -1, Optional CvePACEspecifico As Integer = -1, Optional TransaccionCompartida As SqlClient.SqlTransaction = Nothing) As MCancelacionVentaMensaje
'Comprobante emitido con errores sin relación
- Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, CveEstadoCancelacion:=CveEstadoCancelacion, CancelarBoletos:=CancelarBoletos, ForzarDevolucion:=ForzarDevolucion, CancelacionPagos:=CancelacionPagos, CveEstatusFacturaAsignado:=CveEstatusFacturaAsignado, ValidarSAT:=ValidarSAT, CvePACEspecifico:=CvePACEspecifico)
+ Return CancelarVenta(Me, Me.UsuarioActual, RealizarDevolucionAlmacen:=RealizarDevolucionAlmacen, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveMotivoCancelacion:=CveMotivoCancelacion, MotivoCancelacion:=Motivo, CveEstadoCancelacion:=CveEstadoCancelacion, CancelarBoletos:=CancelarBoletos, ForzarDevolucion:=ForzarDevolucion, CancelacionPagos:=CancelacionPagos, CveEstatusFacturaAsignado:=CveEstatusFacturaAsignado, ValidarSAT:=ValidarSAT, CvePACEspecifico:=CvePACEspecifico, TransaccionCompartida:=TransaccionCompartida)
End Function
Private Function CancelarVenta(ObjFactura As Modelos.Factura, UsuarioActual As Usuario, Optional EsRefacturacion As Boolean = False, Optional RealizarDevolucionAlmacen As Integer = 0,
@@ -5674,7 +5674,8 @@ Namespace Modelos
Optional AcuseCancelacion As String = "", Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "",
Optional FolioSustitucion As String = "", Optional ValidarSAT As Boolean = True, Optional CveEstadoCancelacion As Integer = 0,
Optional CancelarBoletos As Boolean = False, Optional ForzarDevolucion As Boolean = False, Optional CancelacionPagos As OpcionesCancelacionPagos = OpcionesCancelacionPagos.SinPagos,
- Optional CvePACEspecifico As Integer = -1) As MCancelacionVentaMensaje
+ Optional CvePACEspecifico As Integer = -1,
+ Optional TransaccionCompartida As SqlClient.SqlTransaction = Nothing) As MCancelacionVentaMensaje
Dim Retorno As New MCancelacionVentaMensaje()
Dim ErrorList As New List(Of String)
@@ -6136,7 +6137,12 @@ Namespace Modelos
End If
End If
- Dim ObjVentas As New ClsVentas() : ObjVentas.IniciaTransacSQL()
+ Dim ObjVentas As ClsVentas = Nothing
+ If TransaccionCompartida IsNot Nothing Then
+ ObjVentas = New ClsVentas(TransaccionCompartida)
+ Else
+ ObjVentas = New ClsVentas() : ObjVentas.IniciaTransacSQL()
+ End If
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
@@ -6925,7 +6931,7 @@ Namespace Modelos
OnError("Ocurrió un error al cancelar el documento", ex)
Finally
If Not ErrorCancelar Then
- ObjVentas.Commit()
+ If TransaccionCompartida Is Nothing Then ObjVentas.Commit()
If CveEstatus = 5 Then
Dim MensajeAlert As New StringBuilder
@@ -6954,12 +6960,14 @@ Namespace Modelos
End If
Retorno.CveEstatus = CveEstatus
+ If TransaccionCompartida Is Nothing Then
+ ObjVentas.Dispose()
+ ObjBancos.Dispose()
+ ObjInventario.Dispose()
+ ObjContrato.Dispose()
+ ObjConta.Dispose()
+ End If
- ObjVentas.Dispose()
- ObjBancos.Dispose()
- ObjInventario.Dispose()
- ObjContrato.Dispose()
- ObjConta.Dispose()
End Try
Return Retorno
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index 991711e94..c3cf8e2f1 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -1783,6 +1783,7 @@
<%----%>
+
@@ -1945,8 +1946,8 @@
-
-
+
+
<%-- --%>
@@ -5942,7 +5943,7 @@
}
function ClickDeudorChk(Chk, Obj, total, saldo,txtOtrIngEgs) {
- debugger;
+
total = parseFloat(parseFloat(total).toFixed(2));
saldo = parseFloat(parseFloat(saldo).toFixed(2));
@@ -6227,7 +6228,7 @@
function chkAnt(t, txt, importe, TotalSaldoCompra, CveMonedaAnticipo, TCAnticipo, CveMonedaOriginal, TCCompra, txtComision) {
var Total = ToDouble($get('TxtTotal').value);
- debugger;
+
var txtvalue = ToDouble(txt.value);
var ImportePago, ImporteCompra;
@@ -6336,7 +6337,7 @@
}
}
- debugger;
+
let saldoVal = saldo;
if (CveMonedaAnticipo == 1 && CveMonedaOriginal == 2) {
saldoVal = ToDouble(saldo / TCAnticipo)
@@ -6674,7 +6675,7 @@
- function CalculaTotalOCEdit(PS, CantidadOriginal, TxtCantidad, TxtPU, TxtTotal, IEPSOriginal, HdnIEPS, IVAOriginal, HdnIVA, RetIVAOriginal, HdnRetIVA, RetISROriginal, HdnRetISR, IEPSIVAOriginal, HdnIEPSIVA, DescuentoOriginal, HdnDescuento, IVAPorcentaje, RetIVAPorcentaje, RetISRPorcentaje, IEPSPSPorcentaje, IEPSPSIVAPorcentaje) {
+ function CalculaTotalOCEdit(PS, CantidadOriginal, PUOriginal, TxtCantidad, TxtPU, TxtTotal, IEPSOriginal, HdnIEPS, IVAOriginal, HdnIVA, RetIVAOriginal, HdnRetIVA, RetISROriginal, HdnRetISR, IEPSIVAOriginal, HdnIEPSIVA, DescuentoOriginal, HdnDescuento, IVAPorcentaje, RetIVAPorcentaje, RetISRPorcentaje, IEPSPSPorcentaje, IEPSPSIVAPorcentaje) {
//var Proporcional = ((ToDouble(TxtCantidad.value) * 100) / CantidadOriginal) / 100;
@@ -6702,8 +6703,7 @@
TxtTotal.value = FormatoNumero(Total - ToDouble(HdnDescuento.value), 2);
//RECALCULA IMPORTES GENERALES
- CalculaTotalesOC();
-
+ CalculaTotalesOC();
}
function ValidaImporteCero(PS, TxtCantidad, TxtPU) {
@@ -6749,7 +6749,7 @@
});
//Amortizacion = ToDouble($get('C_Tab_TabGenerales_LblAmortizacion').innerText);
-
+
SumaTotal = SumaSubTotal + SumaIVA + SumaIEPS - SumaRetIVA - SumaRetISR;
if ($get("C_Tab_TabOC_LbSubTotalOC1")) {
@@ -6780,7 +6780,7 @@
$get("C_Tab_TabOC_LblRetISROC1").innerText = FormatoNumero(SumaRetISR, 2);
}
if ($get("C_Tab_TabOC_LbTotalOC1")) {
- $get("C_Tab_TabOC_LbTotalOC1").innerText = FormatoNumero(SumaTotal, 2);
+ $get("C_Tab_TabOC_LbTotalOC1").value = FormatoNumero(SumaTotal, 2);
}
}
@@ -6976,7 +6976,7 @@
return;//Evita que se ejecute la rutina cuando se presiona Tap (cuando se salta de interes a ambas si se ejecuta se limpian los valores de capital e interes)
}
- debugger;
+
let TotalCompra = 0;
let ImporteAmortizado = 0;
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index d8c2d3080..6b0e594dc 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -13,7 +13,6 @@ Imports MoreLinq
Imports System.Data.SqlClient
Imports ClsPaginas
Imports Microsoft.Reporting.WebForms
-Imports DocumentFormat.OpenXml.Math
Partial Class Compras_Compras
Inherits ClsPaginas
@@ -283,6 +282,15 @@ Partial Class Compras_Compras
End Set
End Property
+ Private Property PermisoVinculacionImporteDiferente As Boolean
+ Get
+ Return CType(ViewState("PermisoVinculacionImporteDiferente"), Boolean)
+ End Get
+ Set(value As Boolean)
+ ViewState("PermisoVinculacionImporteDiferente") = value
+ End Set
+ End Property
+
Private Property NuevaValidacionXML As Integer
Get
Return ViewState("NuevaValidacionXML").ToString.ToEntero
@@ -1260,6 +1268,7 @@ Partial Class Compras_Compras
'ImgBtnBuscarOC.Attributes.Add("data-placement", "top")
EsGrupoDiaz = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False)
TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False)
+ LbTotalOC1.Attributes.Add(“readonly”, “readonly”)
CargaDatosAgregarPS()
TieneAnticiposXML = False
@@ -2090,6 +2099,10 @@ Partial Class Compras_Compras
If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True
+ If UsuarioActual.TienePermisoProceso(242) Then
+ PermisoVinculacionImporteDiferente = True
+ End If
+
If UsuarioActual.TienePermisoProceso(112) Then
PermisoEdicionManual = True
TxtSubTotal.Enabled = True
@@ -15233,15 +15246,25 @@ Partial Class Compras_Compras
Protected Sub GvOC1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOC1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- Dim JSCambiaScript As String = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "").Replace(vbLf, " ").Replace(vbCrLf, " ")}', {e.Row.DBCampo("Cantidad").ToString.ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToString.ToDouble});"
+ Dim JSCambiaScript As String = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "").Replace(vbLf, " ").Replace(vbCrLf, " ")}', {e.Row.DBCampo("Cantidad").ToDouble},{e.Row.DBCampo("PU").ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToDouble});"
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"LimitaCantidadOC({e.Row.DBCampo("CantidadPendienteVincular")}, this);{JSCambiaScript}")
e.Row.FCTextBox("TxtPU").Attributes.Add("onkeyup", JSCambiaScript)
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onblur", $"ValidaImporteCero('{e.Row.DBCampo("PS").Replace("'", "")}',{e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID});")
e.Row.FCTextBox("TxtPU").Attributes.Add("onblur", $"ValidaImporteCero('{e.Row.DBCampo("PS").Replace("'", "")}',{e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID});")
-
RegistraScript(JSCambiaScript)
+ 'activo el rangevalidator para cambios Proc.242
+ If Not PermisoVinculacionImporteDiferente Then
+ Dim tdif As Decimal = 10D ' solo 10 permitido a nivel total
+ 'If e.Row.DBCampo("Total").ToDecimal > tdif Then
+ ' e.Row.FCRangeValidator("RValPU").MinimumValue = ((e.Row.DBCampo("Total").ToDecimal - tdif) / e.Row.DBCampo("Cantidad").ToDecimal).ToString("F6")
+ 'Else
+ ' e.Row.FCRangeValidator("RValPU").MinimumValue = "0.00"
+ 'End If
+ e.Row.FCRangeValidator("RValPU").MaximumValue = ((e.Row.DBCampo("Total").ToDecimal + tdif) / e.Row.DBCampo("Cantidad").ToDecimal).ToString("F6")
+ End If
+
If e.Row.DataKey("FolioREQ").ToString.Trim.Length > 0 Then
Dim LblOC As Label = e.Row.FCLabel("LblOC")
LblOC.Attributes.Add("data-toggle", "tooltip")
@@ -19143,7 +19166,7 @@ Partial Class Compras_Compras
CompraActual.Fecha = TxtFecha.Text.ToDate
CompraActual.SerieFolio = TxtSerie.Text.Trim & "-" & TxtFolio.Text.Trim
CompraActual.ProveedorNombre = HplProveedor.Text
- CompraActual.TC = TipoCambio
+ CompraActual.TC = TipoCambioOriginal
CompraActual.Total = TxtTotal.Text.ToDecimal
CompraActual.IVA = TxtIVA.Text.ToDecimal
CompraActual.IVADeducible = TxtIVA.Text.ToDecimal
@@ -19157,7 +19180,8 @@ Partial Class Compras_Compras
CompraActual.CveSubProyecto = tCveSubProyeto
CompraActual.EsImportacion = chkImportacion.Checked
- If Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, objConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate, $"Remisión Nota de Crédito {TxtDescripcion.Text}", DdlMoneda.SelectedValue.ToEntero, TxtTC.Text.ToDecimal,
+ If Not GeneraRNC(ObjCompras.IniciaTransacSQL, CveCompra, CompraActual, objConta, CvePrePoliza, DdlProveedor.SelectedValue.ToEntero, DdlProveedor.SelectedItem.Text, TxtFecha.Text.ToDate,
+ $"Remisión Nota de Crédito {TxtDescripcion.Text}", DdlMoneda.SelectedValue.ToEntero, TipoCambioOriginal,
TxtSerie.Text, TxtFolio.Text, EsDRMN:=True) Then
TieneError = True
End If
diff --git a/Compras/RepProductosServiciosDetalle.aspx.vb b/Compras/RepProductosServiciosDetalle.aspx.vb
index dc15ec06c..19ca0a061 100644
--- a/Compras/RepProductosServiciosDetalle.aspx.vb
+++ b/Compras/RepProductosServiciosDetalle.aspx.vb
@@ -115,9 +115,10 @@ Partial Class Compras_RepProductosServiciosDetalle
txtFechaI.Text = If(Mes <> "-1", String.Format("01/{0}/0001", Mes), txtFechaI.Text)
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
- If CveCultivo.ToEntero() > 0 AndAlso FechaI = "-1" AndAlso Anio = "-1" AndAlso Mes = "-1" AndAlso AnioMes = "-1" Then
+ If CveCultivo.Length > 0 AndAlso FechaI = "-1" AndAlso Anio = "-1" AndAlso Mes = "-1" AndAlso AnioMes = "-1" Then
txtFechaI.Text = "01/01/1900"
End If
+
If Fecha <> "-1" Then
txtFechaI.Text = Fecha
txtFechaF.Text = Fecha
diff --git a/CxC/RepCxC.aspx b/CxC/RepCxC.aspx
index 2f05da6a8..e77222e90 100644
--- a/CxC/RepCxC.aspx
+++ b/CxC/RepCxC.aspx
@@ -151,6 +151,7 @@
+
@@ -404,6 +405,13 @@
+
diff --git a/CxC/RepCxCDetalle.aspx.vb b/CxC/RepCxCDetalle.aspx.vb
index ab96ea621..40929c86e 100644
--- a/CxC/RepCxCDetalle.aspx.vb
+++ b/CxC/RepCxCDetalle.aspx.vb
@@ -245,7 +245,7 @@ Partial Class RepCxCDetalle
#Region "CARGAS"
Private Sub CargaCombos()
- Dim CveCliente, CveVendedor, CveUsuario, CveSubProyecto,
+ Dim CveCliente, CveVendedor, CveUsuario, CveSubProyecto, CveSubProyectoCobranza,
CveEstatus, CveResponsable, CveAgrupador, CveClienteClasificacion As Integer
txtFechaF.Text = NowADS().LastDayOfMonth.ToShortDateString
@@ -257,9 +257,20 @@ Partial Class RepCxCDetalle
CargaClientes()
End If
+ If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
+ DivSPCobranza.Visible = True
+ LblSPCobranza.Visible = True
+ End If
+
'CargaSubProyectos
DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
- DdlSubProyecto.DataBind()
+ DdlSubProyecto.DataBind()
+
+ DdlSubProyectoCobranza.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
+ DdlSubProyectoCobranza.DataBind()
+
+ DdlSubProyectoCobranza.Items.Insert(0, New ListItem("Sin Asignar", "-2"))
+ DdlSubProyectoCobranza.Items.Insert(0, New ListItem("Todos", "-1"))
'CargaUsuarios
DdlUsuario.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa)
@@ -340,6 +351,7 @@ Partial Class RepCxCDetalle
TipoDocto = IfNull(Request("TipoDocto"), "-1").ToString
CveClienteSucursal = IfNull(Request("CveClienteSucursal"), "-1").ToString.ToEntero
CveSubProyecto = IfNull(Request("CveSubProyecto"), "-1").ToString.ToEntero
+ CveSubProyectoCobranza = IfNull(Request("CveSubProyectoCobranza"), "-1").ToString.ToEntero
CveVendedor = IfNull(Request("Vendedor"), "-1").ToString.ToEntero
CveCliente = IfNull(Request("CveCliente"), "-1").ToString.ToEntero
CveUsuario = IfNull(Request("CveUsuario"), "-1").ToString.ToEntero
@@ -349,7 +361,7 @@ Partial Class RepCxCDetalle
Iva = IfNull(Request("IVA"), "-1").ToString
DdlSubProyecto.SelectedValueExist(CveSubProyecto)
-
+ DdlSubProyectoCobranza.SelectedValueExist(CveSubProyectoCobranza)
If Request("AplicaAnticiposPagados") IsNot Nothing Then
ChkAnticipos.Checked = If(Request("AplicaAnticiposPagados").ToEntero = 1, True, False)
@@ -476,7 +488,7 @@ Partial Class RepCxCDetalle
FechaCorte:=txtCorteA.Text.ToDate, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveCobranzaEstatus:=DdlCobranzaEstatusFiltro.SelectedValue.ToEntero,
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, LimiteCredito:=LimiteCredito, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero,
CveMoneda:=CveMoneda, EstatusCliente:=DdlEstatusCliente.SelectedValue.ToEntero, TieneLineaAdicional:=DdlTieneLineaAdicional.SelectedValue.ToEntero(),
- CveContrato:=DdlContrato.SelectedValue.ToEntero, Aseguradora:=DdlAseguradora.SelectedValue.ToEntero) Then
+ CveContrato:=DdlContrato.SelectedValue.ToEntero, Aseguradora:=DdlAseguradora.SelectedValue.ToEntero, CveSubProyectoCobranza:=DdlSubProyectoCobranza.SelectedValue.ToEntero()) Then
GvDatos.DataSource = ObjMovtos.DSResultados.Tables(0)
@@ -639,6 +651,7 @@ Partial Class RepCxCDetalle
ActivaColumna(54, ChkEnDemanda.Checked)
ActivaColumna(55, ChkRegistroFirmas.Checked)
ActivaColumna(56, ChkDireccionCliente.Checked)
+ ActivaColumna(57, ChkSucursalCobranzaCliente.Checked)
If SePersonalizo = 1 Then
ImgExcelPersonalizado.Visible = True
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb
index 9008ba63a..d6672b5bb 100644
--- a/Inventarios/EntradasSalidas.aspx.vb
+++ b/Inventarios/EntradasSalidas.aspx.vb
@@ -950,12 +950,19 @@ Partial Class Inventarios_EntradasSalidas
TieneRelacionado = Mov.TieneRelacionado
ConceptoRelacionado = Mov.ConceptoRelacionado
+
'sino existe el movimiento
If (DdlConcepto.Items.FindByValue(Mov.CveConcepto.ToString()) Is Nothing) Then
Dim dr As DataRow = GlobalDTInvConceptos.FiltroPrimero(String.Format("CveConcepto = {0}", Mov.CveConcepto))
DdlConcepto.Items.Insert(0, New ListItem(dr("Concepto").ToString, dr("CveConcepto").ToString)) ' lo genera Obj.SelectedValue = Valor.ToString
End If
+ 'CONDICION ESPECIAL , PARA DEVOLUCIONES DE PRÉSTAMO PROVEEDORES
+ If DdlConcepto.SelectedValue = "29" Then
+ TieneRelacionado = 0 'PARA ELIMINACIÓN NO LO RELACIONE, EN EL PA, TAMBIEN SE TIENE ESTA CONSIDERACIÓN
+ CveMovimientoRelacionado = 0
+ End If
+
DdlConcepto.SelectedValue = Mov.CveConcepto.ToString
ddlConcepto_SelectedIndexChanged(DdlConcepto, EventArgs.Empty)
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index b26724c6f..de3dacf86 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -728,14 +728,15 @@ Partial Class OC_OC
CargarCentrosDeCosto(Nothing, DdlSubProyectoEntrega, Nothing, Nothing, "Seleccione")
- If UsuarioActual.CveEmpresa = 189 Then
+ If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then ModalidadSubProyectoGeneral = True
+ If ModalidadSubProyectoGeneral Then
DdlSubProyectoGral.DataSource = GlobalDTOCEstatusUsuarios(CveEmpresaActual, UsuarioActual.CveUsuario, TipoOC).FiltraParametros("", "SubProyecto", DistinctColumns:={"CveSubProyecto", "SubProyecto"})
DdlSubProyectoGral.DataBind()
DdlSubProyectoGral.Items.Insert(0, New ListItem("-", "-1"))
DdlSubProyectoGral.SelectedValueExist(UsuarioActual.CveSubProyecto)
DdlSubProyectoEntrega.SelectedValueExist(UsuarioActual.CveSubProyecto)
- ModalidadSubProyectoGeneral = True
+
TdProyectoSubPrpyectoDdl.Visible = False
TdProyectoSubPrpyecto.Visible = False
GvD.Columns(4).Visible = False
@@ -744,13 +745,10 @@ Partial Class OC_OC
DdlSubProyectoEntrega.Visible = chkSubProyectoEntrega.Checked
txtLugarEntrega.Visible = Not chkSubProyectoEntrega.Checked
UPPEmp.Update()
-
UPPDetalle.Update()
End If
-
-
'CARGA YA REGISTRADO
If Request("OC") IsNot Nothing AndAlso IsNumeric(Request("OC")) AndAlso Request("OC").ToEntero > 0 Then
diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx
index 2763ea92a..77831e2cd 100644
--- a/OS/OrdenesServicios.aspx
+++ b/OS/OrdenesServicios.aspx
@@ -16,6 +16,9 @@
Material Utilizado
+
+
+
@@ -348,7 +351,7 @@
-
+
diff --git a/OS/OrdenesServicios.aspx.vb b/OS/OrdenesServicios.aspx.vb
index 347d43d1e..a91e1ca02 100644
--- a/OS/OrdenesServicios.aspx.vb
+++ b/OS/OrdenesServicios.aspx.vb
@@ -6,6 +6,7 @@ Imports System.IO
Imports System.Data
Imports System.Data.SqlClient
Imports APP_Code_CSharp
+Imports MoreLinq.Extensions
Partial Class OS_OrdenesServicios
Inherits ClsPaginas
@@ -578,8 +579,6 @@ Partial Class OS_OrdenesServicios
'GvPS.DataSource = TmpDT
'GvPS.DataBind()
-
-
Dim tmpTipoEstatus As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("TipoEstatus", $" CveEstatusOrdenServicio = {DdlEstatusOS.SelectedValue}").ToEntero
Select Case tmpTipoEstatus
Case 1, 2, 3
@@ -732,6 +731,10 @@ Partial Class OS_OrdenesServicios
If TipoEstatus.Contiene(1, 2, 3) Then
LnkAccionesMaterialUtilizado.Visible = True
End If
+ If TipoEstatus.Contiene(4) Then 'finalizada
+ BtnCancelarRemision.Visible = True
+ End If
+
Else
Alert("La Orden de Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
BtnGuardar.Enabled = False
@@ -3530,7 +3533,7 @@ Partial Class OS_OrdenesServicios
If PU > 0 Then
CountDetalles = CountDetalles + 1
Else
- Alert($"Prodcuto {CodigoPS} con precio unitario en cero.", TipoMensaje.MsgAdvertencia)
+ Alert($"Producto {CodigoPS} con precio unitario en cero.", TipoMensaje.MsgAdvertencia)
PuEnCero = True
End If
End If
@@ -3552,7 +3555,7 @@ Partial Class OS_OrdenesServicios
Return Respuesta
End If
- If ObjVentas.GetVenta(CvePedido, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then
+ If ObjVentas.GetVenta(CvePedido, UsuarioActual.CveEmpresa) Then
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Copy().Rows(0)
CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
CveSubProyectoPedido = DbRowVenta("CveSubProyecto").ToString().ToEntero()
@@ -3585,6 +3588,14 @@ Partial Class OS_OrdenesServicios
TmpDTMat.Columns.Add("Lote", GetType(String))
TmpDTMat.Columns.Add("FechaCaducidad", GetType(Date))
TmpDTMat.Columns.Add("CveVentaDetalle", GetType(Integer))
+ 'unificar en un solo producto, y generar las salidas a esa relación
+
+
+ Respuesta.CveVenta = -1
+ Respuesta.SerieFolio = ""
+ Respuesta.dtdetalle = New DataTable
+ Alert("Remision sin detalles.", TipoMensaje.MsgAdvertencia)
+ Return Respuesta
For Each GvRow As GridViewRow In GvMU.Rows
@@ -3594,7 +3605,6 @@ Partial Class OS_OrdenesServicios
Dim Descuento As Decimal = GvRow.DataKey("Descuento").ToDecimal
Dim Obs As String = GvRow.DataKey("Observaciones")
-
If CantidadRegistro > 0 Then
If ObjFactura.AgregarPS(CvePS, CantidadRegistro, PU, Descuento, Obs, CveSubProyecto:=CveSubProyectoPedido, CveVentaDetallePadre:=GvRow.DataKey("CveVentaDetalle").ToEntero) Then
Dim drp As DataRow = TmpDTMat.NewRow
@@ -3635,6 +3645,38 @@ Partial Class OS_OrdenesServicios
End Function
+ Private Function AgrupadoProductos(gridView As GridView) As DataTable
+ ' Filtrar y agrupar las filas por clave3 y clave5
+ Dim groupedData = From row As GridViewRow In gridView.Rows.Cast(Of GridViewRow)()
+ Where row.RowType = DataControlRowType.DataRow
+ Group row By
+ CvePS = gridView.DataKeys(row.RowIndex)("CvePS").ToString(),
+ CveUM = gridView.DataKeys(row.RowIndex)("CveUM").ToString()
+ Into Group
+ Select New With {
+ .CvePS = CvePS,
+ .CveUM = CveUM,
+ .ValorAcumulado = Group.Sum(Function(r) Convert.ToDecimal(r.Cells(5).Text))
+ }
+
+ ' Crear un nuevo DataTable para almacenar los resultados agrupados
+ Dim resultTable As New DataTable()
+ resultTable.Columns.Add("CvePS")
+ resultTable.Columns.Add("CveUM")
+ resultTable.Columns.Add("Cantidad", GetType(Decimal))
+
+ For Each item In groupedData
+ Dim newRow As DataRow = resultTable.NewRow()
+ newRow("CvePS") = item.CvePS
+ newRow("CveUM") = item.CveUM
+ newRow("Cantidad") = item.ValorAcumulado
+ resultTable.Rows.Add(newRow)
+ Next
+
+ Return resultTable
+ End Function
+
+
Friend Class RespuestaFacturacion
Public Property CveVenta As Integer = -1
Public Property SerieFolio As String = "-1"
@@ -3786,4 +3828,77 @@ Partial Class OS_OrdenesServicios
End Try
End Sub
+
+ Private Sub CancelarRemision(CveVenta As Integer, CveAlmacenDevolucion As Integer, CvePedido As Integer)
+
+ Dim LigaRedirigir As String = ""
+
+ Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=True, VerificaAlmacen:=True)
+ Try
+ Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing
+ Dim strMensaje As New StringBuilder()
+ If ObjFacturaCancelacion IsNot Nothing AndAlso ObjFacturaCancelacion.CveVenta > 0 Then
+
+ Dim ListaRemisionesCancelar As New List(Of Integer)
+ ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion
+ Dim CancelacionPagos = Modelos.OpcionesCancelacionPagos.SinPagos
+
+ 'PARA GENERAR LA DEVOLUCION DE ALMACEN SIN ESPERAR LA ACEPTACION DEL SAT
+ Dim GenerarDevolucionAnticipada As Boolean = True
+ Dim CveEstadoCancelacion As Integer = 1
+ Dim objos As New ClsOS
+ Dim ObjVenta As New ClsVentas(objos.IniciaTransacSQL)
+
+ resp = ObjFacturaCancelacion.CancelarFactura(1, ListaRemisionesCancelar, CveMotivoCancelacion:=1, Motivo:="Corrección de material utilizado", CveEstadoCancelacion:=CveEstadoCancelacion, ForzarDevolucion:=GenerarDevolucionAnticipada, CancelacionPagos:=CancelacionPagos, TransaccionCompartida:=objos.IniciaTransacSQL)
+
+ Dim HuboError As Boolean = False
+ If Not resp.HuboError Then
+
+ If resp.CveEstatus = 12 Then
+ Dim cveoo As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", $" TipoEstatus = 3").ToEntero
+ If objos.UpdateOrdenesServiciosEstatus(cveoo, UsuarioActual.CveUsuario, CveOS) Then
+ 'retornar el estatus de la OS,
+ If Not ObjVenta.UpdateVentasDevolucionAlmacen(0, CvePedido) Then
+ HuboError = True
+ End If
+ Else
+ HuboError = True
+ End If
+ Else
+ 'si tiene pagos
+ HuboError = True
+ End If
+ Else
+ HuboError = True
+ End If
+ strMensaje.Append(resp.Mensaje)
+ If Not HuboError Then
+ objos.Commit()
+ Alert(strMensaje.ToString(), resp.TipoMensaje)
+ Else
+ objos.RollBack()
+ Alert(strMensaje.ToString(), resp.TipoMensaje)
+ End If
+
+ objos.Dispose()
+ ObjVenta.Dispose()
+ Else
+ Alert("Ocurrió un error al generar la cancelación", TipoMensaje.MsgError)
+ End If
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al cancelar", ex)
+ End Try
+ ObjFacturaCancelacion.Dispose()
+ UpEstatus.Update()
+
+ If Not String.IsNullOrEmpty(LigaRedirigir) Then
+ Response.Redirect(LigaRedirigir)
+ End If
+
+ End Sub
+
+ Protected Sub BtnCancelarRemision_Click(sender As Object, e As EventArgs)
+ CancelarRemision(CveVenta, 1, CvePedido)
+ End Sub
End Class
diff --git a/RH/CatPersonal.aspx b/RH/CatPersonal.aspx
index 7508c99b0..cdb0add16 100644
--- a/RH/CatPersonal.aspx
+++ b/RH/CatPersonal.aspx
@@ -141,13 +141,11 @@
-
+
-
-
-
-
-
+
+
+
@@ -462,9 +460,9 @@
- Metodo de Pago
+ Forma de Pago
-
+
@@ -750,7 +748,7 @@
+
+
+
+
@@ -1424,6 +1591,7 @@
let totalDebito = ToDouble($get("TxtImporteDebito").value);
let totalCheque = ToDouble($get("TxtImporteCheque").value);
let totalTransferencia = ToDouble($get("TxtImporteTransferencia").value);
+ let totalCobranza = ToDouble($get("TxtCxCAplicado").value);
let TotalOtrosContado = 0;
let total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia;
@@ -1435,7 +1603,7 @@
total = total + totalAnticipos + TotalOtrosContado;
}
- let totalVenta = ToDouble($get('HdnTotal').value);// - ToDouble($get('HdnTotal').value);
+ let totalVenta = ToDouble($get('HdnTotal').value) + totalCobranza;// - ToDouble($get('HdnTotal').value);
if (total > totalVenta) {
lblCambio.innerHTML = "Cambio:";
diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb
index 1fb39977d..319ce9a5e 100644
--- a/Ventas/PVCobranza.aspx.vb
+++ b/Ventas/PVCobranza.aspx.vb
@@ -163,6 +163,10 @@ Partial Class Ventas_PVCobranza
UpContadoOtros.Update()
End If
+ If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
+ DivNoTimbradas.Visible = True
+ End If
+
End If
End Sub
@@ -505,6 +509,7 @@ Partial Class Ventas_PVCobranza
TieneError = True
End If
HdnCveVenta.Value = CveVenta.ToString
+ HdnCveCliente.Value = GvRow.DataKey("CveCliente")
TxtImporteContado.Text = GvRow.DataKey("Saldo").FormatoNumero
HdnTotal.Value = GvRow.DataKey("Saldo")
TxtImporteEfectivo.Focus()
@@ -574,12 +579,12 @@ Partial Class Ventas_PVCobranza
Exit Sub
End If
- If LtlSaldo.Text.ToDecimal() > Pagado Then
+ If LtlSaldo.Text.ToDecimal + TxtCxCAplicado.Text.ToDecimal > Pagado Then
Alert("Favor de especificar el saldo total de pagar", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim PagadoSinEfectivo As Decimal = Pagado - TxtImporteEfectivo.Text.ToDecimal
- If PagadoSinEfectivo > LtlSaldo.Text.ToDecimal() Then
+ If PagadoSinEfectivo > (LtlSaldo.Text.ToDecimal() + TxtCxCAplicado.Text.ToDecimal) Then
Alert("El pago con los metodos de pago actuales no puede ser mayor al importe de la venta", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -652,8 +657,9 @@ Partial Class Ventas_PVCobranza
Dim Fecha As Date = DbRowVenta("Fecha").ToString.ToDate 'NowADS()
Dim MsgError As String = ""
- Dim SaldoPendiente As Decimal = DbRowVenta("Saldo").ToString.ToDecimal
- Dim SaldoTotalInicial As Decimal = DbRowVenta("Saldo").ToString.ToDecimal
+ Dim SaldoPendienteVenta As Decimal = DbRowVenta("Saldo").ToString.ToDecimal
+ Dim SaldoTotalInicialVenta As Decimal = DbRowVenta("Saldo").ToString.ToDecimal
+ Dim SaldoPendientePagos As Decimal = TxtImporteContado.Text.ToDecimal
Dim PagoAplicado As Decimal = 0
Dim ObjVentas2 As New ClsVentas()
@@ -686,7 +692,7 @@ Partial Class Ventas_PVCobranza
If HdnTipoAmortizacion.Value = "4" Then
If respFactura.Factura.DtAnticiposAplicados IsNot Nothing Then
PagoAplicado += respFactura.Factura.DtAnticiposAplicados.SUM("Importe")
- SaldoPendiente = SaldoPendiente - PagoAplicado
+ SaldoPendienteVenta = SaldoPendienteVenta - PagoAplicado
For Each RowAnt As DataRow In respFactura.Factura.DtAnticiposAplicados.Rows
If Not ActualizaAnticipos(RowAnt("CveIE").ToString().ToEntero(), RowAnt("CveVenta").ToString().ToEntero(), RowAnt("Tipo").ToString(), RowAnt("Folio").ToString(), ObjVentas2, ObjOIEventos) Then
@@ -716,7 +722,7 @@ Partial Class Ventas_PVCobranza
End If
Else
PagoAplicado += respNC.Factura.Total
- SaldoPendiente = SaldoPendiente - PagoAplicado
+ SaldoPendienteVenta = SaldoPendienteVenta - PagoAplicado
For Each RowAnt As DataRow In respNC.Factura.DtAnticiposAplicados.Rows
If Not ActualizaAnticipos(RowAnt("CveIE").ToString().ToEntero(), RowAnt("CveVenta").ToString().ToEntero(), RowAnt("Tipo").ToString(), RowAnt("Folio").ToString(), ObjVentas2, ObjOIEventos) Then
@@ -732,7 +738,7 @@ Partial Class Ventas_PVCobranza
End If
If MsgError = "" Then
- If SaldoPendiente > 0 AndAlso VentaContado Then
+ If SaldoPendienteVenta > 0 AndAlso VentaContado Then
If respFactura IsNot Nothing Then
CvePrePoliza = respFactura.Factura.CvePrePoliza
@@ -741,36 +747,40 @@ Partial Class Ventas_PVCobranza
End If
If CvePrePoliza > 0 Then
- If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteCredito.Text.ToDecimal > 0 Then
- MsgError = RegistraIE(12, DdlCuentaTarjetaCredito.SelectedValue.ToEntero, TxtImporteCredito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
- SaldoPendiente -= TxtImporteCredito.Text.ToDecimal
+ If MsgError = "" AndAlso SaldoPendientePagos > 0 AndAlso TxtImporteCredito.Text.ToDecimal > 0 Then
+ MsgError = RegistraIE(12, DdlCuentaTarjetaCredito.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteCredito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
+ SaldoPendienteVenta -= TxtImporteCredito.Text.ToDecimal
+ SaldoPendientePagos -= TxtImporteCredito.Text.ToDecimal
PagoAplicado += TxtImporteCredito.Text.ToDecimal
End If
- If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteDebito.Text.ToDecimal > 0 Then
- MsgError = RegistraIE(11, DdlCuentaTarjetaDebito.SelectedValue.ToEntero, TxtImporteDebito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
- SaldoPendiente -= TxtImporteDebito.Text.ToDecimal
+ If MsgError = "" AndAlso SaldoPendientePagos > 0 AndAlso TxtImporteDebito.Text.ToDecimal > 0 Then
+ MsgError = RegistraIE(11, DdlCuentaTarjetaDebito.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteDebito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
+ SaldoPendienteVenta -= TxtImporteDebito.Text.ToDecimal
+ SaldoPendientePagos -= TxtImporteDebito.Text.ToDecimal
PagoAplicado += TxtImporteDebito.Text.ToDecimal
End If
- If SaldoPendiente > 0 AndAlso TxtImporteCheque.Text.ToDecimal > 0 Then
+ If SaldoPendientePagos > 0 AndAlso TxtImporteCheque.Text.ToDecimal > 0 Then
Dim Obs As String = ""
If DivDatosCheque.Visible Then
Obs = $"{VentaActual.SerieFolio} - Autorizó: {TxtAutorizo.Text}"
End If
- MsgError = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, Obs:=Obs, CveAutorizacion:=TxtClaveAutorizacion.Text.Trim(), CveSubProyecto:=VentaActual.CveSubProyecto)
- SaldoPendiente -= TxtImporteCheque.Text.ToDecimal
+ MsgError = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, Obs:=Obs, CveAutorizacion:=TxtClaveAutorizacion.Text.Trim(), CveSubProyecto:=VentaActual.CveSubProyecto)
+ SaldoPendienteVenta -= TxtImporteCheque.Text.ToDecimal
+ SaldoPendientePagos -= TxtImporteCheque.Text.ToDecimal
PagoAplicado += TxtImporteCheque.Text.ToDecimal
End If
- If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteTransferencia.Text.ToDecimal > 0 Then
- MsgError = RegistraIE(8, DdlCuentaTransferencia.SelectedValue.ToEntero, TxtImporteTransferencia.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
- SaldoPendiente -= TxtImporteTransferencia.Text.ToDecimal
+ If MsgError = "" AndAlso SaldoPendientePagos > 0 AndAlso TxtImporteTransferencia.Text.ToDecimal > 0 Then
+ MsgError = RegistraIE(8, DdlCuentaTransferencia.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteTransferencia.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
+ SaldoPendienteVenta -= TxtImporteTransferencia.Text.ToDecimal
+ SaldoPendientePagos -= TxtImporteTransferencia.Text.ToDecimal
PagoAplicado += TxtImporteTransferencia.Text.ToDecimal
End If
- If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteOtrosContado.Text.ToDecimal > 0 Then
+ If MsgError = "" AndAlso SaldoPendientePagos > 0 AndAlso TxtImporteOtrosContado.Text.ToDecimal > 0 Then
Dim CveConceptroOtros As Integer = -1
Select Case DdlOtroFormaPago.SelectedValue
@@ -782,24 +792,27 @@ Partial Class Ventas_PVCobranza
CveConceptroOtros = 8
End Select
- MsgError = RegistraIE(CveConceptroOtros, DdlCuentaOtrosContado.SelectedValue.ToEntero, TxtImporteOtrosContado.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
- SaldoPendiente -= TxtImporteOtrosContado.Text.ToDecimal
+ MsgError = RegistraIE(CveConceptroOtros, DdlCuentaOtrosContado.SelectedValue.ToEntero, SaldoPendienteVenta, TxtImporteOtrosContado.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
+ SaldoPendienteVenta -= TxtImporteOtrosContado.Text.ToDecimal
+ SaldoPendientePagos -= TxtImporteOtrosContado.Text.ToDecimal
PagoAplicado += TxtImporteOtrosContado.Text.ToDecimal
End If
- If MsgError = "" AndAlso SaldoPendiente > 0 AndAlso TxtImporteEfectivo.Text.ToDecimal > 0 Then
+ If MsgError = "" AndAlso SaldoPendientePagos > 0 AndAlso TxtImporteEfectivo.Text.ToDecimal > 0 Then
Dim PagoEfectivo As Decimal = TxtImporteEfectivo.Text.ToDecimal
PagoAplicado += PagoEfectivo
- If PagoAplicado >= SaldoTotalInicial Then
- TxtCambio.Text = (PagoAplicado - SaldoTotalInicial).FormatoNumero
- PagoEfectivo = SaldoPendiente
+ If PagoAplicado >= SaldoPendientePagos Then
+ TxtCambio.Text = (PagoAplicado - SaldoPendientePagos).FormatoNumero
+ PagoEfectivo = SaldoPendientePagos
End If
- MsgError = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, PagoEfectivo, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
- SaldoPendiente -= PagoEfectivo
+ If SaldoPendienteVenta < 0 Then SaldoPendienteVenta = 0
+ MsgError = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, SaldoPendienteVenta, PagoEfectivo, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta, ObjVentas2, tCveCorte, CveSubProyecto:=VentaActual.CveSubProyecto)
+ SaldoPendienteVenta -= PagoEfectivo
+ SaldoPendientePagos -= PagoEfectivo
End If
- If SaldoPendiente > 0 Then
+ If SaldoPendienteVenta > 0 Then
MsgError = "Tiene saldo pendiente por aplicar"
End If
@@ -819,6 +832,48 @@ Partial Class Ventas_PVCobranza
End If
End If
+ If MsgError = "" Then
+
+ Dim CveIEPago As Integer = HdnCveIE.Value.ToEntero
+ 'registrar los pagos a cobranza
+ For Each gvr As GridViewRow In GvCxC.Rows
+ If gvr.FCCheckBox("Chk").Checked Then
+ Dim VentaCxC As New Venta(UsuarioActual)
+ VentaCxC.CveVenta = gvr.DataKey("CveVenta").ToEntero
+ VentaCxC.TipoDocto = gvr.DataKey("TipoDocto")
+ VentaCxC.Fecha = gvr.DataKey("Fecha").ToDate
+ VentaCxC.CveCliente = gvr.DataKey("CveCliente").ToEntero
+ VentaCxC.CveMoneda = gvr.DataKey("CveMoneda").ToEntero
+ VentaCxC.SerieFolio = gvr.DataKey("SerieFolio")
+ VentaCxC.ClienteNombre = "sss" 'gvr.DataKey("ClienteNombre")
+ VentaCxC.TC = gvr.DataKey("TipoCambio").ToDecimal
+ VentaCxC.Total = gvr.DataKey("Total").ToDecimal
+ VentaCxC.IVA = gvr.DataKey("IVA").ToDecimal
+ VentaCxC.IEPS = gvr.DataKey("IEPS").ToDecimal
+ VentaCxC.RetIVA = gvr.DataKey("RetIVA").ToDecimal
+ VentaCxC.RetISR = gvr.DataKey("RetISR").ToDecimal
+
+ VentaCxC.PorcentajeIVA = gvr.DataKey("PorcentajeIVA").ToDecimal
+ VentaCxC.UsuarioActual = UsuarioActual
+ VentaCxC.CveSubProyecto = gvr.DataKey("CveSubProyecto").ToEntero
+
+ Dim Pago As New VentaPago
+ Pago.ImportePagoVenta = gvr.DataKey("Saldo").ToDecimal
+ Pago.ImportePago = gvr.DataKey("Saldo").ToDecimal
+ Pago.CveIE = CveIEPago
+ Pago.CveMonedaPago = VentaCxC.CveMoneda
+ Pago.Fecha = NowADS()
+ Pago.Referencia = VentaCxC.SerieFolio
+ Pago.TipoPago = "XXX"
+
+ Dim ErrorConta As Boolean = AplicaPrePolizaPagoVenta(VentaCxC, Pago, CvePrePoliza, ObjConta)
+ If ErrorConta Then
+ MsgError = "Error en aplicación de pago en cobranza"
+ End If
+ End If
+ Next
+ End If
+
Else
MsgError = "Error al registrar prepólizas"
End If
@@ -1020,6 +1075,7 @@ Partial Class Ventas_PVCobranza
TxtImporteTransferencia.Text = ""
TxtImporteOtrosContado.Text = ""
TxtCambio.Text = ""
+ TxtCxCAplicado.Text = ""
TxtClaveAutorizacion.Text = ""
TxtAutorizo.Text = ""
TxtNCDev.Text = ""
@@ -1028,7 +1084,6 @@ Partial Class Ventas_PVCobranza
CveCliente = -1
CveVendedor = -1
-
If TmpDTAnticiposNCIxCCliente IsNot Nothing Then
TmpDTAnticiposNCIxCCliente.Clear()
TmpDTAnticiposNCIxCCliente = Nothing
@@ -1216,12 +1271,12 @@ Partial Class Ventas_PVCobranza
For Each dr As DataRow In DtAnticipos.Rows
SBAmortizaciones.AppendLine($" Imprimir historial {dr("Folio").ToString} ")
+ dr("CveIE").ToString,
+ dr("CveVenta").ToString,
+ Retorno.Factura.CveCliente,
+ Retorno.CveVenta,
+ Retorno.Factura.Total,
+ (Retorno.Factura.Total - Retorno.Factura.DtAnticiposAplicados.SUM("Importe"))))}"">Imprimir historial {dr("Folio").ToString} ")
Next
@@ -1488,7 +1543,7 @@ Partial Class Ventas_PVCobranza
Return MsgErrorTimbrado
End Function
- Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad, ByRef ObjVentas As ClsVentas, tCveCorte As Integer, Optional Obs As String = "", Optional CveAutorizacion As String = "", Optional CveSubProyecto As Integer = -1) As String
+ Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImporteAbonoVenta As Decimal, ImporteBancos As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad, ByRef ObjVentas As ClsVentas, tCveCorte As Integer, Optional Obs As String = "", Optional CveAutorizacion As String = "", Optional CveSubProyecto As Integer = -1) As String
Dim Retorno As String = ""
If CveBancoCuenta > 0 Then
Dim CveIEPago As Integer = 0
@@ -1496,25 +1551,31 @@ Partial Class Ventas_PVCobranza
If String.IsNullOrEmpty(Obs) Then
Obs = VentaActual.SerieFolio
End If
- CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto)
+ CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImporteBancos, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto)
If CveIEPago > 0 Then
- Dim Pago As New VentaPago
- Pago.ImportePagoVenta = ImportePago
- Pago.ImportePago = ImportePago
- Pago.CveIE = CveIEPago
- Pago.CveMonedaPago = VentaActual.CveMoneda
- Pago.Fecha = NowADS()
- Pago.Referencia = VentaActual.SerieFolio
+ Dim tImportePago As Decimal = If(ImporteBancos > ImporteAbonoVenta, ImporteAbonoVenta, ImporteBancos) 'toma el importe menor para la factura
+
+ If ImporteBancos > 0 Then
+ Dim Pago As New VentaPago
+ Pago.ImportePagoVenta = tImportePago
+ Pago.ImportePago = ImporteBancos
+ Pago.CveIE = CveIEPago
+ Pago.CveMonedaPago = VentaActual.CveMoneda
+ Pago.Fecha = NowADS()
+ Pago.Referencia = VentaActual.SerieFolio
+
+ ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
+ End If
- ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
If ErrorConta Then
Retorno = "Error en aplicación de pago"
End If
Dim MetodoPago As Integer = If(Metodo = 13, 1, If(Metodo = 12, 4, If(Metodo = 11, 5, If(Metodo = 3, 2, 3))))
- If Not ErrorConta AndAlso Not ObjVentas.AddVta_VentaPago(VentaActual.CveVenta, MetodoPago, ImportePago) Then
+ If Not ErrorConta AndAlso Not ObjVentas.AddVta_VentaPago(VentaActual.CveVenta, MetodoPago, ImporteBancos) Then
Retorno = "Error en aplicación de pago.."
ErrorConta = True
End If
+ HdnCveIE.Value = CveIEPago.ToString
Else
Retorno = "Pago en Bancos no registrado"
ErrorConta = True
@@ -2918,6 +2979,44 @@ Partial Class Ventas_PVCobranza
End Sub
+ Protected Sub LnkCxC_Click(sender As Object, e As EventArgs)
+ CargaCxC(1, HdnCveCliente.Value.ToEntero) 'solo pesos
+ End Sub
+
+ Private Sub CargaCxC(pCveMoneda As Integer, pCveCliente As Integer)
+ Dim Mov As New ClsMovimientos
+ Dim FechaI As String = IfNull(Request("FechaI"), "-1").ToString
+ Dim FechaF As String = IfNull(Request("FechaF"), "-1").ToString
+ Dim FechaCorte As Date = NowADS().AddYears(1).ToShortDateString.ToString.ToDate
+
+ If Mov.GetCxCClienteDetalle(pCveCliente, FechaI, FechaF, pCveMoneda, -1, UsuarioActual.CveEmpresa, -1, FechaCorte:=FechaCorte) Then
+ Dim TmpCxCAux As DataTable
+ TmpCxCAux = Mov.DtResultados.FiltraParametros("Saldo > 0 AND TipoDocto = 'Ing'", "Fecha,SerieFolio")
+ GvCxC.DataSource = Mov.DtResultados.FiltraParametros("Saldo > 0 AND TipoDocto = 'Ing'", "Fecha,SerieFolio")
+ End If
+ Mov.Dispose()
+ GvCxC.DataBind()
+ TxtCxCAplicado.Text = ""
+ UPPCxC.Update()
+
+ RegistraScript("$('#divCxC').modal('show');", "AE2")
+ End Sub
+
+
+ Protected Sub BtnAplicarCxC_Click(sender As Object, e As EventArgs)
+
+ Dim SaldoCxC As Decimal = 0
+ For Each GvRow As GridViewRow In GvCxC.Rows
+ If GvRow.FCCheckBox("Chk") IsNot Nothing AndAlso GvRow.FCCheckBox("Chk").Checked Then
+ SaldoCxC += GvRow.DataKey("Saldo").ToDecimal
+ End If
+ Next
+ TxtCxCAplicado.Text = (SaldoCxC).FormatoNumero
+ TxtImporteContado.Text = (LtlSaldo.Text.ToDecimal + SaldoCxC).FormatoNumero
+ RegistraScript("$('#divCxC').hide();", "AE21")
+ UPPCobranza.Update()
+ UPPTotalesContado.update
+ End Sub
End Class
Public Class MRespuestaSAT
diff --git a/Ventas/RepRecuperacion.aspx b/Ventas/RepRecuperacion.aspx
index 0811eb4fe..ea900ab31 100644
--- a/Ventas/RepRecuperacion.aspx
+++ b/Ventas/RepRecuperacion.aspx
@@ -4,7 +4,7 @@