diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 7b817d862..b11a0195e 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/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/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/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/Ventas/CatPromociones.aspx b/Ventas/CatPromociones.aspx
index 998968349..e19fcc227 100644
--- a/Ventas/CatPromociones.aspx
+++ b/Ventas/CatPromociones.aspx
@@ -28,25 +28,61 @@
-
+
+
+
-
-
- <%-- --%>
+
+
+ :
+
+
-
-
-
-
-
-
-
+
+ Cliente:
+
+
+
+
+ Vendedor:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Marca:
+
+
+
+
+
+ Producto:
+
+
+
+
+
+
+
+
@@ -69,6 +105,10 @@
+
+
+
+
diff --git a/Ventas/CatPromociones.aspx.vb b/Ventas/CatPromociones.aspx.vb
index e5a6f525f..a18864c75 100644
--- a/Ventas/CatPromociones.aspx.vb
+++ b/Ventas/CatPromociones.aspx.vb
@@ -22,21 +22,57 @@ Partial Class Ventas_CatPromociones
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
-
- 'ImgAddPromocion.Attributes.Add("OnClick", "window.location = '/Ventas/Promociones.aspx'")
- 'CARGA SUCURSALES
- DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
- DdlSubProyecto.DataBind()
- DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
-
+ InicializaControles()
CargaDatos()
End If
End Sub
+ Private Sub InicializaControles()
+
+
+
+ CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyecto)
+
+ GvDatos.Columns(6).HeaderText = LblSubProyecto.Text
+
+ DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
+ DdlSubProyecto.DataBind()
+ DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
+
+ DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
+ DdlVendedor.DataBind()
+ DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))
+
+ Dim ObjPS As New ClsProductosServicios
+ If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
+ DdlMarca.DataSource = ObjPS.DtResultados
+ End If
+ ObjPS.Dispose()
+ DdlMarca.DataBind()
+ DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
+
+ DdlClientes.setEsWebService(True)
+
+ 'CARGA PS
+ DdlPS.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
+ DdlPS.IncluyeTodos = True
+ If Not DdlPS.UsaWebService AndAlso CType(DdlPS.DataSource, DataTable) Is Nothing Then
+ DdlPS.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
+ DdlPS.DataBind()
+ End If
+
+ End Sub
+
Private Sub CargaDatos()
+
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetPromociones(-1, MinFecha, -1, -1, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, CveUsuario:=UsuarioActual.CveUsuario) Then
+ Dim CveCliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
+ Dim CvePS As Integer = If(DdlPS.SelectedValue.ToEntero > 0, DdlPS.SelectedValue.ToEntero, -1)
+
+
+ If ObjVentas.GetPromociones(-1, MinFecha, DdlVendedor.SelectedValue.ToEntero, CveCliente, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlSubProyecto.SelectedValue.ToEntero, CveUsuario:=UsuarioActual.CveUsuario,
+ CveMarca:=DdlMarca.SelectedValue.ToEntero, CvePS:=CvePS) Then
DtDatos = ObjVentas.DtResultados
Else
DtDatos = Nothing
diff --git a/Ventas/PVCobranza.aspx b/Ventas/PVCobranza.aspx
index bc0f38ce9..8283ede90 100644
--- a/Ventas/PVCobranza.aspx
+++ b/Ventas/PVCobranza.aspx
@@ -328,7 +328,7 @@
+ DataKeyNames="CveVenta,CveCliente,TipoDocto,Saldo,AtencionA,CveFormaPago33,SerieFolio,CondicionesPago,PlazoCobranza">
<%----%>
@@ -441,6 +441,7 @@