Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d42483b350 | |||
| 80ecad47a3 | |||
| 0b94af8a26 | |||
| 7d349d4efd | |||
| 6bcac8b65c | |||
| 0d1f83872c | |||
| 4c2fefe9c3 | |||
| 7d90548717 | |||
| 0a16246138 | |||
| abbabf4af8 |
@@ -37,5 +37,6 @@ user_guide_src/cilexer/pycilexer.egg-info/*
|
||||
/tests/results/
|
||||
/dev-docs/
|
||||
/ai-rules/
|
||||
*.omo/
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"sessionID": "ses_068c091cfffeSZ25RoesHkRZHA",
|
||||
"updatedAt": "2026-07-25T03:09:04.625Z",
|
||||
"sources": {
|
||||
"background-task": {
|
||||
"state": "idle",
|
||||
"updatedAt": "2026-07-25T03:09:04.625Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"sessionID": "ses_0690d5681fferVVn0tDzMM9Ow7",
|
||||
"updatedAt": "2026-07-25T08:09:46.929Z",
|
||||
"sources": {
|
||||
"background-task": {
|
||||
"state": "idle",
|
||||
"updatedAt": "2026-07-25T08:09:46.929Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"editor.language.colorizedBracketPairs": []
|
||||
}
|
||||
@@ -10,10 +10,10 @@
|
||||
|
||||
## TODO Baru - Catch-up penyusutan multi-bulan
|
||||
|
||||
- [ ] Refactor logic depreciation_asset agar memproses multi-bulan (catch-up)
|
||||
- [ ] Terapkan loop per bulan dari bulan setelah tanggal patokan sampai bulan berjalan
|
||||
- [ ] Pertahankan idempotent check per bulan berdasarkan asset_mutations
|
||||
- [ ] Generate mutasi + jurnal per bulan yang eligible
|
||||
- [ ] Update nilai buku & akumulasi penyusutan asset setelah proses loop
|
||||
- [ ] Tambahkan detail response per bulan (processed/skipped reason)
|
||||
- [ ] Validasi syntax PHP untuk Cronjob.php
|
||||
- [x] Refactor logic depreciation_asset agar memproses multi-bulan (catch-up)
|
||||
- [x] Terapkan loop per bulan dari bulan setelah tanggal patokan sampai bulan berjalan
|
||||
- [x] Pertahankan idempotent check per bulan berdasarkan asset_mutations
|
||||
- [x] Generate mutasi + jurnal per bulan yang eligible
|
||||
- [x] Update nilai buku & akumulasi penyusutan asset setelah proses loop
|
||||
- [x] Tambahkan detail response per bulan (processed/skipped reason)
|
||||
- [x] Validasi syntax PHP untuk Cronjob.php
|
||||
|
||||
@@ -60,3 +60,6 @@ $route['iclock/cdata'] = 'AttendanceWebhook/cdata';
|
||||
$route['dbcompare/sql'] = 'Dbcompare/sql';
|
||||
$route['dbcompare/sql_download'] = 'Dbcompare/sql_download';
|
||||
|
||||
// teknisi log barang
|
||||
$route['teknisi/log_barang'] = 'teknisi/log_barang';
|
||||
|
||||
|
||||
@@ -1,168 +1,171 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Accounts extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('DynamicModel', 'dm');
|
||||
|
||||
if (!$this->session->userdata('logged_in')) {
|
||||
redirect('auth');
|
||||
}
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
if($this->session->userdata('role') != 'Admin'){
|
||||
show_error('Akses ditolak', 403);
|
||||
}
|
||||
|
||||
$data = [
|
||||
"active_menu" => "accounts",
|
||||
"parent_accounts" => $this->db->get('accounts')->result()
|
||||
];
|
||||
|
||||
$this->load->view('partials/header', $data);
|
||||
$this->load->view('accounts/layout', $data);
|
||||
$this->load->view('partials/footer');
|
||||
}
|
||||
|
||||
public function get_data()
|
||||
{
|
||||
$this->dm->setTable('accounts')
|
||||
->setColumn(
|
||||
[null,'kode_akun','nama_akun','tipe','posisi','kategori',null],
|
||||
['kode_akun','nama_akun','tipe'],
|
||||
['kode_akun'=>'ASC']
|
||||
);
|
||||
|
||||
$list = $this->dm->get_datatables();
|
||||
|
||||
$data = [];
|
||||
$no = $_POST['start'];
|
||||
|
||||
foreach ($list as $row) {
|
||||
$no++;
|
||||
|
||||
$data[] = [
|
||||
$no,
|
||||
$row->kode_akun,
|
||||
$row->nama_akun,
|
||||
ucfirst($row->tipe),
|
||||
ucfirst($row->posisi),
|
||||
ucfirst($row->kategori),
|
||||
'
|
||||
<button class="btn btn-sm btn-warning btn-edit" data-id="'.$row->id.'">Edit</button>
|
||||
<button class="btn btn-sm btn-danger btn-delete" data-id="'.$row->id.'">Delete</button>
|
||||
'
|
||||
];
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
"draw" => $_POST['draw'],
|
||||
"recordsTotal" => $this->dm->count_all(),
|
||||
"recordsFiltered" => $this->dm->count_filtered(),
|
||||
"data" => $data
|
||||
]);
|
||||
}
|
||||
|
||||
// ================= SAVE
|
||||
public function save()
|
||||
{
|
||||
$tipe = $this->input->post('tipe');
|
||||
|
||||
$data = [
|
||||
'kode_akun' => $this->input->post('kode_akun'),
|
||||
'nama_akun' => $this->input->post('nama_akun'),
|
||||
'tipe' => $tipe,
|
||||
'posisi' => in_array($tipe, ['asset','expense']) ? 'debit' : 'kredit',
|
||||
'kategori' => in_array($tipe, ['asset','liability','equity']) ? 'neraca' : 'laba_rugi',
|
||||
'parent_id' => $this->input->post('parent_id') ?: NULL
|
||||
];
|
||||
|
||||
$insert = $this->dm->setTable('accounts')->insert($data);
|
||||
|
||||
if($insert){
|
||||
log_activity(
|
||||
'Accounts',
|
||||
'create',
|
||||
'Menambah akun: '.$data['kode_akun'].' - '.$data['nama_akun']
|
||||
);
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
'status' => $insert ? true : false,
|
||||
'message' => $insert ? 'Data berhasil disimpan' : 'Gagal simpan'
|
||||
]);
|
||||
}
|
||||
|
||||
// ================= UPDATE
|
||||
public function update()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$tipe = $this->input->post('tipe');
|
||||
|
||||
$data = [
|
||||
'kode_akun' => $this->input->post('kode_akun'),
|
||||
'nama_akun' => $this->input->post('nama_akun'),
|
||||
'tipe' => $tipe,
|
||||
'posisi' => in_array($tipe, ['asset','expense']) ? 'debit' : 'kredit',
|
||||
'kategori' => in_array($tipe, ['asset','liability','equity']) ? 'neraca' : 'laba_rugi',
|
||||
'parent_id' => $this->input->post('parent_id') ?: NULL
|
||||
];
|
||||
|
||||
$update = $this->dm->setTable('accounts')->update($id, $data);
|
||||
|
||||
if($update){
|
||||
log_activity(
|
||||
'Accounts',
|
||||
'update',
|
||||
'Update akun ID '.$id.' menjadi: '.$data['kode_akun'].' - '.$data['nama_akun']
|
||||
);
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
'status' => $update ? true : false,
|
||||
'message' => $update ? 'Data berhasil diupdate' : 'Gagal update'
|
||||
]);
|
||||
}
|
||||
|
||||
public function detail($id)
|
||||
{
|
||||
$data = $this->dm->setTable('accounts')->find($id);
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
// cek apakah jadi parent
|
||||
$child = $this->db->where('parent_id',$id)->count_all_results('accounts');
|
||||
|
||||
if($child > 0){
|
||||
echo json_encode([
|
||||
'status'=>false,
|
||||
'message'=>'Tidak bisa hapus, akun punya child'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$delete = $this->dm->setTable('accounts')->delete($id);
|
||||
|
||||
if($delete){
|
||||
log_activity(
|
||||
'Accounts',
|
||||
'delete',
|
||||
'Menghapus akun ID '.$id,
|
||||
'success'
|
||||
);
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
'status' => $delete ? true : false,
|
||||
'message' => $delete ? 'Data berhasil dihapus' : 'Gagal hapus'
|
||||
]);
|
||||
}
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Accounts extends CI_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('DynamicModel', 'dm');
|
||||
|
||||
if (!$this->session->userdata('logged_in')) {
|
||||
redirect('auth');
|
||||
}
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
if($this->session->userdata('role') != 'Admin'){
|
||||
show_error('Akses ditolak', 403);
|
||||
}
|
||||
|
||||
$data = [
|
||||
"active_menu" => "accounts",
|
||||
"parent_accounts" => $this->db->get('accounts')->result()
|
||||
];
|
||||
|
||||
$this->load->view('partials/header', $data);
|
||||
$this->load->view('accounts/layout', $data);
|
||||
$this->load->view('partials/footer');
|
||||
}
|
||||
|
||||
public function get_data()
|
||||
{
|
||||
$this->dm->setTable('accounts')
|
||||
->setColumn(
|
||||
[null,'kode_akun','nama_akun','tipe','posisi','kategori',null],
|
||||
['kode_akun','nama_akun','tipe'],
|
||||
['kode_akun'=>'ASC']
|
||||
);
|
||||
|
||||
$list = $this->dm->get_datatables();
|
||||
|
||||
$data = [];
|
||||
$no = $_POST['start'];
|
||||
|
||||
foreach ($list as $row) {
|
||||
$no++;
|
||||
|
||||
$data[] = [
|
||||
$no,
|
||||
$row->kode_akun,
|
||||
$row->priority,
|
||||
$row->nama_akun,
|
||||
ucfirst($row->tipe),
|
||||
ucfirst($row->posisi),
|
||||
ucfirst($row->kategori),
|
||||
'
|
||||
<button class="btn btn-sm btn-warning btn-edit" data-id="'.$row->id.'">Edit</button>
|
||||
<button class="btn btn-sm btn-danger btn-delete" data-id="'.$row->id.'">Delete</button>
|
||||
'
|
||||
];
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
"draw" => $_POST['draw'],
|
||||
"recordsTotal" => $this->dm->count_all(),
|
||||
"recordsFiltered" => $this->dm->count_filtered(),
|
||||
"data" => $data
|
||||
]);
|
||||
}
|
||||
|
||||
// ================= SAVE
|
||||
public function save()
|
||||
{
|
||||
$tipe = $this->input->post('tipe');
|
||||
|
||||
$data = [
|
||||
'kode_akun' => $this->input->post('kode_akun'),
|
||||
'nama_akun' => $this->input->post('nama_akun'),
|
||||
'tipe' => $tipe,
|
||||
'posisi' => in_array($tipe, ['asset','expense']) ? 'debit' : 'kredit',
|
||||
'kategori' => in_array($tipe, ['asset','liability','equity']) ? 'neraca' : 'laba_rugi',
|
||||
'parent_id' => $this->input->post('parent_id') ?: NULL,
|
||||
'priority' => $this->input->post('priority') ?: NULL
|
||||
];
|
||||
|
||||
$insert = $this->dm->setTable('accounts')->insert($data);
|
||||
|
||||
if($insert){
|
||||
log_activity(
|
||||
'Accounts',
|
||||
'create',
|
||||
'Menambah akun: '.$data['kode_akun'].' - '.$data['nama_akun']
|
||||
);
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
'status' => $insert ? true : false,
|
||||
'message' => $insert ? 'Data berhasil disimpan' : 'Gagal simpan'
|
||||
]);
|
||||
}
|
||||
|
||||
// ================= UPDATE
|
||||
public function update()
|
||||
{
|
||||
$id = $this->input->post('id');
|
||||
$tipe = $this->input->post('tipe');
|
||||
|
||||
$data = [
|
||||
'kode_akun' => $this->input->post('kode_akun'),
|
||||
'nama_akun' => $this->input->post('nama_akun'),
|
||||
'tipe' => $tipe,
|
||||
'posisi' => in_array($tipe, ['asset','expense']) ? 'debit' : 'kredit',
|
||||
'kategori' => in_array($tipe, ['asset','liability','equity']) ? 'neraca' : 'laba_rugi',
|
||||
'parent_id' => $this->input->post('parent_id') ?: NULL,
|
||||
'priority' => $this->input->post('priority') ?: NULL
|
||||
];
|
||||
|
||||
$update = $this->dm->setTable('accounts')->update($id, $data);
|
||||
|
||||
if($update){
|
||||
log_activity(
|
||||
'Accounts',
|
||||
'update',
|
||||
'Update akun ID '.$id.' menjadi: '.$data['kode_akun'].' - '.$data['nama_akun']
|
||||
);
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
'status' => $update ? true : false,
|
||||
'message' => $update ? 'Data berhasil diupdate' : 'Gagal update'
|
||||
]);
|
||||
}
|
||||
|
||||
public function detail($id)
|
||||
{
|
||||
$data = $this->dm->setTable('accounts')->find($id);
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
// cek apakah jadi parent
|
||||
$child = $this->db->where('parent_id',$id)->count_all_results('accounts');
|
||||
|
||||
if($child > 0){
|
||||
echo json_encode([
|
||||
'status'=>false,
|
||||
'message'=>'Tidak bisa hapus, akun punya child'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$delete = $this->dm->setTable('accounts')->delete($id);
|
||||
|
||||
if($delete){
|
||||
log_activity(
|
||||
'Accounts',
|
||||
'delete',
|
||||
'Menghapus akun ID '.$id,
|
||||
'success'
|
||||
);
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
'status' => $delete ? true : false,
|
||||
'message' => $delete ? 'Data berhasil dihapus' : 'Gagal hapus'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -22,9 +22,10 @@ class Asset extends CI_Controller {
|
||||
// ================= GET DATA =================
|
||||
public function get_data(){
|
||||
$data = $this->db
|
||||
->select('assets.*, lokasi_asset.nama as nama_lokasi')
|
||||
->select('assets.*, lokasi_asset.nama as nama_lokasi, item_barcodes.barcode as barcode, item_barcodes.id as barcode_id')
|
||||
->from('assets')
|
||||
->join('lokasi_asset', 'lokasi_asset.id = assets.lokasi_asset_id', 'left')
|
||||
->join('item_barcodes', 'item_barcodes.id = assets.barcode_id', 'left')
|
||||
->order_by('assets.tanggal_perolehan','DESC')
|
||||
->get()
|
||||
->result();
|
||||
@@ -37,7 +38,7 @@ class Asset extends CI_Controller {
|
||||
$no++,
|
||||
$d->tanggal_perolehan,
|
||||
$d->kode_asset ?? '-',
|
||||
$d->nama_asset,
|
||||
$d->nama_asset . ($d->barcode_id ? '<br><small class="text-muted"><i>'.$d->barcode.'</i></small>' : ''),
|
||||
$d->nama_lokasi ?? '-',
|
||||
$d->keterangan ?? '-',
|
||||
number_format($d->nilai_perolehan),
|
||||
@@ -201,9 +202,22 @@ class Asset extends CI_Controller {
|
||||
|
||||
$this->db->trans_start();
|
||||
|
||||
// stock log keluar per item
|
||||
$this->db->insert('stock_logs',[
|
||||
'item_id' => $item_id,
|
||||
'warehouse_id' => '1', // default gudang
|
||||
'qty' => $qty,
|
||||
'tipe' => 'keluar',
|
||||
'keterangan' => 'Pemindahan barang ke asset tanggal ' . $tanggal . ' - (' . $keterangan . ')'
|
||||
]);
|
||||
$stock_log_id = $this->db->insert_id();
|
||||
$this->update_item_stok($item_id);
|
||||
|
||||
// INSERT ASSET
|
||||
$this->db->insert('assets',[
|
||||
'item_id' => $item_id,
|
||||
'barcode_id' => $barcode_id,
|
||||
'stock_log_id' => $stock_log_id,
|
||||
'kode_asset' => 'AST-'.time(),
|
||||
'nama_asset' => $nama_asset,
|
||||
'harga_per_unit' => $harga,
|
||||
@@ -238,6 +252,8 @@ class Asset extends CI_Controller {
|
||||
return;
|
||||
}
|
||||
|
||||
// END - Item Movement & item barcodes update status
|
||||
|
||||
$total_sisa = $itemBar->qty_sisa - $qty;
|
||||
$status_bar = ($total_sisa == 0) ? 'installed' : 'available';
|
||||
|
||||
@@ -282,11 +298,6 @@ class Asset extends CI_Controller {
|
||||
'kredit' => $nilai_perolehan
|
||||
]);
|
||||
|
||||
// UPDATE STOK ITEM (kurangi sesuai qty)
|
||||
$this->db->where('id', $item_id)
|
||||
->set('stok', 'stok-'.$qty, FALSE)
|
||||
->update('items');
|
||||
|
||||
// MUTATION DARI GUDANG
|
||||
$this->db->insert('asset_mutations',[
|
||||
'asset_id' => $asset_id,
|
||||
@@ -313,7 +324,12 @@ class Asset extends CI_Controller {
|
||||
$lokasi_asset_id = (int)$this->input->post('lokasi_asset');
|
||||
$keterangan = $this->input->post('keterangan');
|
||||
|
||||
$this->db->trans_start();
|
||||
$asset = $this->db->get_where('assets',['id'=>$id])->row();
|
||||
|
||||
if(!$asset){
|
||||
echo json_encode(['status'=>false,'message'=>'Asset tidak ditemukan']);
|
||||
return;
|
||||
}
|
||||
|
||||
$data = [
|
||||
'nama_asset' => $nama_asset,
|
||||
@@ -321,17 +337,18 @@ class Asset extends CI_Controller {
|
||||
'keterangan' => $keterangan
|
||||
];
|
||||
|
||||
if($asset->barcode_id && $asset->item_id){
|
||||
$data = [
|
||||
'lokasi_asset_id' => $lokasi_asset_id,
|
||||
'keterangan' => $keterangan
|
||||
];
|
||||
}
|
||||
|
||||
$this->db->trans_start();
|
||||
|
||||
$this->db->where('id',$id);
|
||||
$this->db->update('assets',$data);
|
||||
|
||||
// MUTATION EDIT
|
||||
$this->db->insert('asset_mutations',[
|
||||
'asset_id' => $id,
|
||||
'tipe' => 'penambahan',
|
||||
'nilai' => 0,
|
||||
'keterangan' => 'Edit asset: '.$nama_asset
|
||||
]);
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
if ($this->db->trans_status()) {
|
||||
@@ -349,9 +366,27 @@ class Asset extends CI_Controller {
|
||||
$keterangan = $this->input->post('keterangan');
|
||||
|
||||
$asset = $this->db->get_where('assets',['id'=>$id])->row();
|
||||
$itemBar = $this->db->get_where('item_barcodes',['id'=>$asset->barcode_id])->row();
|
||||
|
||||
if($alasan == 'dijual' || $alasan == 'rusak' ){
|
||||
echo json_encode(['status'=>false,'message'=>'Alasan <b>' .strtoupper($alasan).'</b> tidak bisa digunakan, Karena fitur belum tersedia. Silahkan pilih alasan lain.']);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
$this->db->trans_start();
|
||||
|
||||
if ($asset->barcode_id && $asset->item_id) {
|
||||
// Update item_barcodes status to 'available' if it was linked to this asset
|
||||
$qty_sisa = $asset->qty + $itemBar->qty_sisa;
|
||||
|
||||
$this->db->where('id', $asset->barcode_id)
|
||||
->update('item_barcodes', ['status' => 'available', 'qty_sisa' => $qty_sisa]);
|
||||
$this->db->delete('stock_logs', ['id'=>$asset->stock_log_id]);
|
||||
$this->update_item_stok($asset->item_id);
|
||||
|
||||
}
|
||||
|
||||
// Hapus journal
|
||||
$journals = $this->db->get_where('journals', ['ref_type'=>'assets', 'ref_id'=>$id])->result();
|
||||
foreach($journals as $j){
|
||||
@@ -453,4 +488,18 @@ class Asset extends CI_Controller {
|
||||
->result();
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
private function update_item_stok($item_id)
|
||||
{
|
||||
$stok = $this->db->query("
|
||||
SELECT COALESCE(SUM(qty * IF(tipe='masuk',1,-1)),0) as stok
|
||||
FROM stock_logs
|
||||
WHERE item_id = ?
|
||||
", [$item_id])->row()->stok;
|
||||
|
||||
$this->db->where('id', $item_id)
|
||||
->update('items', [
|
||||
'stok' => $stok
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,7 @@ class Generateinvoice extends CI_Controller {
|
||||
$detail = $this->db
|
||||
->where('invoice_id', $invoice_id)
|
||||
->order_by('tanggal', 'ASC')
|
||||
->order_by('id', 'ASC')
|
||||
->get('invoice_details')
|
||||
->result_array();
|
||||
|
||||
@@ -87,12 +88,16 @@ class Generateinvoice extends CI_Controller {
|
||||
// =========================
|
||||
$total = (float)$invi['total'];
|
||||
|
||||
$this->db->select_sum('sisa_piutang');
|
||||
// ================= AMBIL TUNGGAKAN =================
|
||||
$this->db->select_sum('total');
|
||||
$this->db->select_sum('total_bayar');
|
||||
$this->db->where('customer_id', $invi['customer_id']);
|
||||
$this->db->where('status !=', 'paid');
|
||||
$this->db->where('id !=', $invoice_id); // exclude invoice sekarang
|
||||
$this->db->where('id <', $invoice_id); // exclude invoice sekarang
|
||||
|
||||
$tunggakan = $this->db->get('invoices')->row()->sisa_piutang ?? 0;
|
||||
$row = $this->db->get('invoices')->row();
|
||||
|
||||
$tunggakan = ($row->total ?? 0) - ($row->total_bayar ?? 0);
|
||||
|
||||
// Ngambil Data Tunggakan bulan lalu jika ada.
|
||||
$keteranganlain = 'Akumulasi Tunggakan Invoice Bulan Lalu';
|
||||
|
||||
@@ -510,12 +510,15 @@ class Invoices extends CI_Controller {
|
||||
}
|
||||
|
||||
// ================= AMBIL TUNGGAKAN =================
|
||||
$this->db->select_sum('sisa_piutang');
|
||||
$this->db->select_sum('total');
|
||||
$this->db->select_sum('total_bayar');
|
||||
$this->db->where('customer_id', $data->customer_id);
|
||||
$this->db->where('status !=', 'paid');
|
||||
$this->db->where('id !=', $id); // exclude invoice sekarang
|
||||
$this->db->where('id <', $id); // exclude invoice sekarang
|
||||
|
||||
$tunggakan = $this->db->get('invoices')->row()->sisa_piutang ?? 0;
|
||||
$row = $this->db->get('invoices')->row();
|
||||
|
||||
$tunggakan = ($row->total ?? 0) - ($row->total_bayar ?? 0);
|
||||
|
||||
// ================= MASUKKAN KE DATA =================
|
||||
$data->tunggakan = (int)$tunggakan;
|
||||
@@ -1193,7 +1196,7 @@ class Invoices extends CI_Controller {
|
||||
public function get_accounts_assets()
|
||||
{
|
||||
$data = $this->db
|
||||
->where_in('kode_akun', [101,102,207,201,202,203,204,205,209])
|
||||
->where_in('tipe', ['asset','liability'])
|
||||
->order_by('kode_akun', 'ASC')
|
||||
->get('accounts')
|
||||
->result();
|
||||
|
||||
@@ -420,7 +420,7 @@ class Items extends CI_Controller {
|
||||
->or_like('i.nama_barang', $barcode, 'both')
|
||||
->or_like('ib.serial_number', $barcode, 'both')
|
||||
->group_end()
|
||||
->limit(15)
|
||||
// ->limit(15)
|
||||
->get()
|
||||
->result();
|
||||
|
||||
@@ -646,7 +646,7 @@ class Items extends CI_Controller {
|
||||
public function get_accounts()
|
||||
{
|
||||
$data = $this->db
|
||||
->where_in('kode_akun', [101,102,201])
|
||||
->where_in('kode_akun', [101,102,201,122,125,105])
|
||||
->order_by('kode_akun','ASC')
|
||||
->get('accounts')
|
||||
->result();
|
||||
@@ -969,6 +969,8 @@ class Items extends CI_Controller {
|
||||
|
||||
// hapus item
|
||||
$this->db->delete('stock_logs',['item_id'=>$id]);
|
||||
$this->db->delete('item_movements',['item_id'=>$id]);
|
||||
$this->db->delete('item_barcodes',['item_id'=>$id]);
|
||||
$this->db->delete('items',['id'=>$id]);
|
||||
|
||||
$j = $this->db->get_where('journals', [
|
||||
@@ -1087,6 +1089,7 @@ class Items extends CI_Controller {
|
||||
ib.id as barcode_id,
|
||||
ib.item_id,
|
||||
ib.qty_sisa,
|
||||
ib.barcode,
|
||||
ib.warehouse_id,
|
||||
ib.status as barcode_status,
|
||||
i.nama_barang,
|
||||
@@ -1182,6 +1185,9 @@ class Items extends CI_Controller {
|
||||
'qty_sisa' => $new_qty_sisa,
|
||||
'status' => $new_qty_sisa <= 0 ? 'installed' : $barcode->barcode_status
|
||||
]);
|
||||
|
||||
$this->db->where('barcode', $barcode->barcode)->where('status', 'active')->update('item_technician', ['status' => 'inactive', 'deleted_at' => date('Y-m-d H:i:s')]);
|
||||
|
||||
// END - Item Movement & item barcodes update status
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
@@ -101,7 +101,7 @@ class Neraca extends CI_Controller {
|
||||
}
|
||||
|
||||
$this->db->group_by('a.id');
|
||||
$this->db->order_by('a.kode_akun','ASC');
|
||||
$this->db->order_by('a.priority','ASC');
|
||||
|
||||
$rows = $this->db->get()->result();
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ class Teknisi extends CI_Controller {
|
||||
'serial_number' => $item->serial_number,
|
||||
'barcode_id' => $item->barcode_id,
|
||||
'item_id' => $item->item_id,
|
||||
'barcode_status' => $item->barcode_status,
|
||||
'teknisi_id' => $teknisi ? $teknisi->user_id : null,
|
||||
'teknisi_name' => $teknisi ? $teknisi->full_name : null,
|
||||
'teknisi_code' => $teknisi ? $teknisi->employee_code : null
|
||||
@@ -87,6 +88,18 @@ class Teknisi extends CI_Controller {
|
||||
]);
|
||||
}
|
||||
|
||||
function get_date_by_employee_id()
|
||||
{
|
||||
$user_id = (int)$this->input->get('user_id');
|
||||
if (!$user_id) {
|
||||
echo json_encode(['status' => false, 'message' => 'ID teknisi tidak valid']);
|
||||
return;
|
||||
}
|
||||
|
||||
$dates = $this->ptm->get_dates_by_employee_id($user_id);
|
||||
echo json_encode(['status' => true, 'data' => $dates]);
|
||||
}
|
||||
|
||||
public function batch_kembalikan()
|
||||
{
|
||||
$barcodes = $this->input->post('barcodes');
|
||||
@@ -208,6 +221,7 @@ class Teknisi extends CI_Controller {
|
||||
|
||||
$result[] = [
|
||||
$no++,
|
||||
$row->tanggal ?? date('d/m/Y'),
|
||||
htmlspecialchars($row->barcode, ENT_QUOTES, 'UTF-8'),
|
||||
htmlspecialchars($row->nama_barang, ENT_QUOTES, 'UTF-8'),
|
||||
htmlspecialchars($row->serial_number, ENT_QUOTES, 'UTF-8') ?: '-',
|
||||
@@ -239,15 +253,32 @@ class Teknisi extends CI_Controller {
|
||||
return;
|
||||
}
|
||||
|
||||
$items = $this->ptm->get_teknisi_items_full($user_id);
|
||||
$noFaktur = 'GRJN/K/' . date('d/m/Y');
|
||||
$tanggal = date('d F Y');
|
||||
$tanggal_param = $this->input->get('tanggal');
|
||||
$items = [];
|
||||
if ($tanggal_param) {
|
||||
$items = $this->ptm->get_teknisi_items_full($user_id, $tanggal_param);
|
||||
}
|
||||
|
||||
if ($tanggal_param) {
|
||||
if ($tanggal_param === 'all') {
|
||||
$noFaktur = 'GRJN/K/ALL' . date('/m/Y');
|
||||
$tanggal = date('d F Y');
|
||||
} else {
|
||||
$ts = strtotime($tanggal_param);
|
||||
$noFaktur = 'GRJN/K/' . date('d/m/Y', $ts);
|
||||
$tanggal = date('d F Y', $ts);
|
||||
}
|
||||
} else {
|
||||
$noFaktur = 'GRJN/K/' . date('d/m/Y');
|
||||
$tanggal = date('d F Y');
|
||||
}
|
||||
|
||||
$itemsData = [];
|
||||
$no = 1;
|
||||
foreach ($items as $item) {
|
||||
$itemsData[] = [
|
||||
'no' => $no++,
|
||||
'tanggal' => $item->tanggal ?? date('d/m/Y'),
|
||||
'barcode' => $item->barcode ?? '-',
|
||||
'nama_barang' => $item->nama_barang ?? '-',
|
||||
'serial_number' => $item->serial_number ?? '-',
|
||||
@@ -274,9 +305,6 @@ class Teknisi extends CI_Controller {
|
||||
|
||||
public function generate_pdf_barang_bawaan($user_id = null)
|
||||
{
|
||||
if ($this->session->userdata('role') != 'Admin') {
|
||||
show_error('Akses ditolak', 403);
|
||||
}
|
||||
|
||||
$user_id = (int)$user_id;
|
||||
if (!$user_id) {
|
||||
@@ -292,9 +320,22 @@ class Teknisi extends CI_Controller {
|
||||
show_error('Teknisi tidak ditemukan', 404);
|
||||
}
|
||||
|
||||
$items = $this->ptm->get_teknisi_items_full($user_id);
|
||||
$noFaktur = 'GRJN/K/' . date('d/m/Y');
|
||||
$tanggal = date('d F Y');
|
||||
$tanggal_param = $this->input->get('tanggal');
|
||||
|
||||
if ($tanggal_param === 'all') {
|
||||
$items = $this->ptm->get_teknisi_items_full($user_id);
|
||||
$noFaktur = 'GRJN/K/ALL' . date('/m/Y');
|
||||
$tanggal = 'Semua Tanggal';
|
||||
} elseif ($tanggal_param) {
|
||||
$ts = strtotime($tanggal_param);
|
||||
$items = $this->ptm->get_teknisi_items_full($user_id, $tanggal_param);
|
||||
$noFaktur = 'GRJN/K/' . date('d/m/Y', $ts);
|
||||
$tanggal = date('d/m/Y', $ts);
|
||||
} else {
|
||||
$items = $this->ptm->get_teknisi_items_full($user_id);
|
||||
$noFaktur = 'GRJN/K/' . date('d/m/Y');
|
||||
$tanggal = date('d/m/Y');
|
||||
}
|
||||
|
||||
require_once(APPPATH . 'third_party/fpdf/fpdf.php');
|
||||
require_once(APPPATH . 'libraries/PDF_BarangBawaan.php');
|
||||
@@ -436,4 +477,42 @@ class Teknisi extends CI_Controller {
|
||||
|
||||
echo json_encode(['status' => true, 'message' => $msg, 'errors' => $errors]);
|
||||
}
|
||||
|
||||
public function get_log_data()
|
||||
{
|
||||
$data = $this->ptm->get_log_barang();
|
||||
|
||||
$result = [];
|
||||
$no = 1;
|
||||
|
||||
foreach ($data as $row) {
|
||||
$status_badge = $row->status === 'active'
|
||||
? '<span class="badge bg-success">ACTIVE</span>'
|
||||
: '<span class="badge bg-secondary">INACTIVE</span>';
|
||||
|
||||
$result[] = [
|
||||
$no++,
|
||||
htmlspecialchars($row->teknisi_name ?? '-', ENT_QUOTES, 'UTF-8'),
|
||||
htmlspecialchars($row->item_code ?? '-', ENT_QUOTES, 'UTF-8'),
|
||||
htmlspecialchars($row->barcode, ENT_QUOTES, 'UTF-8'),
|
||||
htmlspecialchars($row->nama_barang ?? '-', ENT_QUOTES, 'UTF-8'),
|
||||
$row->created_at ? date('d/m/Y H:i', strtotime($row->created_at)) : '-',
|
||||
$row->status === 'inactive' && $row->deleted_at ? date('d/m/Y H:i', strtotime($row->deleted_at)) : '-',
|
||||
$status_badge,
|
||||
];
|
||||
}
|
||||
|
||||
echo json_encode(['data' => $result]);
|
||||
}
|
||||
|
||||
public function log_barang()
|
||||
{
|
||||
$data = [
|
||||
"active_menu" => "peralatan_teknisi",
|
||||
];
|
||||
|
||||
$this->load->view('partials/header', $data);
|
||||
$this->load->view('peralatan_teknisi/log_barang', $data);
|
||||
$this->load->view('partials/footer');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ class PDF_BarangBawaan extends FPDF
|
||||
private $tanggal;
|
||||
private $teknisi;
|
||||
|
||||
private $colWidths = [10, 28, 48, 30, 12, 62];
|
||||
private $colWidths = [8, 18, 27, 42, 24, 10, 46, 15];
|
||||
|
||||
public function __construct($orientation = 'L', $unit = 'mm', $size = 'A5')
|
||||
{
|
||||
@@ -57,7 +57,7 @@ class PDF_BarangBawaan extends FPDF
|
||||
$this->SetTextColor(255, 255, 255);
|
||||
$this->SetFont('Arial', 'B', 7);
|
||||
|
||||
$headers = ['No', 'Barcode', 'Nama Barang', 'Serial Number', 'Jumlah', 'Keterangan'];
|
||||
$headers = ['No', 'Tanggal', 'Barcode', 'Nama Barang', 'Serial Number', 'Jumlah', 'Keterangan', 'Server'];
|
||||
foreach ($headers as $i => $h) {
|
||||
$this->Cell($this->colWidths[$i], 7, $h, 1, 0, 'C', true);
|
||||
}
|
||||
@@ -73,8 +73,8 @@ class PDF_BarangBawaan extends FPDF
|
||||
$minRowH = 8;
|
||||
$no = 1;
|
||||
|
||||
$colsMultiCell = [false, false, true, true, false, true];
|
||||
$cellAligns = ['C', 'L', 'L', 'L', 'C', 'L'];
|
||||
$colsMultiCell = [false, false, true, true, true, false, true, false];
|
||||
$cellAligns = ['C', 'C', 'L', 'L', 'L', 'C', 'L', 'L'];
|
||||
|
||||
foreach ($items as $item) {
|
||||
$keterangan = isset($item->keterangan) ? $item->keterangan : '';
|
||||
@@ -82,14 +82,17 @@ class PDF_BarangBawaan extends FPDF
|
||||
$serial = $item->serial_number ?? '-';
|
||||
$barcode = $item->barcode ?? '-';
|
||||
$jumlah = isset($item->qty_sisa) ? (int)$item->qty_sisa : 1;
|
||||
$server = '';
|
||||
|
||||
$cellValues = [
|
||||
(string)$no,
|
||||
$item->tanggal ?? '-',
|
||||
$barcode,
|
||||
$namaBarang,
|
||||
$serial,
|
||||
(string)$jumlah,
|
||||
$keterangan
|
||||
$keterangan,
|
||||
$server
|
||||
];
|
||||
|
||||
$maxLines = 1;
|
||||
@@ -121,7 +124,8 @@ class PDF_BarangBawaan extends FPDF
|
||||
foreach ($cellValues as $i => $val) {
|
||||
$this->SetXY($currentX, $startY);
|
||||
if ($colsMultiCell[$i]) {
|
||||
$contentH = $maxLines * $lineH;
|
||||
$colLines = $this->NbLines($this->colWidths[$i], $val);
|
||||
$contentH = $colLines * $lineH;
|
||||
$offsetY = ($rowH - $contentH) / 2;
|
||||
$this->SetXY($currentX, $startY + $offsetY);
|
||||
$this->MultiCell($this->colWidths[$i], $lineH, $val, 0, $cellAligns[$i]);
|
||||
|
||||
@@ -65,6 +65,7 @@ class PeralatanTeknisi_model extends CI_Model {
|
||||
->from('item_barcodes ib')
|
||||
->join('items i', 'i.id = ib.item_id', 'left')
|
||||
->where('ib.barcode', $barcode)
|
||||
->where('ib.qty_sisa >', 0)
|
||||
->get()
|
||||
->row();
|
||||
|
||||
@@ -74,6 +75,7 @@ class PeralatanTeknisi_model extends CI_Model {
|
||||
->from('item_barcodes ib')
|
||||
->join('items i', 'i.id = ib.item_id', 'left')
|
||||
->where('ib.serial_number', $barcode)
|
||||
->where('ib.qty_sisa >', 0)
|
||||
->get()
|
||||
->row();
|
||||
}
|
||||
@@ -163,6 +165,19 @@ class PeralatanTeknisi_model extends CI_Model {
|
||||
|
||||
return ['status' => true, 'message' => $msg, 'errors' => $errors];
|
||||
}
|
||||
|
||||
public function get_dates_by_employee_id($user_id)
|
||||
{
|
||||
return $this->db
|
||||
->select("DATE(it.created_at) as tanggal")
|
||||
->from('item_technician it')
|
||||
->where('it.user_id', $user_id)
|
||||
->where('it.status', 'active')
|
||||
->group_by("DATE(it.created_at)")
|
||||
->order_by("DATE(it.created_at)", "DESC")
|
||||
->get()
|
||||
->result();
|
||||
}
|
||||
|
||||
public function batch_dibawa(array $barcodes, $user_id)
|
||||
{
|
||||
@@ -362,10 +377,11 @@ class PeralatanTeknisi_model extends CI_Model {
|
||||
public function get_teknisi_items_data($user_id, $start, $length, $search, $order_col, $order_dir)
|
||||
{
|
||||
$sort_cols = [
|
||||
1 => 'it.barcode',
|
||||
2 => 'i.nama_barang',
|
||||
3 => 'ib.serial_number',
|
||||
4 => 'it.status'
|
||||
1 => 'it.created_at',
|
||||
2 => 'it.barcode',
|
||||
3 => 'i.nama_barang',
|
||||
4 => 'ib.serial_number',
|
||||
5 => 'it.status'
|
||||
];
|
||||
|
||||
$this->db
|
||||
@@ -375,7 +391,7 @@ class PeralatanTeknisi_model extends CI_Model {
|
||||
ib.serial_number,
|
||||
ib.qty_sisa,
|
||||
it.status,
|
||||
it.created_at
|
||||
DATE_FORMAT(it.created_at, '%d/%m/%Y') as tanggal
|
||||
")
|
||||
->from('item_technician it')
|
||||
->join('items i', 'i.id = it.item_id', 'left')
|
||||
@@ -484,21 +500,28 @@ class PeralatanTeknisi_model extends CI_Model {
|
||||
->row();
|
||||
}
|
||||
|
||||
public function get_teknisi_items_full($user_id)
|
||||
public function get_teknisi_items_full($user_id, $tanggal = null)
|
||||
{
|
||||
return $this->db
|
||||
$this->db
|
||||
->select("
|
||||
it.barcode,
|
||||
i.nama_barang,
|
||||
ib.serial_number,
|
||||
ib.qty_sisa,
|
||||
it.status
|
||||
it.status,
|
||||
DATE_FORMAT(it.created_at, '%d/%m/%Y') as tanggal
|
||||
")
|
||||
->from('item_technician it')
|
||||
->join('items i', 'i.id = it.item_id', 'left')
|
||||
->join('item_barcodes ib', 'ib.barcode = it.barcode', 'left')
|
||||
->where('it.user_id', $user_id)
|
||||
->where('it.status', 'active')
|
||||
->where('it.status', 'active');
|
||||
|
||||
if ($tanggal AND $tanggal != 'all') {
|
||||
$this->db->where('DATE(it.created_at)', $tanggal);
|
||||
}
|
||||
|
||||
return $this->db
|
||||
->order_by('it.created_at', 'ASC')
|
||||
->get()
|
||||
->result();
|
||||
@@ -508,4 +531,26 @@ class PeralatanTeknisi_model extends CI_Model {
|
||||
{
|
||||
return 'GRJN/K/' . date('d/m/Y');
|
||||
}
|
||||
|
||||
public function get_log_barang()
|
||||
{
|
||||
return $this->db
|
||||
->select("
|
||||
it.barcode,
|
||||
it.item_id,
|
||||
it.user_id,
|
||||
it.status,
|
||||
it.created_at,
|
||||
it.deleted_at,
|
||||
ke.full_name as teknisi_name,
|
||||
i.kode_detail as item_code,
|
||||
i.nama_barang
|
||||
")
|
||||
->from('item_technician it')
|
||||
->join('k_employees ke', 'ke.id = it.user_id', 'left')
|
||||
->join('items i', 'i.id = it.item_id', 'left')
|
||||
->order_by('it.created_at', 'DESC')
|
||||
->get()
|
||||
->result();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,215 +1,223 @@
|
||||
<div class="container mt-4">
|
||||
<div class="card modern-card shadow-sm border-0 rounded-4">
|
||||
<div class="card-body p-4">
|
||||
|
||||
<div class="d-flex justify-content-between mb-3">
|
||||
<h5 class="mb-0">Chart of Account (COA)</h5>
|
||||
<button class="btn btn-warning btn-add">Tambah Akun</button>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="tableAccounts" class="table modern-table align-middle w-100">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th width="5%">No</th>
|
||||
<th>Kode</th>
|
||||
<th>Nama</th>
|
||||
<th>Tipe</th>
|
||||
<th>Posisi</th>
|
||||
<th>Kategori</th>
|
||||
<th width="15%">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- MODAL -->
|
||||
<div class="modal fade" id="modalAccount">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content rounded-4">
|
||||
<div class="modal-header bg-warning text-white">
|
||||
<h5 class="modal-title">Tambah Akun</h5>
|
||||
<button class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<input type="hidden" id="inputId">
|
||||
|
||||
<label class="fw-semibold">Kode Akun</label>
|
||||
<input type="text" class="form-control" id="kode_akun">
|
||||
|
||||
<label class="fw-semibold mt-2">Nama Akun</label>
|
||||
<input type="text" class="form-control" id="nama_akun">
|
||||
|
||||
<label class="fw-semibold mt-2">Tipe</label>
|
||||
<select class="form-control" id="tipe">
|
||||
<option value="asset">Asset</option>
|
||||
<option value="liability">Liability</option>
|
||||
<option value="equity">Equity</option>
|
||||
<option value="revenue">Revenue</option>
|
||||
<option value="expense">Expense</option>
|
||||
</select>
|
||||
|
||||
<label class="fw-semibold mt-2">Parent</label>
|
||||
<select class="form-control" id="parent_id">
|
||||
<option value="">-- Tanpa Parent --</option>
|
||||
<?php foreach($parent_accounts as $p): ?>
|
||||
<option value="<?= $p->id ?>">
|
||||
<?= $p->kode_akun ?> - <?= $p->nama_akun ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
||||
<button class="btn btn-warning" id="btnSimpan">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
let table = $('#tableAccounts').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
responsive: true,
|
||||
autoWidth: false,
|
||||
order: [],
|
||||
ajax: {
|
||||
url: "<?= base_url('accounts/get_data'); ?>",
|
||||
type: "POST"
|
||||
},
|
||||
columns: [
|
||||
{ data: 0, orderable:false },
|
||||
{ data: 1 },
|
||||
{ data: 2 },
|
||||
{ data: 3 },
|
||||
{ data: 4 },
|
||||
{ data: 5 },
|
||||
{ data: 6, orderable:false }
|
||||
],
|
||||
language: {
|
||||
processing: `<div class="text-center"><div class="spinner-border text-warning"></div></div>`
|
||||
}
|
||||
});
|
||||
|
||||
// ================= RESET FORM
|
||||
function resetForm(){
|
||||
$('#inputId').val('');
|
||||
$('#kode_akun').val('');
|
||||
$('#nama_akun').val('');
|
||||
$('#tipe').val('asset');
|
||||
$('#parent_id').val('');
|
||||
$('#modalAccount .modal-title').text('Tambah Akun');
|
||||
}
|
||||
|
||||
// ================= OPEN MODAL
|
||||
$('.btn-add').click(function(){
|
||||
resetForm();
|
||||
$('#btnSimpan').data('action','add');
|
||||
$('#modalAccount').modal('show');
|
||||
});
|
||||
|
||||
// ================= SAVE / UPDATE
|
||||
$('#btnSimpan').click(function(){
|
||||
|
||||
let action = $(this).data('action');
|
||||
|
||||
let data = {
|
||||
id: $('#inputId').val(),
|
||||
kode_akun: $('#kode_akun').val().trim(),
|
||||
nama_akun: $('#nama_akun').val().trim(),
|
||||
tipe: $('#tipe').val(),
|
||||
parent_id: $('#parent_id').val()
|
||||
};
|
||||
|
||||
if(!data.kode_akun || !data.nama_akun){
|
||||
Swal.fire('Warning','Kode & Nama wajib diisi','warning');
|
||||
return;
|
||||
}
|
||||
|
||||
let url = action === 'add'
|
||||
? "<?= base_url('accounts/save'); ?>"
|
||||
: "<?= base_url('accounts/update'); ?>";
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: function(res){
|
||||
if(res.status){
|
||||
$('#modalAccount').modal('hide');
|
||||
table.ajax.reload(null,false);
|
||||
Swal.fire('Sukses', res.message, 'success');
|
||||
} else {
|
||||
Swal.fire('Error', res.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
Swal.fire('Error','Terjadi kesalahan server','error');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// ================= EDIT
|
||||
$(document).on('click','.btn-edit',function(){
|
||||
|
||||
let id = $(this).data('id');
|
||||
|
||||
$.get("<?= base_url('accounts/detail/'); ?>" + id, function(res){
|
||||
|
||||
$('#inputId').val(res.id);
|
||||
$('#kode_akun').val(res.kode_akun);
|
||||
$('#nama_akun').val(res.nama_akun);
|
||||
$('#tipe').val(res.tipe);
|
||||
$('#parent_id').val(res.parent_id);
|
||||
|
||||
$('#modalAccount .modal-title').text('Edit Akun');
|
||||
$('#btnSimpan').data('action','edit');
|
||||
|
||||
$('#modalAccount').modal('show');
|
||||
|
||||
},'json');
|
||||
});
|
||||
|
||||
// ================= DELETE
|
||||
$(document).on('click','.btn-delete',function(){
|
||||
|
||||
let id = $(this).data('id');
|
||||
|
||||
Swal.fire({
|
||||
title: 'Yakin hapus?',
|
||||
text: 'Data tidak bisa dikembalikan!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Ya, hapus'
|
||||
}).then((result)=>{
|
||||
if(result.isConfirmed){
|
||||
|
||||
$.get("<?= base_url('accounts/delete/'); ?>" + id, function(res){
|
||||
|
||||
if(res.status){
|
||||
table.ajax.reload(null,false);
|
||||
Swal.fire('Sukses', res.message, 'success');
|
||||
} else {
|
||||
Swal.fire('Error', res.message, 'error');
|
||||
}
|
||||
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
<div class="container mt-4">
|
||||
<div class="card modern-card shadow-sm border-0 rounded-4">
|
||||
<div class="card-body p-4">
|
||||
|
||||
<div class="d-flex justify-content-between mb-3">
|
||||
<h5 class="mb-0">Chart of Account (COA)</h5>
|
||||
<button class="btn btn-warning btn-add">Tambah Akun</button>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="tableAccounts" class="table modern-table align-middle w-100">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th width="5%">No</th>
|
||||
<th>Kode</th>
|
||||
<th>Urutan Laporan</th>
|
||||
<th>Nama</th>
|
||||
<th>Tipe</th>
|
||||
<th>Posisi</th>
|
||||
<th>Kategori</th>
|
||||
<th width="15%">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- MODAL -->
|
||||
<div class="modal fade" id="modalAccount">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content rounded-4">
|
||||
<div class="modal-header bg-warning text-white">
|
||||
<h5 class="modal-title">Tambah Akun</h5>
|
||||
<button class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<input type="hidden" id="inputId">
|
||||
|
||||
<label class="fw-semibold">Kode Akun</label>
|
||||
<input type="text" class="form-control" id="kode_akun">
|
||||
|
||||
<label class="fw-semibold mt-2">Nama Akun</label>
|
||||
<input type="text" class="form-control" id="nama_akun">
|
||||
|
||||
<label class="fw-semibold mt-2">Urutan Laporan</label>
|
||||
<input type="number" class="form-control" id="priority">
|
||||
|
||||
<label class="fw-semibold mt-2">Tipe</label>
|
||||
<select class="form-control" id="tipe">
|
||||
<option value="asset">Asset</option>
|
||||
<option value="liability">Liability</option>
|
||||
<option value="equity">Equity</option>
|
||||
<option value="revenue">Revenue</option>
|
||||
<option value="expense">Expense</option>
|
||||
</select>
|
||||
|
||||
<label class="fw-semibold mt-2">Parent</label>
|
||||
<select class="form-control" id="parent_id">
|
||||
<option value="">-- Tanpa Parent --</option>
|
||||
<?php foreach($parent_accounts as $p): ?>
|
||||
<option value="<?= $p->id ?>">
|
||||
<?= $p->kode_akun ?> - <?= $p->nama_akun ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
|
||||
<button class="btn btn-warning" id="btnSimpan">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
let table = $('#tableAccounts').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
responsive: true,
|
||||
autoWidth: false,
|
||||
order: [],
|
||||
ajax: {
|
||||
url: "<?= base_url('accounts/get_data'); ?>",
|
||||
type: "POST"
|
||||
},
|
||||
columns: [
|
||||
{ data: 0, orderable:false },
|
||||
{ data: 1 },
|
||||
{ data: 2 },
|
||||
{ data: 3 },
|
||||
{ data: 4 },
|
||||
{ data: 5 },
|
||||
{ data: 6 },
|
||||
{ data: 7, orderable:false }
|
||||
],
|
||||
language: {
|
||||
processing: `<div class="text-center"><div class="spinner-border text-warning"></div></div>`
|
||||
}
|
||||
});
|
||||
|
||||
// ================= RESET FORM
|
||||
function resetForm(){
|
||||
$('#inputId').val('');
|
||||
$('#kode_akun').val('');
|
||||
$('#nama_akun').val('');
|
||||
$('#priority').val('');
|
||||
$('#tipe').val('asset');
|
||||
$('#parent_id').val('');
|
||||
$('#modalAccount .modal-title').text('Tambah Akun');
|
||||
}
|
||||
|
||||
// ================= OPEN MODAL
|
||||
$('.btn-add').click(function(){
|
||||
resetForm();
|
||||
$('#btnSimpan').data('action','add');
|
||||
$('#modalAccount').modal('show');
|
||||
});
|
||||
|
||||
// ================= SAVE / UPDATE
|
||||
$('#btnSimpan').click(function(){
|
||||
|
||||
let action = $(this).data('action');
|
||||
|
||||
let data = {
|
||||
id: $('#inputId').val(),
|
||||
kode_akun: $('#kode_akun').val().trim(),
|
||||
nama_akun: $('#nama_akun').val().trim(),
|
||||
priority: $('#priority').val().trim(),
|
||||
tipe: $('#tipe').val(),
|
||||
parent_id: $('#parent_id').val()
|
||||
};
|
||||
|
||||
if(!data.kode_akun || !data.nama_akun){
|
||||
Swal.fire('Warning','Kode & Nama wajib diisi','warning');
|
||||
return;
|
||||
}
|
||||
|
||||
let url = action === 'add'
|
||||
? "<?= base_url('accounts/save'); ?>"
|
||||
: "<?= base_url('accounts/update'); ?>";
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: function(res){
|
||||
if(res.status){
|
||||
$('#modalAccount').modal('hide');
|
||||
table.ajax.reload(null,false);
|
||||
Swal.fire('Sukses', res.message, 'success');
|
||||
} else {
|
||||
Swal.fire('Error', res.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
Swal.fire('Error','Terjadi kesalahan server','error');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// ================= EDIT
|
||||
$(document).on('click','.btn-edit',function(){
|
||||
|
||||
let id = $(this).data('id');
|
||||
|
||||
$.get("<?= base_url('accounts/detail/'); ?>" + id, function(res){
|
||||
|
||||
$('#inputId').val(res.id);
|
||||
$('#kode_akun').val(res.kode_akun);
|
||||
$('#nama_akun').val(res.nama_akun);
|
||||
$('#priority').val(res.priority);
|
||||
$('#tipe').val(res.tipe);
|
||||
$('#parent_id').val(res.parent_id);
|
||||
|
||||
$('#modalAccount .modal-title').text('Edit Akun');
|
||||
$('#btnSimpan').data('action','edit');
|
||||
|
||||
$('#modalAccount').modal('show');
|
||||
|
||||
},'json');
|
||||
});
|
||||
|
||||
// ================= DELETE
|
||||
$(document).on('click','.btn-delete',function(){
|
||||
|
||||
let id = $(this).data('id');
|
||||
|
||||
Swal.fire({
|
||||
title: 'Yakin hapus?',
|
||||
text: 'Data tidak bisa dikembalikan!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Ya, hapus'
|
||||
}).then((result)=>{
|
||||
if(result.isConfirmed){
|
||||
|
||||
$.get("<?= base_url('accounts/delete/'); ?>" + id, function(res){
|
||||
|
||||
if(res.status){
|
||||
table.ajax.reload(null,false);
|
||||
Swal.fire('Sukses', res.message, 'success');
|
||||
} else {
|
||||
Swal.fire('Error', res.message, 'error');
|
||||
}
|
||||
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -214,9 +214,9 @@
|
||||
<input type="hidden" id="delete_id">
|
||||
<label>Pilih Alasan:</label>
|
||||
<select id="delete_alasan" class="form-control">
|
||||
<option value="dijual_untung">Dijual (Untung)</option>
|
||||
<option value="dijual_rugi">Dijual (Rugi)</option>
|
||||
<option value="dihapus">Dihapus</option>
|
||||
<option value="dijual">Dijual</option>
|
||||
<option value="rusak">Asset Rusak</option>
|
||||
<option value="dihapus">Dihapus (Salah Input)</option>
|
||||
</select>
|
||||
<label class="mt-2">Keterangan:</label>
|
||||
<textarea id="delete_keterangan" class="form-control" rows="3" placeholder="Alasan detail penghapusan..."></textarea>
|
||||
@@ -559,6 +559,8 @@ $('#btnConfirmDelete').click(function(){
|
||||
$('#modalDelete').modal('hide');
|
||||
table.ajax.reload(null,false);
|
||||
Swal.fire('Berhasil','Asset berhasil dihapus','success');
|
||||
}else{
|
||||
Swal.fire('Error',res.message || 'Gagal menghapus asset','error');
|
||||
}
|
||||
},'json').always(()=>{
|
||||
btn.prop('disabled', false).html('Hapus');
|
||||
|
||||
@@ -365,7 +365,7 @@ $('.btn-add-bayar').click(function(){
|
||||
|
||||
$('#tableBayar tbody').append(`
|
||||
<tr>
|
||||
<td><select class="form-control account_id">${accountOptionsAssets}</select></td>
|
||||
<td style="width: 60%;"><select class="form-control account_id select-search">${accountOptionsAssets}</select></td>
|
||||
<td><input type="text" class="form-control debit text-end format-rupiah"></td>
|
||||
<td><button class="btn btn-danger btn-remove">X</button></td>
|
||||
</tr>
|
||||
|
||||
@@ -198,10 +198,15 @@ body {
|
||||
<div class="bg-warning text-white p-2 rounded-3 d-flex align-items-center justify-content-center" style="width:38px;height:38px;">
|
||||
<i class="bi bi-tools fs-5"></i>
|
||||
</div>
|
||||
<div>
|
||||
<div class="flex-grow-1">
|
||||
<h5 class="mb-0 fw-bold" style="color:#1a1a2e;">Peralatan Teknisi</h5>
|
||||
<small class="text-muted">Kelola barang bawaan, pengembalian, dan transfer antar teknisi</small>
|
||||
</div>
|
||||
<div>
|
||||
<a href="<?= base_url('teknisi/log_barang'); ?>" class="btn btn-warning" id="btnLogBarang">
|
||||
<i class="bi bi-journal-text me-1"></i> Log Barang Teknisi
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-3">
|
||||
@@ -485,6 +490,7 @@ body {
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:50px">No</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Barcode</th>
|
||||
<th>Nama Barang</th>
|
||||
<th>Serial Number</th>
|
||||
@@ -526,7 +532,9 @@ body {
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<small class="text-muted">Tanggal</small><br>
|
||||
<strong id="fbTanggal">-</strong>
|
||||
<select class="form-select form-select-sm d-inline-block" id="fbTanggalList" style="max-width:2000px">
|
||||
<option value="">-- Pilih Tanggal --</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<small class="text-muted">Teknisi</small><br>
|
||||
@@ -544,6 +552,7 @@ body {
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:50px">No</th>
|
||||
<th style="width:85px">Tanggal</th>
|
||||
<th>Barcode</th>
|
||||
<th>Nama Barang</th>
|
||||
<th>Serial Number</th>
|
||||
@@ -746,9 +755,10 @@ $(function(){
|
||||
{ data: 2 },
|
||||
{ data: 3 },
|
||||
{ data: 4 },
|
||||
{ data: 5, className: 'text-center' }
|
||||
{ data: 5 },
|
||||
{ data: 6, className: 'text-center' }
|
||||
],
|
||||
order: [[1, 'asc']],
|
||||
order: [[1, 'desc']],
|
||||
// language: { url: "//cdn.datatables.net/plug-ins/1.13.6/i18n/id.json" },
|
||||
pageLength: 10,
|
||||
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, 'All']]
|
||||
@@ -764,16 +774,35 @@ $(function(){
|
||||
let dtFormBarang;
|
||||
let _formBarangUserId = null;
|
||||
|
||||
$(document).on('click', '.btn-form-barang-bawaan', function(){
|
||||
let userId = $(this).data('id');
|
||||
let nama = $(this).data('nama');
|
||||
_formBarangUserId = userId;
|
||||
function loadListTanggal(userId) {
|
||||
$.get("<?= base_url('teknisi/get_date_by_employee_id'); ?>", {user_id: userId}, function(r){
|
||||
if (!r.status) {
|
||||
Swal.fire({icon:'error', text:r.message});
|
||||
return;
|
||||
}
|
||||
|
||||
$('#fbNoFaktur').text('Memuat...');
|
||||
$('#fbTanggal').text('-');
|
||||
$('#fbTeknisi').text(nama);
|
||||
let opt='<option value="">-- Pilih Tanggal --</option><option value="all">ALL</option>';
|
||||
r.data.forEach(d=>{
|
||||
let parts = d.tanggal.split('-');
|
||||
let display = parts[2] + '/' + parts[1] + '/' + parts[0];
|
||||
opt += `<option value="${d.tanggal}">${display}</option>`;
|
||||
});
|
||||
$('#fbTanggalList').html(opt);
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
$.get("<?= base_url('teknisi/get_form_barang_bawaan_data'); ?>", {user_id: userId}, function(r){
|
||||
function loadFormBarangData() {
|
||||
let tanggalVal = $('#fbTanggalList').val();
|
||||
|
||||
if (!tanggalVal) {
|
||||
$('#fbNoFaktur').text('Memuat...');
|
||||
if (dtFormBarang) {
|
||||
dtFormBarang.clear().draw();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
$.get("<?= base_url('teknisi/get_form_barang_bawaan_data'); ?>", {user_id: _formBarangUserId, tanggal: tanggalVal}, function(r){
|
||||
if (!r.status) {
|
||||
Swal.fire({icon:'error', text:r.message});
|
||||
return;
|
||||
@@ -781,8 +810,6 @@ $(function(){
|
||||
|
||||
let d = r.data;
|
||||
$('#fbNoFaktur').text(d.no_faktur);
|
||||
$('#fbTanggal').text(d.tanggal);
|
||||
$('#fbTeknisi').text(d.teknisi);
|
||||
|
||||
if (dtFormBarang) {
|
||||
dtFormBarang.destroy();
|
||||
@@ -792,24 +819,63 @@ $(function(){
|
||||
data: d.items,
|
||||
columns: [
|
||||
{ data: 'no' },
|
||||
{ data: 'tanggal' },
|
||||
{ data: 'barcode' },
|
||||
{ data: 'nama_barang' },
|
||||
{ data: 'serial_number' },
|
||||
{ data: 'jumlah', className: 'text-center' }
|
||||
],
|
||||
// language: { url: "//cdn.datatables.net/plug-ins/1.13.6/i18n/id.json" },
|
||||
pageLength: 10,
|
||||
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, 'All']],
|
||||
order: []
|
||||
});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
$('#fbTanggalList').on('change', function() {
|
||||
loadFormBarangData();
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-form-barang-bawaan', function(){
|
||||
let userId = $(this).data('id');
|
||||
let nama = $(this).data('nama');
|
||||
_formBarangUserId = userId;
|
||||
|
||||
$('#fbNoFaktur').text('Memuat...');
|
||||
$('#fbTanggalList').val('');
|
||||
$('#fbTeknisi').text(nama);
|
||||
|
||||
if (!dtFormBarang) {
|
||||
dtFormBarang = $('#tableFormBarang').DataTable({
|
||||
data: [],
|
||||
columns: [
|
||||
{ data: 'no' },
|
||||
{ data: 'tanggal' },
|
||||
{ data: 'barcode' },
|
||||
{ data: 'nama_barang' },
|
||||
{ data: 'serial_number' },
|
||||
{ data: 'jumlah', className: 'text-center' }
|
||||
],
|
||||
pageLength: 10,
|
||||
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, 'All']],
|
||||
order: [],
|
||||
language: {
|
||||
emptyTable: "No data available"
|
||||
}
|
||||
});
|
||||
} else {
|
||||
dtFormBarang.clear().draw();
|
||||
}
|
||||
|
||||
loadListTanggal(userId);
|
||||
|
||||
$('#modalFormBarangBawaan').modal('show');
|
||||
});
|
||||
|
||||
$('#btnCetakPDF').click(function(){
|
||||
if (_formBarangUserId) {
|
||||
let url = "<?= base_url('teknisi/generate_pdf_barang_bawaan/'); ?>" + _formBarangUserId;
|
||||
let tanggalVal = $('#fbTanggalList').val();
|
||||
let url = "<?= base_url('teknisi/generate_pdf_barang_bawaan/'); ?>" + _formBarangUserId + '?tanggal=' + encodeURIComponent(tanggalVal);
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
});
|
||||
@@ -929,7 +995,7 @@ $(function(){
|
||||
|
||||
refreshTable(dtKembalikan, kembalikanData);
|
||||
$('#scanKembalikan').val('').focus();
|
||||
Swal.fire({icon:'success', text:'Barang ditambahkan ke daftar pengembalian', timer:1200, showConfirmButton:false});
|
||||
// Swal.fire({icon:'success', text:'Barang ditambahkan ke daftar pengembalian', timer:1200, showConfirmButton:false});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
@@ -970,6 +1036,16 @@ $(function(){
|
||||
return;
|
||||
}
|
||||
|
||||
if (r.data.barcode_status === 'sold_out') {
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: 'Barang Tidak Dapat Dibawa',
|
||||
text: 'Barcode ' + r.data.barcode + ' sudah berstatus SOLD OUT sehingga tidak dapat diproses.'
|
||||
});
|
||||
$('#scanDibawa').val('').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
let data = r.data;
|
||||
let no = dibawaData.length + 1;
|
||||
|
||||
@@ -983,7 +1059,7 @@ $(function(){
|
||||
|
||||
refreshTable(dtDibawa, dibawaData);
|
||||
$('#scanDibawa').val('').focus();
|
||||
Swal.fire({icon:'success', text:'Barang ditambahkan ke daftar bawaan', timer:1200, showConfirmButton:false});
|
||||
// Swal.fire({icon:'success', text:'Barang ditambahkan ke daftar bawaan', timer:1200, showConfirmButton:false});
|
||||
}, 'json');
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/dataTables.bootstrap5.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/responsive/2.4.1/css/responsive.bootstrap5.min.css">
|
||||
|
||||
<style>
|
||||
:root {
|
||||
--tech-primary: #ff9800;
|
||||
--tech-primary-light: #fff3e0;
|
||||
--tech-primary-dark: #ff9800;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #f5f7fb;
|
||||
}
|
||||
|
||||
.tech-card {
|
||||
border: none;
|
||||
border-radius: 14px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.tech-card .card-header-custom {
|
||||
background: linear-gradient(135deg, var(--tech-primary), var(--tech-primary-dark));
|
||||
color: #fff;
|
||||
padding: 14px 20px;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.tech-card .card-body {
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.table-tech thead th {
|
||||
background: #f8f9fa;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: .4px;
|
||||
color: #495057;
|
||||
border-bottom: 2px solid #ffcc80;
|
||||
padding: 10px 8px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.table-tech tbody td {
|
||||
padding: 8px;
|
||||
vertical-align: middle;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.table-tech td .badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 65px;
|
||||
padding: 0.35em 0.65em;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.table-tech tbody tr:hover {
|
||||
background: #fff3e0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container-fluid px-3 mt-3">
|
||||
|
||||
<div class="d-flex align-items-center gap-2 mb-3">
|
||||
<div class="bg-warning text-white p-2 rounded-3 d-flex align-items-center justify-content-center" style="width:38px;height:38px;">
|
||||
<i class="bi bi-journal-text fs-5"></i>
|
||||
</div>
|
||||
<div class="flex-grow-1">
|
||||
<h5 class="mb-0 fw-bold" style="color:#1a1a2e;">Log Barang Teknisi</h5>
|
||||
<small class="text-muted">Riwayat barang yang pernah dibawa oleh teknisi</small>
|
||||
</div>
|
||||
<div>
|
||||
<a href="<?= base_url('teknisi'); ?>" class="btn btn-secondary">
|
||||
<i class="bi bi-arrow-left me-1"></i> Kembali
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card tech-card">
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-tech table-striped w-100" id="tblLogBarang">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Nama Teknisi</th>
|
||||
<th>Kode Barang</th>
|
||||
<th>Barcode</th>
|
||||
<th>Nama Barang</th>
|
||||
<th>Tanggal Dibawa</th>
|
||||
<th>Tanggal Kembali</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$('#tblLogBarang').DataTable({
|
||||
processing: true,
|
||||
serverSide: false,
|
||||
ajax: {
|
||||
url: "<?= base_url('teknisi/get_log_data'); ?>",
|
||||
dataSrc: 'data'
|
||||
},
|
||||
columns: [
|
||||
{ data: 0 },
|
||||
{ data: 1 },
|
||||
{ data: 2 },
|
||||
{ data: 3 },
|
||||
{ data: 4 },
|
||||
{ data: 5 },
|
||||
{ data: 6 },
|
||||
{ data: 7 }
|
||||
],
|
||||
pageLength: 25,
|
||||
lengthMenu: [
|
||||
[25, 50, 100, -1],
|
||||
[25, 50, 100, 'All']
|
||||
],
|
||||
responsive: true,
|
||||
searching: true,
|
||||
paging: true,
|
||||
ordering: true,
|
||||
info: true,
|
||||
language: {
|
||||
search: "Cari:",
|
||||
lengthMenu: "Tampilkan _MENU_ data",
|
||||
info: "Menampilkan _START_ - _END_ dari _TOTAL_ data",
|
||||
zeroRecords: "Tidak ada data",
|
||||
paginate: {
|
||||
first: "Awal",
|
||||
last: "Akhir",
|
||||
next: "»",
|
||||
previous: "«"
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 150 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 133 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 150 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 138 KiB |
Reference in New Issue
Block a user