This commit is contained in:
2022-05-27 19:25:26 -07:00
59 changed files with 9783 additions and 3829 deletions

View File

@@ -142,36 +142,49 @@
<ContentTemplate>
<div class="row" style="margin-bottom:5px">
<div class="col-md-6" runat="server" >
<label style=" ">Cuenta Depósito:</label>
<asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" style="width: 300px;"></asp:DropDownList>
<div class="col-md-1" runat="server" >
<label style=" ">Cuenta Depósito:</label>
</div>
<div class="col-md-3" runat="server" >
<asp:DropDownList ID="DdlCuentaDeposito" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="100%"></asp:DropDownList>
</div>
<div class="col-md-3" runat="server" style="text-align: left;">
<div class="col-md-1" >
<div class="col-md-1" >
<label style="width:70px;">Fecha:</label>
</div>
<div class="col-md-1" >
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="padding-top: 0; width: 140px !important;">
</div>
<div class="col-md-2" runat="server" style="text-align: left;">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="padding-top: 0; width: 140px !important;">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgCalendarioFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFecha" PopupButtonID="ImgCalendarioFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida2"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida2"></asp:CompareValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div>
<div class="col-md-1" >
<label style="width:70px;">Observaciones:</label>
</div>
<div class="col-md-2" runat="server" style="text-align: left;">
<asp:TextBox ID="TxtObservaciones" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="500"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtObservaciones" runat="server" ControlToValidate="TxtObservaciones" Display="None" ErrorMessage="El campo <b>''Observaciones''</b> es requerido por la aplicación." ValidationGroup="Valida"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceRfvTxtObservaciones" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtObservaciones" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-3" style="text-align: right; font-size:1.2em;" runat="server" id="divLabelTotal" visible="true">
<div class="col-md-2" style="text-align: right; font-size:1.2em;" runat="server" id="divLabelTotal" visible="true">
<asp:label runat="server">Seleccionado: $</asp:label>
<asp:label runat="server" ID="lblValorTotal">0.00</asp:label>
<asp:label runat="server" ID="lblValorTotalSeleccionado" Visible="false"></asp:label>
</div>
</div>
</ContentTemplate>
@@ -282,10 +295,10 @@
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<input type="checkbox" class="form-check-input" id="ChkSelector" onclick="SelectorNotas(this)">
<input type="checkbox" class="form-check-input" id="ChkSelector" onclick="SelectorNotas(this)" checked="checked" disabled >
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="ChkFactura" CssClass="CssSelector" runat="server"/>
<asp:CheckBox ID="ChkFactura" CssClass="CssSelector" runat="server" Checked="true" Enabled="false" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Factura">
@@ -335,7 +348,7 @@
<br />
<br />
<asp:Button ID="BtnDepositar" runat="server" Text="Depósitar" CssClass="btn btn-primary" />
<asp:Button ID="BtnDepositar" runat="server" Text="Depósitar" CssClass="btn btn-primary" ValidationGroup="Valida" />
</div>
</div>
</ContentTemplate>

View File

@@ -97,6 +97,8 @@ Partial Class Bancos_DepositosCaja
ObjBancos.GetPagosCajaChica(FechaI, FechaF, UsuarioActual.CveEmpresa, DdlCajaChica.SelectedValue.ToEntero, DdlTipoPago.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, MSI:=MSI)
GvFacturas.DataSource = ObjBancos.DtResultados
lblValorTotal.Text = ObjBancos.DtResultados.SUM("Importe").ToString("###,###,###.00")
ObjBancos.Dispose()
@@ -108,7 +110,7 @@ Partial Class Bancos_DepositosCaja
TxtDescuento.Text = ""
TxtIVA.Text = ""
TxtComisionIntermediario.Text = ""
lblValorTotal.Text = "0.0"
'lblValorTotal.Text = "0.0"
lblValorTotalSeleccionado.Text = "0.0"
divLabelTotal.Visible = True
DdlSubProyectoDeposito.SelectedValueExist(DdlSubProyectos.SelectedValue.ToEntero)
@@ -116,7 +118,11 @@ Partial Class Bancos_DepositosCaja
DdlSubProyectoIntermediario.SelectedValueExist(DdlSubProyectos.SelectedValue.ToEntero)
UpGvFacturas.Update()
UpParametros.Update()
UpComisiones.Update()
UpComisiones.Update()
End Sub
Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click
@@ -247,7 +253,7 @@ Partial Class Bancos_DepositosCaja
If Not FolioIE > 0 Then
OcurrioError = True
End If
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorIntermediario:=CveProveedorIntermediario)
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, CveTransaccionBanco, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveProveedorIntermediario:=CveProveedorIntermediario)
documentos += String.Format("<a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>Depósito: {1}</a> &nbsp &nbsp <br/> ", CveIEOrigen, FolioIE)
@@ -295,7 +301,7 @@ Partial Class Bancos_DepositosCaja
OcurrioError = True
Exit For
End If
CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveIEDestino = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, String.Format("Depósito Bancario: {0}", SerieFolio), Importe, CveMoneda, 1, TxtObservaciones.Text, "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, Importe, SerieFolio, 30, String.Format("Depósito Bancario: {0}", SerieFolio), Fecha, IdCuentaBancariaDestino, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, CveVenta:=CveVenta, CveIE:=CveIEDestino, ImporteMX:=Importe * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then

View File

@@ -247,6 +247,23 @@
</div>
</div>
</div>
<asp:UpdatePanel runat="server" >
<ContentTemplate>
<div class="col-md-6" runat="server" id="DvComprobante">
<asp:TextBox ID="Anexo" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="row text-center">

View File

@@ -108,7 +108,10 @@ public partial class Bancos_Devoluciones : ClsPaginas
divTipoDevolucion.Visible = false;
break;
}
ComprobanteMuestraOculta();
CargaTipoTransaccion(tipo);
}
protected void TipoDevolucion_SelectedIndexChanged(object sender, EventArgs e)
@@ -125,6 +128,23 @@ public partial class Bancos_Devoluciones : ClsPaginas
break;
}
ComprobanteMuestraOculta();
}
private void ComprobanteMuestraOculta()
{
if (OpcionDevolucion.SelectedValue.ToEntero() == 3 && TipoDevolucion.SelectedValue.ToString().ToEntero() == 2)
{
Anexo.Text = "";
DvComprobante.Visible = false;
}
else
{
DvComprobante.Visible = true;
}
}
protected void CargaTipoTransaccion(string tipo)
@@ -374,6 +394,19 @@ public partial class Bancos_Devoluciones : ClsPaginas
}
//terminan validaciones
List<Archivo> filesgral = Anexo.getfiles().Archivos;
string filemove = "";
string Comprobante = "";
foreach(Archivo fileItem in filesgral){
Comprobante = System.IO.Path.GetExtension(String.Format("{0}Temp\\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "");
filemove = fileItem.filename;
}
ClsBancos ObjIE = new ClsBancos();
ClsContabilidad ObjMov = new ClsContabilidad(ObjIE.IniciaTransacSQL());
ClsCompras ObjComp = new ClsCompras(ObjIE.IniciaTransacSQL());
@@ -385,6 +418,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
int CveConceptoContableBanco = 30;
int CveConceptoContableDevolucion = 0;
int CvePlantillaPoliza = 0;
int CveTipoPoliza = 1;// tipo ingreso
int CvePrePoliza = 0;
int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero();
int FolioFijo = 0;
@@ -403,6 +437,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
CveConceptoContableDevolucion = 92;
CvePlantillaPoliza = 7;
TipoMovtoDevolucion = false;
CveTipoPoliza = 2; //tipo egreso
break;
case "2":
PagueseA = DdlProveedores.SelectedText.ToString();
@@ -431,7 +466,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
// DATOS PREPOLIZA
if ( DdlTipoTransanccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero();
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE Devoluciones", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), 1, TxtFechaDocumento.Text.ToDate(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransanccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransanccion.SelectedValue, "-1", UsuarioActual.CveEmpresa));
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE Devoluciones", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), 1, TxtFechaDocumento.Text.ToDate(), TxtObservaciones.Text.Trim(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransanccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: CveTipoPoliza);
if (CvePrePoliza > 0)
{
@@ -487,7 +522,7 @@ public partial class Bancos_Devoluciones : ClsPaginas
{
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero(), DdlTipoTransanccion.SelectedValue.ToEntero(), TxtFechaDocumento.Text.Trim().ToDate(), TxtFolio.Text.Trim(), PagueseA, TxtImporte.Text.Trim().ToDouble(), CveMoneda,
TC, TxtObservaciones.Text.Trim(), "", false, false, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
TC, TxtObservaciones.Text.Trim(), "", false, false, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
if (CveIE > 0)
{
//GUARDA PREPOLIZAS DETALLE DEVOLUCION
@@ -646,6 +681,12 @@ public partial class Bancos_Devoluciones : ClsPaginas
}
ObjIE.Commit();
if (filemove != "")
{
filemove.FilesMove(CveIE.ToString(), String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase: false);
}
if (!Msg.ToString().Equals(""))
{
string AccionJS = String.Format(@"document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery);

View File

@@ -700,6 +700,13 @@ Partial Class Bancos_IE
TxtImporte.Attributes.Add("onkeypress", "javascript: return false;")
End If
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion") = "INGPC" Then
If UsuarioActual.Empresa.Funcionalidad(590) = "1" Then
DivOtrosIngresosEgresos.Visible = True
End If
End If
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSCREDITO") Then
LblPagueseA.Text = ""
@@ -1844,18 +1851,18 @@ Partial Class Bancos_IE
Private Sub CargaTipoTransaccion(Optional Tipo As String = "")
Dim dt As DataTable
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSSINFACT", "EGSCREDITO") Then
dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'")
dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs' AND Estatus = 1")
LtlTitulo.Text = "Egreso Por Comprobar"
RBL.Items.Remove(RBL.Items.FindByValue("C"))
ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "DEV" Then
dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'")
dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing' AND Estatus = 1 ")
LtlTitulo.Text = If(Request("Opcion").ToString = "INGPC", "Ingreso por comprobar", "Devolución")
LblPagueseA.Text = "Recibido de:"
RBL.SelectedValue = "C"
Anexo.Visible = True
ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "INGPC" Then
dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'")
dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing' AND Estatus = 1")
LtlTitulo.Text = If(Request("Opcion").ToString = "INGPC", "Ingreso por comprobar", "Devolución")
LblPagueseA.Text = "Recibido de:"
RBL.SelectedValue = "C"
@@ -1865,13 +1872,13 @@ Partial Class Bancos_IE
RBL.Items.Remove(RBL.Items.FindByValue("FE"))
ElseIf Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "ANTC" Then
dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing'")
dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Ing' AND Estatus = 1 ")
LtlTitulo.Text = "Anticipo de Cliente"
LblPagueseA.Text = "Recibido de:"
Anexo.Visible = True
RBL.Items.Remove(RBL.Items.FindByValue("P")) : RBL.Items.Remove(RBL.Items.FindByValue("FE")) : RBL.Items.Remove(RBL.Items.FindByValue("DD")) : RBL.Items.Remove(RBL.Items.FindByValue("AC")) : RBL.Items.Remove(RBL.Items.FindByValue("DP"))
ElseIf Opcion = "DevDinV" Then ' DEVOLUCION DINERO NC-VENTAS
dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'")
dt = GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs' AND Estatus = 1 ")
LtlTitulo.Text = "Devolución dinero"
RBL.SelectedValue = "C"
RBL.Enabled = False
@@ -1879,20 +1886,17 @@ Partial Class Bancos_IE
dt = GlobalDTTipoTransacciones
End If
If Opcion = "DevDinC" AndAlso Request("P") IsNot Nothing AndAlso Request("P").Length > 0 Or Opcion = "DevDinC" AndAlso Masivonotas Then
DdlTipoTransaccion.DataSource = dt.FiltraParametros("Tipo = 'Ing' ")
DdlTipoTransaccion.DataSource = dt.FiltraParametros("Tipo = 'Ing' AND Estatus = 1 ")
Else
DdlTipoTransaccion.DataSource = dt
End If
If Tipo.Length > 0 Then
DdlTipoTransaccion.Items.Clear()
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo = '{Tipo}' AND EstatusTexto = 'Activo' ")
DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo = '{Tipo}' AND Estatus = 1 ")
End If
DdlTipoTransaccion.DataBind()
DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1"))
RBL_SelectedIndexChanged(RBL, Nothing)
@@ -2584,6 +2588,7 @@ Partial Class Bancos_IE
Dim CveConceptoContable As Integer = 30
Dim CveConceptoCompra As Integer = 10
Dim CveCreditoDetalle As Integer = -1
Dim tCveTipoPoliza As Integer = 2
Dim CIF As Decimal = 0
Dim CvePlantillaPoliza As Integer = 3
Dim CvePrePoliza As Integer = 0
@@ -2667,9 +2672,11 @@ Partial Class Bancos_IE
CvePlantillaPoliza = 92
End If
Dim AgregaPolizaSaldoInicial As Boolean = False
'Cuando es Egreso sin factura, se registra una compra tipo anticipo
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "EGSSINFACT" Then
tCveTipoPoliza = 2
Select Case RBL.SelectedValue
Case "P" 'Proveedores
If CveProveedor > 0 Then
@@ -2710,6 +2717,7 @@ Partial Class Bancos_IE
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "INGPC" Then
HdnProvPorIVA.Value = "0"
CvePlantillaPoliza = 6
tCveTipoPoliza = 1
Select Case RBL.SelectedValue
Case "DD" ' Deudores Diversos
If CveProveedor > 0 Then
@@ -2792,7 +2800,7 @@ Partial Class Bancos_IE
End If
If DdlTipoTransaccion.SelectedValue = "1" AndAlso UsuarioActual.CveEmpresa <> 119 Then FolioFijo = ObjIE.Folio.ToEntero 'cheque
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa))
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=tCveTipoPoliza)
'valida prepoliza
If CvePrePoliza > 0 Then
@@ -2873,6 +2881,30 @@ Partial Class Bancos_IE
Dim importeMX As Decimal
Dim Multiplicador As Integer
Dim tCveSubProyecto As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveSubProyecto).FiltroPrimeroValor("CveSubProyecto").ToEntero
'OTROS INGRESOS/EGRESOS
Dim TCC As Decimal = 1
If TxtTipoCambio.Text.Trim.ToDecimal > 0 Then TCC = TxtTipoCambio.Text.Trim.ToDecimal
Dim ImporteOtros As Decimal = TxtOtrosIngresosEgresos.Text.ToDecimal * TCC
If ImporteOtros <> 0 Then
Dim TipoMovtoIE As Boolean = False
Dim CveConcIE As Integer = 78
If ImporteOtros > 0 Then
TipoMovtoIE = True : ImporteOtros = Math.Abs(ImporteOtros)
CveConcIE = 78
Else
TipoMovtoIE = False : ImporteOtros = Math.Abs(ImporteOtros)
CveConcIE = 211
End If
Dim OtConcepto As String = PagueseA & " $" & TxtOtrosIngresosEgresos.Text.ToDecimal.FormatoNumero
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, ImporteOtros, PagueseA, CveConcIE, OtConcepto, Now, -1, -1, CveIE, CveCliente:=CveCliente, ImporteMX:=ImporteOtros, CveSubProyecto:=tCveSubProyecto, ImporteME:=0) Then
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
Exit Select
End If
End If
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
@@ -2929,7 +2961,7 @@ Partial Class Bancos_IE
Case 66
If RBL.SelectedValue = "C" AndAlso CveCliente > 0 Then
importeMovimiento = TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal
importeMovimiento = TxtImporte.Text.ToDecimal - TxtIvaIxC.Text.ToDecimal - TxtOtrosIngresosEgresos.Text.ToDecimal
importeMX = importeMovimiento
'Agregamos el IVA
@@ -3733,7 +3765,7 @@ Partial Class Bancos_IE
End Select
If UsuarioActual.Empresa.UsaAC Then
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
Dim ConceptoRenglon, Referencia As String
Dim FolioPoliza As Integer
Dim Fecha As Date = TxtFechaDocumento.Text.ToDate
@@ -4452,7 +4484,7 @@ Partial Class Bancos_IE
Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL())
Dim ObjAC As ClsContPAQi = Nothing
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") Then
Try
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
ObjAC.IniciaTransacSQL()
@@ -4747,7 +4779,7 @@ Partial Class Bancos_IE
Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL)
Dim ObjAC As ClsContPAQi = Nothing
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") Then
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
ObjAC.IniciaTransacSQL()
End If
@@ -5075,49 +5107,53 @@ Partial Class Bancos_IE
EliminaPoliza()
End Sub
Private Sub EliminaPoliza()
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
ObjAC.IniciaTransacSQL()
Dim ObjConta As New ClsContabilidad
ObjConta.IniciaTransacSQL()
Dim ErrorCompra = False
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
ObjAC.IniciaTransacSQL()
Dim ObjConta As New ClsContabilidad
ObjConta.IniciaTransacSQL()
'Elimina la poliza
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IDPoliza > 0 Then
If Not ObjAC.RemovePoliza(IDPoliza) Then
ErrorCompra = True
Dim ErrorCompra = False
'Elimina la poliza
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IDPoliza > 0 Then
If Not ObjAC.RemovePoliza(IDPoliza) Then
ErrorCompra = True
End If
End If
'Desasocia la poliza
If Not ErrorCompra Then
If Not ObjConta.DesasociarPoliza(IDPoliza, UsuarioActual.CveEmpresa) Then
ErrorCompra = True
End If
End If
If Not ErrorCompra Then
If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
ErrorCompra = True
End If
End If
If Not ErrorCompra Then
Alert("La poliza ha sido desvinculada y eliminada con exito.", TipoMensaje.MsgInformacion)
ObjAC.Commit()
ObjConta.Commit()
Else
Alert("Ocurrió un error al desvincular y/o eliminar la poliza. Por favor intente de nuevo ", TipoMensaje.MsgError)
ObjAC.RollBack()
ObjConta.RollBack()
End If
ObjAC.Dispose()
ObjConta.Dispose()
If Not ErrorCompra Then
CargaDatos()
End If
End If
'Desasocia la poliza
If Not ErrorCompra Then
If Not ObjConta.DesasociarPoliza(IDPoliza, UsuarioActual.CveEmpresa) Then
ErrorCompra = True
End If
End If
If Not ErrorCompra Then
If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
ErrorCompra = True
End If
End If
If Not ErrorCompra Then
Alert("La poliza ha sido desvinculada y eliminada con exito.", TipoMensaje.MsgInformacion)
ObjAC.Commit()
ObjConta.Commit()
Else
Alert("Ocurrió un error al desvincular y/o eliminar la poliza. Por favor intente de nuevo ", TipoMensaje.MsgError)
ObjAC.RollBack()
ObjConta.RollBack()
End If
ObjAC.Dispose()
ObjConta.Dispose()
If Not ErrorCompra Then
CargaDatos()
End If
End Sub
#End Region
@@ -5561,7 +5597,7 @@ Partial Class Bancos_IE
End If
End If
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IDPoliza > 0 Then
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso ((UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso IDPoliza > 0) Then
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
ObjAC.IniciaTransacSQL()
If Not ObjAC.RemovePoliza(IDPoliza) Then

View File

@@ -369,7 +369,7 @@
<asp:UpdatePanel ID="UPCompras" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvCxP" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas X Pagar Pendientes"
DataKeyNames="CveCompra,ImporteProgramo,Saldo,SubTotal,IVA,IVADeducible,IVANoDeducible,IEPS,RetIVA,RetISR,Original,UUID,RFC,CveFactura,SerieFolio,Descripcion,CvePrePoliza,Fecha,EstatusInventario,CveProveedor,TipoCambio, CveMoneda,CveRetIVAConcepto,IVAPorPagar,IVAPorPagarDeducible,IVAPorPagarNoDeducible,IEPSPorPagar,CveRetISRConcepto,PorcentajeIVA,CveTipoConcepto,CveSubProyecto,TotalOriginal,EsImportacion"
DataKeyNames="CveCompra,ImporteProgramo,Saldo,SubTotal,IVA,IVADeducible,IVANoDeducible,IEPS,RetIVA,RetISR,Original,UUID,RFC,CveFactura,SerieFolio,Descripcion,CvePrePoliza,Fecha,EstatusInventario,CveProveedor,TipoCambio,TipoCambioOriginal, CveMoneda,CveRetIVAConcepto,IVAPorPagar,IVAPorPagarDeducible,IVAPorPagarNoDeducible,IEPSPorPagar,CveRetISRConcepto,PorcentajeIVA,CveTipoConcepto,CveSubProyecto,TotalOriginal,EsImportacion"
Width="100%" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" Style="text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>

View File

@@ -333,7 +333,7 @@ Partial Class Bancos_ProveedoresAbonar
If UsuarioActual.TienePermisoProceso(98) Then
PermiteModificarImporte = False
End If
Calendario.StartDate = Now.AddMonths(-4)
Calendario.StartDate = Now.AddMonths(-8)
'proceso que restringue solo el pago de apartir del dia de hoy y como limite fin de mes
If UsuarioActual.TienePermisoProceso(105) Then
Calendario.StartDate = Now
@@ -574,7 +574,6 @@ Partial Class Bancos_ProveedoresAbonar
FiltroInv = "" 'queno considera lo proporcional
End If
If PorcentajeAlmacen = 0 Then ' sin recibir
e.Row.FCLabel("LbEstatusInv").Text = "<i Class='fa fa-flag-o' aria-hidden='true'></i>"
e.Row.FCLabel("LbEstatusInv").ForeColor = Drawing.Color.Red
@@ -732,11 +731,6 @@ Partial Class Bancos_ProveedoresAbonar
ImporteSeleccionado += gvr.FCTextBox("TxtAbonar").Text.ToDecimal
If gvr.DataKey("UUID") <> "" Then
'529
Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("TotalOriginal").ToDecimal)
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa < 2 Then
@@ -770,7 +764,6 @@ Partial Class Bancos_ProveedoresAbonar
ObjCompra.Dispose()
Else
MsgValidadas.AppendFormat("Factura Cancelada: {0} - {1} con movimientos de almacen, relacione su factura nueva para descontar saldo<br>", gvr.DataKey("SerieFolio"), gvr.DataKey("Descripcion"))
End If
Else
@@ -807,7 +800,7 @@ Partial Class Bancos_ProveedoresAbonar
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL)
Dim ObjConta As ClsContPAQi = Nothing
If UsuarioActual.Empresa.UsaContabilidad Then
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaContabilidad Then
ObjConta = New ClsContPAQi(UsuarioActual.Empresa)
ObjConta.IniciaTransacSQL()
End If
@@ -892,7 +885,6 @@ Partial Class Bancos_ProveedoresAbonar
End If
Anexo.Text = ""
'inserto los movimientos de la conta para abonar al saldo
If CvePrePoliza > 0 Then
@@ -935,21 +927,6 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
'If ObjIE.GetFluctuacionesBitacora(UsuarioActual.CveEmpresa) Then
' If ObjIE.DtResultados.Rows.Count > 0 Then
' Dim tFecha As Date = TxtFechaDocumento.Text.ToDate
' Dim FechaC As String = String.Format("{0}/{1}/{2}", tFecha.Year, tFecha.Month, tFecha.Day)
' Dim drr As DataRow = ObjIE.DtResultados.FiltroPrimero("Fecha < #" & FechaC & "#", "Fecha DESC")
' If drr IsNot Nothing Then
' FechaUltimaFluctuacion = drr("Fecha").ToString.ToDate
' TipoCambioFluctuacion = drr("TipoCambio").ToString.ToDecimal
' End If
' End If
'End If
Dim DttPlantilla As DataTable = Nothing
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
DttPlantilla = ObjMov.DtResultados
@@ -961,31 +938,24 @@ Partial Class Bancos_ProveedoresAbonar
For Each gvr As GridViewRow In GvCxP.Rows
If gvr.FCCheckBox("Chk").Checked Then
Dim EsImportacion As Boolean = False
tipoCambioCompra = gvr.DataKey("TipoCambioOriginal").ToDecimal
PorcentajePago = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
tipoCambioCompraValuacion = 1
'Tipos de cambio
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en Pesos y se va a pagar en Pesos
TipoCambioPago = 1
tipoCambioCompra = 1
PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
TipoCambioPago = TxtTC.Text.ToDecimal
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal)
PorcentajePago = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) / gvr.DataKey("Original").ToDecimal).RoundSQL
tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
'TipoCambioPago = 'GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).ToString.ToDecimal
TipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal)
PorcentajePago = gvr.FCTextBox("TxtAbonar").Text.ToDecimal / gvr.DataKey("Original").ToDecimal
tipoCambioCompraValuacion = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
TipoCambioPago = TxtTCDolares.Text.ToDecimal
tipoCambioCompra = 1
PorcentajePago = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal) / gvr.DataKey("Original").ToDecimal
End If
CveSubProyecto = gvr.DataKey("CveSubProyecto").ToEntero
'If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
If DttPlantilla IsNot Nothing AndAlso DttPlantilla.Rows.Count > 0 Then
For Each Row As DataRow In DttPlantilla.Rows
ConceptoContable = Row("CveConcepto").ToString.ToEntero
@@ -996,7 +966,6 @@ Partial Class Bancos_ProveedoresAbonar
Referencia = gvr.DataKey("SerieFolio").ToString
Dim PorcentajeImpuesto As Decimal = 0
Select Case ConceptoContable
Case 17 'Pago Proveedores
@@ -1011,21 +980,8 @@ Partial Class Bancos_ProveedoresAbonar
End Select
End If
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompraValuacion
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
importeMX = gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompraValuacion
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompraValuacion
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
ImporteMovimiento = gvr.FCTextBox("TxtAbonar").Text.ToDecimal.RoundSQL
importeMX = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompraValuacion).RoundSQL
TipoCambioGeneral = tipoCambioCompraValuacion
ConceptoMovimiento = $"{HplProveedor.Text} F:{gvr.DataKey("SerieFolio")}"
'cuando son dolares, y tienen complementaria, se hace el registro
@@ -1070,26 +1026,10 @@ Partial Class Bancos_ProveedoresAbonar
ConceptoContable = 285
End If
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
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL
TipoCambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
'Conta ContPAQ
@@ -1127,23 +1067,10 @@ Partial Class Bancos_ProveedoresAbonar
Funcionalidad = 578
ConceptoContable = 286
End If
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
ImporteMovimiento = (gvr.DataKey("RetIVA").ToDecimal * PorcentajePago).RoundSQL
importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
@@ -1177,21 +1104,9 @@ Partial Class Bancos_ProveedoresAbonar
ConceptoContable = 328
End If
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)
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL
importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL
TipoCambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
@@ -1221,22 +1136,8 @@ Partial Class Bancos_ProveedoresAbonar
funcionalidad = 348
ConceptoContable = 328
End If
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, TipoCambioPago, 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 * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL
importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL
TipoCambioGeneral = TipoCambioPago
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
@@ -1254,7 +1155,6 @@ Partial Class Bancos_ProveedoresAbonar
End If
End If
End If
Case 14 'Iva X Acreditar
@@ -1263,23 +1163,8 @@ Partial Class Bancos_ProveedoresAbonar
'funcionalidad que toma el 100% del pago para acreditamiento de iva
If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal).RoundSQL
importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
Else
@@ -1287,23 +1172,10 @@ Partial Class Bancos_ProveedoresAbonar
importeMX = 0
End If
Else
ImporteMovimiento = gvr.DataKey("IVA").ToDecimal * PorcentajePago
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
ImporteMovimiento = (gvr.DataKey("IVA").ToDecimal * PorcentajePago).RoundSQL
importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
End If
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
@@ -1330,24 +1202,10 @@ Partial Class Bancos_ProveedoresAbonar
Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
'funcionalidad que toma el 100% del pago para acreditamiento de iva
If TotalImporte = gvr.DataKey("Saldo").ToDecimal Then
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal
importeMX = gvr.DataKey("IVADeducible").ToDecimal * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
ImporteMovimiento = (gvr.DataKey("IVADeducible").ToDecimal).RoundSQL
importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL
If TipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{TipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
Else
@@ -1356,19 +1214,8 @@ Partial Class Bancos_ProveedoresAbonar
End If
Else
ImporteMovimiento = gvr.DataKey("IVADeducible").ToDecimal * PorcentajePago
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = ImporteMovimiento.RoundSQL
importeMX = importeMX.RoundSQL
@@ -1411,20 +1258,8 @@ Partial Class Bancos_ProveedoresAbonar
Case 25 'IEPS X Acreditar
Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
ImporteMovimiento = gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * tipoCambioCompra
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
ImporteMovimiento = (gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago).RoundSQL
importeMX = (ImporteMovimiento * tipoCambioCompra).RoundSQL
TipoCambioGeneral = tipoCambioCompra
If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
@@ -1435,20 +1270,8 @@ Partial Class Bancos_ProveedoresAbonar
End If
Case 26 'IEPS Acreditable
Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
ImporteMovimiento = gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago
If CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento
ElseIf CveMoneda = 1 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 1 Then
importeMX = ImporteMovimiento * tipoCambioCompra
ElseIf CveMoneda = 2 AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
tipoCambioCompra = gvr.DataKey("TipoCambio").ToDecimal
importeMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
End If
ImporteMovimiento = Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero)
importeMX = Math.Round(importeMX, 2, MidpointRounding.AwayFromZero)
ImporteMovimiento = (gvr.DataKey("IEPSPorPagar").ToDecimal * PorcentajePago).RoundSQL
importeMX = (ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)).RoundSQL
TipoCambioGeneral = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompra)
If ImporteMovimiento <> 0 AndAlso TipoContabilidad <> 1 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
@@ -1456,6 +1279,7 @@ Partial Class Bancos_ProveedoresAbonar
IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditable").ToString.ToEntero
End If
End If
Case 64 'Ganancia
If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then
@@ -1479,37 +1303,6 @@ Partial Class Bancos_ProveedoresAbonar
importeMX = ImporteMovimiento
End If
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioventa
'If tipoCambioPago > tipoCambioVentaDiferenciaCambiaria AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioPago) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en la venta
' ImporteMovimiento -= ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el IVA
' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el RetIVA
' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el RetISR
' ImporteMovimiento -= ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("IEPS").ToDecimal * PorcentajePago) * tipoCambioVentaDiferenciaCambiaria) 'Añadimos la diferencia de ganancia en el IEPS
' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero))
' importeMX = ImporteMovimiento
'End If
'Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
''Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago)
'Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago)
'Dim IEPS As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) 'If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago)
'IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
'Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompraValuacion)
'TipoCambioGeneral = TCImpuestos
'''' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra
'If TipoCambioPago < tipoCambioCompra AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * TipoCambioPago) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra) 'Añadimos la diferencia de ganancia en la venta
' ImporteMovimiento -= (IVA * TCImpuestos) - (IVA * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IVA
' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetIVA
' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el RetISR
' ImporteMovimiento -= (IEPS * TCImpuestos) - (IEPS * tipoCambioCompra) 'Añadimos la diferencia de ganancia en el IEPS
' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero))
' importeMX = ImporteMovimiento
'End If
Else
ImporteMovimiento = 0
End If
@@ -1531,23 +1324,6 @@ Partial Class Bancos_ProveedoresAbonar
ImporteMovimiento = Math.Abs(Diferencia)
importeMX = ImporteMovimiento
End If
'Dim TotalImporte As Decimal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
'Dim IVA As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IVAPorPagar").ToDecimal - (gvr.DataKey("IVA").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IVAPorPagar").ToDecimal, gvr.DataKey("IVA").ToDecimal * PorcentajePago)
'Dim IEPS As Decimal = If(TotalImporte = gvr.DataKey("Saldo").ToDecimal AndAlso Math.Abs(Math.Round(gvr.DataKey("IEPSPorPagar").ToDecimal - (gvr.DataKey("IEPS").ToDecimal * PorcentajePago), 2)) <= 0.02, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago) 'If(TotalImporte = gvr.DataKey("Saldo").ToDecimal, gvr.DataKey("IEPSPorPagar").ToDecimal, gvr.DataKey("IEPS").ToDecimal * PorcentajePago)
'IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
'Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, TipoCambioPago, tipoCambioCompraValuacion)
'' si tiene funcionalidad de flucturación con ivas, tomar tipocambioCompra
'If TipoCambioPago > tipoCambioCompra AndAlso gvr.DataKey("CveMoneda").ToEntero = 2 Then
' ImporteMovimiento = (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * tipoCambioCompra) - (gvr.FCTextBox("TxtAbonar").Text.ToDecimal * TipoCambioPago) 'Añadimos la diferencia de ganancia en la venta
' ImporteMovimiento -= (IVA * tipoCambioCompra) - (IVA * TCImpuestos) 'Añadimos la diferencia de ganancia en el IVA
' ImporteMovimiento += ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetIVA").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetIVA
' ImporteMovimiento += ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * tipoCambioCompra) - ((gvr.DataKey("RetISR").ToDecimal * PorcentajePago) * TCImpuestos) 'Añadimos la diferencia de ganancia en el RetISR
' ImporteMovimiento -= (IEPS * tipoCambioCompra) - (IEPS * TCImpuestos) 'Añadimos la diferencia de ganancia en el IEPS
' ImporteMovimiento = Math.Abs(Math.Round(ImporteMovimiento, 2, MidpointRounding.AwayFromZero))
' importeMX = ImporteMovimiento
'End If
Else
ImporteMovimiento = 0
End If
@@ -1645,8 +1421,6 @@ Partial Class Bancos_ProveedoresAbonar
ObjComp.ProgramarCompra(gvr.DataKey("CveCompra").ToEntero, 0, UsuarioActual.CveUsuario, -1)
End If
' End If
End If
Next
ConceptoMovimiento = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(TipoCambioPago > 1, $" TC:{TipoCambioPago}", "")}"
@@ -1816,7 +1590,6 @@ Partial Class Bancos_ProveedoresAbonar
Exit For
Else
'IVA. siempre se registra aunque sea cero
If MsgError = "" Then