---
# System prepended metadata

title: Material Management - GSI

---

# Material Management - GSI

## Daftar Fitur:
- Service Persediaan
    - Master
    - Master Gudang
        - Master Kategori Item
        - Master Item
        - Master Satuan
        - Harga Beli Supplier
    - Permintaan Stok 
    - Purchase Order
    - Penerimaan Barang
    - Verifikasi PO
    - Faktur Pembelian (Penerimaan Barang)
    - Verifikasi Pembayaran
    - Pengeluaran Stok
    - Stok Opname
- Service Auth
    - Check Token for all of service
    - 
- Service Accounting
    - Resolve all project
    - Create Proyek
    - RAB Proyek
    


## Flow Persediaan

```plantuml
actor divisi
actor gudang
actor pembelian
actor akunting
actor verifikator
participant "Sistem Informasi" as si
participant "Persediaan Service" as persediaanService
participant "Pembelian Service" as pembelianService
database "DB Stok" as dbStok
database "DB Pembelian" as dbPembelian


divisi -> si : Permintaan Barang
pembelian <- si : daftar permintaan barang
pembelian -> dbStok: Cek apakah stok cukup?
pembelian -> dbStok: Data stok

alt stok tidak cukup
    pembelian -> si : Buat PO
    si -> pembelianService: Create PO
    pembelianService -> dbPembelian
    si <- dbPembelian: data pembelian
    verifikator <- si
    verifikator -> si: verifikasi PO
    alt jika diverifikasi verifikator
        pembelian <- si : lanjut beli barang
        pembelian -> akunting: nota pembelian
        si -> pembelianService
        pembelianService -> dbPembelian
        si <- pembelianService: data pembelian
        gudang <- si: penerimaan
    end
end

gudang <- pembelian : data barang
gudang -> si : pengeluaran barang
si -> persediaanService
persediaanService -> dbStok
si <- dbStok
gudang <- si: data barang
divisi <- gudang: penyaluran barang
```




## ER-Diagram

```plantuml
' hide the spot
hide circle

' avoid problems with angled crows feet
skinparam linetype ortho

entity "m_item_kategori" as mk {
    *id : uuid
    --
    tenant_id uuid
    *nama_kategori : text
    deskripsi : text
    created_at timestamp
    created_by text
    
}

entity "m_supplier" as ms {
    *id : uuid
    --
    tenant_id uuid
    *nama_supplier : text
    alamat : text
    kota : text
    telepon : text
    email : text
    no_rekening : text
    termin : int
    created_at timestamp
    created_by text
    
}

entity "m_item" as mi {
  *id : uuid
  --
  *nama_item : text
  deskripsi : text
  kategori_id uuid 
    supplier_default_id uuid
}

entity "m_item_harga_supplier" as mihs {
    *id : uuid
    --
    *tenant_id : uuid
    item_id: uuid
    supplier_id : uuid
    satuan_id : uuid  
    konversi: integer
    harga: numeric
    diskon: varchar(50)
    ppn: numeric default 0
    rangking: integer
}


entity "permintaan_stok" as p {
  *id : uuid
  --
  tanggal: date
  project_id: uuid  
  keterangan: text, 
  created_by: text,
  created_at: timestamp
}

entity "permintaan_stok_detail" as pd {
  *id : uuid
  --
  permintaan_id: uuid  
  item_id: uuid
  qty_req: numeric(18,2)
  qty_rcv: numeric(18,2) 
  satuan_id: uuid
  konv : int  
}

entity "m_satuan" as st {
    *id : uuid
    --
    tenant_id: uuid
    nama_satuan: varchar(50)
}

entity "m_item_satuan" as mist {
    *id : uuid
    --
    tenant_id: uuid
    item_id: uuid
    satuan_id: uuid
    konversi: integer
    hpp: numeric
    barcode: text
}

pd ||..o{p
pd ||..o{mi

mk ||..o{ mi
ms ||..o{ mi    
pd ||..o{ st    

mihs ||..o{ mi
mihs ||..o{ ms
mihs ||..o{ st    
    
mist ||..o{ st
mist ||..o{ mi
```

## ER-Pembelian

```plantuml
' hide the spot
hide circle

' avoid problems with angled crows feet
skinparam linetype ortho


entity "pr" as pr {
  *id : uuid
  --
  nomor: varchar(15)
  tanggal: date
  keterangan: text 
  created_by: text,
  created_at: timestamp
}

entity "pr_detail" as prd {
  *id : uuid
  --
  pr_id: uuid 
  seq: int  
  item_id: uuid
  item_mov_desc: varchar(255)
  qty_req: numeric(18,2)
  qty_rcv: numeric(18,2) 
  satuan_id: uuid
  konv : int  
  qty_ordered: numeric(18,2)
  qty_received: numeric(18,2) 
  notes: text  
}

pr ||..o{ prd

entity "po" as po {
  *id : uuid
  --
  tanggal: date
  keterangan: text, 
  created_by: text,
  created_at: timestamp
}

entity "po_detail" as pod {
  *id : uuid
  --
  permintaan_id: uuid  
  item_id: uuid
  qty_req: numeric(18,2)
  qty_rcv: numeric(18,2) 
  satuan_id: uuid
  konv : int  
  prd_id: uuid
}
po ||..o{ pod
prd ||..o{ pod
    
entity "apinv" as ap {
  *id : uuid
  --
  tanggal: date
  keterangan: text, 
  created_by: text,
  created_at: timestamp
}

entity "apinv_detail" as apd {
  *id : uuid
  --
  pod_id: uuid  
  item_id: uuid
  qty_req: numeric(18,2)
  qty_rcv: numeric(18,2) 
  satuan_id: uuid
  konv : int  
  rcv_id : uuid  
}
    
ap ||..o{ apd
pod ||..o{ apd
apd ||..o{ apd    
```