--Descuento por % porcentaje aplicado en mostrador y Permiso para aplicarlo a determinado usuario.
-- visualizar el % de ganancia
This commit is contained in:
@@ -875,6 +875,33 @@ Public Class ClsProductosServicios
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function GetUltimoPrecioCompra(CveEmpresa As Integer, CvePS As Integer) As Double
|
||||||
|
|
||||||
|
Dim Retorno As Double = -1
|
||||||
|
|
||||||
|
DataAdapter("PA_Inv_UltimoPrecioCompraGet")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
|
||||||
|
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@CvePS", SqlDbType.Int).Value = CvePS
|
||||||
|
.Add("@PU", SqlDbType.Money).Direction = ParameterDirection.Output
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
Retorno = CDbl(SqlAdapter.SelectCommand.Parameters("@PU").Value)
|
||||||
|
|
||||||
|
Catch Ex1 As SqlException
|
||||||
|
Me.OnError("Ocurrió un error al obtener el precio unitario.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al obtener el precio unitario", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
#Region "P R O D U C T O S - E Q U I V A L E N C I A S "
|
#Region "P R O D U C T O S - E Q U I V A L E N C I A S "
|
||||||
|
|
||||||
Public Function GetPSEquivalencias(CvePS As Integer, CveEmpresa As Integer) As Boolean
|
Public Function GetPSEquivalencias(CvePS As Integer, CveEmpresa As Integer) As Boolean
|
||||||
|
|||||||
@@ -612,13 +612,13 @@
|
|||||||
<b>Paciente:</b>
|
<b>Paciente:</b>
|
||||||
</td>
|
</td>
|
||||||
<td runat="server">
|
<td runat="server">
|
||||||
<asp:TextBox ID="TxtPaciente" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="50"></asp:TextBox>
|
<asp:TextBox ID="TxtPaciente" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="50"></asp:TextBox>
|
||||||
</td>
|
</td>
|
||||||
<td runat="server" id="Td9" visible="true">
|
<td runat="server" id="Td9" visible="true">
|
||||||
<b>Episodio:</b>
|
<b>Episodio:</b>
|
||||||
</td>
|
</td>
|
||||||
<td runat="server">
|
<td runat="server">
|
||||||
<asp:TextBox ID="TxtEpisodio" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="20"></asp:TextBox>
|
<asp:TextBox ID="TxtEpisodio" runat="server" CssClass="make-switchsd" Style="width: 130px" MaxLength="20"></asp:TextBox>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -1183,7 +1183,7 @@
|
|||||||
<%--</asp:Panel>--%>
|
<%--</asp:Panel>--%>
|
||||||
|
|
||||||
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
|
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
|
||||||
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,Clasificacion,CveUM,UM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle,CvePromocionDetalle"
|
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,Clasificacion,CveUM,UM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,ImporteIVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle,CvePromocionDetalle"
|
||||||
CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
|
CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
|
||||||
<Columns>
|
<Columns>
|
||||||
<%--0--%>
|
<%--0--%>
|
||||||
@@ -1404,6 +1404,8 @@
|
|||||||
<%--19--%>
|
<%--19--%>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="LnkDescuentos" runat="server" Visible="false" AlternateText="Clonar" CausesValidation="False" CommandName="Descuento" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
|
||||||
|
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-comment-o'></i>" />
|
||||||
<asp:LinkButton ID="imgClone" runat="server" AlternateText="Clonar" CausesValidation="False" CommandName="Clonar" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
|
<asp:LinkButton ID="imgClone" runat="server" AlternateText="Clonar" CausesValidation="False" CommandName="Clonar" CommandArgument='<%# GvPS.Rows.Count.ToString() %>'
|
||||||
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-clone'></i>" />
|
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-clone'></i>" />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
@@ -4319,6 +4321,82 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="ModalDescPS" class="modal ADS fade" role="dialog">
|
||||||
|
<asp:UpdatePanel runat="server" ID="UpDescPS" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<!-- Modal content-->
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header ">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<asp:Label ID="LblTituloDesc" runat="server" ClientIDMode="Static" Text="Descuento:"></asp:Label>
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<asp:HiddenField ID="HdnDescPS" runat="server" ClientIDMode="Static" Value="0" />
|
||||||
|
<asp:HiddenField ID="HdnConsecPS" runat="server" ClientIDMode="Static" Value="-1" />
|
||||||
|
<asp:HiddenField ID="HdnTotalCompra" runat="server" ClientIDMode="Static" Value="0" />
|
||||||
|
<table style="width: 90%">
|
||||||
|
<tr>
|
||||||
|
<td>SubTotal</td>
|
||||||
|
<td>
|
||||||
|
<asp:Label ID="LblSubtotalDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
|
||||||
|
</td>
|
||||||
|
<td>Total</td>
|
||||||
|
<td>
|
||||||
|
<asp:Label ID="LblTotalDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>% Descuento</td>
|
||||||
|
<td>
|
||||||
|
<asp:TextBox ID="TxtPorPS" runat="server" CausesValidation="true" ClientIDMode="Static" MaxLength="12" Text="0" ValidationGroup="GrpDescuentoP" Width="72px"></asp:TextBox>
|
||||||
|
<asp:CompareValidator ID="CVPorPS" runat="server" ControlToValidate="TxtPorPS" Display="None" ErrorMessage="El campo <b>''Descuento por Porcentaje''</b> no tiene el formato correcto, por favor corrija e intente de nuevo (Solo formato numérico)." Operator="DataTypeCheck" Type="Currency" ValidationGroup="GrpPorPS"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEPorPS" runat="server" HighlightCssClass="vco" TargetControlID="CVPorPS" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
(%)
|
||||||
|
</td>
|
||||||
|
<td>IVA</td>
|
||||||
|
<td>
|
||||||
|
<asp:Label ID="LblIVADescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<b>
|
||||||
|
<asp:Label runat="server" ClientIDMode="Static" Text="Descuento"></asp:Label>
|
||||||
|
</b>
|
||||||
|
</td>
|
||||||
|
<td><b>
|
||||||
|
<asp:Label ID="LblDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label></b></td>
|
||||||
|
<td>
|
||||||
|
<b>
|
||||||
|
<asp:Label runat="server" ClientIDMode="Static" Text="% Utilidad"></asp:Label>
|
||||||
|
</b>
|
||||||
|
</td>
|
||||||
|
<td><b>
|
||||||
|
<asp:Label ID="LblUtilidadPorcentaje" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label></b></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td> <b>Total Final</b></td>
|
||||||
|
<td>
|
||||||
|
<b><asp:Label ID="LblTotalFinalDescPS" runat="server" ClientIDMode="Static" Text="0.00"></asp:Label></b>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<asp:Button ID="BtnPorPS" runat="server" Text="Aplicar" ValidationGroup="GrpPorPS" CssClass="btn btn-primary" OnClick="BtnPorPS_Click" />
|
||||||
|
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
<div id="DivAnticipos" class="modal ADS fade" role="dialog">
|
<div id="DivAnticipos" class="modal ADS fade" role="dialog">
|
||||||
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" class="modal-dialog">
|
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" class="modal-dialog">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
@@ -8445,7 +8523,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<%--Medico Procedimiento--%>
|
<%--Medico Procedimiento--%>
|
||||||
@@ -8462,7 +8540,7 @@
|
|||||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Médico:</asp:Label>
|
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Médico:</asp:Label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-1 form-md-line-input input-iconright ">
|
<div class="form-group col-md-1 form-md-line-input input-iconright ">
|
||||||
<asp:LinkButton runat="server" ID="LnkAddMedicoModal" OnClick="LnkAddMedicoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" style="margin-top:8px!important" ></asp:LinkButton>
|
<asp:LinkButton runat="server" ID="LnkAddMedicoModal" OnClick="LnkAddMedicoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" Style="margin-top: 8px!important"></asp:LinkButton>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-5 form-md-line-input input-iconright ">
|
<div class="form-group col-md-5 form-md-line-input input-iconright ">
|
||||||
<asp:DropDownList ID="DdlProcedimientoModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento"
|
<asp:DropDownList ID="DdlProcedimientoModal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Procedimiento" DataValueField="CveProcedimiento"
|
||||||
@@ -8476,7 +8554,7 @@
|
|||||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlProcedimientoModal">Procedimiento:</asp:Label>
|
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlProcedimientoModal">Procedimiento:</asp:Label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-1 form-md-line-input input-iconright ">
|
<div class="form-group col-md-1 form-md-line-input input-iconright ">
|
||||||
<asp:LinkButton runat="server" ID="LnkAddProcedimientoModal" OnClick="LnkAddProcedimientoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" style="margin-top:8px!important"></asp:LinkButton>
|
<asp:LinkButton runat="server" ID="LnkAddProcedimientoModal" OnClick="LnkAddProcedimientoModal_Click" CssClass="btn btn-default btn-circle btn-sm" Text="<i class='fa fa-plus' style='color:green'></i>" Style="margin-top: 8px!important"></asp:LinkButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -8517,9 +8595,9 @@
|
|||||||
<asp:BoundField DataField="Abreviatura" HeaderText="UM">
|
<asp:BoundField DataField="Abreviatura" HeaderText="UM">
|
||||||
<ItemStyle HorizontalAlign="Left" />
|
<ItemStyle HorizontalAlign="Left" />
|
||||||
</asp:BoundField>
|
</asp:BoundField>
|
||||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Precio" ItemStyle-Width="30px">
|
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Precio" ItemStyle-Width="30px">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("Precio", "{0:N4}") %>' Style="text-align: right!important" Width="80px" Enabled="false"></asp:TextBox>
|
<asp:TextBox ID="TxtPrecio" runat="server" Text='<%# Eval("Precio", "{0:N4}") %>' Style="text-align: right!important" Width="80px" Enabled="false"></asp:TextBox>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
@@ -8544,14 +8622,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="DvModalAddMedico" class="modal ADS fade" role="dialog">
|
<div id="DvModalAddMedico" class="modal ADS fade" role="dialog">
|
||||||
|
|
||||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddMedico" UpdateMode="Conditional">
|
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddMedico" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
<div class="modal-content" style="max-width:600px!important;max-height:505px!important">
|
<div class="modal-content" style="max-width: 600px!important; max-height: 505px!important">
|
||||||
<UserControl:AddMedico runat="server" ID="AddMedicoControl" />
|
<UserControl:AddMedico runat="server" ID="AddMedicoControl" />
|
||||||
</div>
|
</div>
|
||||||
<asp:Button ID="BtnRecargaMedicos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaMedicos_Click" />
|
<asp:Button ID="BtnRecargaMedicos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaMedicos_Click" />
|
||||||
<asp:HiddenField ID="HdnCveMedicoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
|
<asp:HiddenField ID="HdnCveMedicoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
|
||||||
@@ -8560,22 +8638,22 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="DvModalAddProcedimiento" class="modal ADS fade" role="dialog">
|
<div id="DvModalAddProcedimiento" class="modal ADS fade" role="dialog">
|
||||||
|
|
||||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddProcedimiento" UpdateMode="Conditional">
|
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddProcedimiento" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="modal-content" style="max-width:600px!important;max-height:505px!important">
|
<div class="modal-content" style="max-width: 600px!important; max-height: 505px!important">
|
||||||
<UserControl:AddProcedimiento runat="server" ID="AddProcedimientoControl" />
|
<UserControl:AddProcedimiento runat="server" ID="AddProcedimientoControl" />
|
||||||
</div>
|
</div>
|
||||||
<asp:Button ID="BtnRecargaProcedimientos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaProcedimientos_Click" />
|
<asp:Button ID="BtnRecargaProcedimientos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaProcedimientos_Click" />
|
||||||
<asp:HiddenField ID="HdnCveProcedimientoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
|
<asp:HiddenField ID="HdnCveProcedimientoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
|
||||||
|
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</div>
|
||||||
|
|
||||||
</ContentTemplate>
|
|
||||||
</asp:UpdatePanel>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||||
@@ -9657,6 +9735,46 @@
|
|||||||
$("#LblSubTotal1").text($("#TxtSubTotal").val());
|
$("#LblSubTotal1").text($("#TxtSubTotal").val());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function CalculaDescPS() {
|
||||||
|
if ($get("TxtPorPS").value != "") {
|
||||||
|
var PorcentajeDescuento = parseFloat($get("TxtPorPS").value);
|
||||||
|
if (PorcentajeDescuento < 0 || PorcentajeDescuento > 99) {
|
||||||
|
alert("No se puede aplicar ese porcentaje de descuento");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var subTotal = parseFloat($get("LblSubtotalDescPS").innerText.replace(",", "").replace(",", ""));
|
||||||
|
var Monto = parseFloat($get("LblTotalDescPS").innerText.replace(",", "").replace(",", ""));
|
||||||
|
|
||||||
|
var Total = Monto - ((Monto * PorcentajeDescuento) / 100);
|
||||||
|
|
||||||
|
$get("LblTotalFinalDescPS").innerText = formato_numero(Total, 2, '.', ',');
|
||||||
|
|
||||||
|
var TotalRedondeado = parseFloat($get("LblTotalFinalDescPS").innerText.replace(",", "").replace(",", ""));
|
||||||
|
|
||||||
|
var descuento = - ((TotalRedondeado - (subTotal * 1.16)) / 1.16);
|
||||||
|
|
||||||
|
$get("LblIVADescPS").innerText = formato_numero(((subTotal - descuento) * 0.16), 2, '.', ',');
|
||||||
|
|
||||||
|
$get("LblDescPS").innerText = formato_numero(descuento, 2, '.', ',');
|
||||||
|
$get("HdnDescPS").value = descuento;
|
||||||
|
|
||||||
|
var totalCompra = parseFloat($get("HdnTotalCompra").value);
|
||||||
|
if (totalCompra > 0) {
|
||||||
|
var utilidad = ((TotalRedondeado - totalCompra) / TotalRedondeado) * 100;
|
||||||
|
$get("LblUtilidadPorcentaje").innerText = formato_numero(utilidad, 2, '.', ',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$get("LblTotalFinalDescPS").innerText = "0.00";
|
||||||
|
$get("LblDescPS").innerText = "0.00";
|
||||||
|
$get("LblIVADescPS").innerText = "0.00";
|
||||||
|
$get("LblUtilidadPorcentaje").innerText = "0.00";
|
||||||
|
$get("HdnDescPS").innerText = "0.00";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function formato_numero(numero, decimales, separador_decimal, separador_miles) { // v2007-08-06
|
function formato_numero(numero, decimales, separador_decimal, separador_miles) { // v2007-08-06
|
||||||
numero = parseFloat(numero);
|
numero = parseFloat(numero);
|
||||||
if (isNaN(numero)) {
|
if (isNaN(numero)) {
|
||||||
@@ -10501,17 +10619,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function fncRegargaMedicos(CveNuevoMedico) {
|
function fncRegargaMedicos(CveNuevoMedico) {
|
||||||
|
|
||||||
$("#HdnCveMedicoNuevo").val(CveNuevoMedico)
|
$("#HdnCveMedicoNuevo").val(CveNuevoMedico)
|
||||||
$('#BtnRecargaMedicos').click();
|
$('#BtnRecargaMedicos').click();
|
||||||
}
|
}
|
||||||
|
|
||||||
function fncRegargaProcedimientos(CveProcedimientoNuevo) {
|
function fncRegargaProcedimientos(CveProcedimientoNuevo) {
|
||||||
|
|
||||||
$("#HdnCveProcedimientoNuevo").val(CveProcedimientoNuevo)
|
$("#HdnCveProcedimientoNuevo").val(CveProcedimientoNuevo)
|
||||||
$('#BtnRecargaProcedimientos').click();
|
$('#BtnRecargaProcedimientos').click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2567,6 +2567,7 @@ Partial Class Ventas
|
|||||||
TabAlmacen.Enabled = UsuarioActual.Empresa.UsaInventarios
|
TabAlmacen.Enabled = UsuarioActual.Empresa.UsaInventarios
|
||||||
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
||||||
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
||||||
|
TxtPorPS.Attributes.Add("onKeyUp", "CalculaDescPS();")
|
||||||
|
|
||||||
CreaDTmpC()
|
CreaDTmpC()
|
||||||
CreaDTmpF()
|
CreaDTmpF()
|
||||||
@@ -8245,6 +8246,10 @@ Partial Class Ventas
|
|||||||
e.Row.FCLinkButton("imgE").Visible = True
|
e.Row.FCLinkButton("imgE").Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(109) = "1" AndAlso UsuarioActual.TienePermisoProceso(374) Then
|
||||||
|
e.Row.FCLinkButton("LnkDescuentos").Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
'If GvInv.Rows.Count > 0 AndAlso ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso e.Row.DataKey("CveVentaDetalle").ToString().ToEntero() > 0 Then
|
'If GvInv.Rows.Count > 0 AndAlso ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso e.Row.DataKey("CveVentaDetalle").ToString().ToEntero() > 0 Then
|
||||||
' e.Row.FCLinkButton("imgE").Enabled = False
|
' e.Row.FCLinkButton("imgE").Enabled = False
|
||||||
' e.Row.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen."
|
' e.Row.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen."
|
||||||
@@ -23888,7 +23893,6 @@ Partial Class Ventas
|
|||||||
Dim RowNum As Integer = Convert.ToInt32(e.CommandArgument)
|
Dim RowNum As Integer = Convert.ToInt32(e.CommandArgument)
|
||||||
Dim GvRow As GridViewRow = GvPS.Rows(RowNum)
|
Dim GvRow As GridViewRow = GvPS.Rows(RowNum)
|
||||||
|
|
||||||
|
|
||||||
If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
|
If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
|
||||||
TxtCantidad.Text = GvRow.FCTextBox("TxtCantidad").Text
|
TxtCantidad.Text = GvRow.FCTextBox("TxtCantidad").Text
|
||||||
DdlClasificacion.SelectedValue = GvRow.FCDropDownList("DdlClasificacion").SelectedValue
|
DdlClasificacion.SelectedValue = GvRow.FCDropDownList("DdlClasificacion").SelectedValue
|
||||||
@@ -23914,6 +23918,32 @@ Partial Class Ventas
|
|||||||
RegistraScript("Recalcula();")
|
RegistraScript("Recalcula();")
|
||||||
LbAgregar_Click(Nothing, Nothing)
|
LbAgregar_Click(Nothing, Nothing)
|
||||||
|
|
||||||
|
ElseIf e.CommandName = "Descuento" Then
|
||||||
|
LblSubtotalDescPS.Text = ""
|
||||||
|
LblTotalDescPS.Text = ""
|
||||||
|
LblTituloDesc.Text = "Descuento"
|
||||||
|
HdnConsecPS.Value = "-1"
|
||||||
|
HdnTotalCompra.Value = ""
|
||||||
|
TxtPorPS.Text = ""
|
||||||
|
LblIVADescPS.Text = ""
|
||||||
|
|
||||||
|
Dim GvRow As GridViewRow = GvPS.Rows(e.CommandArgument.ToString().ToEntero())
|
||||||
|
LblTituloDesc.Text = $"Descuento: {GvRow.DataKey("PS")}"
|
||||||
|
HdnConsecPS.Value = GvRow.DataKey("Consec")
|
||||||
|
LblSubtotalDescPS.Text = (GvRow.DataKey("Total").ToDecimal()).FormatoNumero()
|
||||||
|
LblTotalDescPS.Text = (GvRow.DataKey("Total").ToDecimal() + GvRow.DataKey("ImporteIVA").ToDecimal()).FormatoNumero()
|
||||||
|
LblIVADescPS.Text = GvRow.DataKey("ImporteIVA").FormatoNumero()
|
||||||
|
|
||||||
|
Using ObjPS As New ClsProductosServicios
|
||||||
|
Dim PrecioCompra = ObjPS.GetUltimoPrecioCompra(UsuarioActual.CveEmpresa, GvRow.DataKey("CvePS").ToEntero())
|
||||||
|
If PrecioCompra > 0 Then
|
||||||
|
HdnTotalCompra.Value = (PrecioCompra * GvRow.DataKey("Cantidad").ToDouble() * 1.16).ToString()
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
UpDescPS.Update()
|
||||||
|
|
||||||
|
RegistraScript("$('#ModalDescPS').modal({backdrop: 'static', keyboard: false});")
|
||||||
Else
|
Else
|
||||||
DdlPS_SelectedIndexChanged(Nothing, Nothing)
|
DdlPS_SelectedIndexChanged(Nothing, Nothing)
|
||||||
End If
|
End If
|
||||||
@@ -36794,6 +36824,20 @@ Partial Class Ventas
|
|||||||
Protected Sub TxtFechaAnticipoCliente_TextChanged(sender As Object, e As EventArgs)
|
Protected Sub TxtFechaAnticipoCliente_TextChanged(sender As Object, e As EventArgs)
|
||||||
CargaAnticipos(CveCliente)
|
CargaAnticipos(CveCliente)
|
||||||
End Sub
|
End Sub
|
||||||
|
Protected Sub BtnPorPS_Click(sender As Object, e As EventArgs)
|
||||||
|
If HdnDescPS.Value.ToEntero() > 0 Then
|
||||||
|
Dim RowUpdate As DataRow = TmpDT.Select($"Consec = {HdnConsecPS.Value}").FirstOrDefault()
|
||||||
|
If RowUpdate IsNot Nothing Then
|
||||||
|
RowUpdate("Descuento") = HdnDescPS.Value.ToDecimal()
|
||||||
|
RowUpdate("ImporteIVA") = LblIVADescPS.Text.ToDecimal()
|
||||||
|
|
||||||
|
CalculaTotalesVenta()
|
||||||
|
RegistraScript("$('#ModalDescPS').modal('hide');")
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Alert("No se pudo aplicar el descuento", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user