-- candado de NC E140
This commit is contained in:
@@ -6427,17 +6427,20 @@
|
|||||||
<asp:RequiredFieldValidator ID="RFVNCPS" runat="server" InitialValue="-1" ControlToValidate="DdlNCPS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalAplicarNC"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVNCPS" runat="server" InitialValue="-1" ControlToValidate="DdlNCPS" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Concepto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalAplicarNC"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCENCPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPS" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCENCPS" runat="server" HighlightCssClass="vco" TargetControlID="RFVNCPS" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-3">
|
||||||
<asp:Label ID="LblNCSaldoAnticipo" runat="server" Text=""></asp:Label>
|
<asp:Label ID="LblNCSaldoAnticipo" runat="server" Text=""></asp:Label>
|
||||||
<asp:CheckBox ID="ChkAplicaNCAnticipo" runat="server" Text="Aplicar a Anticipo" Visible="false" />
|
<asp:CheckBox ID="ChkAplicaNCAnticipo" runat="server" Text="Aplicar a Anticipo" Visible="false" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-3" id="DivBtnRemNC" runat="server" visible="false" >
|
||||||
|
<asp:Button ID="BtnModalAplicarRemisionesNC" Text="Aplicar Remisiones" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row form-group">
|
<div class="row form-group">
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
Observaciones:
|
Observaciones:
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<asp:TextBox ID="TxtNCObservaciones" Text="" Rows="3" TextMode="MultiLine" CssClass="Widthall form-control input-sm" runat="server" />
|
<asp:TextBox ID="TxtNCObservaciones" Text="" Rows="2" TextMode="MultiLine" CssClass="Widthall form-control input-sm" runat="server" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row form-group">
|
<div class="row form-group">
|
||||||
@@ -6488,22 +6491,12 @@
|
|||||||
<asp:RangeValidator ID="RVNCPorcentaje" runat="server" Type="Double" MinimumValue="0.01" MaximumValue="100.00" ErrorMessage="El campo <b>''Porcentaje''</b> debe estar entre 1 y el porcentaje máximo de la factura(Saldo)." ControlToValidate="TxtNCPorcentaje" Display="None" ValidationGroup="GrpModalAplicarNC"></asp:RangeValidator>
|
<asp:RangeValidator ID="RVNCPorcentaje" runat="server" Type="Double" MinimumValue="0.01" MaximumValue="100.00" ErrorMessage="El campo <b>''Porcentaje''</b> debe estar entre 1 y el porcentaje máximo de la factura(Saldo)." ControlToValidate="TxtNCPorcentaje" Display="None" ValidationGroup="GrpModalAplicarNC"></asp:RangeValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCENCPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RVNCPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCENCPorcentaje" runat="server" HighlightCssClass="vco" TargetControlID="RVNCPorcentaje" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="DivBtnRemNC" runat="server" visible="false" class="row form-group">
|
<div class="row" style="margin-right: 10px; margin-top: 5px;" align="right">
|
||||||
<div class="col-md-2">
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
<asp:Button ID="BtnModalAplicarRemisionesNC" Text="Aplicar Remisiones" runat="server" OnClick="BtnModalAplicarRemisionesNC_Click" class="btn btn-primary" />
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
|
|
||||||
<input type="text" id="TxtBusqueda10" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
<input type="text" id="TxtBusqueda10" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda10','{0}')", GvCxC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" id="DivGvCxC" style="max-height: 10px" runat="server" visible="false">
|
<div class="row" id="DivGvCxC" style="max-height: 5px" runat="server" visible="false">
|
||||||
<br />
|
|
||||||
<div class="col-md-12" style="height: 440px; overflow: auto">
|
<div class="col-md-12" style="height: 440px; overflow: auto">
|
||||||
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvCxC_RowDataBound"
|
<asp:GridView ID="GvCxC" runat="server" AutoGenerateColumns="False" OnRowDataBound="GvCxC_RowDataBound"
|
||||||
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
|
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
|
||||||
|
|||||||
@@ -6595,7 +6595,7 @@ Partial Class Ventas
|
|||||||
'RMF. validacion temporal
|
'RMF. validacion temporal
|
||||||
'verifica si tiene autorizaciones de Nota de crédito autorizadas
|
'verifica si tiene autorizaciones de Nota de crédito autorizadas
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, CveEstatus:=1) Then
|
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, "Ing", CveEstatus:=1) Then
|
||||||
Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL AND CveTipoDocumento='Egs'", Orderby:="TipoAutorizacion")
|
Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL AND CveTipoDocumento='Egs'", Orderby:="TipoAutorizacion")
|
||||||
If RowAutorizacion IsNot Nothing Then
|
If RowAutorizacion IsNot Nothing Then
|
||||||
DdlTipoComprobante.SelectedValueExistInsert("Egs", "Egresos")
|
DdlTipoComprobante.SelectedValueExistInsert("Egs", "Egresos")
|
||||||
@@ -7938,7 +7938,7 @@ Partial Class Ventas
|
|||||||
Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero()
|
Dim CveVendedor As Integer = DdlVendedor.SelectedValue.ToEntero()
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
Try
|
Try
|
||||||
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, CveEstatus:=1) Then
|
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, CveVendedor, DdlTipoDocto.SelectedValue, CveEstatus:=1) Then
|
||||||
Dim RowAutorizacion As DataRow = Nothing
|
Dim RowAutorizacion As DataRow = Nothing
|
||||||
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
'SI TIENE DIAS VENCIDOS BUSCAR POR TIPO VENCIMIENTO
|
||||||
If TieneDiasVencidos Then
|
If TieneDiasVencidos Then
|
||||||
@@ -26920,15 +26920,48 @@ Partial Class Ventas
|
|||||||
Protected Sub BtnAplicarNC_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnAplicarNC_Click(sender As Object, e As EventArgs)
|
||||||
'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
|
'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
|
||||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||||
If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
|
|
||||||
If ClienteEsDistribuidor AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then
|
Dim Verificacion As Boolean = False
|
||||||
Alert("No se puede generar una nota de crédito para devolución de efectivo si el cliente es distribuidor.", TipoMensaje.MsgAdvertencia)
|
|
||||||
|
If ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0 Then ' si hay opciones seleccionadas, se activa el generar las NCs
|
||||||
|
Verificacion = True
|
||||||
|
Else
|
||||||
|
If UsuarioActual.TienePermisoProceso(175) Then ' si es una nc, que se va a generar directa, el permiso de generar NC directas
|
||||||
|
Verificacion = True
|
||||||
Else
|
Else
|
||||||
Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:=" Si ", TextoCancelacion:=" No ")
|
'verificar autorizaciones
|
||||||
|
Dim ObjVentas As New ClsVentas
|
||||||
|
If ObjVentas.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, -1, "Egs", CveEstatus:=1) Then
|
||||||
|
Dim RowAutorizacion As DataRow = ObjVentas.DtResultados.FiltroPrimero($"CveVenta IS NULL ", Orderby:="TipoAutorizacion")
|
||||||
|
If RowAutorizacion IsNot Nothing Then
|
||||||
|
Verificacion = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
ObjVentas.Dispose()
|
||||||
|
' si es una nc, que se va a generar directa, debe de revisar que tenga una autorización, o el permiso de generar NC directas
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
|
||||||
|
If Verificacion Then
|
||||||
|
If ClienteEsDistribuidor AndAlso TxtImportesRemisionesNC.Text.ToDecimal() > 0 Then
|
||||||
|
Alert("No se puede generar una nota de crédito para devolución de efectivo si el cliente es distribuidor.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Else
|
||||||
|
Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:=" Si ", TextoCancelacion:=" No ")
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
Alert("No se puede Generar notas de crédito directas", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
AplicarNotaCreditoDesdeVenta()
|
' si viene de remisiones, puede seguir adelante
|
||||||
|
If Verificacion Then
|
||||||
|
AplicarNotaCreditoDesdeVenta()
|
||||||
|
Else
|
||||||
|
Alert("No se puede Generar notas de crédito directas", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
AplicarNotaCreditoDesdeVenta()
|
AplicarNotaCreditoDesdeVenta()
|
||||||
@@ -31524,6 +31557,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
ListaRemisionesNC.Add(RemNC)
|
ListaRemisionesNC.Add(RemNC)
|
||||||
|
BtnAplicarNC.Enabled = True
|
||||||
|
|
||||||
If TerminarCiclo Then
|
If TerminarCiclo Then
|
||||||
Exit For
|
Exit For
|
||||||
@@ -31567,6 +31601,10 @@ Partial Class Ventas
|
|||||||
TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero
|
TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero
|
||||||
'TxtNCImporte.Text = TotalRemNCAplicado.FormatoNumero
|
'TxtNCImporte.Text = TotalRemNCAplicado.FormatoNumero
|
||||||
|
|
||||||
|
If ListaRemisionesNC.Count > 0 Then ' si hay opciones seleccionadas, se activa el generar las NCs
|
||||||
|
BtnAplicarNC.Enabled = True
|
||||||
|
End If
|
||||||
|
|
||||||
UpModalRemisionesNC.Update()
|
UpModalRemisionesNC.Update()
|
||||||
UpAplicarNC.Update()
|
UpAplicarNC.Update()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user