Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -337,7 +337,7 @@ Partial Class Ventas_PVCobranza
|
||||
PnlContado.Visible = False
|
||||
ObjConta.Commit()
|
||||
CargaDatos()
|
||||
Alert("Pago Registrado correctamente.<br/><br/> <a href='#' class='Texto'>Imprimir ticket</a>", TipoMensaje.MsgInformacion)
|
||||
Alert($"Pago Registrado correctamente.<br/><br/> <a href=""/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1&TICKET=1®ENERAR=1", CveVenta))}"" class='Texto'>Imprimir ticket</a>", TipoMensaje.MsgInformacion)
|
||||
Else
|
||||
ObjConta.RollBack()
|
||||
End If
|
||||
|
||||
@@ -612,13 +612,13 @@
|
||||
<b>Paciente:</b>
|
||||
</td>
|
||||
<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 runat="server" id="Td9" visible="true">
|
||||
<b>Episodio:</b>
|
||||
</td>
|
||||
<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>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -1183,7 +1183,7 @@
|
||||
<%--</asp:Panel>--%>
|
||||
|
||||
<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;">
|
||||
<Columns>
|
||||
<%--0--%>
|
||||
@@ -1404,6 +1404,8 @@
|
||||
<%--19--%>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
|
||||
<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() %>'
|
||||
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-clone'></i>" />
|
||||
</ItemTemplate>
|
||||
@@ -4319,6 +4321,83 @@
|
||||
</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">
|
||||
<asp:UpdatePanel runat="server" ID="UpAnticipos" UpdateMode="Conditional" class="modal-dialog">
|
||||
<ContentTemplate>
|
||||
@@ -8430,7 +8509,7 @@
|
||||
|
||||
|
||||
<%--Cliente Sucursales --%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaPasoCliente">
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaClientesucursal">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12 form-md-line-input input-iconright ">
|
||||
<asp:DropDownList ID="DdlClienteSucursal" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" DataTextField="Nombre" DataValueField="Clave" CausesValidation="true"
|
||||
@@ -8444,8 +8523,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--Cliente Solo se usa para en PAgo Directo --%>
|
||||
<div runat="server" visible="False" id="DvModalTipoVentaCliente">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12 form-md-line-input input-iconright" style="margin-top: -7px!important">
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlClienteSucursal">Cliente:</asp:Label>
|
||||
<ADS:Dropdownlost CssClassDdl="form-control select2me" ID="DdlClientesModal" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"
|
||||
Style="margin-top: -5px!important" IncluyeTodos="false"></ADS:Dropdownlost>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<%--Medico Procedimiento--%>
|
||||
@@ -8462,7 +8550,7 @@
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlMedicoModal">Médico:</asp:Label>
|
||||
</div>
|
||||
<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 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"
|
||||
@@ -8476,7 +8564,7 @@
|
||||
<asp:Label runat="server" Style="width: 90%; color: #888888;" AssociatedControlID="DdlProcedimientoModal">Procedimiento:</asp:Label>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
@@ -8517,9 +8605,9 @@
|
||||
<asp:BoundField DataField="Abreviatura" HeaderText="UM">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:BoundField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Precio" ItemStyle-Width="30px">
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Precio" ItemStyle-Width="30px">
|
||||
<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>
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -8544,14 +8632,14 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DvModalAddMedico" class="modal ADS fade" role="dialog">
|
||||
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddMedico" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="modal-content" style="max-width:600px!important;max-height:505px!important">
|
||||
<UserControl:AddMedico runat="server" ID="AddMedicoControl" />
|
||||
<div class="modal-content" style="max-width: 600px!important; max-height: 505px!important">
|
||||
<UserControl:AddMedico runat="server" ID="AddMedicoControl" />
|
||||
</div>
|
||||
<asp:Button ID="BtnRecargaMedicos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaMedicos_Click" />
|
||||
<asp:HiddenField ID="HdnCveMedicoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
@@ -8560,22 +8648,22 @@
|
||||
</asp:UpdatePanel>
|
||||
</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">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content" style="max-width:600px!important;max-height:505px!important">
|
||||
<UserControl:AddProcedimiento runat="server" ID="AddProcedimientoControl" />
|
||||
</div>
|
||||
<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:UpdatePanel class="modal-dialog" runat="server" ID="UpModalAddProcedimiento" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-content" style="max-width: 600px!important; max-height: 505px!important">
|
||||
<UserControl:AddProcedimiento runat="server" ID="AddProcedimientoControl" />
|
||||
</div>
|
||||
<asp:Button ID="BtnRecargaProcedimientos" Style="display: none;" ClientIDMode="Static" runat="server" OnClick="BtnRecargaProcedimientos_Click" />
|
||||
<asp:HiddenField ID="HdnCveProcedimientoNuevo" runat="server" ClientIDMode="Static" Value="-1" />
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
@@ -9657,6 +9745,46 @@
|
||||
$("#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
|
||||
numero = parseFloat(numero);
|
||||
if (isNaN(numero)) {
|
||||
@@ -10501,17 +10629,17 @@
|
||||
}
|
||||
|
||||
|
||||
function fncRegargaMedicos(CveNuevoMedico) {
|
||||
function fncRegargaMedicos(CveNuevoMedico) {
|
||||
|
||||
$("#HdnCveMedicoNuevo").val(CveNuevoMedico)
|
||||
$('#BtnRecargaMedicos').click();
|
||||
}
|
||||
$("#HdnCveMedicoNuevo").val(CveNuevoMedico)
|
||||
$('#BtnRecargaMedicos').click();
|
||||
}
|
||||
|
||||
function fncRegargaProcedimientos(CveProcedimientoNuevo) {
|
||||
function fncRegargaProcedimientos(CveProcedimientoNuevo) {
|
||||
|
||||
$("#HdnCveProcedimientoNuevo").val(CveProcedimientoNuevo)
|
||||
$('#BtnRecargaProcedimientos').click();
|
||||
}
|
||||
$("#HdnCveProcedimientoNuevo").val(CveProcedimientoNuevo)
|
||||
$('#BtnRecargaProcedimientos').click();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -539,6 +539,20 @@ Partial Class Ventas
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Private Property CveClienteOS As Integer
|
||||
Get
|
||||
If ViewState("CveClienteOS") Is Nothing Then
|
||||
ViewState("CveClienteOS") = -1
|
||||
End If
|
||||
Return ViewState("CveClienteOS").ToString().ToEntero()
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveClienteOS") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveClienteSucursal As Integer
|
||||
Get
|
||||
If ViewState("CveClienteSucursal") Is Nothing Then
|
||||
@@ -2567,6 +2581,7 @@ Partial Class Ventas
|
||||
TabAlmacen.Enabled = UsuarioActual.Empresa.UsaInventarios
|
||||
TxtPorDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
||||
TxtDescP.Attributes.Add("onKeyUp", "CalculaDescuento();")
|
||||
TxtPorPS.Attributes.Add("onKeyUp", "CalculaDescPS();")
|
||||
|
||||
CreaDTmpC()
|
||||
CreaDTmpF()
|
||||
@@ -8245,6 +8260,10 @@ Partial Class Ventas
|
||||
e.Row.FCLinkButton("imgE").Visible = True
|
||||
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
|
||||
' e.Row.FCLinkButton("imgE").Enabled = False
|
||||
' e.Row.FCLinkButton("imgE").ToolTip = "No se puede editar debido a que ya hay un movimiento de almacen."
|
||||
@@ -23888,7 +23907,6 @@ Partial Class Ventas
|
||||
Dim RowNum As Integer = Convert.ToInt32(e.CommandArgument)
|
||||
Dim GvRow As GridViewRow = GvPS.Rows(RowNum)
|
||||
|
||||
|
||||
If (GvRow.RowState = DataControlRowState.Edit OrElse GvRow.RowState = 5) Then
|
||||
TxtCantidad.Text = GvRow.FCTextBox("TxtCantidad").Text
|
||||
DdlClasificacion.SelectedValue = GvRow.FCDropDownList("DdlClasificacion").SelectedValue
|
||||
@@ -23914,6 +23932,32 @@ Partial Class Ventas
|
||||
RegistraScript("Recalcula();")
|
||||
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
|
||||
DdlPS_SelectedIndexChanged(Nothing, Nothing)
|
||||
End If
|
||||
@@ -36273,6 +36317,17 @@ Partial Class Ventas
|
||||
DdlClienteSucursal.DataBind()
|
||||
DdlClienteSucursal.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
Dim EsWS As Boolean = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
|
||||
If EsWS Then
|
||||
DdlClientesModal.setEsWebService(True)
|
||||
|
||||
Else
|
||||
DdlClientesModal.setEsWebService(False)
|
||||
DdlClientesModal.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
|
||||
DdlClientesModal.DataBind()
|
||||
DdlClientesModal.ddl.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub ChkRequiereTecnico_CheckedChanged(sender As Object, e As EventArgs)
|
||||
@@ -36289,7 +36344,7 @@ Partial Class Ventas
|
||||
If RBLTipoVenta.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
DvModalTipoVentaPasoTipo.Visible = False
|
||||
DvModalTipoVentaPasoCliente.Visible = True
|
||||
DvModalTipoVentaClientesucursal.Visible = True
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = True
|
||||
DvModalTipoVentaPasoMedicoProcedimiento.Visible = True
|
||||
|
||||
@@ -36315,6 +36370,7 @@ Partial Class Ventas
|
||||
ChkRequiereTecnicoModal.Checked = True
|
||||
ChkRequiereTecnicoModal.Enabled = False
|
||||
DvModalRequiereOSFecha.Visible = True
|
||||
DvModalTipoVentaCliente.Visible = True
|
||||
Case "3" 'A-Vista
|
||||
ChkRequiereTecnicoModal.Checked = False
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = False
|
||||
@@ -36404,7 +36460,8 @@ Partial Class Ventas
|
||||
LnkDvModalTipoVentaAceptar.Visible = False
|
||||
|
||||
DvModalTipoVentaPasoTipo.Visible = True
|
||||
DvModalTipoVentaPasoCliente.Visible = False
|
||||
DvModalTipoVentaClientesucursal.Visible = False
|
||||
DvModalTipoVentaCliente.Visible = False
|
||||
DvModalTipoVentaPasoRequiereOS.Visible = False
|
||||
DvModalTipoVentaPasoMedicoProcedimiento.Visible = False
|
||||
|
||||
@@ -36437,15 +36494,35 @@ Partial Class Ventas
|
||||
|
||||
Protected Sub LnkDvModalTipoVentaAceptar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If RBLTipoVenta.SelectedValue.ToEntero = 2 Then
|
||||
|
||||
If DdlClientesModal.SelectedValue.ToEntero > 0 Then
|
||||
ViewState("CveCliente") = DdlClientesModal.SelectedValue.ToEntero
|
||||
Else
|
||||
Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
If DdlClienteSucursalCliente() > 0 Then
|
||||
ViewState("CveCliente") = DdlClienteSucursalCliente()
|
||||
If DdlClienteSucursalCliente() > 0 Then
|
||||
CveClienteOS = DdlClienteSucursalCliente()
|
||||
Else
|
||||
Alert("Debe de seleccionar un hospital.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
If DdlClienteSucursalCliente() > 0 Then
|
||||
ViewState("CveCliente") = DdlClienteSucursalCliente()
|
||||
CveClienteOS = CveCliente
|
||||
Else
|
||||
Alert("Debe de seleccionar un cliente.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If ChkRequiereTecnicoModal.Checked Then
|
||||
If Not IsDate(TxtFechaModal.Text.Replace(",", "")) Then
|
||||
Alert("El campo fecha no es valido.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -36657,7 +36734,7 @@ Partial Class Ventas
|
||||
|
||||
Dim EstatusOrdenServicio As Integer = GlobalDTEstatusOrdenServicios(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveEstatusOrdenServicio", "TipoEstatus = 1").ToEntero
|
||||
|
||||
If ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
|
||||
If ObjOrdenServicio.AddOrdenesServicios(CveClienteOS, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio,
|
||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVentaOS, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero,
|
||||
Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero,
|
||||
CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime,
|
||||
@@ -36811,6 +36888,20 @@ Partial Class Ventas
|
||||
Protected Sub TxtFechaAnticipoCliente_TextChanged(sender As Object, e As EventArgs)
|
||||
CargaAnticipos(CveCliente)
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user