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() {
// $("#show_form_ra_material").show();
// $("#hide_form_ra_material").hide();
// $("#form_report_activity_material").hide();
$("#id_ra_material").val("");
$('#form_report_activity_material').trigger("reset");
$('#btn_add_ra_material').html('Add');
@ -53,7 +50,6 @@ $(document).ready(function () {
$("#btn-cancel-status").on("click", function () {
resetFormAddRa()
// $(".text-update-status").hide()
});
$("#ra_select_status").on("change", function () {
let val = $(this).val()
@ -63,7 +59,6 @@ $(document).ready(function () {
} else {
$('#ra_date_end_activity').prop('disabled', true);
}
// $(".text-update-status").hide()
});
$("#ra_date_end_activity").on("change", function () {
@ -71,38 +66,11 @@ $(document).ready(function () {
let valStart = $('#ra_date_start_activity').val()
const compDate = moment(valEnd).isBefore(moment(valStart))
console.log({ valEnd, valStart, compDate })
if (compDate) {
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({
"processing": true,
"serverSide": true,
@ -114,8 +82,16 @@ $(document).ready(function () {
},
"columns": [
{ 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: 'start_activity', render: function (data, type) {
@ -187,12 +163,15 @@ $(document).ready(function () {
d.idAmi = assignMaterialId;
d.idAct = activityId;
d.type = 'plan';
// console.log(d)
}
},
"columns": [
{ 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: 'plan_date', render: function (data, type) {

Loading…
Cancel
Save