@@ -51,17 +51,27 @@ export type ApprovalStep = {
|
||||
decided_at: string | null;
|
||||
};
|
||||
export type Requisition = {
|
||||
draft_input?: {
|
||||
incomplete: boolean;
|
||||
values: {
|
||||
cost_center_id?: number | null;
|
||||
priority?: string | null;
|
||||
needed_by?: string | null;
|
||||
justification?: string | null;
|
||||
items?: Record<string, string | number | null>[];
|
||||
};
|
||||
} | null;
|
||||
id: number;
|
||||
process_version?: number;
|
||||
number: string;
|
||||
status: string;
|
||||
priority: string;
|
||||
needed_by: string;
|
||||
justification: string;
|
||||
cost_center_id: number;
|
||||
subtotal_minor: number;
|
||||
tax_minor: number;
|
||||
total_minor: number;
|
||||
needed_by: string | null;
|
||||
justification: string | null;
|
||||
cost_center_id: number | null;
|
||||
subtotal_minor: number | null;
|
||||
tax_minor: number | null;
|
||||
total_minor: number | null;
|
||||
created_at: string;
|
||||
requester?: { name: string };
|
||||
department?: Department;
|
||||
@@ -94,12 +104,16 @@ export const priorityLabels: Record<string, string> = {
|
||||
high: 'Alta',
|
||||
urgent: 'Urgente',
|
||||
};
|
||||
export const money = (minor: number, currency = 'MZN') =>
|
||||
new Intl.NumberFormat('pt-MZ', {
|
||||
style: 'currency',
|
||||
currency,
|
||||
}).format(minor / 100);
|
||||
export const date = (value: string) =>
|
||||
new Intl.DateTimeFormat('pt-MZ').format(
|
||||
new Date(value.slice(0, 10) + 'T12:00:00'),
|
||||
);
|
||||
export const money = (minor: number | null | undefined, currency = 'MZN') =>
|
||||
minor == null
|
||||
? 'Por completar'
|
||||
: new Intl.NumberFormat('pt-MZ', {
|
||||
style: 'currency',
|
||||
currency,
|
||||
}).format(minor / 100);
|
||||
export const date = (value: string | null | undefined) =>
|
||||
!value
|
||||
? 'Por completar'
|
||||
: new Intl.DateTimeFormat('pt-MZ').format(
|
||||
new Date(value.slice(0, 10) + 'T12:00:00'),
|
||||
);
|
||||
|
||||
@@ -67,6 +67,26 @@ export type OrderItem = {
|
||||
tax_minor: number;
|
||||
total_minor: number;
|
||||
};
|
||||
export type FrozenOrderAgreement = {
|
||||
contract?: {
|
||||
id: number;
|
||||
reference: string;
|
||||
version: number;
|
||||
currency: string;
|
||||
max_order_value_minor: number | null;
|
||||
checked_order_value_minor: number;
|
||||
};
|
||||
agreement_id: number;
|
||||
record_key: string;
|
||||
version: number;
|
||||
reference: string;
|
||||
currency: string;
|
||||
unit: string;
|
||||
max_order_value_minor: number | null;
|
||||
max_order_quantity_milli: number | null;
|
||||
checked_order_value_minor: number;
|
||||
checked_order_quantity_milli: string;
|
||||
};
|
||||
export type PurchaseOrder = {
|
||||
id: number;
|
||||
number: string;
|
||||
@@ -78,6 +98,7 @@ export type PurchaseOrder = {
|
||||
total_minor: number;
|
||||
items: OrderItem[];
|
||||
snapshot: {
|
||||
agreement_bindings?: Record<string, FrozenOrderAgreement>;
|
||||
exchange_basis?: ExchangeBasis;
|
||||
reference_amounts?: {
|
||||
subtotal_minor: number;
|
||||
|
||||
Reference in New Issue
Block a user