- permiso para editar precio de PU en la vinculación de la OC
proceso 242
This commit is contained in:
@@ -1783,6 +1783,7 @@
|
|||||||
<asp:TextBox ID="TxtPU" Text='<%# Eval("Importe", "{0:#,##0.00####}")%>' runat="server" Width="60px" CssClass="TextBoxAsLabel" />
|
<asp:TextBox ID="TxtPU" Text='<%# Eval("Importe", "{0:#,##0.00####}")%>' runat="server" Width="60px" CssClass="TextBoxAsLabel" />
|
||||||
<ajax:FilteredTextBoxExtender ID="FTETxtPU" runat="server" TargetControlID="TxtPU" FilterType="Custom, Numbers" ValidChars="." />
|
<ajax:FilteredTextBoxExtender ID="FTETxtPU" runat="server" TargetControlID="TxtPU" FilterType="Custom, Numbers" ValidChars="." />
|
||||||
<%--<asp:Label Text='<%# Eval("Importe", "{0:N2}")%>' runat="server" ID="LbPU" />--%>
|
<%--<asp:Label Text='<%# Eval("Importe", "{0:N2}")%>' runat="server" ID="LbPU" />--%>
|
||||||
|
<asp:RangeValidator ID="RValPU" runat="server" ErrorMessage="Rango no permitido" ForeColor="Red" ControlToValidate="TxtPU" ValidationGroup="GrpVincularOC" Type="Double"></asp:RangeValidator>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="Total" ItemStyle-Width="10%">
|
<asp:TemplateField HeaderText="Total" ItemStyle-Width="10%">
|
||||||
@@ -1945,8 +1946,8 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td width="100px"></td>
|
<td width="100px"></td>
|
||||||
<td width="70px" class="well" align="right" style="font-weight: bold;">
|
<td width="70px" class="well" >
|
||||||
<asp:Label Text="0.00" runat="server" ID="LbTotalOC1" />
|
<asp:TextBox Text="0.00" runat="server" ID="LbTotalOC1" Font-Bold="true" CssClass="textaslabel" Style="text-align:right;" />
|
||||||
</td>
|
</td>
|
||||||
<%-- --%>
|
<%-- --%>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -6674,7 +6675,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function CalculaTotalOCEdit(PS, CantidadOriginal, TxtCantidad, TxtPU, TxtTotal, IEPSOriginal, HdnIEPS, IVAOriginal, HdnIVA, RetIVAOriginal, HdnRetIVA, RetISROriginal, HdnRetISR, IEPSIVAOriginal, HdnIEPSIVA, DescuentoOriginal, HdnDescuento, IVAPorcentaje, RetIVAPorcentaje, RetISRPorcentaje, IEPSPSPorcentaje, IEPSPSIVAPorcentaje) {
|
function CalculaTotalOCEdit(PS, CantidadOriginal, PUOriginal, TxtCantidad, TxtPU, TxtTotal, IEPSOriginal, HdnIEPS, IVAOriginal, HdnIVA, RetIVAOriginal, HdnRetIVA, RetISROriginal, HdnRetISR, IEPSIVAOriginal, HdnIEPSIVA, DescuentoOriginal, HdnDescuento, IVAPorcentaje, RetIVAPorcentaje, RetISRPorcentaje, IEPSPSPorcentaje, IEPSPSIVAPorcentaje) {
|
||||||
//var Proporcional = ((ToDouble(TxtCantidad.value) * 100) / CantidadOriginal) / 100;
|
//var Proporcional = ((ToDouble(TxtCantidad.value) * 100) / CantidadOriginal) / 100;
|
||||||
|
|
||||||
|
|
||||||
@@ -6702,8 +6703,7 @@
|
|||||||
|
|
||||||
TxtTotal.value = FormatoNumero(Total - ToDouble(HdnDescuento.value), 2);
|
TxtTotal.value = FormatoNumero(Total - ToDouble(HdnDescuento.value), 2);
|
||||||
//RECALCULA IMPORTES GENERALES
|
//RECALCULA IMPORTES GENERALES
|
||||||
CalculaTotalesOC();
|
CalculaTotalesOC();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ValidaImporteCero(PS, TxtCantidad, TxtPU) {
|
function ValidaImporteCero(PS, TxtCantidad, TxtPU) {
|
||||||
@@ -6749,7 +6749,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Amortizacion = ToDouble($get('C_Tab_TabGenerales_LblAmortizacion').innerText);
|
//Amortizacion = ToDouble($get('C_Tab_TabGenerales_LblAmortizacion').innerText);
|
||||||
|
debugger;
|
||||||
SumaTotal = SumaSubTotal + SumaIVA + SumaIEPS - SumaRetIVA - SumaRetISR;
|
SumaTotal = SumaSubTotal + SumaIVA + SumaIEPS - SumaRetIVA - SumaRetISR;
|
||||||
|
|
||||||
if ($get("C_Tab_TabOC_LbSubTotalOC1")) {
|
if ($get("C_Tab_TabOC_LbSubTotalOC1")) {
|
||||||
@@ -6780,7 +6780,7 @@
|
|||||||
$get("C_Tab_TabOC_LblRetISROC1").innerText = FormatoNumero(SumaRetISR, 2);
|
$get("C_Tab_TabOC_LblRetISROC1").innerText = FormatoNumero(SumaRetISR, 2);
|
||||||
}
|
}
|
||||||
if ($get("C_Tab_TabOC_LbTotalOC1")) {
|
if ($get("C_Tab_TabOC_LbTotalOC1")) {
|
||||||
$get("C_Tab_TabOC_LbTotalOC1").innerText = FormatoNumero(SumaTotal, 2);
|
$get("C_Tab_TabOC_LbTotalOC1").value = FormatoNumero(SumaTotal, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ Imports MoreLinq
|
|||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports ClsPaginas
|
Imports ClsPaginas
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
Imports DocumentFormat.OpenXml.Math
|
|
||||||
|
|
||||||
Partial Class Compras_Compras
|
Partial Class Compras_Compras
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -283,6 +282,15 @@ Partial Class Compras_Compras
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property PermisoVinculacionImporteDiferente As Boolean
|
||||||
|
Get
|
||||||
|
Return CType(ViewState("PermisoVinculacionImporteDiferente"), Boolean)
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
ViewState("PermisoVinculacionImporteDiferente") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Private Property NuevaValidacionXML As Integer
|
Private Property NuevaValidacionXML As Integer
|
||||||
Get
|
Get
|
||||||
Return ViewState("NuevaValidacionXML").ToString.ToEntero
|
Return ViewState("NuevaValidacionXML").ToString.ToEntero
|
||||||
@@ -1260,6 +1268,7 @@ Partial Class Compras_Compras
|
|||||||
'ImgBtnBuscarOC.Attributes.Add("data-placement", "top")
|
'ImgBtnBuscarOC.Attributes.Add("data-placement", "top")
|
||||||
EsGrupoDiaz = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False)
|
EsGrupoDiaz = If(UsuarioActual.Empresa.Funcionalidad(382) = "1", True, False)
|
||||||
TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False)
|
TienePermisoKardex = If(UsuarioActual.TienePermisoPagina(224), True, False)
|
||||||
|
LbTotalOC1.Attributes.Add(“readonly”, “readonly”)
|
||||||
|
|
||||||
CargaDatosAgregarPS()
|
CargaDatosAgregarPS()
|
||||||
TieneAnticiposXML = False
|
TieneAnticiposXML = False
|
||||||
@@ -2090,6 +2099,10 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True
|
If TxtFolio.Text.Trim = "" Then TxtFolio.Enabled = True : TxtSerie.Enabled = True
|
||||||
|
|
||||||
|
If UsuarioActual.TienePermisoProceso(242) Then
|
||||||
|
PermisoVinculacionImporteDiferente = True
|
||||||
|
End If
|
||||||
|
|
||||||
If UsuarioActual.TienePermisoProceso(112) Then
|
If UsuarioActual.TienePermisoProceso(112) Then
|
||||||
PermisoEdicionManual = True
|
PermisoEdicionManual = True
|
||||||
TxtSubTotal.Enabled = True
|
TxtSubTotal.Enabled = True
|
||||||
@@ -15233,15 +15246,21 @@ Partial Class Compras_Compras
|
|||||||
Protected Sub GvOC1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOC1.RowDataBound
|
Protected Sub GvOC1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOC1.RowDataBound
|
||||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
|
||||||
Dim JSCambiaScript As String = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "").Replace(vbLf, " ").Replace(vbCrLf, " ")}', {e.Row.DBCampo("Cantidad").ToString.ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToString.ToDouble});"
|
Dim JSCambiaScript As String = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "").Replace(vbLf, " ").Replace(vbCrLf, " ")}', {e.Row.DBCampo("Cantidad").ToDouble},{e.Row.DBCampo("PU").ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToDouble});"
|
||||||
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"LimitaCantidadOC({e.Row.DBCampo("CantidadPendienteVincular")}, this);{JSCambiaScript}")
|
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"LimitaCantidadOC({e.Row.DBCampo("CantidadPendienteVincular")}, this);{JSCambiaScript}")
|
||||||
e.Row.FCTextBox("TxtPU").Attributes.Add("onkeyup", JSCambiaScript)
|
e.Row.FCTextBox("TxtPU").Attributes.Add("onkeyup", JSCambiaScript)
|
||||||
|
|
||||||
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onblur", $"ValidaImporteCero('{e.Row.DBCampo("PS").Replace("'", "")}',{e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID});")
|
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onblur", $"ValidaImporteCero('{e.Row.DBCampo("PS").Replace("'", "")}',{e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID});")
|
||||||
e.Row.FCTextBox("TxtPU").Attributes.Add("onblur", $"ValidaImporteCero('{e.Row.DBCampo("PS").Replace("'", "")}',{e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID});")
|
e.Row.FCTextBox("TxtPU").Attributes.Add("onblur", $"ValidaImporteCero('{e.Row.DBCampo("PS").Replace("'", "")}',{e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID});")
|
||||||
|
|
||||||
RegistraScript(JSCambiaScript)
|
RegistraScript(JSCambiaScript)
|
||||||
|
|
||||||
|
'activo el rangevalidator para cambios Proc.242
|
||||||
|
If Not PermisoVinculacionImporteDiferente Then
|
||||||
|
Dim tdif As Decimal = 10D ' solo 10 permitido a nivel total
|
||||||
|
e.Row.FCRangeValidator("RValPU").MinimumValue = ((e.Row.DBCampo("Total").ToDecimal - tdif) / e.Row.DBCampo("Cantidad").ToDecimal).ToString("N6")
|
||||||
|
e.Row.FCRangeValidator("RValPU").MaximumValue = ((e.Row.DBCampo("Total").ToDecimal + tdif) / e.Row.DBCampo("Cantidad").ToDecimal).ToString("N6")
|
||||||
|
End If
|
||||||
|
|
||||||
If e.Row.DataKey("FolioREQ").ToString.Trim.Length > 0 Then
|
If e.Row.DataKey("FolioREQ").ToString.Trim.Length > 0 Then
|
||||||
Dim LblOC As Label = e.Row.FCLabel("LblOC")
|
Dim LblOC As Label = e.Row.FCLabel("LblOC")
|
||||||
LblOC.Attributes.Add("data-toggle", "tooltip")
|
LblOC.Attributes.Add("data-toggle", "tooltip")
|
||||||
|
|||||||
Reference in New Issue
Block a user