-- cambios aplicación pagos compras
This commit is contained in:
@@ -7707,23 +7707,28 @@ Public Class ClsPaginas
|
||||
If Pago.Fecha < tFechaUltimaFluctuacion Then TCValuacionPago = TCValuacion
|
||||
End If
|
||||
End If
|
||||
If CompraActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares
|
||||
tImportePago = ((Pago.ImportePago * TCValuacionCompra / Pago.TCPago).RoundSQL * Pago.TCPago).RoundSQL
|
||||
tImporteCompra = (Pago.ImportePago * TCValuacionCompra).RoundSQL
|
||||
PorcentajePago = Pago.ImportePago * Pago.TCCambioMoneda / CompraActual.Total
|
||||
ElseIf CompraActual.CveMoneda <> 1 And Pago.CveMonedaPago = 1 Then 'factura dolares, pago en pesos
|
||||
tImporteCompra = (Pago.ImportePagoCompra * TCValuacionCompra).RoundSQL
|
||||
tImportePago = (Pago.ImportePago).RoundSQL
|
||||
PorcentajePago = Pago.ImportePago * Pago.TCCambioMoneda / CompraActual.Total
|
||||
ElseIf CompraActual.CveMoneda <> 1 And Pago.CveMonedaPago <> 1 Then 'factura dolares, pago en dolares
|
||||
tImporteCompra = (Pago.ImportePago * TCValuacionCompra).RoundSQL
|
||||
tImportePago = (Pago.ImportePago * Pago.TCPago).RoundSQL
|
||||
PorcentajePago = Pago.ImportePago / CompraActual.Total
|
||||
ElseIf CompraActual.CveMoneda = 1 And Pago.CveMonedaPago = 1 Then 'factura dolares, pago en pesos
|
||||
tImporteCompra = Pago.ImportePago
|
||||
tImportePago = Pago.ImportePago
|
||||
PorcentajePago = Pago.ImportePago / CompraActual.Total
|
||||
End If
|
||||
|
||||
tImporteCompra = (Pago.ImportePagoCompra * TCValuacionCompra).RoundSQL
|
||||
tImportePago = (Pago.ImportePago * Pago.TCPago).RoundSQL
|
||||
PorcentajePago = Pago.ImportePago * Pago.TCCambioMoneda / CompraActual.Total
|
||||
|
||||
'If CompraActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares
|
||||
' tImportePago = ((Pago.ImportePago * TCValuacionCompra / Pago.TCPago).RoundSQL * Pago.TCPago).RoundSQL
|
||||
' tImporteCompra = (Pago.ImportePagoCompra * TCValuacionCompra).RoundSQL
|
||||
' PorcentajePago = Pago.ImportePago * Pago.TCCambioMoneda / CompraActual.Total
|
||||
'ElseIf CompraActual.CveMoneda <> 1 And Pago.CveMonedaPago = 1 Then 'factura dolares, pago en pesos
|
||||
' tImporteCompra = (Pago.ImportePagoCompra * TCValuacionCompra).RoundSQL
|
||||
' tImportePago = (Pago.ImportePago).RoundSQL
|
||||
' PorcentajePago = Pago.ImportePago * Pago.TCCambioMoneda / CompraActual.Total
|
||||
'ElseIf CompraActual.CveMoneda <> 1 And Pago.CveMonedaPago <> 1 Then 'factura dolares, pago en dolares
|
||||
' tImporteCompra = (Pago.ImportePagoCompra * TCValuacionCompra).RoundSQL
|
||||
' tImportePago = (Pago.ImportePago * Pago.TCPago).RoundSQL
|
||||
' PorcentajePago = Pago.ImportePago / CompraActual.Total
|
||||
'ElseIf CompraActual.CveMoneda = 1 And Pago.CveMonedaPago = 1 Then 'factura dolares, pago en pesos
|
||||
' tImporteCompra = Pago.ImportePagoCompra
|
||||
' tImportePago = Pago.ImportePago
|
||||
' PorcentajePago = Pago.ImportePago / CompraActual.Total
|
||||
'End If
|
||||
Dim ImportePagoMN As Decimal = Pago.ImportePagoCompra
|
||||
Dim UsaComplementaria As Boolean = True
|
||||
If CompraActual.CveMoneda > 1 Then ImporteME = Pago.ImportePagoCompra
|
||||
|
||||
@@ -2660,6 +2660,7 @@ Partial Class Bancos_IE
|
||||
Case "AC" ' Acreedores Diversos
|
||||
If CveProveedor > 0 Then
|
||||
CveConceptoCompra = 48 'anticipo a acreedor diverso
|
||||
If CveMoneda = 2 Then CveConceptoCompra = 345
|
||||
CveConceptoContable = 30 'Bancos
|
||||
'limpio el iva
|
||||
HdnProvPorIVA.Value = "0"
|
||||
@@ -2883,7 +2884,7 @@ Partial Class Bancos_IE
|
||||
|
||||
Select Case ConceptoContable
|
||||
|
||||
Case 10, 338
|
||||
Case 10, 338, 345
|
||||
If RBL.SelectedValue = "P" AndAlso CveProveedor > 0 Then
|
||||
importeMovimiento = TxtImporte.Text.ToDecimal
|
||||
importeMX = importeMovimiento
|
||||
@@ -3622,29 +3623,6 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
End If
|
||||
|
||||
'Select Case ConceptoContable
|
||||
|
||||
' Case 30
|
||||
' importeMovimiento = TxtImporte.Text.ToDecimal
|
||||
' importeMX = importeMovimiento
|
||||
|
||||
' Case 42
|
||||
|
||||
' importeMovimiento = TxtImporte.Text.ToDecimal
|
||||
' importeMX = importeMovimiento
|
||||
' If tCveMoneda > 1 Then
|
||||
' importeMovimiento = TxtImporte.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal
|
||||
' importeMX = importeMovimiento
|
||||
' End If
|
||||
|
||||
' Case 57
|
||||
|
||||
' importeMovimiento = TxtImporte.Text.ToDecimal
|
||||
' importeMX = importeMovimiento
|
||||
' If tCveMoneda > 1 Then
|
||||
' importeMovimiento = TxtImporte.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal
|
||||
' importeMX = importeMovimiento
|
||||
' End If
|
||||
|
||||
' Case 46
|
||||
' If TxtInteresMoratorio.Text.ToDecimal > 0 Then
|
||||
@@ -3656,13 +3634,6 @@ Partial Class Bancos_IE
|
||||
' End If
|
||||
|
||||
|
||||
'End Select
|
||||
|
||||
' If importeMovimiento <> 0 Then
|
||||
' If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
|
||||
' MsgError = "Ocurrió un error al registrar el asiento del ingreso."
|
||||
' End If
|
||||
' End If
|
||||
|
||||
|
||||
Case Else
|
||||
@@ -3710,7 +3681,7 @@ Partial Class Bancos_IE
|
||||
MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución"
|
||||
End If
|
||||
|
||||
If CveConceptoCompra.Contiene(10, 338, 48) Then
|
||||
If CveConceptoCompra.Contiene(10, 338, 48, 345) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteAplicar, Ref, If(CveConceptoCompra = 10, 266, 340), Conc, Now, IdCtaAnticipoComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
|
||||
MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución"
|
||||
End If
|
||||
|
||||
@@ -1402,11 +1402,15 @@ Partial Class Bancos_PopIECompras
|
||||
'Tipos de cambio
|
||||
If Pago.CveMonedaPago = 1 AndAlso CompraActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
|
||||
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
|
||||
Pago.TCCambioMoneda = 1 / TxtTipoCambio.Text.ToDecimal
|
||||
ElseIf Pago.CveMonedaPago = 2 AndAlso CompraActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
|
||||
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
|
||||
ElseIf Pago.CveMonedaPago = 2 AndAlso CompraActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
|
||||
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
|
||||
Pago.TCCambioMoneda = TxtTipoCambio.Text.ToDecimal
|
||||
End If
|
||||
If ChkPagarPesos.Checked Then Pago.TCCambioMoneda = 1 / TxtTipoCambio.Text.ToDecimal
|
||||
If ChkPagarDolares.Checked Then Pago.TCCambioMoneda = TxtTipoCambio.Text.ToDecimal
|
||||
|
||||
If TxtComision.Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal Else Pago.OtroGastoIngreso = 0
|
||||
|
||||
@@ -1416,6 +1420,7 @@ Partial Class Bancos_PopIECompras
|
||||
If Not CveIE > 0 Then
|
||||
MsgError = "Ocurrio un Error al registrarse el movimiento bancario."
|
||||
End If
|
||||
|
||||
'Importe de pago
|
||||
Pago.ImportePago = ImportePagado
|
||||
Pago.CveIE = CveIE
|
||||
@@ -1473,8 +1478,6 @@ Partial Class Bancos_PopIECompras
|
||||
Alert("No se encontro movimientos bancarios de personal", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Dim saldo As Decimal = DtCheques.Rows(DDlCheques.SelectedIndex)("Saldo").ToString.ToDecimal
|
||||
|
||||
If TxtImporte.Text.ToDecimal > saldo Then
|
||||
@@ -1503,6 +1506,8 @@ Partial Class Bancos_PopIECompras
|
||||
Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero
|
||||
Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
|
||||
Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal
|
||||
If ChkPagarPesos.Checked Then Pago.TCCambioMoneda = 1 / rw.DataKey("TipoCambio").ToDecimal
|
||||
If ChkPagarDolares.Checked Then Pago.TCCambioMoneda = rw.DataKey("TipoCambio").ToDecimal
|
||||
|
||||
If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjMov) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
@@ -1544,11 +1549,15 @@ Partial Class Bancos_PopIECompras
|
||||
|
||||
For Each rw As GridViewRow In GvAcreedores.Rows
|
||||
If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then
|
||||
Dim TCC As Decimal = 1
|
||||
Pago = New CompraPago
|
||||
If ChkPagarPesos.Checked Then Pago.TCCambioMoneda = 1 / TxtTipoCambio.Text.ToDecimal
|
||||
If ChkPagarDolares.Checked Then Pago.TCCambioMoneda = TxtTipoCambio.Text.ToDecimal
|
||||
Pago.CveIE = rw.DataKey("CveIE").ToEntero
|
||||
Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero
|
||||
Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
|
||||
Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal
|
||||
Pago.CveProveedor = DdlDeudor.SelectedValue.ToEntero
|
||||
Pago.TCPago = TxtTipoCambio.Text.ToDecimal
|
||||
Pago.CveProveedor = DdlAcreedor.SelectedValue.ToEntero
|
||||
Pago.TipoPago = "Egsc"
|
||||
If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjMov) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
|
||||
Reference in New Issue
Block a user