Merge branch 'development' into feature/partes-descargadas
# Conflicts: # frontend/src/lib/components/dashboard/invoices/edit/InvoiceSelectorModal.svelte # frontend/src/lib/components/dashboard/invoices/edit/items/fa/item-sheet-fa.svelte
This commit is contained in:
@@ -58,7 +58,9 @@ export interface A76ClassListParams {
|
||||
page_size?: number;
|
||||
class_code?: string;
|
||||
description?: string;
|
||||
q?: string; // Agregado por si usas búsqueda general
|
||||
/** Búsqueda OR en class_code, description_es y description_en (backend ClassService) */
|
||||
search?: string;
|
||||
q?: string;
|
||||
sort_by?: string;
|
||||
sort_order?: 'asc' | 'desc';
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ export interface LineFinancials {
|
||||
unit_cost_mxn?: number;
|
||||
unit_cost_capture?: number;
|
||||
unit_cost_commercial_usd?: number;
|
||||
unit_cost_mc?: number;
|
||||
|
||||
// Values
|
||||
value_mc?: number;
|
||||
@@ -42,6 +43,9 @@ export interface LineFinancials {
|
||||
value_returned_mxn?: number;
|
||||
customs_value_usd?: number;
|
||||
customs_value_mxn?: number;
|
||||
vat_mxn?: number;
|
||||
vat_usd?: number;
|
||||
vat_mc?: number;
|
||||
}
|
||||
|
||||
export interface LineQuantities {
|
||||
@@ -137,6 +141,13 @@ export interface FaLineItem {
|
||||
own_equipment?: boolean;
|
||||
omit_annex31?: boolean;
|
||||
|
||||
// Source data for proportional calculations (CALCULO_PESOS) and inventory balance validation
|
||||
source_quantity?: number;
|
||||
source_balance?: number;
|
||||
source_net_weight?: number;
|
||||
source_gross_weight?: number;
|
||||
source_packages?: number;
|
||||
|
||||
// Timestamps
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
@@ -290,9 +301,6 @@ export const itemsApi = {
|
||||
return api.put<Item>(`/v1/a76/items/${itemId}/?${params.toString()}`, data);
|
||||
},
|
||||
|
||||
/**
|
||||
* Elimina un item
|
||||
*/
|
||||
delete: (itemId: number, companyId: number) => {
|
||||
const params = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
@@ -300,6 +308,18 @@ export const itemsApi = {
|
||||
return api.delete(`/v1/a76/items/${itemId}/?${params.toString()}`);
|
||||
},
|
||||
|
||||
/**
|
||||
* Elimina todas las series de un item
|
||||
*/
|
||||
deleteSeries: (itemId: number, companyId: number) => {
|
||||
const params = new URLSearchParams({
|
||||
company_id: companyId.toString()
|
||||
});
|
||||
return api.delete<{ message: string; count: number }>(
|
||||
`/v1/a76/items/${itemId}/series?${params.toString()}`
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Lista las líneas de una factura de importación con su saldo disponible.
|
||||
* Solo las líneas con has_balance = true tienen mercancía disponible para descarga.
|
||||
@@ -313,10 +333,12 @@ export const itemsApi = {
|
||||
listByInvoiceWithBalance: (
|
||||
invoiceId: number,
|
||||
companyId: number,
|
||||
asOfDate?: string
|
||||
asOfDate?: string,
|
||||
currentExportInvoiceId?: number
|
||||
) => {
|
||||
const params = new URLSearchParams({ company_id: companyId.toString() });
|
||||
if (asOfDate) params.append('as_of_date', asOfDate);
|
||||
if (currentExportInvoiceId) params.append('current_export_invoice_id', currentExportInvoiceId.toString());
|
||||
return api.get<ImportLineWithBalance[]>(
|
||||
`/v1/a76/items/invoice/${invoiceId}/items-with-balance?${params.toString()}`
|
||||
);
|
||||
@@ -339,6 +361,9 @@ export interface ImportLineWithBalance {
|
||||
quantity?: number;
|
||||
quantity_used_temp?: number;
|
||||
quantity_used_def?: number;
|
||||
// Weights
|
||||
net_weight?: number;
|
||||
gross_weight?: number;
|
||||
// Balance
|
||||
available_balance: number;
|
||||
has_balance: boolean;
|
||||
|
||||
Reference in New Issue
Block a user