fix(FE): fixing response data debt supplier

This commit is contained in:
randy-ar
2026-01-13 10:46:52 +07:00
parent eb1337292b
commit 6702dd7dc6
6 changed files with 484 additions and 70 deletions
+292
View File
@@ -0,0 +1,292 @@
[
{
"supplier": {
"id": 1,
"name": "PT CHAROEN POKPHAND INDONESIA Tbk",
"alias": "CPI",
"category": "SAPRONAK"
},
"initial_balance": -9680000,
"rows": [
{
"pr_number": "PR-TEST-202501-01",
"po_number": "PO-TEST-202501-01",
"po_date": "2025-01-15",
"received_date": "2025-01-15",
"aging": 0,
"area": {
"id": 1,
"name": "Bandung"
},
"warehouse": {
"id": 3,
"name": "Gudang Kandang Bandung 1",
"type": "KANDANG",
"area": {
"id": 1,
"name": "Bandung"
}
},
"due_date": "2025-02-14",
"due_status": "Sudah Jatuh Tempo",
"total_price": 5610000,
"payment_price": 0,
"debt_price": -5610000,
"status": "Belum Lunas",
"travel_number": "-",
"balance": -15290000
},
{
"pr_number": "PR-TEST-202501-02",
"po_number": "PO-TEST-202501-02",
"po_date": "2025-01-15",
"received_date": "2025-01-15",
"aging": 0,
"area": {
"id": 1,
"name": "Bandung"
},
"warehouse": {
"id": 4,
"name": "Gudang Kandang Bandung 2",
"type": "KANDANG",
"area": {
"id": 1,
"name": "Bandung"
}
},
"due_date": "2025-02-14",
"due_status": "Sudah Jatuh Tempo",
"total_price": 5035000,
"payment_price": 0,
"debt_price": -5035000,
"status": "Belum Lunas",
"travel_number": "-",
"balance": -20325000
},
{
"pr_number": "INIT-90001",
"po_number": "SALDO-AWAL",
"po_date": "-",
"received_date": "2026-01-05",
"aging": 0,
"due_date": "-",
"due_status": "-",
"total_price": 0,
"payment_price": -10000000,
"debt_price": -30325000,
"status": "Pembayaran",
"travel_number": "-",
"balance": -30325000
},
{
"pr_number": "PR-LTI-9001",
"po_number": "PO-LTI-9001",
"po_date": "2026-01-10",
"received_date": "2026-01-10",
"aging": 2,
"area": {
"id": 1,
"name": "Bandung"
},
"warehouse": {
"id": 3,
"name": "Gudang Kandang Bandung 1",
"type": "KANDANG",
"area": {
"id": 1,
"name": "Bandung"
}
},
"due_date": "2026-02-09",
"due_status": "Mendekati Jatuh Tempo",
"total_price": 52500000,
"payment_price": 2000000,
"debt_price": -50500000,
"status": "Belum Lunas",
"travel_number": "SJ-9001",
"balance": -82825000
},
{
"pr_number": "PAY-OUT-90001",
"po_number": "PO-LTI-9001",
"po_date": "-",
"received_date": "2026-01-10",
"aging": 0,
"due_date": "-",
"due_status": "-",
"total_price": 0,
"payment_price": 2000000,
"debt_price": -80825000,
"status": "Pembayaran",
"travel_number": "-",
"balance": -80825000
},
{
"pr_number": "PR-LTI-0001",
"po_number": "PO-LTI-0001",
"po_date": "2026-01-10",
"received_date": "2026-01-10",
"aging": 2,
"area": {
"id": 1,
"name": "Bandung"
},
"warehouse": {
"id": 3,
"name": "Gudang Kandang Bandung 1",
"type": "KANDANG",
"area": {
"id": 1,
"name": "Bandung"
}
},
"due_date": "2026-02-09",
"due_status": "Mendekati Jatuh Tempo",
"total_price": 52500000,
"payment_price": 1800000,
"debt_price": -50700000,
"status": "Belum Lunas",
"travel_number": "3232",
"balance": -133325000
},
{
"pr_number": "PAY-OUT-00003",
"po_number": "PO-LTI-0001",
"po_date": "-",
"received_date": "2026-01-10",
"aging": 0,
"due_date": "-",
"due_status": "-",
"total_price": 0,
"payment_price": 2000000,
"debt_price": -131325000,
"status": "Pembayaran",
"travel_number": "-",
"balance": -131325000
},
{
"pr_number": "PAY-OUT-90002",
"po_number": "2323",
"po_date": "-",
"received_date": "2026-01-11",
"aging": 0,
"due_date": "-",
"due_status": "-",
"total_price": 0,
"payment_price": 200000,
"debt_price": -131125000,
"status": "Pembayaran",
"travel_number": "-",
"balance": -131125000
},
{
"pr_number": "PAY-OUT-00002",
"po_number": "2323",
"po_date": "-",
"received_date": "2026-01-11",
"aging": 0,
"due_date": "-",
"due_status": "-",
"total_price": 0,
"payment_price": 200000,
"debt_price": -130925000,
"status": "Pembayaran",
"travel_number": "-",
"balance": -130925000
},
{
"pr_number": "INIT-00001",
"po_number": "PO-LTI-0001",
"po_date": "-",
"received_date": "2026-01-11",
"aging": 0,
"due_date": "-",
"due_status": "-",
"total_price": 0,
"payment_price": -200000,
"debt_price": -131125000,
"status": "Pembayaran",
"travel_number": "-",
"balance": -131125000
},
{
"pr_number": "PR-LTI-9002",
"po_number": "PO-LTI-9002",
"po_date": "2026-01-12",
"received_date": "2026-01-12",
"aging": 0,
"area": {
"id": 1,
"name": "Bandung"
},
"warehouse": {
"id": 3,
"name": "Gudang Kandang Bandung 1",
"type": "KANDANG",
"area": {
"id": 1,
"name": "Bandung"
}
},
"due_date": "2026-02-11",
"due_status": "Mendekati Jatuh Tempo",
"total_price": 30000000,
"payment_price": 5000000,
"debt_price": -25000000,
"status": "Belum Lunas",
"travel_number": "SJ-9002",
"balance": -161125000
},
{
"pr_number": "PAY-OUT-90003",
"po_number": "PO-LTI-9002",
"po_date": "-",
"received_date": "2026-01-12",
"aging": 0,
"due_date": "-",
"due_status": "-",
"total_price": 0,
"payment_price": 5000000,
"debt_price": -156125000,
"status": "Pembayaran",
"travel_number": "-",
"balance": -156125000
},
{
"pr_number": "PR-LTI-0002",
"po_number": "PO-LTI-0002",
"po_date": "2026-01-12",
"received_date": "2026-01-12",
"aging": 0,
"area": {
"id": 1,
"name": "Bandung"
},
"warehouse": {
"id": 4,
"name": "Gudang Kandang Bandung 2",
"type": "KANDANG",
"area": {
"id": 1,
"name": "Bandung"
}
},
"due_date": "2026-02-11",
"due_status": "Mendekati Jatuh Tempo",
"total_price": 45000000,
"payment_price": 0,
"debt_price": -45000000,
"status": "Belum Lunas",
"travel_number": "232",
"balance": -201125000
}
],
"total": {
"aging": 2,
"total_price": 190645000,
"payment_price": 8800000,
"debt_price": -181845000
}
}
]
+29
View File
@@ -0,0 +1,29 @@
/**
* Dummy data for DebtSupplier
* Generated from: debt-supplier.dummy.json
*
* This file is auto-generated. Do not edit manually.
*/
import { DebtSupplier } from '../../types/api/report/debt-supplier';
import { BaseApiResponse } from '@/types/api/api-general';
import dummyData from './debt-supplier.dummy.json';
/**
* Get dummy DebtSupplier data
* @returns Promise with BaseApiResponse containing DebtSupplier
*/
export async function getDummyDebtSupplier(): Promise<
BaseApiResponse<DebtSupplier[]> | undefined
> {
return new Promise((resolve) => {
setTimeout(() => {
resolve({
code: 200,
status: 'success',
message: 'Data retrieved successfully',
data: dummyData as unknown as DebtSupplier[],
});
}, 500);
});
}