diff --git a/src/services/api/logistic.ts b/src/services/api/logistic.ts index 611c601d..94b7a2cf 100644 --- a/src/services/api/logistic.ts +++ b/src/services/api/logistic.ts @@ -24,7 +24,7 @@ export class LogisticApiService extends BaseApiService< ): Promise | undefined> { return await this.customRequest< BaseApiResponse - >(`logistic-stock`, { + >(`purchase-supplier`, { method: 'GET', params: { area_id: area_id, @@ -43,5 +43,5 @@ export class LogisticApiService extends BaseApiService< // TODO: REPLACE WITH PRODUCTION URL export const LogisticApi = new LogisticApiService( - 'http://localhost:4010/api/report' + 'http://localhost:4010/api/reports/logistics' ); diff --git a/src/types/api/report/logistic-stock.d.ts b/src/types/api/report/logistic-stock.d.ts index 2f771bfa..77d0b5d3 100644 --- a/src/types/api/report/logistic-stock.d.ts +++ b/src/types/api/report/logistic-stock.d.ts @@ -1,31 +1,23 @@ import { BaseMetadata } from '@/types/api/api-general'; import { Supplier } from '@/types/api/supplier/supplier'; import { Product } from '@/types/api/product/product'; -import { Area } from '@/types/api/area/area'; - -export type LogisticPurchasePerSupplierItems = { - id: number; - received_date: string; - po_date: string; - po_number: string; - product: Product; - area: Area; - destination_warehouse: string; - qty: number; - price: number; - transport_per_item: number; - transport_total: number; - expedition_vendor_id: number; - expedition_vendor_name: string; - travel_number: string; -}; - -export type LogisticPurchasePerSupplier = { - id: number; - supplier: Supplier; - items: LogisticPurchasePerSupplierItems[]; -}; +import { Warehouse } from '@/types/api/warehouse/warehouse'; export type LogisticPurchasePerSupplierReport = BaseMetadata & { - data: LogisticPurchasePerSupplier[]; + rows: { + supplier: Supplier; + receive_date: string; + po_date: string; + po_number: string; + product: Product; + warehouse: Warehouse; + qty: number; + unit_price: number; + purchase_value: number; + transport_unit_price: number; + transport_value: number; + total_amount: number; + expedition: string; + delivery_number: string; + }[]; };