--FIX devolucion al cliente
This commit is contained in:
@@ -10898,19 +10898,24 @@ Partial Class Clientes
|
|||||||
Dim PorcentajePagoDevDin As Decimal = (gvr.DataKey("Saldo").ToDecimal / gvr.DataKey("Total").ToDecimal).RoundSQL(6)
|
Dim PorcentajePagoDevDin As Decimal = (gvr.DataKey("Saldo").ToDecimal / gvr.DataKey("Total").ToDecimal).RoundSQL(6)
|
||||||
Dim tCveConcepto As Integer
|
Dim tCveConcepto As Integer
|
||||||
ImporteAplicar = gvr.DataKey("Saldo").ToDecimal
|
ImporteAplicar = gvr.DataKey("Saldo").ToDecimal
|
||||||
|
Dim CveVentaAmortizacion As Integer = -1
|
||||||
|
|
||||||
If gvr.DataKey("Tipo") = "IxC" Then
|
If gvr.DataKey("Tipo") = "IxC" Then
|
||||||
tCveConcepto = 92 : tTipoMovto = False
|
tCveConcepto = 92 : tTipoMovto = False
|
||||||
ElseIf gvr.DataKey("Tipo").Contiene("Dev", "NC") Then
|
ElseIf gvr.DataKey("Tipo").Contiene("Dev", "NC") Then
|
||||||
tCveConcepto = 12 : ImporteAplicar = -ImporteAplicar : tTipoMovto = True
|
CveVentaAmortizacion = gvr.DataKey("CveVenta").ToEntero
|
||||||
|
tCveConcepto = 91 : ImporteAplicar = ImporteAplicar : tTipoMovto = False
|
||||||
ElseIf gvr.DataKey("Tipo").Contiene("Ant") Then
|
ElseIf gvr.DataKey("Tipo").Contiene("Ant") Then
|
||||||
tCveConcepto = 11 : ImporteAplicar = ImporteAplicar : tTipoMovto = False
|
tCveConcepto = 11 : ImporteAplicar = ImporteAplicar : tTipoMovto = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
ImporteAplicarMN = (ImporteAplicar * If(tCveMoneda = 1, 1, tTipoCambio)).RoundSQL()
|
ImporteAplicarMN = (ImporteAplicar * If(tCveMoneda = 1, 1, tTipoCambio)).RoundSQL()
|
||||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, tTipoMovto, ImporteAplicar, ImporteAplicarMN, tCveConcepto, ReferenciaAplicar, ConceptoAplicar, CveIE:=gvr.DataKey("CveIE").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
|
|
||||||
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, tTipoMovto, ImporteAplicar, ImporteAplicarMN, tCveConcepto, ReferenciaAplicar, ConceptoAplicar, CveIE:=gvr.DataKey("CveIE").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME, CveVentaAmortizacion:=CveVentaAmortizacion) Then
|
||||||
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
|
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'IMPUESTOS
|
'IMPUESTOS
|
||||||
If gvr.DataKey("IVA").ToDecimal > 0 Then
|
If gvr.DataKey("IVA").ToDecimal > 0 Then
|
||||||
tImporte = -(gvr.DataKey("IVA").ToDecimal * PorcentajePagoDevDin).RoundSQL
|
tImporte = -(gvr.DataKey("IVA").ToDecimal * PorcentajePagoDevDin).RoundSQL
|
||||||
@@ -10923,6 +10928,7 @@ Partial Class Clientes
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If gvr.DataKey("IEPS").ToDecimal > 0 Then
|
If gvr.DataKey("IEPS").ToDecimal > 0 Then
|
||||||
tImporte = (gvr.DataKey("IEPS").ToDecimal * PorcentajePagoDevDin).RoundSQL
|
tImporte = (gvr.DataKey("IEPS").ToDecimal * PorcentajePagoDevDin).RoundSQL
|
||||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, tImporte, tImporte, 39, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, tImporte, tImporte, 39, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
|
||||||
@@ -10930,6 +10936,7 @@ Partial Class Clientes
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If gvr.DataKey("RetIVA").ToDecimal > 0 Then
|
If gvr.DataKey("RetIVA").ToDecimal > 0 Then
|
||||||
tImporte = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePagoDevDin).RoundSQL
|
tImporte = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePagoDevDin).RoundSQL
|
||||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 62, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 62, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
|
||||||
@@ -10937,6 +10944,7 @@ Partial Class Clientes
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If gvr.DataKey("RetISR").ToDecimal > 0 Then
|
If gvr.DataKey("RetISR").ToDecimal > 0 Then
|
||||||
tImporte = (gvr.DataKey("RetISR").ToDecimal * PorcentajePagoDevDin).RoundSQL
|
tImporte = (gvr.DataKey("RetISR").ToDecimal * PorcentajePagoDevDin).RoundSQL
|
||||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 63, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
|
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, tImporte, tImporte, 63, ReferenciaAplicar, ConceptoAplicar, CveIE:=CveIE, CveVenta:=gvr.DataKey("CveVenta").ToEntero, CveCliente:=CveCliente, ImporteME:=ImporteAplicarME) Then
|
||||||
@@ -10944,6 +10952,7 @@ Partial Class Clientes
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user