This commit is contained in:
2023-02-08 08:33:55 -07:00
8 changed files with 3991 additions and 3835 deletions

View File

@@ -2773,7 +2773,7 @@ Partial Class Bancos_IE
End If
End If
Dim UsaComplementariaBancos As Boolean = False
UsaComplementariaBancos = True
UsaComplementariaBancos = If(UsuarioActual.CveEmpresa.Contiene(13, 83), False, True)
If MsgError = "" Then
@@ -3706,8 +3706,16 @@ Partial Class Bancos_IE
IDCtaBeneficiario = IdCtaAnticipoExtranjera
End If
Dim Importe30 As Decimal = TxtImporte.Text.ToDecimal
If Not UsaComplementariaBancos AndAlso tCveMoneda > 1 Then
Importe30 = TxtImporte.Text.ToDecimal + (TxtImporte.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal - TxtImporte.Text.ToDecimal).RoundSQL()
End If
'MOVIMIENTOS EGRESOS
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=Importe30, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=If(UsaComplementariaBancos, TxtImporte.Text.ToDecimal, tImporteMonedaExtranjera), ImporteME:=TxtImporte.Text.ToDecimal, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then
If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
@@ -3725,7 +3733,7 @@ Partial Class Bancos_IE
End If
'BANCOS COMPLEMENTARIA
If tCveMoneda > 1 Then
If tCveMoneda > 1 And UsaComplementariaBancos Then
Dim ImporteAplicar As Decimal = TxtImporte.Text.ToDecimal
Dim ImporteAplicarMN = (ImporteAplicar * TxtTipoCambio.Text.ToDecimal - ImporteAplicar).RoundSQL()
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAplicar, Ref, 204, Conc, Now, IDCtaContableComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then

View File

@@ -3442,7 +3442,7 @@ Partial Class Bancos_PopIECompras
Protected Sub CVTxtImporte_ServerValidate(source As Object, args As ServerValidateEventArgs)
Dim Saldo As Decimal = LtlSaldo.Text.Replace("USD", "").Replace(",", "").ToDecimal
Dim Saldo As Decimal = LtlSaldo.Text.Replace("USD", "").Replace("MXN", "").Replace(",", "").ToDecimal
Dim ImportePagado As Decimal = TxtImporte.Text.ToDecimal
If ChkPagarPesos.Checked Then

View File

@@ -253,7 +253,8 @@ Partial Class Bancos_Transferencias
If CveMonedaOrigen = 1 AndAlso CveMonedaDestino <> 1 Then
'pesos a otra moneda se divide
ImporteMXDestino = Math.Round(TxtImporte.Text.Trim.ToDouble / TxtTipoCambio.Text.ToDouble, 2)
ImporteDestino = Math.Round(TxtImporte.Text.Trim.ToDouble / TxtTipoCambio.Text.ToDouble, 2)
ImporteMXDestino = TxtImporte.Text.Trim.ToDouble
ElseIf CveMonedaOrigen <> 1 AndAlso CveMonedaDestino = 1 Then
'de otra moneda a pesos se multiplica
ImporteDestino = Math.Round(TxtImporte.Text.Trim.ToDouble * TxtTipoCambio.Text.ToDouble, 2)
@@ -269,6 +270,7 @@ Partial Class Bancos_Transferencias
TipoCambio = TxtTipoCambio.Text.ToDouble 'GlobalTipoCambio(TxtFechaDocumento.Text.ToDate)
End If
Dim CvePrePoliza As Integer = ObjMov.AddPrePolizas("Bancos/Transferencias", 13, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, CveMonedaOrigen, TxtFechaDocumento.Text.ToDate, $"Transferencia entre cuentas {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If UsuarioActual.CveEmpresa = 48 Then
@@ -363,11 +365,21 @@ Partial Class Bancos_Transferencias
If RBLOpcion.SelectedValue = "2" Then TipoMovtoDetalle = False ' cuando sea un reembolso/devoluci<63>n, es ingreso a bancos
Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoDetalle, TxtImporte.Text.ToDouble, $"Transferencia entre cuentas {TxtObservaciones.Text}", 30, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IdCtaContableOrigen, -1, CveIE, ImporteMX:=If(UsuarioActual.CveEmpresa = 119, TxtImporte.Text.ToDouble, ImporteMXOrigen), ImporteME:=If(CveMonedaOrigen > 1, TxtImporte.Text.ToDouble * TC, 0), CveCuenta:=CveCuentaOrigen, CveIEDevolucion:=CveIEDevolucion) Then
If CveMonedaOrigen > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoDetalle,
TxtImporte.Text.ToDouble, $"Transferencia entre cuentas {TxtObservaciones.Text}", 30, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IdCtaContableOrigen, -1, CveIE,
ImporteMX:=If(Not UsuarioActual.CveEmpresa.Contiene(13, 83), TxtImporte.Text.ToDouble, ImporteMXOrigen),
ImporteME:=If(CveMonedaOrigen > 1, TxtImporte.Text.ToDouble * TC, 0),
CveCuenta:=CveCuentaOrigen,
CveIEDevolucion:=CveIEDevolucion) Then
If CveMonedaOrigen > 1 AndAlso Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then
'Agregamos complementaria
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoDetalle, 0, $"Transferencia entre cuentas {TxtObservaciones.Text}", 204, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IDCtaContableComplementariaOrigen, -1, CveIE:=CveIE, ImporteMX:=(TxtImporte.Text.ToDouble * TC - TxtImporte.Text.ToDouble).RoundSQL, ImporteME:=TxtImporte.Text.ToDouble, TipoCambio:=TC) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoDetalle,
0, $"Transferencia entre cuentas {TxtObservaciones.Text}", 204, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IDCtaContableComplementariaOrigen, -1, CveIE:=CveIE,
ImporteMX:=(TxtImporte.Text.ToDouble * TC - TxtImporte.Text.ToDouble).RoundSQL,
ImporteME:=TxtImporte.Text.ToDouble,
TipoCambio:=TC) Then
MsgError = "Ocurri<EFBFBD> un error al registrar el asiento del ingreso."
End If
@@ -385,13 +397,20 @@ Partial Class Bancos_Transferencias
'Agregamos la contraria a bancos cuando es cuenta
Else
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoDetalle, ImporteDestino, $"Transferencia entre cuentas {TxtObservaciones.Text}", 30, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IdCtaContableDestino, -1, CveIEDestino, ImporteMX:=If(UsuarioActual.CveEmpresa = 119, ImporteDestino, ImporteMXDestino), ImporteME:=If(CveMonedaDestino > 1, TxtImporte.Text.ToDouble * TC, 0)) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoDetalle,
ImporteDestino, $"Transferencia entre cuentas {TxtObservaciones.Text}", 30, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IdCtaContableDestino, -1, CveIEDestino,
ImporteMX:=If(Not UsuarioActual.CveEmpresa.Contiene(13, 83), ImporteDestino, ImporteMXDestino),
ImporteME:=If(CveMonedaDestino > 1, ImporteDestino, 0), CveCuenta:=CveCuentaDestino) Then
MsgError = "Ocurrio un error al ingresar la prepoliza"
End If
If CveMonedaDestino > 1 AndAlso UsuarioActual.CveEmpresa = 119 Then
If CveMonedaDestino > 1 AndAlso Not UsuarioActual.CveEmpresa.Contiene(13, 83) Then
'Agregamos complementaria
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoDetalle, 0, $"Transferencia entre cuentas {TxtObservaciones.Text}", 204, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IDCtaContableComplementariaDestino, -1, CveIE:=CveIEDestino, ImporteMX:=(TxtImporte.Text.ToDouble * TC - TxtImporte.Text.ToDouble).RoundSQL, ImporteME:=TxtImporte.Text.ToDouble, TipoCambio:=TC) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoDetalle,
0, $"Transferencia entre cuentas {TxtObservaciones.Text}", 204, $"Transferencia entre cuentas {TxtObservaciones.Text}", Now, IDCtaContableComplementariaDestino, -1, CveIE:=CveIEDestino,
ImporteMX:=(ImporteMXDestino - ImporteDestino).RoundSQL,
ImporteME:=ImporteDestino, TipoCambio:=TC) Then
MsgError = "Ocurri<EFBFBD> un error al registrar el asiento del ingreso."
End If