BDH. marcas de usados, quitar restriccion de saldo en bonificaciones, verificar estatus en refacturacion
This commit is contained in:
@@ -1450,6 +1450,22 @@ Public Class ClsProductosServicios
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetMarcasUsados(CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Gral_MarcasUsadosGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el Catálogo de Marcas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Function AddMarcas(Marca As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
@@ -3635,15 +3635,17 @@
|
||||
<td id="Td3" runat="server">Próxima Rotación y Balanceo: </td>
|
||||
</tr>
|
||||
<tr align="left" id="trRotacionlbl" runat="server" visible="false">
|
||||
<td><asp:Label runat="server" id="LblRotacion" Text=""></asp:Label></td>
|
||||
<td>
|
||||
<asp:Label runat="server" ID="LblRotacion" Text=""></asp:Label></td>
|
||||
</tr>
|
||||
<tr align="left" id="trAlineacion" runat="server" visible="false">
|
||||
<td id="Td7" runat="server">Próxima Alineación: </td>
|
||||
</tr>
|
||||
<tr align="left" id="trAlineacionlbl" runat="server" visible="false">
|
||||
<td><asp:Label runat="server" id="LblAlineacion" Text=""></asp:Label></td>
|
||||
<td>
|
||||
<asp:Label runat="server" ID="LblAlineacion" Text=""></asp:Label></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
@@ -6627,7 +6629,7 @@
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:TextBox ID="TxtImporte" CssClass="myvalue" runat="server" Width="75px" />
|
||||
<asp:TextBox ID="TxtImporte" CssClass="myvalue ImportesRNCBon" runat="server" Width="75px" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
@@ -7030,7 +7032,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:RadioButtonList ID="RblRNCTipoDesc" runat="server" RepeatDirection="Horizontal" CssClass="input-group col-md-12" CellSpacing="100" AutoPostBack="true" OnSelectedIndexChanged="RblRNCTipoDesc_SelectedIndexChanged">
|
||||
<asp:ListItem Value="2" Class="one"><label><b>Bonificaciones</b></label></asp:ListItem>
|
||||
<%--<asp:ListItem Value="2" Class="one"><label><b>Bonificaciones</b></label></asp:ListItem>--%>
|
||||
<asp:ListItem Value="1" Class="one" Selected="True"><label><b>Cargos</b></label></asp:ListItem>
|
||||
<asp:ListItem Value="3" Class="one"><label><b>Ajuste/Garantía</b></label></asp:ListItem>
|
||||
</asp:RadioButtonList>
|
||||
@@ -7110,7 +7112,7 @@
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkAplicar" runat="server" />
|
||||
<asp:HiddenField ID="HdnPorcentajeIVA" ClientIDMode="Static" runat="server" Value='<%# Eval("PorcentajeIVA").ToString %>' />
|
||||
<asp:HiddenField ID="HdnPorcentajeIVA" ClientIDMode="Static" runat="server" Value='<%# Eval("PorcentajeIVA").ToString %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cantidad">
|
||||
@@ -7201,7 +7203,7 @@
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<%-- <div class="row">
|
||||
<div class="col-md-12">
|
||||
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
|
||||
<tr align="right">
|
||||
@@ -7213,13 +7215,11 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<asp:HiddenField ID="HdnSaldoMaximoUsados" runat="server" ClientIDMode="Static" Value="0" />
|
||||
<asp:HiddenField ID="HdnSMUBonDesc" runat="server" ClientIDMode="Static" Value="0" />
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="CancelarAplicarDescNC" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
@@ -7229,6 +7229,13 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UpHdnSaldos" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:HiddenField ID="HdnSaldoMaximoUsados" runat="server" ClientIDMode="Static" Value="0" />
|
||||
<asp:HiddenField ID="HdnSMUBon" runat="server" ClientIDMode="Static" Value="0" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<%-- MODAL SUCURSAL --%>
|
||||
<div id="divAgregarSucursal" class="modal fade" role="dialog">
|
||||
<div class="modal-dialog" style="max-height: 500px; max-width: 500px;">
|
||||
@@ -7577,6 +7584,100 @@
|
||||
}
|
||||
}
|
||||
|
||||
function CalculaSaldoRNCBonChkDesc(TxtImporte, Saldo, Chk) {
|
||||
if (Chk.checked) {
|
||||
TxtImporte.value = FormatoNumero(Saldo, 2);
|
||||
} else {
|
||||
TxtImporte.value = "";
|
||||
}
|
||||
//if (Chk.checked) {
|
||||
// let SaldoMaximoUtilizable = ToDouble(HdnSMUBonDesc.value)
|
||||
// let ImportesAsignados = 0;
|
||||
|
||||
// $('.ImportesRNCBon').each(function () {
|
||||
// if ($(this).context.id != TxtImporte.id) {
|
||||
// ImportesAsignados += ToDouble($(this).val());
|
||||
// }
|
||||
// });
|
||||
// let Importe = SaldoMaximoUtilizable - ImportesAsignados;
|
||||
|
||||
// if (Importe > 0) {
|
||||
// if (Saldo > Importe) {
|
||||
// TxtImporte.value = FormatoNumero(Importe, 2);
|
||||
// } else {
|
||||
// TxtImporte.value = FormatoNumero(Saldo, 2);
|
||||
// }
|
||||
// } else {
|
||||
// if (SaldoMaximoUtilizable > 0) {
|
||||
// TxtImporte.value = "";
|
||||
// Chk.checked = false;
|
||||
// } else {
|
||||
// TxtImporte.value = FormatoNumero(Saldo, 2);
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
//} else {
|
||||
// TxtImporte.value = "";
|
||||
//}
|
||||
}
|
||||
function LimitaSaldoRNCBonChkDesc(TxtImporte, Saldo) {
|
||||
//var Importe = 0;
|
||||
|
||||
//if (TxtImporte.value.includes('.')) {
|
||||
// return;
|
||||
//}
|
||||
//if (TxtImporte.value.includes(',')) {
|
||||
// return;
|
||||
//}
|
||||
|
||||
//var regex = new RegExp("^[-+]?[0-9]+\.[0-9]+$");
|
||||
|
||||
//if (regex.test(TxtImporte.value)) {
|
||||
// if (TxtImporte.value != '') {
|
||||
// Importe = parseFloat(TxtImporte.value);
|
||||
// }
|
||||
|
||||
// if (Importe > Saldo) {
|
||||
// TxtImporte.value = FormatoNumero(Saldo, 2);
|
||||
// } else {
|
||||
// TxtImporte.value = FormatoNumero(Importe, 2);;
|
||||
// }
|
||||
//}
|
||||
|
||||
var Importe = 0;
|
||||
|
||||
if (TxtImporte.value.includes('.')) {
|
||||
return;
|
||||
}
|
||||
if (TxtImporte.value.includes(',')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var regex = new RegExp("^[-+]?[0-9]+\.[0-9]+$");
|
||||
|
||||
if (regex.test(TxtImporte.value)) {
|
||||
if (TxtImporte.value != '') {
|
||||
Importe = parseFloat(TxtImporte.value);
|
||||
}
|
||||
|
||||
let SaldoMaximoUtilizable = parseFloat(Saldo)
|
||||
//let ImportesAsignados = 0;
|
||||
//$('.ImportesRNCBon').each(function () {
|
||||
// if ($(this).context.id != TxtImporte.id) {
|
||||
// ImportesAsignados += ToDouble($(this).val());
|
||||
// }
|
||||
//});
|
||||
let ImporteDiferencia = SaldoMaximoUtilizable; //- ImportesAsignados;
|
||||
|
||||
if (Importe > ImporteDiferencia) {
|
||||
TxtImporte.value = FormatoNumero(ImporteDiferencia, 2);
|
||||
} else {
|
||||
TxtImporte.value = FormatoNumero(Importe, 2);;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CalculaSaldoRNCBonChk(TxtImporte, Saldo, Chk) {
|
||||
//if (Chk.checked) {
|
||||
// TxtImporte.value = FormatoNumero(Saldo, 2);
|
||||
@@ -7584,7 +7685,7 @@
|
||||
// TxtImporte.value = "";
|
||||
//}
|
||||
if (Chk.checked) {
|
||||
let SaldoMaximoUtilizable = ToDouble(HdnSMUBonDesc.value)
|
||||
let SaldoMaximoUtilizable = ToDouble(HdnSMUBon.value)
|
||||
let ImportesAsignados = 0;
|
||||
|
||||
$('.ImportesRNCBon').each(function () {
|
||||
@@ -7654,7 +7755,7 @@
|
||||
Importe = parseFloat(TxtImporte.value);
|
||||
}
|
||||
|
||||
let SaldoMaximoUtilizable = parseFloat(HdnSMUBonDesc.value)
|
||||
let SaldoMaximoUtilizable = parseFloat(HdnSMUBon.value)
|
||||
let ImportesAsignados = 0;
|
||||
$('.ImportesRNCBon').each(function () {
|
||||
if ($(this).context.id != TxtImporte.id) {
|
||||
@@ -8806,31 +8907,31 @@
|
||||
|
||||
function CerrarModalRemNC() {
|
||||
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
|
||||
AplicarValidarRNC(true);
|
||||
CompararNC();
|
||||
AplicarValidarRNC(true);
|
||||
CompararNC();
|
||||
}
|
||||
$('#ModalAplicarRemisionesNC').modal('hide');
|
||||
}
|
||||
$('#ModalAplicarRemisionesNC').modal('hide');
|
||||
}
|
||||
|
||||
var verficaRNC = function () {
|
||||
var total = 0;
|
||||
if ('<%= UsuarioActual.CveEmpresa %>' == '140') {
|
||||
$(".ChkAplicaRNC > input").each(function () {
|
||||
if (this.checked) {
|
||||
total = total + 1;
|
||||
}
|
||||
if (total == 2) {
|
||||
alert("No se puede seleccionar mas de una remisión de nota de crédito.");
|
||||
this.checked = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var verficaRNC = function () {
|
||||
var total = 0;
|
||||
if ('<%= UsuarioActual.CveEmpresa %>' == '140') {
|
||||
$(".ChkAplicaRNC > input").each(function () {
|
||||
if (this.checked) {
|
||||
total = total + 1;
|
||||
}
|
||||
if (total == 2) {
|
||||
alert("No se puede seleccionar mas de una remisión de nota de crédito.");
|
||||
this.checked = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function showDivAgregarSucursal() {
|
||||
function showDivAgregarSucursal() {
|
||||
|
||||
$('#<%= TxtNombreSucursal.ClientID %>').val('');
|
||||
$('#<%= TxtNombreSucursal.ClientID %>').val('');
|
||||
$('#<%= TxtDireccionSucursal.ClientID %>').val('');
|
||||
$('#<%= TxtNumExtSucursal.ClientID %>').val('');
|
||||
$('#<%= TxtNumIntSucursal.ClientID %>').val('');
|
||||
|
||||
@@ -5464,6 +5464,12 @@ Partial Class Ventas
|
||||
TrVistaPrevia.Visible = EstatusCliente
|
||||
End If
|
||||
|
||||
If ViewState("CveDevolucion") IsNot Nothing AndAlso ViewState("NuevaFactura") IsNot Nothing Then
|
||||
If (CveDevolucion > 0 AndAlso NuevaFactura = 1) Then
|
||||
BtnEmitirImprimir.Visible = EstatusCliente
|
||||
TrVistaPrevia.Visible = EstatusCliente
|
||||
End If
|
||||
End If
|
||||
|
||||
'CUANDO SEA COTIZACION Y SEA COMPUPROVEEDORES (EMPRESA 72) NO DEBE ENVIAR CORREO AL CLIENTE
|
||||
If UsuarioActual.CveEmpresa = 72 AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
@@ -12840,6 +12846,40 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjFactura.RetIVA <> 0 AndAlso ObjFactura.CveTipoRetencion = 4 Then
|
||||
Dim PorcentajeImpuestoPago As Decimal = TmpDT.MAX("PorcentajeRetIVA").ToDecimal
|
||||
Dim IdCtaContableRetIVA = 0
|
||||
'RETIVA X TRASLADAR
|
||||
'OBTENER CUENTAS
|
||||
|
||||
If ObjConta.GetRetCuenta(313, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
'Conta ContPAQ
|
||||
IdCtaContableRetIVA = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
Else
|
||||
IdCtaContableRetIVA = 0
|
||||
End If
|
||||
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 313, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, Not TipoMovimiento, (importeMovimiento * ObjFactura.RetIVA) / ObjFactura.Total, Referencia, 313, Concepto, Fecha, IdCtaContableRetIVA, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.RetIVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'RETIVA PAGADO
|
||||
If ObjConta.GetRetCuenta(314, UsuarioActual.CveEmpresa) AndAlso ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
'Conta ContPAQ
|
||||
IdCtaContableRetIVA = ObjConta.DtResultados.Rows(0)("IdCtaContable").ToString.ToEntero
|
||||
Else
|
||||
IdCtaContableRetIVA = 0
|
||||
End If
|
||||
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, 314, NombreCliente, $"{ObjFactura.Serie}-{ObjFactura.Folio}", FolioIE.ToString())
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, (importeMovimiento * ObjFactura.RetIVA) / ObjFactura.Total, Referencia, 314, Concepto, Fecha, IdCtaContableRetIVA, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=CveCliente, CveIE:=CveIEPago, ImporteMX:=((importeMovimiento * ObjFactura.RetIVA) / ObjFactura.Total) * tipoCambio * Multiplicador, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, PorcentajeImpuesto:=PorcentajeImpuestoPago) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
ErrorPrepoliza = True
|
||||
@@ -16924,7 +16964,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
|
||||
TotalCalculableImpuestos = ((Cantidad * (PU)) - Descuento).RoundSQL
|
||||
TotalCalculableImpuestos = ((Cantidad * (PU)) - Descuento)
|
||||
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + DrPS("IEPSPorcentaje").ToString().ToDecimal)
|
||||
|
||||
Row("PU") = PU
|
||||
@@ -16994,7 +17034,7 @@ Partial Class Ventas
|
||||
Row("Descuento") = (Descuento).RoundSQL(NumeroDecimales)
|
||||
Row("TipoDescuento") = HdnTipoDescuento.Value
|
||||
Row("CvePromocionDetalle") = CvePromocionDetalle
|
||||
Row("Total") = (Cantidad * PU).RoundSQL(NumeroDecimales)
|
||||
Row("Total") = (Cantidad * PU)
|
||||
Row("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales)
|
||||
|
||||
'Row("AsientoContableVentas") = DrPS("AsientoContableVentas")
|
||||
@@ -17121,7 +17161,7 @@ Partial Class Ventas
|
||||
End If
|
||||
PU = PU.RoundSQL(6)
|
||||
DrPoliza("PU") = PU
|
||||
TotalCalculableImpuestos = (DrPoliza("Cantidad").ToString().ToDecimal * (PU)).RoundSQL
|
||||
TotalCalculableImpuestos = (DrPoliza("Cantidad").ToString().ToDecimal * (PU))
|
||||
|
||||
If DrPSAdicional("IVA").ToString().Contiene("-1", "") Then
|
||||
DrPoliza("PorcentajeIVA") = PorcentajeIVA
|
||||
@@ -17139,7 +17179,7 @@ Partial Class Ventas
|
||||
DrPoliza("IEPS") = DrPoliza("ImporteIEPS")
|
||||
DrPoliza("Descuento") = 0 ' Descuento
|
||||
DrPoliza("TipoDescuento") = HdnTipoDescuento.Value
|
||||
DrPoliza("Total") = (DrPoliza("Cantidad").ToString().ToDecimal * PU).RoundSQL(NumeroDecimales)
|
||||
DrPoliza("Total") = (DrPoliza("Cantidad").ToString().ToDecimal * PU)
|
||||
DrPoliza("TotalImporte") = (DrPoliza("Cantidad").ToString().ToDecimal * PU).RoundSQL(NumeroDecimales)
|
||||
DrPoliza("SATClaveProdServ") = DrPSAdicional("SATClavePS")
|
||||
DrPoliza("SATClaveUM") = DrPSAdicional("SATClaveUnidadMedida")
|
||||
@@ -25170,7 +25210,10 @@ Partial Class Ventas
|
||||
GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
|
||||
GvRemisionesNCBon.DataBind()
|
||||
|
||||
LtlSMUBon.Text = String.Format("{0:N2}", Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal())
|
||||
Dim SMUBon As Decimal = Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal()
|
||||
|
||||
LtlSMUBon.Text = String.Format("{0:N2}", SMUBon)
|
||||
HdnSMUBon.Value = SMUBon.ToString()
|
||||
|
||||
UpModalRemisionesNC.Update()
|
||||
End Sub
|
||||
@@ -25302,26 +25345,26 @@ Partial Class Ventas
|
||||
GvDescNCBonificaciones.DataBind()
|
||||
|
||||
'SI ES CREDITO
|
||||
If RBLPago.SelectedValue = "1" Then
|
||||
Dim ImporteUsados As Decimal = Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal()
|
||||
HdnSMUBonDesc.Value = ImporteUsados.ToString()
|
||||
LblSaldoMaximoBonificacion.Text = String.Format("{0:N2}", ImporteUsados)
|
||||
'SI ES CONTADO
|
||||
ElseIf RBLPago.SelectedValue = "2" Then
|
||||
Dim ImporteUsados As Decimal = 0
|
||||
'If RBLPago.SelectedValue = "1" Then
|
||||
' Dim ImporteUsados As Decimal = Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal()
|
||||
' HdnSMUBonDesc.Value = ImporteUsados.ToString()
|
||||
' LblSaldoMaximoBonificacion.Text = String.Format("{0:N2}", ImporteUsados)
|
||||
' 'SI ES CONTADO
|
||||
'ElseIf RBLPago.SelectedValue = "2" Then
|
||||
' Dim ImporteUsados As Decimal = 0
|
||||
|
||||
For Each Row As DataRow In Me.TmpDT.FiltraParametros("EsCargo = True").Rows
|
||||
Dim PUBonificacion As Decimal = GlobalDTAcumTamaños().FiltroPrimeroValor("Bonificacion", $"CvePSCargo={Row("CvePS")}").ToDecimal()
|
||||
' For Each Row As DataRow In Me.TmpDT.FiltraParametros("EsCargo = True").Rows
|
||||
' Dim PUBonificacion As Decimal = GlobalDTAcumTamaños().FiltroPrimeroValor("Bonificacion", $"CvePSCargo={Row("CvePS")}").ToDecimal()
|
||||
|
||||
Dim TotalBonificacion As Decimal = (Row("Cantidad").ToString().ToDecimal() * PUBonificacion)
|
||||
Dim IVABonificacion As Decimal = (TotalBonificacion * Row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
|
||||
' Dim TotalBonificacion As Decimal = (Row("Cantidad").ToString().ToDecimal() * PUBonificacion)
|
||||
' Dim IVABonificacion As Decimal = (TotalBonificacion * Row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL(2)
|
||||
|
||||
ImporteUsados += TotalBonificacion + IVABonificacion
|
||||
Next
|
||||
HdnSMUBonDesc.Value = ImporteUsados.ToString()
|
||||
LblSaldoMaximoBonificacion.Text = String.Format("{0:N2}", ImporteUsados)
|
||||
' ImporteUsados += TotalBonificacion + IVABonificacion
|
||||
' Next
|
||||
' HdnSMUBonDesc.Value = ImporteUsados.ToString()
|
||||
' LblSaldoMaximoBonificacion.Text = String.Format("{0:N2}", ImporteUsados)
|
||||
|
||||
End If
|
||||
'End If
|
||||
|
||||
UpDescNC.Update()
|
||||
End Sub
|
||||
@@ -25351,8 +25394,8 @@ Partial Class Ventas
|
||||
|
||||
Protected Sub GvDescNCBonificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDescNCBonificaciones.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
|
||||
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});")
|
||||
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChkDesc({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
|
||||
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCBonChkDesc({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -29909,15 +29952,15 @@ Partial Class Ventas
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim LimiteBonficaciones As Decimal = LblSaldoMaximoBonificacion.Text.Trim().ToDecimal()
|
||||
'Dim LimiteBonficaciones As Decimal = LblSaldoMaximoBonificacion.Text.Trim().ToDecimal()
|
||||
|
||||
'VERIFICA EL LIMITE DE LOS USADOS
|
||||
If ListaNCBonificacion.Sum(Function(x) x.TotalRemNCAplicado) > LimiteBonficaciones Then
|
||||
Alert($"La suma de las remisiones de nota de crédito de tipo 'Bonificación' no debe superar el limite.<br/>Total RNC: {ListaNCBonificacion.Sum(Function(x) x.TotalRemNCAplicado):N2}.<br/>Total Usados: {LimiteUsados:N2}", TipoMensaje.MsgAdvertencia)
|
||||
ListaNCDesc.Clear()
|
||||
ListaNCBonificacion.Clear()
|
||||
Exit Sub
|
||||
End If
|
||||
''VERIFICA EL LIMITE DE LOS USADOS
|
||||
'If ListaNCBonificacion.Sum(Function(x) x.TotalRemNCAplicado) > LimiteBonficaciones Then
|
||||
' Alert($"La suma de las remisiones de nota de crédito de tipo 'Bonificación' no debe superar el limite.<br/>Total RNC: {ListaNCBonificacion.Sum(Function(x) x.TotalRemNCAplicado):N2}.<br/>Total Usados: {LimiteUsados:N2}", TipoMensaje.MsgAdvertencia)
|
||||
' ListaNCDesc.Clear()
|
||||
' ListaNCBonificacion.Clear()
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
ElseIf RblRNCTipoDesc.SelectedValue.Contiene("2") Then
|
||||
|
||||
@@ -29940,15 +29983,15 @@ Partial Class Ventas
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim LimiteBonficaciones As Decimal = LblSaldoMaximoBonificacion.Text.Trim().ToDecimal()
|
||||
'Dim LimiteBonficaciones As Decimal = LblSaldoMaximoBonificacion.Text.Trim().ToDecimal()
|
||||
|
||||
'VERIFICA EL LIMITE DE LOS USADOS
|
||||
If ListaNCBonificacion.Sum(Function(x) x.TotalRemNCAplicado) > LimiteBonficaciones Then
|
||||
Alert($"La suma de las remisiones de nota de crédito de tipo 'Bonificación' no debe superar el limite.<br/>Total RNC: {ListaNCBonificacion.Sum(Function(x) x.TotalRemNCAplicado):N2}.<br/>Total Usados: {LimiteUsados:N2}", TipoMensaje.MsgAdvertencia)
|
||||
ListaNCDesc.Clear()
|
||||
ListaNCBonificacion.Clear()
|
||||
Exit Sub
|
||||
End If
|
||||
''VERIFICA EL LIMITE DE LOS USADOS
|
||||
'If ListaNCBonificacion.Sum(Function(x) x.TotalRemNCAplicado) > LimiteBonficaciones Then
|
||||
' Alert($"La suma de las remisiones de nota de crédito de tipo 'Bonificación' no debe superar el limite.<br/>Total RNC: {ListaNCBonificacion.Sum(Function(x) x.TotalRemNCAplicado):N2}.<br/>Total Usados: {LimiteUsados:N2}", TipoMensaje.MsgAdvertencia)
|
||||
' ListaNCDesc.Clear()
|
||||
' ListaNCBonificacion.Clear()
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
'SI SON SOLO BONIFICACIONES GENERA LA NC PRINCIPAL EN BASE A ESAS
|
||||
If RblRNCTipoDesc.SelectedValue.ToString() = "2" AndAlso ListaNCDesc.Count = 0 Then
|
||||
@@ -29965,6 +30008,13 @@ Partial Class Ventas
|
||||
TotalProntoPago = TmpDT.SUM("ImporteProntoPago").ToDecimal
|
||||
End If
|
||||
|
||||
If TotalRemNCAplicado > TxtTotal.Text.ToDecimal() Then
|
||||
Alert($"La suma de las remisiones de nota de crédito no debe superar el total de la factura.<br/>Total RNC: {TotalRemNCAplicado:N2}.<br/>Total Factura: {TxtTotal.Text.ToDecimal():N2}", TipoMensaje.MsgAdvertencia)
|
||||
ListaNCDesc.Clear()
|
||||
ListaNCBonificacion.Clear()
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
HdnTotalRNC.Value = TotalRemNCAplicado.ToString()
|
||||
LblDescuentosRNC.Text = TotalRemNCAplicado.FormatoNumero
|
||||
LblTotalAPagar.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado - TotalProntoPago).FormatoNumero
|
||||
|
||||
Reference in New Issue
Block a user