Browse Source

format number

pull/1/head
Yusuf 2 years ago
parent
commit
20aa5d3515
  1. 51
      src/function/reportActivity.js

51
src/function/reportActivity.js

@ -16,9 +16,6 @@ function resetFormAddRa() {
} }
function resetFormAddRaMaterial() { function resetFormAddRaMaterial() {
// $("#show_form_ra_material").show();
// $("#hide_form_ra_material").hide();
// $("#form_report_activity_material").hide();
$("#id_ra_material").val(""); $("#id_ra_material").val("");
$('#form_report_activity_material').trigger("reset"); $('#form_report_activity_material').trigger("reset");
$('#btn_add_ra_material').html('Add'); $('#btn_add_ra_material').html('Add');
@ -53,7 +50,6 @@ $(document).ready(function () {
$("#btn-cancel-status").on("click", function () { $("#btn-cancel-status").on("click", function () {
resetFormAddRa() resetFormAddRa()
// $(".text-update-status").hide()
}); });
$("#ra_select_status").on("change", function () { $("#ra_select_status").on("change", function () {
let val = $(this).val() let val = $(this).val()
@ -63,7 +59,6 @@ $(document).ready(function () {
} else { } else {
$('#ra_date_end_activity').prop('disabled', true); $('#ra_date_end_activity').prop('disabled', true);
} }
// $(".text-update-status").hide()
}); });
$("#ra_date_end_activity").on("change", function () { $("#ra_date_end_activity").on("change", function () {
@ -71,38 +66,11 @@ $(document).ready(function () {
let valStart = $('#ra_date_start_activity').val() let valStart = $('#ra_date_start_activity').val()
const compDate = moment(valEnd).isBefore(moment(valStart)) const compDate = moment(valEnd).isBefore(moment(valStart))
console.log({ valEnd, valStart, compDate })
if (compDate) { if (compDate) {
gantt.alert("End Activity Date cannot be lower than Start Activity Date"); gantt.alert("End Activity Date cannot be lower than Start Activity Date");
} }
// $(".text-update-status").hide()
}); });
// $("#modal_report_activity_materi al").show()
// var tableRa = $("#table_report").DataTable({
// "processing": true,
// "serverSide": true,
// "ajax": {
// "url": `${base_url}assign-material/datatables`,
// "data": function ( d ) {
// d.idact = activityId;
// }
// },
// "columns": [
// {data: 'user_name', name: 'user_name'},
// {data: 'report_date', name: 'report_date'},
// {data: 'job_count_report', name: 'job_count_report'},
// {data: 'description', name: 'description'},
// {
// data: 'action',
// name: 'action',
// orderable: true,
// searchable: true
// },
// ]
// });
// for table material, flow material resource as report activity
var tableRa = $("#table_report").DataTable({ var tableRa = $("#table_report").DataTable({
"processing": true, "processing": true,
"serverSide": true, "serverSide": true,
@ -114,8 +82,16 @@ $(document).ready(function () {
}, },
"columns": [ "columns": [
{ data: 'material_name', name: 'material_name' }, { data: 'material_name', name: 'material_name' },
{ data: 'qty_planning', name: 'qty_planning' }, {
{ data: 'qty_sum', name: 'qty_sum' }, data: 'qty_planning', render: function (data, type) {
return data ? formatRupiah(parseInt(data)) : '-'
}
},
{
data: 'qty_sum', render: function (data, type) {
return data ? formatRupiah(parseInt(data)) : '-'
}
},
{ data: 'uom', name: 'uom' }, { data: 'uom', name: 'uom' },
{ {
data: 'start_activity', render: function (data, type) { data: 'start_activity', render: function (data, type) {
@ -187,12 +163,15 @@ $(document).ready(function () {
d.idAmi = assignMaterialId; d.idAmi = assignMaterialId;
d.idAct = activityId; d.idAct = activityId;
d.type = 'plan'; d.type = 'plan';
// console.log(d)
} }
}, },
"columns": [ "columns": [
{ data: 'material_name', name: 'material_name'}, { data: 'material_name', name: 'material_name'},
{ data: 'qty_planning', name: 'qty_planning' }, {
data: 'qty_planning', render: function (data, type) {
return data ? formatRupiah(parseInt(data)) : '-'
}
},
{ data: 'uom', name: 'uom' }, { data: 'uom', name: 'uom' },
{ {
data: 'plan_date', render: function (data, type) { data: 'plan_date', render: function (data, type) {

Loading…
Cancel
Save