Purchase create

This commit is contained in:
efrilm
2025-09-13 03:03:08 +07:00
parent 98d6446b0c
commit 222beb5043
3 changed files with 278 additions and 146 deletions
-40
View File
@@ -10,46 +10,6 @@ export type PurchaseOrderType = {
total: number
}
export interface IngredientItem {
id: number
ingredient: { label: string; value: string } | null
deskripsi: string
kuantitas: number
satuan: { label: string; value: string } | null
harga: number
total: number
}
export interface PurchaseOrderFormData {
vendor: { label: string; value: string } | null
nomor: string
tglTransaksi: string
tglJatuhTempo: string
referensi: string
termin: { label: string; value: string } | null
hargaTermasukPajak: boolean
showShippingInfo: boolean
tanggalPengiriman: string
ekspedisi: { label: string; value: string } | null
noResi: string
showPesan: boolean
showAttachment: boolean
showTambahDiskon: boolean
showBiayaPengiriman: boolean
showBiayaTransaksi: boolean
showUangMuka: boolean
pesan: string
ingredientItems: IngredientItem[]
transactionCosts?: TransactionCost[]
subtotal?: number
discountType?: 'percentage' | 'fixed'
downPaymentType?: 'percentage' | 'fixed'
discountValue?: string
shippingCost?: string
transactionCost?: string
downPayment?: string
}
export interface TransactionCost {
id: string
type: string
+25
View File
@@ -1,3 +1,4 @@
import { IngredientItem } from './ingredient'
import { Vendor } from './vendor'
export interface PurchaseOrderRequest {
@@ -93,3 +94,27 @@ export interface PurchaseOrderFile {
created_at: string
updated_at: string
}
export interface PurchaseOrderFormData {
vendor: { label: string; value: string } | null
po_number: string
transaction_date: string
due_date: string
reference: string
status: 'draft' | 'sent' | 'approved' | 'received' | 'cancelled'
showPesan: boolean
showAttachment: boolean
message: string
items: PurchaseOrderFormItem[]
attachment_file_ids: string[]
}
export interface PurchaseOrderFormItem {
id: number // for UI tracking
ingredient: { label: string; value: string; originalData?: IngredientItem } | null
description: string
quantity: number
unit: { label: string; value: string } | null
amount: number
total: number // calculated field for UI
}