Correcion en aplicacion masiva de NC

This commit is contained in:
2021-08-23 12:39:43 -07:00
parent 1a835e29a6
commit 0e03f786e7
2 changed files with 144 additions and 50 deletions

View File

@@ -6437,6 +6437,9 @@
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="ChkAllCxC" CssClass="gvcxcAllChe" onclick="chkSeleccionarNC();" runat="server" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="ChkCxC" CssClass="gvcxcChe" runat="server" />
</ItemTemplate>
@@ -7654,6 +7657,12 @@
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
<script type="text/javascript">
//$('body').on('click', '.gvcxcAllChe input', function () { });
function chkSeleccionarNC() {
$(".gvcxcChe input").not(this).click();
}
//FUNCIONES PARA COMERCIO EXTERIOR
function CalculaTotalUSD(TotalUSD, ValorUnitario, TxtCantidad) {
TotalUSD.innerText = FormatoNumero(ToDouble(ValorUnitario.value) * ToDouble(TxtCantidad.value), 2);
@@ -8211,21 +8220,56 @@
Importe = Saldo;
}
Importe = Porcentaje * Importe / 100;
if (Chk.checked) {
TxtTotalGv.value = FormatoNumero(ToDouble(TxtTotalGv.value) + ImporteSinPorcentaje, 2);
TxtImporte.value = FormatoNumero(Importe, 2);
$get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) + Importe, 2);
} else {
TxtTotalGv.value = FormatoNumero(ToDouble(TxtTotalGv.value) - ImporteSinPorcentaje, 2);
$get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) - ToDouble(TxtImporte.value), 2);
TxtImporte.value = "";
}
if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
if (Chk.checked) {
//SI HAY RNC SELECCIONADAS
if (ToDouble($get('TxtImportesRemisionesNC').value) > 0) {
let ImporteRestante = ToDouble($get('TxtImportesRemisionesNC').value) - ToDouble($get('TxtNCImporte').value)
if (ImporteRestante < 0) {
ImporteRestante = 0;
}
if ((ToDouble(TxtTotalGv.value) + ImporteSinPorcentaje) > ImporteRestante) {
TxtTotalGv.value = FormatoNumero(ToDouble(TxtTotalGv.value) + ImporteRestante, 2);
}
if (Importe > ImporteRestante) {
TxtImporte.value = FormatoNumero(ImporteRestante, 2);
$get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) + ToDouble(TxtImporte.value), 2);
}else {
$get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) + Importe, 2);
}
if (ToDouble(TxtImporte.value) <= 0) {
Chk.checked = false;
}
}else {
TxtTotalGv.value = FormatoNumero(ToDouble(TxtTotalGv.value) + ImporteSinPorcentaje, 2);
TxtImporte.value = FormatoNumero(Importe, 2);
$get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) + Importe, 2);
}
} else {
TxtTotalGv.value = FormatoNumero(ToDouble(TxtTotalGv.value) - ImporteSinPorcentaje, 2);
$get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) - ToDouble(TxtImporte.value), 2);
TxtImporte.value = "";
}
CompararNC();
}else {
if (Chk.checked) {
TxtTotalGv.value = FormatoNumero(ToDouble(TxtTotalGv.value) + ImporteSinPorcentaje, 2);
TxtImporte.value = FormatoNumero(Importe, 2);
$get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) + Importe, 2);
} else {
TxtTotalGv.value = FormatoNumero(ToDouble(TxtTotalGv.value) - ImporteSinPorcentaje, 2);
$get('TxtNCImporte').value = FormatoNumero(ToDouble($get('TxtNCImporte').value) - ToDouble(TxtImporte.value), 2);
TxtImporte.value = "";
}
}
}
@@ -8270,6 +8314,18 @@
Entro = 1;
}
<%-- if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
let ImporteRestante = ToDouble($get('TxtImportesRemisionesNC').value) - ToDouble($get('TxtNCImporte').value)
if (ImporteRestante > 0) {
if (ImporteRestante < ImporteNuevo) {
ImporteNuevo = ImporteRestante;
}
Entro = 1;
}else {
ImporteNuevo = 0;
}
}--%>
if (ImporteNuevo > Saldo) {
ImporteNuevo = Saldo;
Entro = 1;