mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 13:55:45 +00:00
Merge branch 'development' into feat/FE/US-335/production-data-report
This commit is contained in:
Vendored
+92
-2
@@ -1,9 +1,34 @@
|
||||
import { Area } from '@/types/api/master-data/area';
|
||||
import { Fcr } from '@/types/api/master-data/fcr';
|
||||
import { Flock } from '@/types/api/master-data/flock';
|
||||
import { Kandang } from '@/types/api/master-data/kandang';
|
||||
import { Location } from '@/types/api/master-data/location';
|
||||
import { BaseApproval, BaseMetadata } from '@/types/api/api-general';
|
||||
import { Kandang } from '@/types/api/master-data/kandang';
|
||||
import { Product } from '@type/api/master-data/product';
|
||||
import { Customer } from '@type/api/master-data/customer';
|
||||
import { BaseMetadata } from '@/types/api/api-general';
|
||||
|
||||
export type BaseSales = {
|
||||
id: number;
|
||||
realization_date: string;
|
||||
age: number;
|
||||
do_number: string;
|
||||
product: Product;
|
||||
customer: Customer;
|
||||
qty: number;
|
||||
weight: number;
|
||||
avg_weight: number;
|
||||
price: number;
|
||||
total_price: number;
|
||||
kandang: Kandang;
|
||||
payment_status: string;
|
||||
};
|
||||
|
||||
export type BaseClosingSales = {
|
||||
project_type: string;
|
||||
flock_id: number;
|
||||
period: number;
|
||||
sales: BaseSales[];
|
||||
};
|
||||
|
||||
export type BaseClosing = {
|
||||
id: number;
|
||||
@@ -88,3 +113,68 @@ export type ClosingProductionData = {
|
||||
variance_feed_kg: number;
|
||||
};
|
||||
};
|
||||
|
||||
// ====== PERHITUNGAN SAPRONAK ======
|
||||
|
||||
export type RowSapronakCalculation = {
|
||||
id: number;
|
||||
tanggal: string;
|
||||
no_referensi: string;
|
||||
qty_masuk: number;
|
||||
qty_keluar: number;
|
||||
qty_pakai: number;
|
||||
uraian: string;
|
||||
kategori_produk: string;
|
||||
harga_beli_per_qty: number;
|
||||
total_harga: number;
|
||||
keterangan: string;
|
||||
};
|
||||
|
||||
export type TotalSapronakCalculation = {
|
||||
label: string;
|
||||
qty_masuk: number;
|
||||
qty_keluar: number;
|
||||
qty_pakai: number;
|
||||
harga_beli_per_qty: number;
|
||||
total_harga: number;
|
||||
};
|
||||
|
||||
export type ClosingSapronakCalculationItem = {
|
||||
rows: RowSapronakCalculation[];
|
||||
total: TotalSapronakCalculation;
|
||||
};
|
||||
|
||||
export type ClosingSapronakCalculation = {
|
||||
doc_broiler: ClosingSapronakCalculationItem;
|
||||
ovk: ClosingSapronakCalculationItem;
|
||||
pakan: ClosingSapronakCalculationItem;
|
||||
};
|
||||
|
||||
// ====== OVERHEAD ======
|
||||
export type ClosingOverhead = {
|
||||
overheads: Overhead[];
|
||||
total: OverheadTotal;
|
||||
};
|
||||
|
||||
export type Overhead = {
|
||||
item_name: string;
|
||||
uom_name: string;
|
||||
budget_quantity: number;
|
||||
budget_unit_price: number;
|
||||
budget_total_amount: number;
|
||||
actual_date: string;
|
||||
actual_quantity: number;
|
||||
actual_unit_price: number;
|
||||
actual_total_amount: number;
|
||||
cost_per_bird: number;
|
||||
};
|
||||
|
||||
export type OverheadTotal = {
|
||||
budget_quantity: number;
|
||||
budget_total_amount: number;
|
||||
actual_quantity: number;
|
||||
actual_total_amount: number;
|
||||
cost_per_bird: number;
|
||||
};
|
||||
|
||||
export type ClosingSales = BaseMetadata & BaseClosingSales;
|
||||
|
||||
Vendored
+14
-20
@@ -18,7 +18,7 @@ export type BaseExpense = {
|
||||
id: number;
|
||||
path: string;
|
||||
}[];
|
||||
expense_date: string;
|
||||
transaction_date: string;
|
||||
realization_date?: string;
|
||||
grand_total: number;
|
||||
location: BaseLocation;
|
||||
@@ -29,28 +29,23 @@ export type BaseExpense = {
|
||||
name: string;
|
||||
pengajuans?: {
|
||||
id: number;
|
||||
expense_id: number;
|
||||
kandang_id: number;
|
||||
nonstock_id: number;
|
||||
qty: number;
|
||||
unit_price: number;
|
||||
total_price: number;
|
||||
price: number;
|
||||
note?: string;
|
||||
nonstock: Pick<BaseNonstock, 'id' | 'name' | 'flags'>;
|
||||
project_flock_kandang: {
|
||||
id: number;
|
||||
kandang_id: number;
|
||||
};
|
||||
created_at: string;
|
||||
}[];
|
||||
realisasi?: {
|
||||
id: number;
|
||||
expense_nonstock_id: number;
|
||||
qty: number;
|
||||
unit_price: number;
|
||||
total_price: number;
|
||||
date: string;
|
||||
price: number;
|
||||
note?: string;
|
||||
nonstock: Pick<BaseNonstock, 'id' | 'name' | 'flags'>;
|
||||
project_flock_kandang: {
|
||||
id: number;
|
||||
kandang_id: number;
|
||||
};
|
||||
created_at: string;
|
||||
}[];
|
||||
}[];
|
||||
total_pengajuan: number;
|
||||
@@ -65,12 +60,12 @@ export type CreateExpensePayload = {
|
||||
transaction_date: string;
|
||||
supplier_id: number;
|
||||
documents: File[];
|
||||
cost_per_kandangs: {
|
||||
expense_nonstocks: {
|
||||
kandang_id: number;
|
||||
cost_items: {
|
||||
nonstock_id: number;
|
||||
quantity: number;
|
||||
total_cost: number;
|
||||
price: number;
|
||||
notes: string;
|
||||
}[];
|
||||
}[];
|
||||
@@ -81,12 +76,12 @@ export type UpdateExpensePayload = {
|
||||
transaction_date: string;
|
||||
supplier_id: number;
|
||||
documents: File[];
|
||||
cost_per_kandang: {
|
||||
expense_nonstocks: {
|
||||
kandang_id: number;
|
||||
cost_items: {
|
||||
nonstock_id: number;
|
||||
quantity: number;
|
||||
total_cost: number;
|
||||
price: number;
|
||||
notes: string;
|
||||
}[];
|
||||
}[];
|
||||
@@ -98,8 +93,7 @@ export type CreateExpenseRealizationPayload = {
|
||||
realizations: {
|
||||
expense_nonstock_id: number;
|
||||
qty: number;
|
||||
unit_price: number;
|
||||
total_price: number;
|
||||
price: number;
|
||||
notes: string;
|
||||
}[];
|
||||
};
|
||||
|
||||
Vendored
+48
@@ -0,0 +1,48 @@
|
||||
import { BaseMetadata, CreatedUser } from '@/types/api/api-general';
|
||||
import { ProductWarehouse } from '@/types/api/inventory/product-warehouse';
|
||||
import { ProductCategory } from '@/types/api/master-data/product-category';
|
||||
import { Supplier } from '@/types/api/master-data/supplier';
|
||||
import { Uom } from '@/types/api/master-data/uom';
|
||||
import { Location } from '@/types/api/master-data/location';
|
||||
|
||||
export type BaseInventoryProduct = {
|
||||
id: number;
|
||||
name: string;
|
||||
brand: string;
|
||||
sku: string;
|
||||
product_price: number;
|
||||
selling_price?: number;
|
||||
tax?: number;
|
||||
expiry_period?: number;
|
||||
uom: Uom;
|
||||
product_category: ProductCategory;
|
||||
suppliers: Supplier[];
|
||||
flags: string[];
|
||||
product_warehouses?: ProductWarehouseStock[];
|
||||
total_stock?: number;
|
||||
};
|
||||
|
||||
export type ProductWarehouseStock = {
|
||||
id: number;
|
||||
product_id: number;
|
||||
warehouse_id: number;
|
||||
warehouse_name: string;
|
||||
location: Location | null;
|
||||
current_stock: number;
|
||||
stock_logs: StockLog[];
|
||||
};
|
||||
|
||||
export type StockLog = {
|
||||
id: number;
|
||||
increase: number;
|
||||
decrease: number;
|
||||
loggable_type: string;
|
||||
loggable_id: number;
|
||||
notes: string;
|
||||
product_warehouse_id: number;
|
||||
created_by: number;
|
||||
created_user: CreatedUser;
|
||||
created_at: string;
|
||||
};
|
||||
|
||||
export type InventoryProduct = BaseInventoryProduct & BaseMetadata;
|
||||
@@ -39,3 +39,43 @@ export type LookupProjectFlockKandangPayload = {
|
||||
project_flock_id: number;
|
||||
kandang_id: number;
|
||||
};
|
||||
|
||||
export type ClosingProjectFlockKandangPayload = {
|
||||
action: 'close' | 'unclose';
|
||||
closed_date?: string; // YYYY-MM-DD, DD-MM-YYYY, or RFC3339
|
||||
};
|
||||
|
||||
export type ClosingExpense = {
|
||||
id: number;
|
||||
po_number: string;
|
||||
category: string;
|
||||
total: number;
|
||||
status: string;
|
||||
step_name: string;
|
||||
step: number;
|
||||
reference_number: string;
|
||||
};
|
||||
|
||||
// "flag_name": "PAKAN",
|
||||
// "product_warehouse_id": 14,
|
||||
// "product_id": 8,
|
||||
// "product_name": "281 SPECIAL STARTER",
|
||||
// "product_category": "Bahan Baku",
|
||||
// "uom": "Kilogram",
|
||||
// "quantity": 1100
|
||||
|
||||
export type StockItem = {
|
||||
flag_name: string;
|
||||
product_warehouse_id: number;
|
||||
product_id: number;
|
||||
product_name: string;
|
||||
product_category: string;
|
||||
uom: string;
|
||||
quantity: number;
|
||||
};
|
||||
|
||||
export type CheckClosingResponse = {
|
||||
unfinished_expenses: number;
|
||||
stock_remaining: StockItem[];
|
||||
expenses: ClosingExpense[];
|
||||
};
|
||||
|
||||
+12
@@ -4,6 +4,7 @@ import { Flock } from '@/types/api/master-data/flock';
|
||||
import { Kandang } from '@/types/api/master-data/kandang';
|
||||
import { Location } from '@/types/api/master-data/location';
|
||||
import { BaseApproval, BaseMetadata } from '@/types/api/api-general';
|
||||
import { Nonstock } from '@/types/api/master-data/nonstock';
|
||||
|
||||
export type BaseProjectFlock = {
|
||||
id: number;
|
||||
@@ -22,6 +23,7 @@ export type BaseProjectFlock = {
|
||||
kandangs: (Kandang & {
|
||||
project_flock_kandang_id: number;
|
||||
})[];
|
||||
project_budgets?: ProjectFlockBudget[];
|
||||
approval: BaseApproval;
|
||||
};
|
||||
|
||||
@@ -30,6 +32,15 @@ export type PeriodFlock = {
|
||||
next_period: number;
|
||||
};
|
||||
|
||||
export type ProjectFlockBudget = {
|
||||
id?: number;
|
||||
project_flock_id?: number;
|
||||
nonstock_id: number;
|
||||
nonstock?: Nonstock;
|
||||
qty: number;
|
||||
price: number;
|
||||
};
|
||||
|
||||
export type ProjectFlock = BaseMetadata & BaseProjectFlock;
|
||||
|
||||
export type CreateProjectFlockPayload = {
|
||||
@@ -39,6 +50,7 @@ export type CreateProjectFlockPayload = {
|
||||
fcr_id: number;
|
||||
location_id: number;
|
||||
kandang_ids: number[];
|
||||
project_budgets?: ProjectFlockBudget[];
|
||||
};
|
||||
|
||||
export type UpdateProjectFlockPayload = CreateProjectFlockPayload;
|
||||
|
||||
+6
-42
@@ -9,8 +9,7 @@ export type ProductionMetrics = {
|
||||
cum_intake: number;
|
||||
fcr_value: number;
|
||||
total_chick_qty: number;
|
||||
daily_depletion_rate?: number;
|
||||
cum_depletion?: number;
|
||||
cum_depletion: number;
|
||||
};
|
||||
|
||||
export type BaseRecording = {
|
||||
@@ -18,42 +17,33 @@ export type BaseRecording = {
|
||||
project_flock_kandang_id: number;
|
||||
record_datetime: string;
|
||||
day: number;
|
||||
created_by: User;
|
||||
project_flock_category?: 'GROWING' | 'LAYING';
|
||||
} & ProductionMetrics;
|
||||
|
||||
export type RecordingBW = {
|
||||
id: number;
|
||||
recording_id: number;
|
||||
avg_weight: number;
|
||||
qty: number;
|
||||
total_weight: number;
|
||||
};
|
||||
|
||||
export type RecordingDepletion = {
|
||||
id: number;
|
||||
recording_id: number;
|
||||
product_warehouse_id: number;
|
||||
qty: number;
|
||||
product_warehouse: ProductWarehouse;
|
||||
};
|
||||
|
||||
export type RecordingStock = {
|
||||
id: number;
|
||||
recording_id: number;
|
||||
product_warehouse_id: number;
|
||||
usage_amount?: number;
|
||||
usage_qty: number;
|
||||
qty: number;
|
||||
pending_qty: number;
|
||||
product_warehouse: ProductWarehouse;
|
||||
};
|
||||
|
||||
export type RecordingEgg = {
|
||||
id: number;
|
||||
recording_id: number;
|
||||
product_warehouse_id: number;
|
||||
qty: number;
|
||||
created_by: User;
|
||||
weight: number;
|
||||
product_warehouse: ProductWarehouse;
|
||||
gradings?: {
|
||||
grade: string;
|
||||
@@ -71,19 +61,12 @@ export type GradingEgg = {
|
||||
|
||||
export type Recording = BaseMetadata &
|
||||
BaseRecording & {
|
||||
project_flock_category?: 'GROWING' | 'LAYING';
|
||||
approval?: BaseApproval;
|
||||
egg_grading_status?: string | null;
|
||||
egg_grading_pending_qty?: number | null;
|
||||
egg_grading_completed_qty?: number | null;
|
||||
created_user: User;
|
||||
body_weights?: RecordingBW[];
|
||||
depletions?: RecordingDepletion[];
|
||||
stocks?: RecordingStock[];
|
||||
eggs?: RecordingEgg[];
|
||||
recording_bws?: RecordingBW[];
|
||||
recording_depletions?: RecordingDepletion[];
|
||||
recording_stocks?: RecordingStock[];
|
||||
recording_eggs?: RecordingEgg[];
|
||||
grading_eggs?: GradingEgg[];
|
||||
};
|
||||
|
||||
@@ -108,27 +91,10 @@ export type CreateGrowingRecordingPayload = {
|
||||
}[];
|
||||
};
|
||||
|
||||
export type CreateGradingPayload = {
|
||||
eggs_grading: {
|
||||
recording_egg_id: number;
|
||||
grade: string;
|
||||
qty: number;
|
||||
}[];
|
||||
};
|
||||
|
||||
export type UpdateGradingPayload = CreateGradingPayload;
|
||||
|
||||
export type CreateGradingRecordingPayload = {
|
||||
eggs_grading: {
|
||||
recording_egg_id: number;
|
||||
grade: string;
|
||||
qty: number;
|
||||
}[];
|
||||
};
|
||||
|
||||
export type CreateEggPayload = {
|
||||
product_warehouse_id: number;
|
||||
qty: number;
|
||||
weight: number;
|
||||
};
|
||||
|
||||
export type CreateLayingRecordingPayload = CreateGrowingRecordingPayload & {
|
||||
@@ -137,11 +103,9 @@ export type CreateLayingRecordingPayload = CreateGrowingRecordingPayload & {
|
||||
|
||||
export type CreateRecordingPayload =
|
||||
| CreateGrowingRecordingPayload
|
||||
| CreateLayingRecordingPayload
|
||||
| CreateGradingRecordingPayload;
|
||||
| CreateLayingRecordingPayload;
|
||||
|
||||
export type UpdateGrowingRecordingPayload = CreateGrowingRecordingPayload;
|
||||
export type UpdateLayingRecordingPayload = CreateLayingRecordingPayload;
|
||||
export type UpdateGradingRecordingPayload = CreateGradingRecordingPayload;
|
||||
|
||||
export type UpdateRecordingPayload = CreateRecordingPayload;
|
||||
|
||||
Vendored
+9
-10
@@ -42,7 +42,6 @@ export type PurchaseItem = {
|
||||
expedition_vendor_name?: string | null;
|
||||
received_qty?: number | null;
|
||||
transport_per_item?: number | null;
|
||||
transport_total?: number | null;
|
||||
};
|
||||
|
||||
export type BasePurchase = {
|
||||
@@ -52,9 +51,8 @@ export type BasePurchase = {
|
||||
po_document_path?: string | null;
|
||||
po_date: string;
|
||||
supplier: Supplier;
|
||||
credit_term: number;
|
||||
credit_term?: number;
|
||||
due_date: string;
|
||||
grand_total: number;
|
||||
notes?: string | null;
|
||||
deleted_at?: string | null;
|
||||
created_by: number;
|
||||
@@ -62,7 +60,7 @@ export type BasePurchase = {
|
||||
location?: Location;
|
||||
warehouse?: Warehouse;
|
||||
items?: PurchaseItem[];
|
||||
approval?: BaseApproval;
|
||||
latest_approval?: BaseApproval;
|
||||
};
|
||||
|
||||
export type Purchase = BaseMetadata & BasePurchase;
|
||||
@@ -71,7 +69,7 @@ export type CreatePurchaseRequestPayload = {
|
||||
supplier_id: number;
|
||||
credit_term: number;
|
||||
notes?: string | null;
|
||||
items: {
|
||||
items?: {
|
||||
warehouse_id: number;
|
||||
product_id: number;
|
||||
qty: number;
|
||||
@@ -81,7 +79,7 @@ export type CreatePurchaseRequestPayload = {
|
||||
export type CreateStaffApprovalRequestPayload = {
|
||||
action: 'APPROVED' | 'REJECTED';
|
||||
notes?: string | null;
|
||||
items: {
|
||||
items?: {
|
||||
purchase_item_id: number;
|
||||
qty: number;
|
||||
price: number;
|
||||
@@ -92,7 +90,7 @@ export type CreateStaffApprovalRequestPayload = {
|
||||
export type UpdateStaffApprovalRequestPayload = {
|
||||
action: 'APPROVED' | 'REJECTED';
|
||||
notes?: string | null;
|
||||
items: Array<{
|
||||
items?: Array<{
|
||||
purchase_item_id?: number;
|
||||
product_id?: number;
|
||||
warehouse_id?: number;
|
||||
@@ -103,12 +101,14 @@ export type UpdateStaffApprovalRequestPayload = {
|
||||
};
|
||||
|
||||
export type CreateManagerApprovalRequestPayload = {
|
||||
action: 'APPROVED' | 'REJECTED';
|
||||
notes?: string | null;
|
||||
};
|
||||
|
||||
export type CreateAcceptApprovalRequestPayload = {
|
||||
notes?: string;
|
||||
items: {
|
||||
action: 'APPROVED' | 'REJECTED';
|
||||
notes?: string | null;
|
||||
items?: {
|
||||
purchase_item_id: number;
|
||||
received_date: string;
|
||||
travel_number: string;
|
||||
@@ -117,7 +117,6 @@ export type CreateAcceptApprovalRequestPayload = {
|
||||
expedition_vendor_id: number;
|
||||
received_qty: number;
|
||||
transport_per_item: number;
|
||||
transport_total: number;
|
||||
}[];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user