penambahan menu approval per po per proses

This commit is contained in:
Aji Setiaji
2025-05-30 21:59:22 +07:00
parent ec9d47846e
commit 4126f378f5
6 changed files with 239 additions and 195 deletions

View File

@@ -98,7 +98,6 @@
{ key: "acknowledged", title: "Acknowledged" },
{ key: "acknowledge_by", title: "Acknowledge By" },
{ key: "created_at", title: "Created At" },
{ key: "actions", title: "Actions" }, // For edit/delete buttons
];
let currentPage = 1;
@@ -123,9 +122,8 @@
) {
let query = supabase
.from("purchaseorder_data")
.select(
"id, purchase_order_number, villa_data, issue_id, prepared_date, po_type, po_quantity, po_status, approved_vendor, acknowledged, acknowledge_by, approved_price, approved_quantity, total_approved_order_amount, approval, completed_status, received, received_by, input_by, approved_by, created_at",
)
.select("*")
.eq("po_status", "APPROVED")
.order(sort || "created_at", { ascending: order === "asc" })
.range(offset, offset + limit - 1);
if (filter) {
@@ -409,7 +407,7 @@
async function acknowledgedOk(id: string, status: boolean) {
const { data, error } = await supabase
.from("purchase_orders")
.update({ acknowledged: status })
.update({ acknowledged: status, po_status: "ACKNOWLEDGED" })
.eq("id", id);
if (error) {
@@ -660,21 +658,6 @@
>
</select>
</td>
{:else if col.key === "actions"}
<td class="px-4 py-2">
<button
class="inline-flex items-center gap-1 rounded bg-blue-600 px-3 py-1.5 text-white text-xs font-medium hover:bg-blue-700"
on:click={() => openModal(row)}
>
✏️ Edit
</button>
<button
class="inline-flex items-center gap-1 rounded bg-red-600 px-3 py-1.5 text-white text-xs font-medium hover:bg-red-700"
on:click={() => deleteProject(row.id)}
>
🗑️ Delete
</button>
</td>
{:else if col.key === "move_issue"}
<td class="px-4 py-2">
<button