datatablePending.bootstrapTable({ url: "/dashboard/datatable/pending", showColumns: true, showColumnsToggleAll: true, showRefresh: true, sortable: true, search: true, searchOnEnterKey: false, searchHighlight: true, pagination: true, serverSide:true, pageSize: 10, pageList: [10, 20, 30, 40, 50, 100, 200], cookie: true, cookieIdTable: "table_rma_ssc_id", icons: { refresh: "fas fa-sync-alt", // atau ganti ke icon lain columns: "fas fa-th-large" }, columns: [ { title: "Action", field:'order_id', formatter: function(value, row) { const rowData = row; // jika butuh ID atau status dari baris return `
${row?.status_order === "Lunas" ? '' : ` `}
`; }, hozAlign: "center", headerSort: false }, { title: "No.Order", field:'no_order' }, { title: "Pemesan", field:'nama_pemesan', }, { title: "Kategori Customer", field: 'jenis_customer' }, { title: "Total Harga Pesanan", field:'total_harga', formatter: function(value, row){ return 'Rp ' + parseInt(row.total_harga).toLocaleString('id-ID') } }, { title: "Status Pembayaran", field: 'status_order', formatter: function(value, row) { const status = value; let badgeClass = 'bg-secondary'; if (status === "Belum Bayar") { badgeClass = 'bg-warning text-dark'; } else if (status === "Menunggu Konfirmasi Pembayaran") { badgeClass = 'bg-primary'; } else if (status === "Lunas" || status === "Sudah Bayar") { badgeClass = 'bg-success'; } return `${status}`; } } ], });