--Agregar productos similares o complementarios en ventas

This commit is contained in:
2024-06-05 14:05:46 -07:00
parent 8fdf1c8c15
commit 52a976d9ba
10 changed files with 229 additions and 9 deletions

View File

@@ -346,7 +346,7 @@ Partial Class PopUpVerFactura
Dim totalPallets As String = ""
Dim totalBachas As String = ""
Dim dfec As DateTime = fecha.ToDateTime()
Dim fechas As String = String.Format(New System.Globalization.CultureInfo("es-MX"), "{0dd} DE {0:MMMM} DEL {0:yyyy}", dfec).ToUpper()
Dim fechas As String = String.Format(New System.Globalization.CultureInfo("es-MX"), "{0:dd} DE {0:MMMM} DEL {0:yyyy}", dfec).ToUpper()
Dim totalcajas As String = ""
Dim TotalBins As String = ""
@@ -1589,6 +1589,16 @@ Partial Class PopUpVerFactura
' End If
'End If
If DtCortesVentas.Rows.Count > 0 Then
Dim RowInfo As DataRow = DtCortesVentas.FiltroPrimero("CveVenta > 0")
If RowInfo IsNot Nothing Then
Fecha = RowInfo("FechaInicial").ToString
Nombre = RowInfo("Nombre").ToString
End If
End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa = 197 Then
If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, CveSubProyecto, CveCorte:=CveCorte) Then
DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("CveCorte > 0")

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384v38.6C310.1 219.5 256 287.4 256 368c0 59.1 29.1 111.3 73.7 143.3c-3.2 .5-6.4 .7-9.7 .7H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM288 368a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm211.3-43.3c-6.2-6.2-16.4-6.2-22.6 0L416 385.4l-28.7-28.7c-6.2-6.2-16.4-6.2-22.6 0s-6.2 16.4 0 22.6l40 40c6.2 6.2 16.4 6.2 22.6 0l72-72c6.2-6.2 6.2-16.4 0-22.6z"/></svg>

After

Width:  |  Height:  |  Size: 635 B

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="512" height="512" viewBox="0 0 512 512" xml:space="preserve">
<desc>Created with Fabric.js 5.2.4</desc>
<defs>
</defs>
<rect x="0" y="0" width="100%" height="100%" fill="transparent"></rect>
<g transform="matrix(1 0 0 1 256 256)" id="e9bb80fb-323c-4ae6-8bdf-3b3a144f5e10" >
<rect style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; visibility: hidden;" vector-effect="non-scaling-stroke" x="-256" y="-256" rx="0" ry="0" width="512" height="512" />
</g>
<g transform="matrix(Infinity NaN NaN Infinity 0 0)" id="ceba7656-13ea-488d-a645-4a6d8fcc7b29" >
</g>
<g transform="matrix(0.83 0 0 0.83 256 256)" id="f41be53b-d9e8-4392-b614-de3f5d57e2e4" >
<path style="stroke: rgb(0,0,0); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(3,163,76); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-288, -256)" d="M 0 64 C 0 28.7 28.7 0 64 0 L 224 0 L 224 128 C 224 145.7 238.3 160 256 160 L 384 160 L 384 198.6 C 310.1 219.5 256 287.4 256 368 C 256 427.1 285.1 479.3 329.7 511.3 C 326.5 511.8 323.3 512 320 512 L 64 512 C 28.700000000000003 512 0 483.3 0 448 L 0 64 z M 384 128 L 256 128 L 256 0 L 384 128 z M 288 368 C 288 288.4709960243657 352.4709960243657 224 432 224 C 511.5290039756343 224 576 288.4709960243657 576 367.99999999999994 C 576 447.5290039756343 511.5290039756343 512 432 512 C 352.4709960243657 512 288 447.5290039756343 288 368 z M 499.3 324.7 C 493.1 318.5 482.90000000000003 318.5 476.7 324.7 L 416 385.4 L 387.3 356.7 C 381.1 350.5 370.90000000000003 350.5 364.7 356.7 C 358.49999999999994 362.9 358.5 373.09999999999997 364.7 379.3 L 404.7 419.3 C 410.9 425.5 421.09999999999997 425.5 427.3 419.3 L 499.3 347.3 C 505.5 341.1 505.5 330.90000000000003 499.3 324.7 z" stroke-linecap="round" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M320 488c0 9.5-5.6 18.1-14.2 21.9s-18.8 2.3-25.8-4.1l-80-72c-5.1-4.6-7.9-11-7.9-17.8s2.9-13.3 7.9-17.8l80-72c7-6.3 17.2-7.9 25.8-4.1s14.2 12.4 14.2 21.9v40h16c35.3 0 64-28.7 64-64V153.3C371.7 141 352 112.8 352 80c0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3V320c0 70.7-57.3 128-128 128H320v40zM456 80a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM192 24c0-9.5 5.6-18.1 14.2-21.9s18.8-2.3 25.8 4.1l80 72c5.1 4.6 7.9 11 7.9 17.8s-2.9 13.3-7.9 17.8l-80 72c-7 6.3-17.2 7.9-25.8 4.1s-14.2-12.4-14.2-21.9V128H176c-35.3 0-64 28.7-64 64V358.7c28.3 12.3 48 40.5 48 73.3c0 44.2-35.8 80-80 80s-80-35.8-80-80c0-32.8 19.7-61 48-73.3V192c0-70.7 57.3-128 128-128h16V24zM56 432a24 24 0 1 0 48 0 24 24 0 1 0 -48 0z"/></svg>

After

Width:  |  Height:  |  Size: 931 B

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="512" height="512" viewBox="0 0 512 512" xml:space="preserve">
<desc>Created with Fabric.js 5.2.4</desc>
<defs>
</defs>
<rect x="0" y="0" width="100%" height="100%" fill="transparent"></rect>
<g transform="matrix(0 0 0 0 0 0)" id="ceba7656-13ea-488d-a645-4a6d8fcc7b29" >
</g>
<g transform="matrix(1 0 0 1 256 256)" id="e9bb80fb-323c-4ae6-8bdf-3b3a144f5e10" >
<rect style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; visibility: hidden;" vector-effect="non-scaling-stroke" x="-256" y="-256" rx="0" ry="0" width="512" height="512" />
</g>
<g transform="matrix(1 0 0 1 256 256)" id="3ca35d26-2c96-49e5-b5c6-7bbb1761ade8" >
<path style="stroke: rgb(0,0,0); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(10,109,51); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-256, -256)" d="M 320 488 C 320 497.5 314.4 506.1 305.8 509.9 C 297.20000000000005 513.6999999999999 287 512.1999999999999 280 505.79999999999995 L 200 433.79999999999995 C 194.9 429.19999999999993 192.1 422.79999999999995 192.1 415.99999999999994 C 192.1 409.19999999999993 195 402.69999999999993 200 398.19999999999993 L 280 326.19999999999993 C 287 319.8999999999999 297.2 318.29999999999995 305.8 322.0999999999999 C 314.40000000000003 325.89999999999986 320 334.4999999999999 320 343.9999999999999 L 320 383.9999999999999 L 336 383.9999999999999 C 371.3 383.9999999999999 400 355.2999999999999 400 319.9999999999999 L 400 153.3 C 371.7 141 352 112.8 352 80 C 352 35.8 387.8 0 432 0 C 476.2 0 512 35.8 512 80 C 512 112.8 492.3 141 464 153.3 L 464 320 C 464 390.7 406.7 448 336 448 L 320 448 L 320 488 z M 456 80 C 456 66.74516600406096 445.25483399593907 56 432 56 C 418.74516600406093 56 408 66.74516600406095 408 80 C 408 93.25483399593904 418.74516600406093 104 432 104 C 445.25483399593907 104 456 93.25483399593904 456 80 z M 192 24 C 192 14.5 197.6 5.899999999999999 206.2 2.1000000000000014 C 214.79999999999998 -1.6999999999999957 225 -0.1999999999999984 232 6.200000000000001 L 312 78.2 C 317.1 82.8 319.9 89.2 319.9 96 C 319.9 102.8 317 109.3 312 113.8 L 232 185.8 C 225 192.10000000000002 214.8 193.70000000000002 206.2 189.9 C 197.59999999999997 186.1 192 177.5 192 168 L 192 128 L 176 128 C 140.7 128 112 156.7 112 192 L 112 358.7 C 140.3 371 160 399.2 160 432 C 160 476.2 124.2 512 80 512 C 35.8 512 0 476.2 0 432 C 0 399.2 19.7 371 48 358.7 L 48 192 C 48 121.3 105.3 64 176 64 L 192 64 L 192 24 z M 56 432 C 56 445.25483399593907 66.74516600406096 456 80 456 C 93.25483399593904 456 104 445.25483399593907 104 432 C 104 418.74516600406093 93.25483399593904 408 80 408 C 66.74516600406096 408 56 418.74516600406093 56 432 z" stroke-linecap="round" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M32 96l320 0V32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l96 96c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-96 96c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6V160L32 160c-17.7 0-32-14.3-32-32s14.3-32 32-32zM480 352c17.7 0 32 14.3 32 32s-14.3 32-32 32H160v64c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-96-96c-6-6-9.4-14.1-9.4-22.6s3.4-16.6 9.4-22.6l96-96c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 64H480z"/></svg>

After

Width:  |  Height:  |  Size: 648 B

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="512" height="512" viewBox="0 0 512 512" xml:space="preserve">
<desc>Created with Fabric.js 5.2.4</desc>
<defs>
</defs>
<rect x="0" y="0" width="100%" height="100%" fill="transparent"></rect>
<g transform="matrix(0 0 0 0 0 0)" id="ceba7656-13ea-488d-a645-4a6d8fcc7b29" >
</g>
<g transform="matrix(1 0 0 1 256 256)" id="e9bb80fb-323c-4ae6-8bdf-3b3a144f5e10" >
<rect style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1; visibility: hidden;" vector-effect="non-scaling-stroke" x="-256" y="-256" rx="0" ry="0" width="512" height="512" />
</g>
<g transform="matrix(1 0 0 1 256 256)" id="545cc652-9814-4d79-b673-2e742ca1232d" >
<path style="stroke: rgb(0,0,0); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(23,61,88); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-256, -256)" d="M 32 96 L 352 96 L 352 32 C 352 19.1 359.8 7.399999999999999 371.8 2.3999999999999986 C 383.8 -2.6000000000000014 397.5 0.1999999999999984 406.7 9.299999999999999 L 502.7 105.3 C 508.7 111.3 512.1 119.39999999999999 512.1 127.9 C 512.1 136.40000000000003 508.70000000000005 144.5 502.70000000000005 150.5 L 406.70000000000005 246.5 C 397.50000000000006 255.7 383.80000000000007 258.4 371.80000000000007 253.4 C 359.80000000000007 248.40000000000003 352.00000000000006 236.8 352.00000000000006 223.8 L 352.00000000000006 160 L 32 160 C 14.3 160 0 145.7 0 128 C 0 110.30000000000001 14.3 96 32 96 z M 480 352 C 497.7 352 512 366.3 512 384 C 512 401.7 497.7 416 480 416 L 160 416 L 160 480 C 160 492.9 152.2 504.6 140.2 509.6 C 128.2 514.6 114.49999999999999 511.8 105.29999999999998 502.70000000000005 L 9.299999999999983 406.70000000000005 C 3.299999999999983 400.70000000000005 -0.10000000000001741 392.6 -0.10000000000001741 384.1 C -0.10000000000001741 375.6 3.2999999999999825 367.5 9.299999999999983 361.5 L 105.29999999999998 265.5 C 114.49999999999999 256.3 128.2 253.6 140.2 258.6 C 152.2 263.6 160 275.20000000000005 160 288.20000000000005 L 160 352.20000000000005 L 480 352.20000000000005 z" stroke-linecap="round" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -333,7 +333,7 @@ Partial Class CatPS
End If
If Opcion = 1 Then
If Not ObjPS.AddPSAdicionales(CvePSPagina, CvePSAdicional, Cantidad) Then
If Not ObjPS.AddPSAdicionales(CvePSPagina, CvePSAdicional, Cantidad, 1) Then
Return String.Format("No se registró el producto adicional:{0} no existe en la franquicia: '{1}'", CodigoPS, GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa"))
End If
End If

View File

@@ -758,12 +758,12 @@
<td><b>Fecha:</b></td>
<td>
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;">
<asp:TextBox ID="TxtFecha" runat="server" Enabled="false" AutoPostBack="true" CssClass="form-control" CausesValidation="true" MaxLength="10" OnTextChanged="TxtFecha_TextChanged"></asp:TextBox>
<asp:TextBox ID="TxtFecha" runat="server" AutoPostBack="true" CssClass="form-control" CausesValidation="true" MaxLength="10" OnTextChanged="TxtFecha_TextChanged"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server" ></asp:LinkButton>
<asp:LinkButton ID="ImgFecha" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFecha" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="false" ></ajax:CalendarExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFecha" PopupButtonID="ImgFecha" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtFecha" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />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="GrpEmitirImprimir"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
@@ -1160,7 +1160,9 @@
<asp:HiddenField ID="HdnAplicaIEPS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnPorcentajeIEPS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnCvePS" runat="server" Value="-1" />
<asp:HiddenField ID="HdnCvePSComparar" runat="server" Value="-1" ClientIDMode="Static" />
<asp:HiddenField ID="HdnTipoPSComparar" runat="server" Value="-1" ClientIDMode="Static" />
<asp:Button ID="BtnCargarPSAdicionales" runat="server" ClientIDMode="Static" Text="adicionales" Style="display: none;" />
<asp:DropDownList ID="DdlClasificacion" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%">
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
</asp:DropDownList>
@@ -6566,6 +6568,7 @@
<asp:Button ID="BtnRefacturacionConfirmarAceptacion" runat="server" ClientIDMode="Static" Text="Refacturacion Aceptacion Documento" Style="display: none;" />
<asp:Button ID="BtnRefrescarPagina" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" />
<asp:Button ID="BtnAplicaNuevaNC" runat="server" ClientIDMode="Static" Text="AplicarNC" Style="display: none;" />
<asp:HiddenField ID="HdnCveVentaAcuse" runat="server" ClientIDMode="Static" Value="0" />
<%--FLETES--%>
<div id="ModalFletes" class="modal ADS fade" role="dialog">
@@ -8925,7 +8928,70 @@
</asp:UpdatePanel>
</div>
<%-- MODAL PS ADICIONALES --%>
<div id="DivSimilares" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<asp:UpdatePanel ID="UpSimilares" class="modal-content rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">
<asp:Literal ID="LtlNombreModalPS" runat="server"></asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<asp:GridView ID="GvPSAdicionales" runat="server" GridLines="None" DataKeyNames="CvePS,CodigoPS" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" BorderWidth="1" BorderColor="#D3D3D3" CellSpacing="0" Width="100%" AutoGenerateColumns="False" data-heighterror="600" EmptyDataText="No se encontraron registros">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="5%" ItemStyle-CssClass="NoClick">
<HeaderTemplate>
<asp:CheckBox runat="server" ID="chkAllPSAdicionales" CssClass="ChkAllClickPS" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkPSAdicional" CssClass="ChkAllEvtPS" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidad" runat="server" CausesValidation="true" lang="nb" Text="0.00" MaxLength="12" Width="100%" Height="24px" CssClass="form-control input-sm"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTVCantidad" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="CodigoPS" ItemStyle-Width="85%" HeaderText="Producto y/o Servicio" ItemStyle-HorizontalAlign="Left"/>
</Columns>
</asp:GridView>
</div>
</div>
<%--<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtCantidadPSSimilar" runat="server" ClientIDMode="Static" CssClass="form-control" CausesValidation="true"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTBPSSimilar" runat="server" TargetControlID="TxtCantidadPSSimilar" FilterType="Numbers, Custom" ValidChars="." />
<asp:RequiredFieldValidator ID="RFVPSSimilar" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtCantidadPSSimilar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cantidad''</b> es necesario, por favor ingréselo." ValidationGroup="GrpPSSimilar"></asp:RequiredFieldValidator>
<label for="<%= TxtCantidadPSSimilar.ClientID.ToString()%>">Cantidad:</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlPSSimilar" Width="100%" runat="server" CssClass="form-control select2me" DataValueField="CvePSAdicional" DataTextField="PS"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVSimilar" runat="server" ControlToValidate="DdlPSSimilar" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Producto/Servicio''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpPSSimilar"></asp:RequiredFieldValidator>
<label for="<%= DdlPSSimilar.ClientID.ToString()%>">Producto/Servicio:</label>
</div>
</div>
</div>--%>
</div>
<div class="modal-footer" style="display: block">
<asp:LinkButton ID="BtnAgregarPSSimilar" runat="server" CssClass="btn btn-success" Text="Agregar" ValidationGroup="GrpPSSimilar"></asp:LinkButton>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
@@ -10218,6 +10284,7 @@
});
$('body').on('click', '.ChkAllClickAF input', function () { $(".ChkAllEvtAF input").not(this).prop('checked', $('.ChkAllClickAF input').is(':checked')); });
$('body').on('click', '.ChkAllClickPS input', function () { $(".ChkAllEvtPS input").not(this).prop('checked', $('.ChkAllClickPS input').is(':checked')); });
if(HdnCargarInventario.value == 'True'){
$("#TabAlmacen_tab .ajax__tab_inner").click(function () {
@@ -10566,6 +10633,10 @@
$('#BtnCargaAuxiliarConta').click();
}
function CargaPSAdicionalesSimilares() {
$('#BtnCargarPSAdicionales').click();
}
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {
@@ -10597,6 +10668,8 @@
for (var key in item) {
if (idxHeader == 0 && '<%= UsuarioActual.Empresa.Funcionalidad(382) %>' == '1') {
tr.append('<td style="font-weight:bold;"> </td>');
tr.append('<td style="font-weight:bold;"></td>');
tr.append('<td style="font-weight:bold;"></td>');
}
if (!(key == "text" || key == "id")) {
td = $('<td style="font-weight:bold;">' + key + '</td>');
@@ -10612,8 +10685,14 @@
for (var key in item) {
if (idxColumn == 0 && '<%= UsuarioActual.Empresa.Funcionalidad(382) %>' == '1') {
let tdExistencia = '<a href="javascript:void(0);" onclick="javascript:AbrirVentana(' + "'/Inventarios/PopUpExistenciasAlmacen.aspx?CvePS=" + item.id + "'" + ", 800, 547," + "'N'" + ",'PopUpBuscar');$('#C_Tab_TabGenerales_DdlPS > select').select2('close');" + '"> <i class="fa fa-eye" aria-hidden="true"></i> </a>';
let tdExistencia = '<a href="javascript:void(0);" onclick="javascript:AbrirVentana(' + "'/Inventarios/PopUpExistenciasAlmacen.aspx?CvePS=" + item.id + "'" + ", 800, 547," + "'N'" + ",'PopUpBuscar');$('#C_Tab_TabGenerales_DdlPS > select').select2('close');" + '"> <img style="width:15px; height: 13px;" src="../Content/CustomIcons/existencia_verde.svg" alt="Buscar existencias"></img > </a>';
tr.append('<td>' + tdExistencia + '</td>');
let tdComplementarios = '<a href="javascript:void(0);" onclick="' + "javascript:$get('HdnCvePSComparar').value=" + item.id + ";$get('HdnTipoPSComparar').value=1;CargaPSAdicionalesSimilares();" + "$('#C_Tab_TabGenerales_DdlPS > select').select2('close');" + '"> <img style="width:15px; height: 13px;" src="../Content/CustomIcons/sustituir_azul.svg" alt="Productos complementarios"></img ></a>';
tr.append('<td>' + tdComplementarios + '</td>');
let tdSimilares = '<a href="javascript:void(0);" onclick="' + "javascript:$get('HdnCvePSComparar').value=" + item.id + ";$get('HdnTipoPSComparar').value=2;CargaPSAdicionalesSimilares();" + "$('#C_Tab_TabGenerales_DdlPS > select').select2('close');" + '"> <img style="width:15px; height: 13px;" src="../Content/CustomIcons/similar_verde.svg" alt="Productos similares"></img > </a>';
tr.append('<td>' + tdSimilares + '</td>');
}
if (!(key == "text" || key == "id")) {

View File

@@ -8710,6 +8710,9 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
e.Row.FCLinkButton("LnkDescuentos").Visible = True
If e.Row.DBCampo("TipoDocto") = "Cot" AndAlso CveVenta > 0 AndAlso Not EsCreaApartirDe Then
e.Row.FCLinkButton("imgClone").Visible = False
End If
End If
'If GvInv.Rows.Count > 0 AndAlso ModalidadEdicion AndAlso DdlTipoComprobante.SelectedValue = "Rem" AndAlso e.Row.DataKey("CveVentaDetalle").ToString().ToEntero() > 0 Then
@@ -31522,6 +31525,10 @@ Partial Class Ventas
LnkDescuentosRNC.Visible = UsuarioActual.TienePermisoProceso(328)
End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" Then
GvPS.Columns(19).Visible = True
End If
UpPS.Update()
UPPDescuento.Update()
UPObservaciones.Update()
@@ -33635,12 +33642,85 @@ Partial Class Ventas
ObjVentas.Dispose()
ObjEventos.Dispose()
End Sub
#End Region
Private Sub BtnRefrescarPagina_Click(sender As Object, e As EventArgs) Handles BtnRefrescarPagina.Click
Response.Redirect($"~/Ventas/Ventas.aspx?CveVenta={Me.CveVenta}")
End Sub
#End Region
Private Sub BtnCargarPSAdicionales_Click(sender As Object, e As EventArgs) Handles BtnCargarPSAdicionales.Click
Dim CvePS = HdnCvePSComparar.Value.ToEntero()
If CvePS > 0 Then
Dim ObjProductosServicios As New ClsProductosServicios()
If ObjProductosServicios.GetPSAdicionales(CvePS, UsuarioActual.CveEmpresa) Then
GvPSAdicionales.DataSource = ObjProductosServicios.DtResultados.FiltraParametros($"Tipo={HdnTipoPSComparar.Value}")
End If
ObjProductosServicios.Dispose()
If HdnTipoPSComparar.Value = "1" Then
LtlNombreModalPS.Text = "Productos y/o servicios complementarios"
ElseIf HdnTipoPSComparar.Value = "2" Then
LtlNombreModalPS.Text = "Productos y/o servicios similares"
End If
GvPSAdicionales.DataBind()
UpSimilares.Update()
RegistraScript("$('#DivSimilares').modal({backdrop: 'static', keyboard: false });")
End If
End Sub
Private Sub BtnAgregarPSSimilar_Click(sender As Object, e As EventArgs) Handles BtnAgregarPSSimilar.Click
If HdnTipoPSComparar.Value.ToEntero() > 0 Then
If GvPSAdicionales.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("chkPSAdicional").Checked) <= 0 Then
Alert($"Debe seleccionar al menos 1 producto", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
'VALIDA
For Each Row As GridViewRow In GvPSAdicionales.Rows
If Row.RowType = DataControlRowType.DataRow Then
If Row.FCCheckBox("chkPSAdicional").Checked Then
If Row.FCTextBox("TxtCantidad").Text.ToDecimal() <= 0.00 Then
Alert($"La cantidad del producto y/o servicio {Row.DataKey("CodigoPS")} debe ser mayor a 0", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If
Next
'AGREGA
For Each Row As GridViewRow In GvPSAdicionales.Rows
If Row.RowType = DataControlRowType.DataRow Then
If Row.FCCheckBox("chkPSAdicional").Checked Then
Dim CvePS As Integer = Row.DataKey("CvePS").ToEntero()
HdnPS.Value = CvePS.ToString()
DdlPS.SelectedValue = CvePS.ToString()
DdlPS.SelectedText = Row.DataKey("CodigoPS")
TxtCantidad.Text = Row.FCTextBox("TxtCantidad").Text
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS IsNot Nothing Then
DdlUnidadMedida.SelectedValueExistInsert(DrPS("CveUnidadMedida").ToString(), DrPS("UnidadMedida").ToString())
DdlPSIndexChange(DdlPS.SelectedValue.ToEntero(), DdlPS)
AgregarPS()
End If
End If
End If
Next
End If
HdnTipoPSComparar.Value = "-1"
HdnCvePSComparar.Value = "-1"
End Sub
#Region "U S A D O S"