This commit is contained in:
2021-08-14 13:40:16 -07:00
64 changed files with 52406 additions and 3441 deletions

View File

@@ -58,7 +58,7 @@
</asp:DropDownList>
</div>
</div>
<asp:TextBox ID="hdnTotal" runat="server" Style="text-align: right; display: none;" AutoComplete="off" Width="145px"></asp:TextBox>
<asp:TextBox ID="hdnTotal" runat="server" Style="text-align: right; display: none;" ClientIDMode="Static" AutoComplete="off" Width="145px"></asp:TextBox>
<hr />
<div class="row" id="divTipoDevolucion" runat="server" visible="false" style="margin-top: -20px;">
<div class="col-md-12">
@@ -222,7 +222,7 @@
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" Text="Veces por Aplicar:" AssociatedControlID=""></asp:Label>
<asp:TextBox ID="TxtVecesAplicar" CssClass="form-control" runat="server"></asp:TextBox>
<asp:TextBox ID="TxtVecesAplicar" CssClass="form-control" runat="server" Text="1"></asp:TextBox>
</div>
</div>
</div>
@@ -333,8 +333,11 @@
} else {
txt.value = "";
}
let valor = FormatoNumero(SumaValores(), 2);
$('#hdnTotal').val(valor);
debugger;
$get('hdnTotal').value = valor;
$get('TxtImporte').value = valor;
}
@@ -354,8 +357,9 @@
}
}
var Suma = SumaValores();
let valor = FormatoNumero(SumaValores(), 2);
$('#C_hdnTotal').val(valor);
let valor = FormatoNumero(Suma, 2);
debugger;
$get('hdnTotal').value = valor;
$get('TxtImporte').value = valor;
if ($get('TxtTotal') != null) {

View File

@@ -338,13 +338,14 @@ public partial class Bancos_Devoluciones : ClsPaginas
#region"GUARDAR"
protected void BtnGuardar_Click(object sender, EventArgs e)
{
//inician validaciones
if (OpcionDevolucion.SelectedValue.ToEntero() != 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() != 2 && TxtImporte.Text == "")
{
Alert("Debe ingresar un importe", TipoMensaje.MsgAdvertencia);
return;
}
if (OpcionDevolucion.SelectedValue.ToEntero() == 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() == 2)
if (OpcionDevolucion.SelectedValue == "3" && TipoDevolucion.SelectedValue == "2")
{
if (TxtValor.Text == "")
{
@@ -353,17 +354,25 @@ public partial class Bancos_Devoluciones : ClsPaginas
}
else
{
int valor = (TxtValor.Text.ToEntero() * TxtVecesAplicar.Text.ToEntero()).ToEntero();
int total = hdnTotal.Text.ToEntero();
decimal valor = TxtValor.Text.ToDecimal() * TxtVecesAplicar.Text.ToDecimal();
decimal total = hdnTotal.Text.ToDecimal();
if (valor != total)
{
Alert("La cantidad total debe ser igual a lo seleccionado");
Alert("La cantidad total debe ser igual a lo seleccionado", TipoMensaje.MsgAdvertencia);
return;
}
else
{
if (valor ==0)
{
Alert("No se han seleccionado opciones", TipoMensaje.MsgAdvertencia);
return;
}
}
}
}
//terminan validaciones
ClsBancos ObjIE = new ClsBancos();
ClsContabilidad ObjMov = new ClsContabilidad(ObjIE.IniciaTransacSQL());
@@ -465,7 +474,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
//Decimal tTotal = (TxtValor.Text.ToDecimal() * TxtVecesAplicar.Text.ToDecimal()).RoundSQL();
Decimal tTotal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal();
//GUARDA PREPOLIZAS DETALLE Via Nómina
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, !TipoMovoDevolucion, tTotal, Ref, 174, Conc, DateTime.Now, 0, -1, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: cveCliente, CveProveedor: cveProveedor, CvePersonal: cvePersonal, ImporteMX: tTotal, CveNominaMovtoPermanente: CveMovtoPermanente))
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, !TipoMovoDevolucion, tTotal, Ref, 174, Conc, DateTime.Now, 0, -1, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero(), CveCliente: cveCliente, CveProveedor: cveProveedor, CvePersonal: cvePersonal, CveIE: gvr.DataKey("CveIE").ToEntero(), ImporteMX: tTotal, CveNominaMovtoPermanente: CveMovtoPermanente))
{
MsgError = "No se pudo insertar concepto de Devolución";
}
@@ -617,15 +626,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
{
archivo = new System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuenta.SelectedValue.ToEntero()));
}
//if (archivo.Length > 0)
//{
// if (archivo.Exists)
// {
// Msg.AppendFormat(@"<br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">{1}</a> ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)), String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem));
// }
//}
if (IDPoliza > 0)
{
Msg.AppendFormat(@"<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza);

View File

@@ -523,7 +523,7 @@
</span>
</div>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaDocumento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaDocumento" PopupButtonID="ImgCalendario" PopupPosition="Left" Enabled="True"></ajax:CalendarExtender>
<ajax:CalendarExtender ID="Calendario" runat="server" TargetControlID="TxtFechaDocumento" PopupButtonID="ImgCalendario" PopupPosition="TopLeft" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" Display="None" ErrorMessage="El campo <b>''FechaDocumento''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaDocumento" runat="server" ControlToValidate="TxtFechaDocumento" Display="None" ErrorMessage="El campo <b>''FechaDocumento''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaDocumento1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaDocumento" Width="350px"></ajax:ValidatorCalloutExtender>

View File

@@ -1780,8 +1780,28 @@ Partial Class Bancos_PopIECompras
IdCtaContable = IdCtaProveedorExtranjera
End If
End If
Case 15 'Ret IVA X Acreditar Honorarios/Serv. Prof.
If MovimientoPagar.ConceptoRetIVA = 1 Then
Case 15 'Ret IVA X Acreditar Honorarios/Serv. Prof.
If MovimientoPagar.ConceptoRetIVA > 0 Then
Dim Funcionalidad As Integer = 0
If MovimientoPagar.ConceptoRetIVA = 1 Then
Funcionalidad = 307
ConceptoContable = 15
ElseIf MovimientoPagar.ConceptoRetIVA = 2 Then
Funcionalidad = 309
ConceptoContable = 183
ElseIf MovimientoPagar.ConceptoRetIVA = 3 Then
Funcionalidad = 311
ConceptoContable = 185
ElseIf MovimientoPagar.ConceptoRetIVA = 4 Then
Funcionalidad = 313
ConceptoContable = 248
ElseIf MovimientoPagar.ConceptoRetIVA = 5 Then
Funcionalidad = 578
ConceptoContable = 285
End If
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
@@ -1815,7 +1835,24 @@ Partial Class Bancos_PopIECompras
End If
Case 22 'Ret IVA Acreditable Honorarios/Serv. Prof.
If MovimientoPagar.ConceptoRetIVA = 1 Then
If MovimientoPagar.ConceptoRetIVA > 0 Then
Dim Funcionalidad As Integer = 0
If MovimientoPagar.ConceptoRetIVA = 1 Then
Funcionalidad = 308
ConceptoContable = 22
ElseIf MovimientoPagar.ConceptoRetIVA = 2 Then
Funcionalidad = 310
ConceptoContable = 184
ElseIf MovimientoPagar.ConceptoRetIVA = 3 Then
Funcionalidad = 312
ConceptoContable = 186
ElseIf MovimientoPagar.ConceptoRetIVA = 4 Then
Funcionalidad = 314
ConceptoContable = 249
ElseIf MovimientoPagar.ConceptoRetIVA = 5 Then
Funcionalidad = 578
ConceptoContable = 286
End If
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
@@ -1838,281 +1875,8 @@ Partial Class Bancos_PopIECompras
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(308).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(308).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 183 'Ret IVA X Acreditar Fletes P.F.
If MovimientoPagar.ConceptoRetIVA = 2 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(309).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(309).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 184 'Ret IVA Acreditable Fletes P.F.
If MovimientoPagar.ConceptoRetIVA = 2 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(310).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(310).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 185 'Ret IVA X Acreditar Fletes P.M.
If MovimientoPagar.ConceptoRetIVA = 3 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(311).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(311).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 186 'Ret IVA Acreditable Fletes P.M.
If MovimientoPagar.ConceptoRetIVA = 3 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(312).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(312).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 248 'Ret IVA x Acreditar Acreditable Arrendamiento
If MovimientoPagar.ConceptoRetIVA = 4 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(313).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(313).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 249 'Ret IVA Acreditable Arrendamiento
If MovimientoPagar.ConceptoRetIVA = 4 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(314).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(314).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 285 'Ret IVA x Acreditar Acreditable Servicios
If MovimientoPagar.ConceptoRetIVA = 5 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(578).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 286 'Ret IVA Acreditable Servicio
If MovimientoPagar.ConceptoRetIVA = 5 Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetIVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetIVA * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(582).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(582).ToEntero
ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
@@ -2121,223 +1885,169 @@ Partial Class Bancos_PopIECompras
End If
End If
End If
'Case 16 'Ret ISR X Acreditar
' If MovimientoPagar.ConceptoRetISR = 1 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' End If
' ImporteMovimiento = ImporteMovimiento.RoundSQL
' ImporteMX = ImporteMX.RoundSQL
' TimpocambioGeneral = tipoCambioCompra
' If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
Case 16 'Ret ISR X Acreditar
If MovimientoPagar.ConceptoRetISR > 0 Then
Dim funcionalidad As Integer = 0
If MovimientoPagar.ConceptoRetISR = 1 Then
funcionalidad = 315
ConceptoContable = 16
ElseIf MovimientoPagar.ConceptoRetISR = 2 Then
funcionalidad = 317
ConceptoContable = 243
End If
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(315).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetISR > 0 Then
IdCtaContable = IdCtaContRetISR
ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
End If
End If
End If
'Case 23 'Ret ISR Acreditable
' If MovimientoPagar.ConceptoRetISR = 1 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = ImporteMovimiento.RoundSQL
' ImporteMX = ImporteMX.RoundSQL
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
Case 23 'Ret ISR Acreditable
If MovimientoPagar.ConceptoRetISR > 0 Then
Dim funcionalidad As Integer = 0
If MovimientoPagar.ConceptoRetISR = 1 Then
funcionalidad = 316
ConceptoContable = 23
ElseIf MovimientoPagar.ConceptoRetISR = 2 Then
funcionalidad = 318
ConceptoContable = 244
End If
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(316).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
'Conta ContPAQ
If IdCtaContRetISRAcreditable > 0 Then
IdCtaContable = IdCtaContRetISRAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
End If
End If
' End If
'Case 243 'Ret ISR X Acreditar Terceros y Arrendamiento
' If MovimientoPagar.ConceptoRetISR = 2 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = ImporteMovimiento.RoundSQL
' ImporteMX = ImporteMX.RoundSQL
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
End If
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
Case 14 'Iva por Acreditar
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
Dim TotalImporte As Decimal
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(317).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
TotalImporte = ImportePagado.ToString.ToDecimal
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
TotalImporte = ImportePagado.ToString.ToDecimal
End If
' End If
'Case 244 'Ret ISR Acreditable Terceros y Arrendamiento
' If MovimientoPagar.ConceptoRetISR = 2 Then
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
' ImporteMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' End If
' ImporteMovimiento = ImporteMovimiento.RoundSQL
' ImporteMX = ImporteMX.RoundSQL
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' End If
Case 14 'Iva por Acreditar
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
Dim TotalImporte As Decimal
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
TotalImporte = ImportePagado.ToString.ToDecimal
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
TotalImporte = ImportePagado.ToString.ToDecimal
End If
If TotalImporte = CompraSaldo Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
If TotalImporte = CompraSaldo Then
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = MovimientoPagar.IVA
ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
Else
ImporteMovimiento = 0
ImporteMX = 0
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
'ImporteMovimiento = MovimientoPagar.IVA * PorcentajePago
ImporteMovimiento = MovimientoPagar.IVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
End If
PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
Dim IdCtaIVAXAcreditar As Integer = 0
Dim IdCtaIVAAcreditable As Integer = 0
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
End If
IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero
End If
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
Else
ImporteMovimiento = 0
ImporteMX = 0
End If
Else
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
'ImporteMovimiento = MovimientoPagar.IVA * PorcentajePago
ImporteMovimiento = MovimientoPagar.IVA * PorcentajePago
ImporteMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
ImporteMovimiento = (MovimientoPagar.IVA * PorcentajePago)
ImporteMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
ImporteMX = ImporteMX.RoundSQL
TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
End If
PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
Dim IdCtaIVAXAcreditar As Integer = 0
Dim IdCtaIVAAcreditable As Integer = 0
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
End If
IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero
End If
End If
Case 19 'Iva Acreditable
@@ -2562,7 +2272,7 @@ Partial Class Bancos_PopIECompras
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAxAcreditar").ToString.ToEntero
End If
End If
@@ -2703,7 +2413,7 @@ Partial Class Bancos_PopIECompras
If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
End If
End If

View File

@@ -1040,7 +1040,25 @@ Partial Class Bancos_ProveedoresAbonar
IdCtaContable = IdCtaProveedorExtranjera
End If
Case 15 'Ret IVA X Acreditar Honorarios/Serv. Prof.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 1 Then
If gvr.DataKey("CveRetIVAConcepto").ToEntero > 0 Then
Dim Funcionalidad As Integer = 0
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 1 Then
Funcionalidad = 307
ConceptoContable = 15
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 2 Then
Funcionalidad = 309
ConceptoContable = 183
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 3 Then
Funcionalidad = 311
ConceptoContable = 185
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 4 Then
Funcionalidad = 313
ConceptoContable = 248
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
Funcionalidad = 578
ConceptoContable = 285
End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
@@ -1066,8 +1084,8 @@ Partial Class Bancos_ProveedoresAbonar
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(307).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(307).ToEntero
ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
@@ -1075,10 +1093,29 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
End If
End If
Case 22 'Ret IVA Acreditable Honorarios/Serv. Prof.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 1 Then
Case 22 'Ret IVA Acreditable Honorarios/Serv. Prof.
If gvr.DataKey("CveRetIVAConcepto").ToEntero > 0 Then
Dim Funcionalidad As Integer = 0
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 1 Then
Funcionalidad = 308
ConceptoContable = 22
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 2 Then
Funcionalidad = 310
ConceptoContable = 184
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 3 Then
Funcionalidad = 312
ConceptoContable = 186
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 4 Then
Funcionalidad = 314
ConceptoContable = 249
ElseIf gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
Funcionalidad = 578
ConceptoContable = 286
End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
@@ -1103,8 +1140,8 @@ Partial Class Bancos_ProveedoresAbonar
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(308).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(308).ToEntero
ElseIf UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(Funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
@@ -1113,438 +1150,96 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
End If
Case 183 'Ret IVA X Acreditar Fletes P.F.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 2 Then
Case 16 'Ret ISR X Acreditar
If gvr.DataKey("CveRetISRConcepto").ToEntero > 0 Then
Dim funcionalidad As Integer = 0
If gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
funcionalidad = 315
ConceptoContable = 16
ElseIf gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
funcionalidad = 317
ConceptoContable = 243
End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
TipoCambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(309).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(309).ToEntero
If IdCtaContRetISR > 0 Then
IdCtaContable = IdCtaContRetISR
ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 184 'Ret IVA Acreditable Fletes P.F.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 2 Then
Case 23 'Ret ISR Acreditable
If gvr.DataKey("CveRetISRConcepto").ToEntero > 0 Then
Dim funcionalidad As Integer = 0
If gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
funcionalidad = 316
ConceptoContable = 23
ElseIf gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
funcionalidad = 318
ConceptoContable = 244
End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
TipoCambioGeneral = TipoCambioPago
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(310).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(310).ToEntero
If IdCtaContRetISRAcreditable > 0 Then
IdCtaContable = IdCtaContRetISRAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(funcionalidad).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 185 'Ret IVA X Acreditar Fletes P.M.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 3 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(311).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(311).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 186 'Ret IVA Acreditable Fletes P.M.
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 3 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(312).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(312).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 248 'Ret IVA X Acreditar Arrendamiento
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 4 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = tipoCambioCompra
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(313).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(313).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 249 'Ret IVA Acreditable Arrendamiento
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 4 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(314).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(314).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 285 'Ret IVA x Acreditar Acreditable Servicios
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVA > 0 Then
IdCtaContable = IdCtaContRetIVA
ElseIf UsuarioActual.Empresa.Funcionalidad(578).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
Case 286 'Ret IVA Acreditable Servicio
If gvr.DataKey("CveRetIVAConcepto").ToEntero = 5 Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("RetIVA").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago)
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
If IdCtaContRetIVAAcreditable > 0 Then
IdCtaContable = IdCtaContRetIVAAcreditable
ElseIf UsuarioActual.Empresa.Funcionalidad(582).ToEntero > 0 Then
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(582).ToEntero
Else
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
If ObjMov.DtResultados.Rows.Count > 0 Then
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
End If
End If
End If
End If
'Case 16 'Ret ISR X Acreditar
' If gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = tipoCambioCompra
' If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(315).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' End If
'Case 23 'Ret ISR Acreditable
' If gvr.DataKey("CveRetISRConcepto").ToEntero = 1 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = TipoCambioPago
' If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(316).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' End If
'Case 243 'Ret ISR x Acreditar Terceros y Arrendamiento
' If gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = TipoCambioPago
' If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISR > 0 Then
' IdCtaContable = IdCtaContRetISR
' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(317).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' End If
'Case 244 'Ret ISR Acreditable Terceros y Arrendamiento
' If gvr.DataKey("CveRetISRConcepto").ToEntero = 2 Then
' If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = gvr.DataKey("RetISR").ToDecimal * PorcentajePago
' importeMX = ImporteMovimiento
' ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * tipoCambioCompra
' ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago)
' importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, TipoCambioPago)
' End If
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
' importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
' TipoCambioGeneral = TipoCambioPago
' If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
' 'Conta ContPAQ
' If IdCtaContRetISRAcreditable > 0 Then
' IdCtaContable = IdCtaContRetISRAcreditable
' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero
' Else
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
' If ObjMov.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
' End If
' End If
' End If
' End If
' End If
Case 14 'Iva X Acreditar
Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then