mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 13:55:45 +00:00
Merge branch 'development' of gitlab.com:mbugroup/lti-web-client into feat/FE/US-339/TASK-361-362-363-slicing-purchase-and-integrate-purchase-report-page
This commit is contained in:
Vendored
+81
@@ -0,0 +1,81 @@
|
||||
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 { Location } from '@/types/api/master-data/location';
|
||||
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;
|
||||
location_id: number;
|
||||
location_name: string;
|
||||
project_category: 'GROWING' | 'LAYING';
|
||||
period: number;
|
||||
closing_date?: string;
|
||||
shed_label: string;
|
||||
shed_count: number;
|
||||
sales_paid_amount: number;
|
||||
sales_remaining_amount: number;
|
||||
sales_payment_status: string;
|
||||
project_status: 'Pengajuan' | 'Aktif' | 'Selesai';
|
||||
};
|
||||
|
||||
export type Closing = BaseMetadata & BaseClosing;
|
||||
|
||||
export type BaseClosingGeneralInformation = BaseClosing & {
|
||||
flock_id: number;
|
||||
period: number;
|
||||
project_type: 'GROWING' | 'LAYING';
|
||||
population: number;
|
||||
active_house_count: number;
|
||||
sales_payment_status: string;
|
||||
project_status: 'Pengajuan' | 'Aktif' | 'Selesai';
|
||||
closing_status: string;
|
||||
};
|
||||
|
||||
export type ClosingGeneralInformation = BaseMetadata &
|
||||
BaseClosingGeneralInformation;
|
||||
|
||||
export type ClosingIncomingSapronak = {
|
||||
id: number;
|
||||
date: string;
|
||||
reference_number: string;
|
||||
transaction_type: string;
|
||||
product_name: string;
|
||||
product_category: string;
|
||||
product_sub_category: string;
|
||||
source_warehouse: string;
|
||||
destination_warehouse: string;
|
||||
quantity: number;
|
||||
unit: string;
|
||||
formatted_quantity: string;
|
||||
notes: string;
|
||||
};
|
||||
|
||||
export type ClosingOutgoingSapronak = ClosingIncomingSapronak;
|
||||
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,25 @@ 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;
|
||||
};
|
||||
|
||||
export type CheckClosingResponse = {
|
||||
unfinished_expenses: number;
|
||||
stock_remaining: ProductWarehouse[];
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user