-- cambios en prepolizasdetalle

This commit is contained in:
2023-08-14 18:11:11 -07:00
parent 292f882458
commit 4bce2fcc28
58 changed files with 726 additions and 2259 deletions

View File

@@ -86,23 +86,6 @@ Partial Class Ventas_ClientesAbonar
End Set
End Property
Private Property IdCuentaBancaria As Integer
Get
Return ViewState("IdCuentaBancaria").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("IdCuentaBancaria") = value
End Set
End Property
Private Property IdCuentaBancariaComplementaria As Integer
Get
Return ViewState("IdCuentaBancariaComplementaria").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("IdCuentaBancariaComplementaria") = value
End Set
End Property
Private Property NombreComercial As String
Get
Return ViewState("NombreComercial").ToString
@@ -212,8 +195,6 @@ Partial Class Ventas_ClientesAbonar
If CargaCliente(CveCliente, CveMonedaFiltro) Then
IdCuentaBancaria = 0
TxtOtrosImportes.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1},-1);", "TxtTotal", 0))
'TxtAnticipo.Attributes.Add("onKeyUp", String.Format("FnSuma(this,{0},{1},-1);", "null", 0))
@@ -416,10 +397,6 @@ Partial Class Ventas_ClientesAbonar
CveMoneda = 1
TxtTCDolares.Attributes.Add("onkeyup", String.Format("FnCambia(0,0,0,0,1,{0});", moneda))
End If
IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
IdCuentaBancariaComplementaria = dr("IdCtaContableComplementaria").ToString.ToEntero
ValidaCuentaDePagoFormaDePago()
End If
@@ -987,61 +964,61 @@ Partial Class Ventas_ClientesAbonar
Dim ConceptoPartida As String = gvr.DataKey("SerieFolio") & " " & gvr.FCDropDownList("DdlTG").SelectedItem.Text
If ImporteLiq1 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq1, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq1 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol1, ImporteME:=If(CveMoneda > 1, ImporteLiq1, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq1, ImporteLiq1 * tipoCambioPago, CveConceptoLiquidacion, gvr.DataKey("SerieFolio"), ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol1, ImporteME:=If(CveMoneda > 1, ImporteLiq1, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq2 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq2, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq2 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2, ImporteME:=If(CveMoneda > 1, ImporteLiq2, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq2, ImporteLiq2 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol2, ImporteME:=If(CveMoneda > 1, ImporteLiq2, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq3 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq3, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq3 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3, ImporteME:=If(CveMoneda > 1, ImporteLiq3, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq3, ImporteLiq3 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol3, ImporteME:=If(CveMoneda > 1, ImporteLiq3, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq4 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq4, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq4 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4, ImporteME:=If(CveMoneda > 1, ImporteLiq4, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq4, ImporteLiq4 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol4, ImporteME:=If(CveMoneda > 1, ImporteLiq4, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq5 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq5, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq5 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5, ImporteME:=If(CveMoneda > 1, ImporteLiq5, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq5, ImporteLiq5 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol5, ImporteME:=If(CveMoneda > 1, ImporteLiq5, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq6 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq6, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq6 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6, ImporteME:=If(CveMoneda > 1, ImporteLiq6, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq6, ImporteLiq6 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol6, ImporteME:=If(CveMoneda > 1, ImporteLiq6, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq7 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq7, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq7 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7, ImporteME:=If(CveMoneda > 1, ImporteLiq7, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq7, ImporteLiq7 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol7, ImporteME:=If(CveMoneda > 1, ImporteLiq7, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq8 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq8, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq8 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol8, ImporteME:=If(CveMoneda > 1, ImporteLiq8, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq8, ImporteLiq8 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol8, ImporteME:=If(CveMoneda > 1, ImporteLiq8, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq9 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq9, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq9 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol9, ImporteME:=If(CveMoneda > 1, ImporteLiq9, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq9, ImporteLiq9 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol9, ImporteME:=If(CveMoneda > 1, ImporteLiq9, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
If ImporteLiq10 <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq10, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, Now, -1, -1, CveIE, gvr.DataKey("CveVenta").ToEntero, -1, CveSubProyectoLiquidacion, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=ImporteLiq10 * tipoCambioPago, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol10, ImporteME:=If(CveMoneda > 1, ImporteLiq10, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, ImporteLiq10, ImporteLiq10 * tipoCambioPago, gvr.DataKey("SerieFolio"), CveConceptoLiquidacion, ConceptoPartida, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyectoLiquidacion, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago, PorcentajeImpuesto:=0, CveClasificacion:=CveClasificacionCol10, ImporteME:=If(CveMoneda > 1, ImporteLiq10, 0), CveTipoGasto:=gvr.FCDropDownList("DdlTG").SelectedValue.ToEntero) Then
MsgError = "No se pudo insertar la póliza" : Exit For
End If
End If
@@ -1137,11 +1114,11 @@ Partial Class Ventas_ClientesAbonar
tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, ObjIE.Folio, 30, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCuentaBancaria, -1, CveIE, -1, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=TxtImporte.Text.Trim.ToDecimal, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, TxtImporte.Text.Trim.ToDecimal, 30, ObjIE.Folio, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), CveIE:=CveIE, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
End If
If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, TxtImporte.Text.ToDecimal), TxtObservaciones.Text, 204, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCuentaBancariaComplementaria, -1, CveIE, -1, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (TxtImporte.Text.Trim.ToDecimal * tipoCambioPago) - TxtImporte.Text.Trim.ToDecimal, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, TxtImporte.Text.ToDecimal / TxtTC.Text.ToDecimal, TxtImporte.Text.ToDecimal), If(CveMoneda = 2, (TxtImporte.Text.Trim.ToDecimal * tipoCambioPago) - TxtImporte.Text.Trim.ToDecimal, TxtImporte.Text.Trim.ToDecimal), 204, TxtObservaciones.Text, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), CveIE:=CveIE, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, ImporteME:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
End If
@@ -1152,7 +1129,7 @@ Partial Class Ventas_ClientesAbonar
tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, ObjIE.Folio, 30, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), TxtFechaDocumento.Text, IdCuentaBancaria, -1, CveIE, -1, -1, CveSubProyectoContabilizar, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal * tipoCambioPago, TxtImporte.Text.Trim.ToDecimal), ImporteME:=If(CveMoneda = 2, TxtImporte.Text.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, If(CveMoneda = 2, TxtImporte.Text.Trim.ToDecimal * tipoCambioPago, TxtImporte.Text.Trim.ToDecimal), 30, ObjIE.Folio, TxtObservaciones.Text + If(CveMoneda = 2, $" TC:{tipoCambioPago}", ""), CveIE:=CveIE, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, ImporteME:=If(CveMoneda = 2, TxtImporte.Text.ToDecimal, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
@@ -1160,12 +1137,12 @@ Partial Class Ventas_ClientesAbonar
If UsuarioActual.Empresa.Funcionalidad(590) = "1" AndAlso MsgError = "" Then '' si es empresa agrícola
If TxtAnticipo.Text.ToDecimal <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtAnticipo.Text.ToDecimal, TxtFolio.Text, 66, TxtObservaciones.Text, Now, -1, -1, CveIE, -1, -1, CveSubProyecto, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=TxtAnticipo.Text.ToDecimal, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=0, ImporteME:=If(CveMoneda > 1, TxtAnticipo.Text.ToDecimal, 0)) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtAnticipo.Text.ToDecimal, TxtAnticipo.Text.ToDecimal, 66, TxtFolio.Text, TxtObservaciones.Text, CveIE:=CveIE, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=0, ImporteME:=If(CveMoneda > 1, TxtAnticipo.Text.ToDecimal, 0)) Then
MsgError = "No se pudo insertar la póliza"
End If
If CveMoneda > 1 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtAnticipo.Text.ToDecimal, TxtFolio.Text, 226, TxtObservaciones.Text, Now, -1, -1, CveIE, -1, -1, CveSubProyecto, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=((TxtAnticipo.Text.ToDecimal * tipoCambioPago) - TxtAnticipo.Text.ToDecimal).RoundSQL, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=0, ImporteME:=If(CveMoneda > 1, TxtAnticipo.Text.ToDecimal, 0)) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtAnticipo.Text.ToDecimal, ((TxtAnticipo.Text.ToDecimal * tipoCambioPago) - TxtAnticipo.Text.ToDecimal).RoundSQL, 226, TxtFolio.Text, TxtObservaciones.Text, CveIE:=CveIE, CveSubProyecto:=CveSubProyectoContabilizar, CveCliente:=ViewState("CveCliente").ToString.ToEntero, TipoCambio:=tipoCambioPago, PorcentajeImpuesto:=0, ImporteME:=If(CveMoneda > 1, TxtAnticipo.Text.ToDecimal, 0)) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
@@ -1283,7 +1260,7 @@ Partial Class Ventas_ClientesAbonar
'AFECTAR MATRIZ EGRESOS
ConceptoRenglon = String.Format("Recaudado: {0} - F.{1}", TxtAboneA.Text, Facturas.ToString)
If ObjConta.AddMovimiento(IDPoliza, IdCuentaBancaria, False, TxtImporte.Text.ToDecimal, "", ConceptoRenglon, 0, Fecha, "") Then
If ObjConta.AddMovimiento(IDPoliza, 0, False, TxtImporte.Text.ToDecimal, "", ConceptoRenglon, 0, Fecha, "") Then
If TxtImporte.Text.ToDecimal - ImporteOP > 0 Then
If Not ObjConta.AddMovimiento(IDPoliza, ViewState("CtaCliente").ToString.ToEntero, True, TxtImporte.Text.ToDecimal - ImporteOP, "", ConceptoRenglon, 0, Fecha, "") Then ErrorAC = True
End If
@@ -1367,15 +1344,15 @@ Partial Class Ventas_ClientesAbonar
Dim MsgError As String = ""
If CveMonedaPago = 2 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, ReferenciaVenta, 92, ReferenciaVenta, TxtFechaDocumento.Text, 0, -1, CveIE, CveCliente:=CveCliente, ImporteMX:=Importe, CveVenta:=CveVenta, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, Importe, 92, ReferenciaVenta, ReferenciaVenta, CveIE:=CveIE, CveCliente:=CveCliente, CveVenta:=CveVenta, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, Importe / TxtTC.Text.ToDecimal, Importe), ReferenciaVenta, 227, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioPago}", "")), TxtFechaDocumento.Text, 0, -1, CveIE, CveCliente:=ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (Importe * tipoCambioPago) - Importe, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), CveVenta:=CveVenta, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, Importe / TxtTC.Text.ToDecimal, Importe), If(CveMoneda = 2, (Importe * tipoCambioPago) - Importe, Importe), 227, ReferenciaVenta, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioPago}", "")), CveIE:=CveIE, CveCliente:=ViewState("CveCliente").ToString.ToEntero, ImporteME:=If(CveMoneda = 2, Importe, 0), CveVenta:=CveVenta, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
End If
Else
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, ReferenciaVenta, 92, ReferenciaVenta, TxtFechaDocumento.Text, 0, -1, CveIE, CveCliente:=ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, Importe * tipoCambioPago, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), CveVenta:=CveVenta, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, If(CveMoneda = 2, Importe * tipoCambioPago, Importe), 92, ReferenciaVenta, ReferenciaVenta, CveIE, CveCliente:=ViewState("CveCliente").ToString.ToEntero, ImporteME:=If(CveMoneda = 2, Importe, 0), CveVenta:=CveVenta, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
End If
End If
@@ -2363,28 +2340,20 @@ Partial Class Ventas_ClientesAbonar
Dim CveConceptoCliente As Integer = 2
Dim ImpuestosMovto As Boolean = False
Dim IdCuentaContableNoDeducible As Integer = 0
Dim CveSubProyecto As Integer = gr.DataKey("CveSubProyecto").ToEntero
Dim ConceptoPartida As String = TxtObsSaldarIncobrable.Text.Trim & " " & gr.DataKey("SerieFolio").ToString
If CveConceptoDeduccion = 255 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(266).ToEntero
If CveConceptoDeduccion = 179 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(559).ToEntero
If CveConceptoDeduccion = 263 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(537).ToEntero
If CveConceptoDeduccion = 252 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(581).ToEntero
'If CveConceptoDeduccion = 255 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(266).ToEntero
'If CveConceptoDeduccion = 179 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(559).ToEntero
'If CveConceptoDeduccion = 263 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(537).ToEntero
'If CveConceptoDeduccion = 252 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(581).ToEntero
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) Then
ClienteMovto = False : Saldo = Saldo * -1
ImpuestosMovto = True : IVA = IVA * -1
'RETIVA = RETIVA * -1
RETIVA = ((SubTotal * RETIVA / gr.DataKey("SubTotal").ToDecimal.RoundSQL) * -1).RoundSQL(2)
CveConceptoCliente = 1
'falta cuenta incobrable
IdCuentaContableNoDeducible = 3114
End If
Dim UsaComplementaria As Boolean = True
@@ -2396,13 +2365,13 @@ Partial Class Ventas_ClientesAbonar
If MsgError = "" Then
Dim ConPreP As ConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(6, tCveMoneda, True, 1)
'normal
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, ConPreP.CveConcepto, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo), TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, Saldo, ConPreP.CveConcepto, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
If UsaComplementaria AndAlso tCveMoneda = 2 Then
'complementaria
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, gr.DataKey("SerieFolio").ToString, ConPreP.CveConceptoComplementario, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, (Saldo * TCVenta) - Saldo).RoundSQL, ImporteME:=Saldo, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, If(CveMonedaFiltro = 1, Saldo, (Saldo * TCVenta) - Saldo).RoundSQL, ConPreP.CveConceptoComplementario, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteME:=Saldo, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If
@@ -2417,11 +2386,11 @@ Partial Class Ventas_ClientesAbonar
End If
If TCPago > TCVenta Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 64, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=0, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), Math.Abs(ImporteFluctuacion), 65, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If
@@ -2431,17 +2400,17 @@ Partial Class Ventas_ClientesAbonar
End If
If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, 0, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), PorcentajeImpuesto:=gr.DataKey("PorcentajeIVA").ToDecimal, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, PorcentajeImpuesto:=gr.DataKey("PorcentajeIVA").ToDecimal, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
If (RETIVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And RETIVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, RETIVA, gr.DataKey("SerieFolio").ToString, 8, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, 0, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, RETIVA, RETIVA * TCVenta), TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If (RETIVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And RETIVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, RETIVA, If(CveMonedaFiltro = 1, RETIVA, RETIVA * TCVenta), gr.DataKey("SerieFolio").ToString, 8, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, gr.DataKey("SerieFolio").ToString, 38, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, 0, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), 38, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
'al gasto,Subtotal
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, gr.DataKey("SerieFolio").ToString, CveConceptoDeduccion, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCuentaContableNoDeducible, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=SubTotal, CveSubProyecto:=CveSubProyecto, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, SubtotalMovto, SubTotal, SubTotal, CveConceptoDeduccion, gr.DataKey("SerieFolio").ToString, ConceptoPartida, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, CveSubProyecto:=CveSubProyecto, CveCuenta:=-1, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
@@ -2452,7 +2421,6 @@ Partial Class Ventas_ClientesAbonar
Exit For
End If
End If
End If
End If
Next
@@ -2632,13 +2600,10 @@ Partial Class Ventas_ClientesAbonar
End If
Deudores.Dispose()
End If
IdCuentaBancariaComplementaria = 0
Banco.Dispose()
Else
CveMonedaPago = -1
End If
If CveMonedaPago = 1 Then
'DivTC.Visible = True
DivTCDolares.Visible = False
@@ -2730,8 +2695,6 @@ Partial Class Ventas_ClientesAbonar
#End Region
Protected Sub LnkAccionesModalSeleccionLayout_Click(sender As Object, e As EventArgs)
TxtModalLayoutExcel.Text = "[]"
@@ -2740,7 +2703,6 @@ Partial Class Ventas_ClientesAbonar
End Sub
Protected Sub LnkSeleccionLayout_Click(sender As Object, e As EventArgs)
Dim ProcesoOK As Boolean = True