This commit is contained in:
2025-05-13 09:04:29 -07:00
18 changed files with 622 additions and 137 deletions

View File

@@ -368,7 +368,7 @@
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" Width="100%"
EmptyDataText="No se encontraron Ventas con los filtros especificados" data-sort="true" ToolTip="Listado de Ventas"
CssClass="ScrollAD table table-striped table-hover Widthall mysmallbtn" data-heighterror="320" data-freezecols="0" data-freezerows="0" GridLines="None"
DataKeyNames="CveVenta,CveCliente,TipoDocto,Saldo,AtencionA,CveFormaPago33,SerieFolio,CondicionesPago,PlazoCobranza">
DataKeyNames="CveVenta,CveCliente,TipoDocto,Saldo,AtencionA,CveFormaPago33,SerieFolio,CondicionesPago,PlazoCobranza,CveMoneda,Moneda">
<Columns>
<%--<asp:BoundField HeaderText="Atención" DataField="AtencionA" />--%>
<asp:TemplateField HeaderText="Atención/Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="25%">
@@ -481,36 +481,29 @@
<div class="col-md-7">
<asp:Panel runat="server" ID="PnlContado" DefaultButton="BtnPagar" Visible="false">
<div class="row">
<div class="note note-success">
<div class="row">
<div class="col-md-2">
<b>Nombre:</b>
</div>
<div class="row" style="display: flex;">
<div class="col-md-1"><b>Nombre:</b></div>
<div class="col-md-4">&nbsp;<label><asp:Literal ID="LtlNombre" runat="server"></asp:Literal></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
<div class="col-md-1"><b>Folio:</b></div>
<div class="col-md-2">&nbsp;<label><asp:Literal ID="LtlFolio" runat="server"></asp:Literal></label>&nbsp;</div>
<div class="col-md-1">
<div class="col-md-2"><b>Folio:</b> &nbsp;<label><asp:Literal ID="LtlFolio" runat="server"></asp:Literal></label>&nbsp;</div>
<div class="col-md-4">
<b>
<asp:Literal ID="LtLTipoSaldo" runat="server" Text="Total:"></asp:Literal></b>
</div>
<div class="col-md-1">
<b>
<asp:TextBox ID="LtlSaldo" runat="server" Enabled="true" CssClass="TextBoxAsLabel" BorderStyle="None" BackColor="Transparent" ForeColor="#3c763d" Style="text-align: left"></asp:TextBox>
</b>
<asp:Literal ID="LtLTipoSaldo" runat="server" Text="Total:"></asp:Literal>
</b>&nbsp;
<asp:Literal ID="LtlSaldo" runat="server" Text=""></asp:Literal>
&nbsp;
<b>
<asp:Literal ID="LtlMoneda" runat="server"></asp:Literal></b>
</div>
<div class="col-md-1" style="text-align: right;">
<asp:LinkButton ID="LnkLiberar" runat="server" CssClass="btn btn-xs btn-success" Text="Liberar" OnClick="LnkLiberar_Click" />
</div>
</div>
</div>
</div>
<div class="row">
<div>
<div runat="server" id="DivContadoBancos" class="row" visible="True">
<div class="col-md-12">
<div class="chequesie1">
@@ -682,7 +675,7 @@
<div class="chequesie2">
<div class="row">
<div class="col-md-4" style="display: flex; align-items: center;">
<label style="font-weight: bold; font-size: medium;">Total:</label>
<label style="font-weight: bold; font-size: 13px;width: 90px;">Total:</label>
<div class="input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtImporteContado" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100%" ReadOnly="true" ClientIDMode="Static" Style="text-align: right; font-size: 14px;"></asp:TextBox>
@@ -692,7 +685,7 @@
<div class="col-md-8">
<div class="row">
<div class="col-md-5" style="display: flex; align-items: center;">
<label id="lblCambio" runat="server" style="font-weight: bold; font-size: medium;">Cambio:</label>
<label id="lblCambio" runat="server" style="font-weight: bold; font-size: 13px;width: 60px;">Cambio:</label>
<div class="input-icon">
<i style="margin: 0px;">$</i>
<asp:HiddenField ID="HdnSobranteFaltante" Value="0" ClientIDMode="Static" runat="server" />
@@ -701,7 +694,7 @@
</div>
</div>
<div class="col-md-7" style="display: flex; align-items: center;">
<label style="font-weight: bold; font-size: medium;">Sob/falt:</label>
<label style="font-weight: bold; font-size: 13px;">Sob/falt:</label>
&nbsp;
<asp:CheckBox ID="ChkSobFaltante" runat="server" ClientIDMode="Static" />
<div class="input-icon" style="margin-left: 20px;">
@@ -713,6 +706,25 @@
</div>
</div>
</div>
<br />
<div id="DivUSD" runat="server" class="row" visible="false">
<div class="col-md-4" style="display: flex; align-items: center;">
<label style="font-weight: bold; font-size: 13px;width: 90px;">Total (MXN):</label>
<div class="input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtTotalMXN" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100%" ReadOnly="true" ClientIDMode="Static" Style="text-align: right; font-size: 14px;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTETotalMXN" runat="server" TargetControlID="TxtTotalMXN" FilterType="Custom, Numbers" ValidChars=".," />
</div>
</div>
<div class="col-md-4" style="display: flex; align-items: center;">
<label style="font-weight: bold; font-size: 13px; width: 60px;">TC:</label>
<div class="input-icon">
<i style="margin: 0px;">$</i>
<asp:TextBox ID="TxtTC" CssClass="form-control input-sm " runat="server" MaxLength="12" Width="100px" ReadOnly="false" ClientIDMode="Static" Style="text-align: right; font-size: 14px;"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTETC" runat="server" TargetControlID="TxtTC" FilterType="Custom, Numbers" ValidChars=".," />
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
@@ -727,6 +739,7 @@
<asp:HiddenField ID="HdnVentaCondicionesPago" runat="server" />
<asp:HiddenField ID="HdnCveIE" runat="server" />
<asp:HiddenField ID="HdnTotal" runat="server" ClientIDMode="Static" />
<asp:HiddenField ID="HdnMoneda" runat="server" ClientIDMode="Static" Value="1" />
<asp:Button ID="BtnPagar" CssClass="btn btn-large btn-success e-big-btn" runat="server" Text="Pagar" />
</div>
</div>
@@ -1239,7 +1252,7 @@
<input type="text" id="TxtBusquedaAnticipos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaAnticipos','{0}')", GVAnticipos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" style="display: flex; justify-content: end; font-size: 16px; font-weight: bold;">
<span>Total: </span>
@@ -1609,6 +1622,12 @@
}
$get("TxtImporteContado").value = FormatoNumero(total, 2);
//DOLARES
if ($get("HdnMoneda").value == "2") {
$get("TxtTotalMXN").value = FormatoNumero(ToDouble($get('TxtImporteContado').value) * ToDouble($get('TxtTC').value), 2);
}
}
function CalculaDiferencia() {

View File

@@ -517,6 +517,17 @@ Partial Class Ventas_PVCobranza
LtlNombre.Text = GvRow.DataKey("AtencionA")
LtlFolio.Text = GvRow.DataKey("SerieFolio")
LtlSaldo.Text = GvRow.DataKey("Saldo").ToDecimal.FormatoNumero
LtlMoneda.Text = GvRow.DataKey("Moneda")
Dim CveMoneda As Integer = GvRow.DataKey("CveMoneda").ToEntero()
HdnMoneda.Value = CveMoneda.ToString()
If CveMoneda = 2 Then
DivUSD.Visible = True
TxtTC.Text = GlobalTipoCambio(Now).ToString()
TxtTotalMXN.Text = (TxtImporteContado.Text.ToDecimal() * TxtTC.Text.ToDecimal()).FormatoNumero()
End If
HdnVentaCondicionesPago.Value = GvRow.DataKey("CondicionesPago")
HdnPlazoCobranza.Value = GvRow.DataKey("PlazoCobranza")
@@ -1262,6 +1273,11 @@ Partial Class Ventas_PVCobranza
LtlTipoAnticipo.Text = ""
TxtFaltante.Text = ""
ChkSobFaltante.Checked = False
LtlMoneda.Text = ""
TxtTC.Text = ""
TxtTotalMXN.Text = ""
DivUSD.Visible = False
HdnMoneda.Value = "1"
'HdnTipoAmortizacion.Value = ""
CveCliente = -1
CveVendedor = -1
@@ -1318,7 +1334,7 @@ Partial Class Ventas_PVCobranza
ObjFactura.CveMoneda = VentaRemision.CveMoneda
If ObjFactura.CveMoneda = 2 Then
ObjFactura.TipoCambio = GlobalTipoCambio(Now).ToString().ToDecimal()
ObjFactura.TipoCambio = TxtTC.Text.ToDecimal()
Else
ObjFactura.TipoCambio = 1
End If
@@ -1699,6 +1715,9 @@ Partial Class Ventas_PVCobranza
Dim CveIEPago As Integer = 0
Dim ErrorConta As Boolean
Dim CveMonedaVenta As Integer = VentaActual.CveMoneda
Dim CveMonedaPago As Integer = CveMonedaVenta
If String.IsNullOrEmpty(Obs) Then
Obs = $"Folio: {VentaActual.SerieFolio}"
Else
@@ -1750,7 +1769,7 @@ Partial Class Ventas_PVCobranza
End If
If String.IsNullOrEmpty(Retorno) Then
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImporteIE, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto)
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImporteIE, CveMonedaPago, If(CveMonedaVenta = 1, 1, TxtTC.Text.ToDecimal()), Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto, Modulo:="PVCob")
If CveIEPago > 0 Then
Dim tImportePago As Decimal = If(ImporteBancos > ImporteAbonoVenta, ImporteAbonoVenta, ImporteBancos) 'toma el importe menor para la factura
@@ -1759,10 +1778,10 @@ Partial Class Ventas_PVCobranza
Pago.ImportePagoVenta = tImportePago
Pago.ImportePago = ImporteIE
Pago.CveIE = CveIEPago
Pago.CveMonedaPago = VentaActual.CveMoneda
Pago.CveMonedaPago = CveMonedaPago ' EL PAGO SIEMRE DEBE SER EN PESOS
Pago.Fecha = NowADS()
Pago.Referencia = VentaActual.SerieFolio
If Pago.CveMonedaPago > 1 Then Pago.TCPago = GlobalTipoCambio(Now).ToDecimal
Pago.TCPago = If(CveMonedaVenta = 1, 1, TxtTC.Text.ToDecimal())
ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
End If
@@ -3092,6 +3111,9 @@ Partial Class Ventas_PVCobranza
Next
TxtCxCAplicado.Text = (SaldoCxC).FormatoNumero
TxtImporteContado.Text = (LtlSaldo.Text.ToDecimal + SaldoCxC).FormatoNumero
If DivUSD.Visible Then
TxtTotalMXN.Text = (TxtImporteContado.Text.ToDecimal() * TxtTC.Text.ToDecimal()).FormatoNumero()
End If
RegistraScript("$('#divCxC').hide();", "AE21")
UPPCobranza.Update()
UPPTotalesContado.Update()

View File

@@ -301,9 +301,6 @@ Partial Class Ventas_RepVentas
Dim Vendedores As String = If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM)
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
If TipoComprobante.Contiene("Rem") And Not Estatus.Contiene("11") Then
Estatus = Estatus & ",11"
End If
If RblTipoCambio.SelectedValue.ToEntero = 3 And TxtEspecifico.Text <> "" Then
TCEspecifico = TxtEspecifico.Text.ToDecimal

View File

@@ -459,10 +459,6 @@ Partial Class RepVentasDetalle
FechaIEjec = If(IsDate(TxtFechaIEjec.Text.Trim()), TxtFechaIEjec.Text.Trim.ToDate, MinFecha)
FechaFEjec = If(IsDate(TxtFechaFEjec.Text.Trim()), TxtFechaFEjec.Text.Trim.ToDate, MaxFecha)
If TipoComprobante.Contiene("Rem") And Not Estatus.Contiene("11") Then
Estatus = Estatus & ",11"
End If
Dim ModalidadContable As Boolean = CBool(If(Request("ModalidadContable") IsNot Nothing, Request("ModalidadContable").ToEntero(), 0))
ChkLecturaAdmin.Checked = Not ModalidadContable

View File

@@ -10670,6 +10670,10 @@ Partial Class Ventas
End If
End If
If Not ValidaPSSoloCotizacion() Then
Exit Sub
End If
'CREA UNA COPIA DE SEGURIDAD PARA LOS DATOS DEL TMPDT
If TmpDTError Is Nothing OrElse TmpDTError.Rows.Count = 0 Then
TmpDTError = TmpDT.Copy()
@@ -19914,6 +19918,36 @@ Partial Class Ventas
Protected Sub LbAgregar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbAgregar.Click
AgregarPS()
End Sub
Private Function ValidaPSSoloCotizacion() As Boolean
Dim Returno As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(720) <> "" AndAlso DdlTipoComprobante.SelectedValue <> "Cot" Then
Dim ProductosSoloCotizacion As List(Of String) = UsuarioActual.Empresa.Funcionalidad(720).Split(","c).ToList()
If ProductosSoloCotizacion IsNot Nothing AndAlso ProductosSoloCotizacion.Count > 0 Then
For Each GvRow As GridViewRow In GvPS.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
Dim CvePS As String = GvRow.DataKey("CvePS")
If ProductosSoloCotizacion.Any(Function(CvePSCot) CvePSCot.Trim() = CvePS) Then
Dim PSCot As String = ""
Dim DrPSCot As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS.ToEntero()).Rows(0)
If DrPSCot IsNot Nothing Then
PSCot = DrPSCot("PSCodigo").ToString
End If
Alert($"El producto y/o servicio '{PSCot}' está disponible únicamente para cotizaciones.", TipoMensaje.MsgAdvertencia)
Returno = False
Exit For
End If
End If
Next
End If
End If
Return Returno
End Function
Private Function ValidaAgregarPS(Cantidad As Decimal, CvePS As Integer, CveUM As Integer, PU As Double, CveTipoPS As Integer, CveClasificacion As Integer, CveSubProyecto As Integer, ObjDescuento As Modelos.VentaDescuentos, Optional CantidadModal As Decimal = 0D, Optional PSValidarModal As String = "", Optional CantidadOriginal As Decimal = 0D, Optional EsEdicion As Boolean = False) As Boolean 'NO TOCAR - IPP
'VALIDA PARAMETROS
@@ -19922,6 +19956,23 @@ Partial Class Ventas
Return False
End If
'VALIDA PS DE COTIZACION
If UsuarioActual.Empresa.Funcionalidad(720) <> "" Then
Dim ProductosSoloCotizacion As List(Of String) = UsuarioActual.Empresa.Funcionalidad(720).Split(","c).ToList()
If ProductosSoloCotizacion IsNot Nothing AndAlso ProductosSoloCotizacion.Count > 0 Then
If DdlTipoComprobante.SelectedValue <> "Cot" AndAlso ProductosSoloCotizacion.Any(Function(CvePSCot) CvePSCot.Trim() = CvePS.ToString()) Then
Dim PSCot As String = ""
Dim DrPSCot As DataRow = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
If DrPSCot IsNot Nothing Then
PSCot = DrPSCot("PSCodigo").ToString
End If
Alert($"El producto y/o servicio '{PSCot}' está disponible únicamente para cotizaciones.", TipoMensaje.MsgAdvertencia)
Return False
End If
End If
End If
If PSValidarModal.Trim.Length > 0 Then
HdnPS.Value = PSValidarModal
End If