Pagos Contado COmpras
This commit is contained in:
@@ -416,6 +416,22 @@ Partial Class Compras_Compras
|
||||
ViewState("CveCuentaBancaria") = 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 CveCuentaBancariaComplementaria As Integer
|
||||
Get
|
||||
Return ViewState("CveCuentaBancariaComplementaria").ToString.ToEntero
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveCuentaBancariaComplementaria") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property IvaAcumulado As Double
|
||||
Get
|
||||
Return ViewState("IvaAcumulado").ToString.ToDouble
|
||||
@@ -1126,6 +1142,9 @@ Partial Class Compras_Compras
|
||||
CveCuentaBancaria = 0
|
||||
End If
|
||||
|
||||
IdCuentaBancariaComplementaria = 0
|
||||
CveCuentaBancariaComplementaria = 0
|
||||
|
||||
'If UsuarioActual.TienePermisoProceso(259) Then
|
||||
DivEsNoDeducible.Visible = True
|
||||
'End If
|
||||
@@ -4164,14 +4183,47 @@ Partial Class Compras_Compras
|
||||
If CvePrePoliza > 0 Then
|
||||
|
||||
'seria de contado, solo cuando no tenga vinculado ningun anticipo
|
||||
Dim ImportePago As Decimal = 0
|
||||
Dim TCPago As Decimal = GlobalTipoCambio(TxtFechaPago.Text.ToDate).ToString.ToDecimal
|
||||
Dim CveMonedaPago As Integer = DdlMoneda.SelectedValue.ToEntero
|
||||
|
||||
If RBLPago.SelectedValue.ToEntero = 2 AndAlso ArrAnticipos.Count = 0 Then 'Contado
|
||||
|
||||
If RBLContado.SelectedValue = "1" Then
|
||||
ImportePago = TxtDocumentoImporte.Text.Trim.ToDecimal
|
||||
Dim Dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuenta.SelectedValue}").Rows(0)
|
||||
|
||||
If Dr IsNot Nothing Then
|
||||
CveMonedaPago = Dr("CveMoneda").ToString.ToEntero
|
||||
End If
|
||||
|
||||
If CveMonedaPago = 1 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
|
||||
ImportePago = (ImportePago * TCPago).RoundSQL
|
||||
ElseIf CveMonedaPago = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then
|
||||
ImportePago = (ImportePago / TCPago).RoundSQL
|
||||
ElseIf CveMonedaPago = 1 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then
|
||||
TCPago = 1
|
||||
End If
|
||||
|
||||
'se registra primero el movimiento en bancos para luego vincularlo en la compra
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaPago.Text.Trim.ToDate, TxtDocumentoFolio.Text.Trim, DdlProveedor.SelectedItem.Text.Trim, TxtDocumentoImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero, 0.0, TxtDocumentoObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1))
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaPago.Text.Trim.ToDate, TxtDocumentoFolio.Text.Trim, DdlProveedor.SelectedItem.Text.Trim, ImportePago, CveMonedaPago, TCPago, TxtDocumentoObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1))
|
||||
ElseIf RBLContado.SelectedValue = "6" Then
|
||||
ImportePago = TxtDocumentoImporteCaja.Text.Trim.ToDecimal
|
||||
Dim Dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros($"CveCuenta = {DdlCuentaCaja.SelectedValue}").Rows(0)
|
||||
If Dr IsNot Nothing Then
|
||||
CveMonedaPago = Dr("CveMoneda").ToString.ToEntero
|
||||
End If
|
||||
|
||||
If CveMonedaPago = 1 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then
|
||||
ImportePago = (ImportePago * TCPago).RoundSQL
|
||||
ElseIf CveMonedaPago = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then
|
||||
ImportePago = (ImportePago / TCPago).RoundSQL
|
||||
ElseIf CveMonedaPago = 1 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then
|
||||
TCPago = 1
|
||||
End If
|
||||
|
||||
'se registra primero el movimiento en bancos para luego vincularlo en la compra
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuentaCaja.SelectedValue.ToEntero, DdlTipoTransaccionCaja.SelectedValue.ToEntero, TxtFechaPago.Text.Trim.ToDate, TxtDocumentoFolioCaja.Text.Trim, DdlProveedor.SelectedItem.Text.Trim, TxtDocumentoImporteCaja.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero, 0.0, TxtDocumentoObservacionesCaja.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuentaCaja.SelectedValue.ToEntero, DdlTipoTransaccionCaja.SelectedValue.ToEntero, TxtFechaPago.Text.Trim.ToDate, TxtDocumentoFolioCaja.Text.Trim, DdlProveedor.SelectedItem.Text.Trim, ImportePago, CveMonedaPago, TCPago, TxtDocumentoObservacionesCaja.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
End If
|
||||
|
||||
If (RBLContado.SelectedValue = "1" OrElse RBLContado.SelectedValue = "6") AndAlso Not CveIE > 0 Then
|
||||
@@ -5215,7 +5267,6 @@ Partial Class Compras_Compras
|
||||
Dim PorcentajePagos As Decimal = 0
|
||||
Dim sumaPagos As Decimal = 0
|
||||
Dim tipoCambioActual As Decimal
|
||||
Dim tipoCambioPago As Decimal
|
||||
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
|
||||
Dim idCuentaContabilizacion As Long = 1
|
||||
Dim CveCuentaContabilizacion As Long = 1
|
||||
@@ -5368,13 +5419,19 @@ Partial Class Compras_Compras
|
||||
|
||||
'**************************************************************************************************************************
|
||||
|
||||
Dim TipoCambioCompra As Decimal = 1
|
||||
TipoCambioCompra = GlobalTipoCambio(FechaMovimiento).ToString.ToDecimal
|
||||
TipoCambioCompra = If(DivTC.Visible, TipoCambio.ToDecimal, TipoCambioCompra)
|
||||
|
||||
If CveMonedaPago = 1 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then
|
||||
TipoCambioCompra = 1
|
||||
End If
|
||||
|
||||
If DdlMoneda.SelectedValue.ToString.ToEntero = 2 Then
|
||||
tipoCambioActual = GlobalTipoCambio(FechaMovimiento).ToString.ToDecimal
|
||||
tipoCambioActual = If(DivTC.Visible, TipoCambio.ToDecimal, tipoCambioActual)
|
||||
tipoCambioPago = GlobalTipoCambio(TxtFechaPago.Text.ToDate).ToString.ToDecimal
|
||||
Else
|
||||
tipoCambioActual = 1
|
||||
tipoCambioPago = 1
|
||||
End If
|
||||
|
||||
'CASO ESPECIAL CREDITOS
|
||||
@@ -5412,7 +5469,10 @@ Partial Class Compras_Compras
|
||||
Case 17 'Pago Proveedores
|
||||
|
||||
importeMovimiento = importePagoProv
|
||||
importeMN = importeMovimiento * tipoCambioActual * Multiplicador
|
||||
If CveMonedaPago = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then
|
||||
importeMovimiento = importeMovimiento / TipoCambioCompra
|
||||
End If
|
||||
importeMN = importeMovimiento * TipoCambioCompra * Multiplicador
|
||||
IdCtaContable = CtaProveedor
|
||||
CveCuenta = CveCuentaProveedor
|
||||
|
||||
@@ -5509,9 +5569,9 @@ Partial Class Compras_Compras
|
||||
|
||||
End If
|
||||
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
If TipoCambioCompra > 1 Then Concepto += $" TC:{TipoCambioCompra} ${importeMovimiento.FormatoNumero(2)}"
|
||||
|
||||
If tipoCambioActual = 1 Then
|
||||
If TipoCambioCompra = 1 Then
|
||||
IdCtaContable = CtaProveedor
|
||||
CveCuenta = CveCuentaProveedor
|
||||
Else
|
||||
@@ -5519,7 +5579,7 @@ Partial Class Compras_Compras
|
||||
CveCuenta = CveCuentaProveedorComplementaria
|
||||
If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or CveCuenta > 0) Then 'Cuando tiene complementaria lo dividimos en dos
|
||||
importeMN = importeMovimiento
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, 201, Concepto, FechaMovimiento, IdCtaContable, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * tipoCambioActual - importeMovimiento, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, 201, Concepto, FechaMovimiento, IdCtaContable, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * TipoCambioCompra - importeMovimiento, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, TipoCambio:=TipoCambioCompra) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
@@ -5530,11 +5590,30 @@ Partial Class Compras_Compras
|
||||
|
||||
Case 30 'Bancos
|
||||
importeMovimiento = importeBanco + importeCajaChica 'Uno de los dos debe ser 0
|
||||
importeMN = importeMovimiento * tipoCambioPago * Multiplicador
|
||||
IdCtaContable = IdCuentaBancaria
|
||||
CveCuenta = CveCuentaBancaria
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioPago} ${importeMovimiento.FormatoNumero(2)}"
|
||||
'' falta complementaria
|
||||
If CveMonedaPago = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 1 Then
|
||||
importeMovimiento = importeMovimiento / TCPago
|
||||
End If
|
||||
importeMN = importeMovimiento * TCPago * Multiplicador
|
||||
|
||||
If TCPago > 1 Then Concepto += $" TC:{TCPago} ${importeMovimiento.FormatoNumero(2)}"
|
||||
|
||||
If TCPago = 1 Then
|
||||
IdCtaContable = IdCuentaBancaria
|
||||
CveCuenta = CveCuentaBancaria
|
||||
Else
|
||||
IdCtaContable = IdCuentaBancariaComplementaria
|
||||
CveCuenta = CveCuentaBancariaComplementaria
|
||||
If importeMovimiento <> 0 AndAlso (IdCtaContable > 0 Or CveCuenta > 0) Then 'Cuando tiene complementaria lo dividimos en dos
|
||||
importeMN = importeMovimiento
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Referencia, 201, Concepto, FechaMovimiento, IdCtaContable, -1, CveIE, CveProveedor:=CveProveedor, ImporteMX:=importeMovimiento * TCPago - importeMovimiento, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, TipoCambio:=TCPago) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
|
||||
IdCtaContable = IdCuentaBancaria
|
||||
CveCuenta = CveCuentaBancaria
|
||||
End If
|
||||
|
||||
|
||||
Case 19 'IVA Acreditable
|
||||
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
|
||||
@@ -5547,7 +5626,7 @@ Partial Class Compras_Compras
|
||||
importeMovimiento = importeIVAAcreditable
|
||||
End If
|
||||
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioPago * Multiplicador
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
|
||||
PorcentajeImpuesto = PorcentajeIVA
|
||||
IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
|
||||
@@ -5577,7 +5656,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioPago} ${importeMovimiento.FormatoNumero(2)}"
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
Case 14 'IVA X Acreditar
|
||||
importeMovimiento = importeIVAxAcreditar
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
@@ -5614,7 +5693,7 @@ Partial Class Compras_Compras
|
||||
Case 26 'IEPS Acreditable
|
||||
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
|
||||
importeMovimiento = ImporteIEPSAcreditable
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioPago * Multiplicador
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero
|
||||
@@ -5638,7 +5717,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioPago} ${importeMovimiento.FormatoNumero(2)}"
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
|
||||
End If
|
||||
Case 22 'RetIVA Acreditable Honorarios/Serv. Prof.
|
||||
@@ -5646,7 +5725,7 @@ Partial Class Compras_Compras
|
||||
If DdlRetIVAConcepto.Items.Count > 0 Then
|
||||
If DdlRetIVAConcepto.SelectedValue.ToEntero = 1 Then
|
||||
importeMovimiento = importeRetIVAAcreditable
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioPago * Multiplicador
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
If CtaProveedorRetIVA > 0 Then
|
||||
IdCtaContable = CtaProveedorRetIVA
|
||||
CveCuenta = CveCuentaProveedorRetIVA
|
||||
@@ -5668,7 +5747,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioPago} ${importeMovimiento.FormatoNumero(2)}"
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -5700,7 +5779,7 @@ Partial Class Compras_Compras
|
||||
If DdlRetIVAConcepto.Items.Count > 0 Then
|
||||
If DdlRetIVAConcepto.SelectedValue.ToEntero = 2 Then
|
||||
importeMovimiento = importeRetIVAAcreditable
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioPago * Multiplicador
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
If CtaProveedorRetIVA > 0 Then
|
||||
IdCtaContable = CtaProveedorRetIVA
|
||||
CveCuenta = CveCuentaProveedorRetIVA
|
||||
@@ -5722,7 +5801,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioPago} ${importeMovimiento.FormatoNumero(2)}"
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -5776,7 +5855,7 @@ Partial Class Compras_Compras
|
||||
If DdlRetIVAConcepto.Items.Count > 0 Then
|
||||
If DdlRetIVAConcepto.SelectedValue.ToEntero = 3 Then
|
||||
importeMovimiento = importeRetIVAAcreditable
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioPago * Multiplicador
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
If CtaProveedorRetIVA > 0 Then
|
||||
IdCtaContable = CtaProveedorRetIVA
|
||||
CveCuenta = CveCuentaProveedorRetIVA
|
||||
@@ -5798,7 +5877,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioPago} ${importeMovimiento.FormatoNumero(2)}"
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -5829,7 +5908,7 @@ Partial Class Compras_Compras
|
||||
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
|
||||
If DdlRetIVAConcepto.Items.Count > 0 AndAlso DdlRetIVAConcepto.SelectedValue.ToEntero = 4 Then
|
||||
importeMovimiento = importeRetIVAAcreditable
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioPago * Multiplicador
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
If CtaProveedorRetIVA > 0 Then
|
||||
IdCtaContable = CtaProveedorRetIVA
|
||||
CveCuenta = CveCuentaProveedorRetIVA
|
||||
@@ -5844,7 +5923,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioPago} ${importeMovimiento.FormatoNumero(2)}"
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -5852,7 +5931,7 @@ Partial Class Compras_Compras
|
||||
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
|
||||
If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 1 Then
|
||||
importeMovimiento = importeRetISRAcreditable
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioPago * Multiplicador
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
If CtaProveedorRetISR > 0 Then
|
||||
IdCtaContable = CtaProveedorRetISR
|
||||
CveCuenta = CveCuentaProveedorRetISR
|
||||
@@ -5874,7 +5953,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioPago} ${importeMovimiento.FormatoNumero(2)}"
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
End If
|
||||
End If
|
||||
Case 16 'Ret ISR X Acreditar
|
||||
@@ -5902,7 +5981,7 @@ Partial Class Compras_Compras
|
||||
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
|
||||
If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then
|
||||
importeMovimiento = importeRetISRxAcreditar
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioPago * Multiplicador
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
If CtaProveedorRetISR > 0 Then
|
||||
IdCtaContable = CtaProveedorRetISR
|
||||
CveCuenta = CveCuentaProveedorRetISR
|
||||
@@ -5917,14 +5996,14 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioPago} ${importeMovimiento.FormatoNumero(2)}"
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
End If
|
||||
End If
|
||||
Case 244 'RetISR Acreditable Terceros y Arrendamiento
|
||||
If Not DdlTipoComprobante.SelectedValue.Contiene("Ant") Then
|
||||
If DdlRetISRConcepto.Items.Count > 0 AndAlso DdlRetISRConcepto.SelectedValue.ToEntero = 2 Then
|
||||
importeMovimiento = importeRetISRAcreditable
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioPago * Multiplicador
|
||||
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
|
||||
If CtaProveedorRetISR > 0 Then
|
||||
IdCtaContable = CtaProveedorRetISR
|
||||
CveCuenta = CveCuentaProveedorRetISR
|
||||
@@ -5944,18 +6023,18 @@ Partial Class Compras_Compras
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioPago} ${importeMovimiento.FormatoNumero(2)}"
|
||||
If tipoCambioActual > 1 Then Concepto += $" TC:{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
|
||||
End If
|
||||
End If
|
||||
Case 64 'Ganancia
|
||||
If tipoCambioActual <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
|
||||
If TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
||||
If tipoCambioPago < tipoCambioActual Then
|
||||
importeMovimiento = Math.Abs(tipoCambioPago - tipoCambioActual) * importePagoProv
|
||||
importeMovimiento -= Math.Abs(tipoCambioPago - tipoCambioActual) * importeIVAAcreditable
|
||||
importeMovimiento += Math.Abs(tipoCambioPago - tipoCambioActual) * importeRetIVAAcreditable
|
||||
importeMovimiento += Math.Abs(tipoCambioPago - tipoCambioActual) * importeRetISRAcreditable
|
||||
If TCPago < TipoCambioCompra Then
|
||||
importeMovimiento = Math.Abs(TCPago - TipoCambioCompra) * importePagoProv
|
||||
importeMovimiento -= Math.Abs(TCPago - TipoCambioCompra) * importeIVAAcreditable
|
||||
importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetIVAAcreditable
|
||||
importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetISRAcreditable
|
||||
importeMN = importeMovimiento
|
||||
End If
|
||||
Else
|
||||
@@ -5963,14 +6042,14 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
Case 65 'Perdida
|
||||
If tipoCambioActual <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
|
||||
If TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
If tipoCambioActual < tipoCambioPago Then
|
||||
importeMovimiento = Math.Abs(tipoCambioPago - tipoCambioActual) * importePagoProv
|
||||
importeMovimiento -= Math.Abs(tipoCambioPago - tipoCambioActual) * importeIVAAcreditable
|
||||
importeMovimiento += Math.Abs(tipoCambioPago - tipoCambioActual) * importeRetIVAAcreditable
|
||||
importeMovimiento += Math.Abs(tipoCambioPago - tipoCambioActual) * importeRetISRAcreditable
|
||||
If TCPago < TipoCambioCompra Then
|
||||
importeMovimiento = Math.Abs(TCPago - TipoCambioCompra) * importePagoProv
|
||||
importeMovimiento -= Math.Abs(TCPago - TipoCambioCompra) * importeIVAAcreditable
|
||||
importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetIVAAcreditable
|
||||
importeMovimiento += Math.Abs(TCPago - TipoCambioCompra) * importeRetISRAcreditable
|
||||
importeMN = importeMovimiento
|
||||
End If
|
||||
Else
|
||||
@@ -11102,12 +11181,12 @@ Partial Class Compras_Compras
|
||||
|
||||
Private Sub CargaCuentas()
|
||||
DdlCuenta.Items.Clear()
|
||||
DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue))
|
||||
DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveTipoCuenta <> 1"))
|
||||
DdlCuenta.DataBind()
|
||||
DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
|
||||
DdlCuentaCaja.Items.Clear()
|
||||
DdlCuentaCaja.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", DdlMoneda.SelectedValue))
|
||||
DdlCuentaCaja.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros(String.Format("CveTipoCuenta = 1"))
|
||||
DdlCuentaCaja.DataBind()
|
||||
DdlCuentaCaja.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
End Sub
|
||||
@@ -11886,6 +11965,8 @@ Partial Class Compras_Compras
|
||||
CveMoneda = dr("CveMoneda").ToString.ToEntero
|
||||
IdCuentaBancaria = dr("IdCtaContable").ToString.ToEntero
|
||||
CveCuentaBancaria = dr("IdCtaContableSIG").ToString.ToEntero
|
||||
IdCuentaBancariaComplementaria = dr("IdCtaContableComplementaria").ToString.ToEntero
|
||||
CveCuentaBancariaComplementaria = dr("IdCtaContableSIGComplementaria").ToString.ToEntero
|
||||
If dr("UsaTarjeta").ToString = "True" Then
|
||||
CargaGridTarjetas()
|
||||
Else
|
||||
|
||||
Reference in New Issue
Block a user