From 5a5a1158355bb80c2b00dc9fb1b74b885acac8e6 Mon Sep 17 00:00:00 2001 From: Yusuf Date: Wed, 27 Jul 2022 04:15:34 +0700 Subject: [PATCH] implement decimal on actual --- src/function/reportActivity.js | 17 +- src/index.html | 361 +-------------------------------- 2 files changed, 19 insertions(+), 359 deletions(-) diff --git a/src/function/reportActivity.js b/src/function/reportActivity.js index 15fa789..f070fc4 100644 --- a/src/function/reportActivity.js +++ b/src/function/reportActivity.js @@ -12,7 +12,6 @@ function resetFormAddRa() { $('#form_report_activity').trigger("reset"); $('#btn_add_ra').html('Add'); $('#btn_add_ra').prop("disabled", false); - } function resetFormAddRaMaterial() { @@ -20,9 +19,13 @@ function resetFormAddRaMaterial() { $('#form_report_activity_material').trigger("reset"); $('#btn_add_ra_material').html('Add'); $('#btn_add_ra_material').prop("disabled", false); - } +var qty = document.getElementById('volume_pekerjaan_material'); + qty.addEventListener('keyup', function (e) { + qty.value = formatRibuanInput(this.value); + }); + $(document).ready(function () { $("#table_report tbody").on("click", ".btn-update-status", function () { @@ -84,7 +87,7 @@ $(document).ready(function () { { data: 'material_name', name: 'material_name' }, { data: 'qty_planning', render: function (data, type) { - return data ? formatRupiah(parseInt(data)) : '-' + return data ? formatRupiah(data) : '-' } }, { @@ -145,7 +148,11 @@ $(document).ready(function () { return data ? formatDate(data) : '-' } }, - { data: 'qty', name: 'qty' }, + { + data: 'qty', render: function (data, type) { + return data ? formatRupiah(data) : '-' + } + }, { data: 'description', name: 'description' }, { data: 'action', @@ -423,6 +430,8 @@ $(document).ready(function () { } async function submitRaMaterial(formData) { + let qty_actual = $("#volume_pekerjaan_material").val(); + formData.set('qty', qty_actual); const result = await axiosInstance .post(`${base_url}report-activity-material/add`, formData) .then(res => res) diff --git a/src/index.html b/src/index.html index 61218fc..c273d85 100644 --- a/src/index.html +++ b/src/index.html @@ -181,56 +181,6 @@ - - - - @@ -339,7 +284,7 @@