Merge branch 'fix/margenes-maquinas-format' into 'main'

fix decimals number

See merge request jjimenez/safekat!544
This commit is contained in:
Alvaro
2025-02-18 08:27:53 +00:00
2 changed files with 14 additions and 1 deletions

View File

@ -543,7 +543,7 @@
return '<?= lang('MaquinasTarifasImpresions.colorhq') ?>';
}
},
{ 'data': 'precio',render : (d) => `<span class="autonumeric">${d}</span>` },
{ 'data': 'precio',render : (d) => `<span class="autonumeric-decimal" data-decimal-places="6">${d}</span>` },
{ 'data': 'margen',render : (d) => `<span class="autonumeric">${d}</span>` },
{
data: actionBtns,

View File

@ -26,6 +26,19 @@ export const initAutonumeric = () => {
});
}
})
$("span.autonumeric-decimal").each(function () {
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
if (!autoNumericInstance) {
new AutoNumeric(this, {
digitGroupSeparator: ".",
decimalCharacter: ",",
allowDecimalPadding : 'floats',
decimalPlaces: $(this).data('decimal-places'),
unformatOnSubmit: true,
});
}
})
// $(':input[type="number"]').each(function(){
// $(this).attr('type','text')
// let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)