@zauru-sdk/services 1.0.32 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/common.d.ts +55 -0
- package/dist/common.js +222 -0
- package/dist/index.d.ts +34 -34
- package/dist/index.js +34 -34
- package/dist/sessions/sessions.d.ts +2 -0
- package/dist/sessions/sessions.js +13 -0
- package/dist/sessions/upstash.d.ts +1 -0
- package/dist/sessions/upstash.js +52 -0
- package/dist/zauru/httpGraphQL.d.ts +2 -0
- package/dist/zauru/httpGraphQL.js +37 -0
- package/dist/zauru/httpOauth.d.ts +2 -0
- package/dist/zauru/httpOauth.js +37 -0
- package/dist/zauru/httpZauru.d.ts +2 -0
- package/dist/zauru/httpZauru.js +37 -0
- package/dist/zauru/zauru-agencies.d.ts +8 -0
- package/dist/zauru/zauru-agencies.js +20 -0
- package/dist/zauru/zauru-automatic-numbers.d.ts +8 -0
- package/dist/zauru/zauru-automatic-numbers.js +21 -0
- package/dist/zauru/zauru-bookings.d.ts +28 -0
- package/dist/zauru/zauru-bookings.js +80 -0
- package/dist/zauru/zauru-bundles.d.ts +28 -0
- package/dist/zauru/zauru-bundles.js +93 -0
- package/dist/zauru/zauru-cases.d.ts +6 -0
- package/dist/zauru/zauru-cases.js +23 -0
- package/dist/zauru/zauru-consolidated.d.ts +36 -0
- package/dist/zauru/zauru-consolidated.js +71 -0
- package/dist/zauru/zauru-currencies.d.ts +6 -0
- package/dist/zauru/zauru-currencies.js +20 -0
- package/dist/zauru/zauru-deliveries.d.ts +22 -0
- package/dist/zauru/zauru-deliveries.js +44 -0
- package/dist/zauru/zauru-discharges.d.ts +26 -0
- package/dist/zauru/zauru-discharges.js +46 -0
- package/dist/zauru/zauru-employees.d.ts +6 -0
- package/dist/zauru/zauru-employees.js +23 -0
- package/dist/zauru/zauru-forms.d.ts +96 -0
- package/dist/zauru/zauru-forms.js +343 -0
- package/dist/zauru/zauru-invoices.d.ts +26 -0
- package/dist/zauru/zauru-invoices.js +94 -0
- package/dist/zauru/zauru-items.d.ts +97 -0
- package/dist/zauru/zauru-items.js +272 -0
- package/dist/zauru/zauru-lote-record.d.ts +8 -0
- package/dist/zauru/zauru-lote-record.js +26 -0
- package/dist/zauru/zauru-lotes.d.ts +111 -0
- package/dist/zauru/zauru-lotes.js +294 -0
- package/dist/zauru/zauru-motivos-rechazo.d.ts +9 -0
- package/dist/zauru/zauru-motivos-rechazo.js +49 -0
- package/dist/zauru/zauru-payees.d.ts +97 -0
- package/dist/zauru/zauru-payees.js +227 -0
- package/dist/zauru/zauru-payment-terms.d.ts +20 -0
- package/dist/zauru/zauru-payment-terms.js +65 -0
- package/dist/zauru/zauru-price-lists.d.ts +22 -0
- package/dist/zauru/zauru-price-lists.js +40 -0
- package/dist/zauru/zauru-profiles.d.ts +28 -0
- package/dist/zauru/zauru-profiles.js +69 -0
- package/dist/zauru/zauru-purchase-orders.d.ts +160 -0
- package/dist/zauru/zauru-purchase-orders.js +414 -0
- package/dist/zauru/zauru-receptions.d.ts +33 -0
- package/dist/zauru/zauru-receptions.js +94 -0
- package/dist/zauru/zauru-shipments.d.ts +20 -0
- package/dist/zauru/zauru-shipments.js +53 -0
- package/dist/zauru/zauru-suggested-prices.d.ts +31 -0
- package/dist/zauru/zauru-suggested-prices.js +84 -0
- package/dist/zauru/zauru-tags.d.ts +7 -0
- package/dist/zauru/zauru-tags.js +13 -0
- package/dist/zauru/zauru-templates.d.ts +7 -0
- package/dist/zauru/zauru-templates.js +15 -0
- package/dist/zauru/zauru-variables.d.ts +14 -0
- package/dist/zauru/zauru-variables.js +48 -0
- package/dist/zauru/zauru-web-app-tables.d.ts +55 -0
- package/dist/zauru/zauru-web-app-tables.js +154 -0
- package/package.json +5 -5
- package/src/{common.server.ts → common.ts} +4 -4
- package/src/index.ts +34 -34
- package/src/sessions/{sessions.server.ts → sessions.ts} +1 -1
- package/src/zauru/{zauru-agencies.server.ts → zauru-agencies.ts} +2 -2
- package/src/zauru/{zauru-automatic-numbers.server.ts → zauru-automatic-numbers.ts} +1 -1
- package/src/zauru/{zauru-bookings.server.ts → zauru-bookings.ts} +3 -3
- package/src/zauru/{zauru-bundles.server.ts → zauru-bundles.ts} +3 -3
- package/src/zauru/{zauru-cases.server.ts → zauru-cases.ts} +2 -2
- package/src/zauru/{zauru-consolidated.server.ts → zauru-consolidated.ts} +3 -3
- package/src/zauru/{zauru-currencies.server.ts → zauru-currencies.ts} +2 -2
- package/src/zauru/{zauru-deliveries.server.ts → zauru-deliveries.ts} +1 -1
- package/src/zauru/{zauru-discharges.server.ts → zauru-discharges.ts} +2 -2
- package/src/zauru/{zauru-employees.server.ts → zauru-employees.ts} +2 -2
- package/src/zauru/{zauru-forms.server.ts → zauru-forms.ts} +3 -3
- package/src/zauru/{zauru-invoices.server.ts → zauru-invoices.ts} +3 -3
- package/src/zauru/{zauru-items.server.ts → zauru-items.ts} +3 -3
- package/src/zauru/{zauru-lote-record.server.ts → zauru-lote-record.ts} +2 -2
- package/src/zauru/{zauru-lotes.server.ts → zauru-lotes.ts} +5 -5
- package/src/zauru/{zauru-motivos-rechazo.server.ts → zauru-motivos-rechazo.ts} +2 -2
- package/src/zauru/{zauru-payees.server.ts → zauru-payees.ts} +3 -3
- package/src/zauru/{zauru-payment-terms.server.ts → zauru-payment-terms.ts} +3 -3
- package/src/zauru/{zauru-price-lists.server.ts → zauru-price-lists.ts} +1 -1
- package/src/zauru/{zauru-profiles.server.ts → zauru-profiles.ts} +2 -2
- package/src/zauru/{zauru-purchase-orders.server.ts → zauru-purchase-orders.ts} +4 -4
- package/src/zauru/{zauru-receptions.server.ts → zauru-receptions.ts} +1 -1
- package/src/zauru/{zauru-shipments.server.ts → zauru-shipments.ts} +3 -3
- package/src/zauru/{zauru-suggested-prices.server.ts → zauru-suggested-prices.ts} +3 -3
- package/src/zauru/{zauru-tags.server.ts → zauru-tags.ts} +1 -1
- package/src/zauru/{zauru-templates.server.ts → zauru-templates.ts} +1 -1
- package/src/zauru/{zauru-variables.server.ts → zauru-variables.ts} +1 -1
- package/src/zauru/{zauru-web-app-tables.server.ts → zauru-web-app-tables.ts} +3 -3
- /package/src/sessions/{upstash.server.ts → upstash.ts} +0 -0
- /package/src/zauru/{httpGraphQL.server.ts → httpGraphQL.ts} +0 -0
- /package/src/zauru/{httpOauth.server.ts → httpOauth.ts} +0 -0
- /package/src/zauru/{httpZauru.server.ts → httpZauru.ts} +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
2
|
+
import { getGraphQLAPIHeaders } from "../common.js";
|
|
3
|
+
import httpGraphQLAPI from "./httpGraphQL.js";
|
|
4
|
+
import { getPaymentTermByIdStringQuery, getPaymentTermsStringQuery, } from "@zauru-sdk/graphql";
|
|
5
|
+
import httpZauru from "./httpZauru.js";
|
|
6
|
+
/**
|
|
7
|
+
* getPaymentTerms
|
|
8
|
+
*/
|
|
9
|
+
export async function getPaymentTerms(session) {
|
|
10
|
+
return handlePossibleAxiosErrors(async () => {
|
|
11
|
+
const headers = await getGraphQLAPIHeaders(session);
|
|
12
|
+
const response = await httpGraphQLAPI.post("", {
|
|
13
|
+
query: getPaymentTermsStringQuery,
|
|
14
|
+
}, { headers });
|
|
15
|
+
if (response.data.errors) {
|
|
16
|
+
throw new Error(response.data.errors.map((x) => x.message).join(";"));
|
|
17
|
+
}
|
|
18
|
+
const registers = response?.data?.data?.payment_terms;
|
|
19
|
+
return registers;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* getPaymentTermById
|
|
24
|
+
*/
|
|
25
|
+
export async function getPaymentTermById(session, id) {
|
|
26
|
+
return handlePossibleAxiosErrors(async () => {
|
|
27
|
+
const headers = await getGraphQLAPIHeaders(session);
|
|
28
|
+
const response = await httpGraphQLAPI.post("", {
|
|
29
|
+
query: getPaymentTermByIdStringQuery,
|
|
30
|
+
variables: { id },
|
|
31
|
+
}, { headers });
|
|
32
|
+
if (response.data.errors) {
|
|
33
|
+
throw new Error(response.data.errors.map((x) => x.message).join(";"));
|
|
34
|
+
}
|
|
35
|
+
if (!response?.data?.data?.payment_terms[0]) {
|
|
36
|
+
throw new Error("No se encontró ningún método de pago con este id: " + id);
|
|
37
|
+
}
|
|
38
|
+
const registers = response?.data?.data?.payment_terms[0] ?? [];
|
|
39
|
+
return registers;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* createPaymentTerm
|
|
44
|
+
* @param headers
|
|
45
|
+
*/
|
|
46
|
+
export async function createPaymentTerm(headers, payment_term) {
|
|
47
|
+
return handlePossibleAxiosErrors(async () => {
|
|
48
|
+
const response = await httpZauru.patch(`/sales/settings/payment_terms.json`, {
|
|
49
|
+
payment_term,
|
|
50
|
+
}, { headers });
|
|
51
|
+
return response.data;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* updatePaymentTerm
|
|
56
|
+
* @param headers
|
|
57
|
+
*/
|
|
58
|
+
export async function updatePaymentTerm(headers, payment_term) {
|
|
59
|
+
return handlePossibleAxiosErrors(async () => {
|
|
60
|
+
const response = await httpZauru.patch(`/sales/settings/payment_terms/${payment_term.id}.json`, {
|
|
61
|
+
payment_term,
|
|
62
|
+
}, { headers });
|
|
63
|
+
return response.data;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AxiosUtilsResponse, CreatePriceListBody, PriceListGraphQL } from "@zauru-sdk/types";
|
|
2
|
+
/**
|
|
3
|
+
* createPriceList
|
|
4
|
+
* @param session
|
|
5
|
+
* @param headers
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare function createPriceList(headers: any, body: CreatePriceListBody): Promise<AxiosUtilsResponse<PriceListGraphQL>>;
|
|
9
|
+
/**
|
|
10
|
+
* deletePriceList
|
|
11
|
+
* @param headers
|
|
12
|
+
* @param id
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare function deletePriceList(headers: any, id: string | number): Promise<AxiosUtilsResponse<boolean>>;
|
|
16
|
+
/**
|
|
17
|
+
* updatePriceList
|
|
18
|
+
* @param session
|
|
19
|
+
* @param headers
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function updatePriceList(headers: any, body: Partial<PriceListGraphQL>): Promise<AxiosUtilsResponse<boolean>>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
2
|
+
import httpZauru from "./httpZauru.js";
|
|
3
|
+
/**
|
|
4
|
+
* createPriceList
|
|
5
|
+
* @param session
|
|
6
|
+
* @param headers
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export async function createPriceList(headers, body) {
|
|
10
|
+
return handlePossibleAxiosErrors(async () => {
|
|
11
|
+
const response = await httpZauru.post("/sales/settings/price_lists", { price_list: body }, { headers });
|
|
12
|
+
return response.data;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* deletePriceList
|
|
17
|
+
* @param headers
|
|
18
|
+
* @param id
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export async function deletePriceList(headers, id) {
|
|
22
|
+
return handlePossibleAxiosErrors(async () => {
|
|
23
|
+
await httpZauru.delete(`/sales/settings/price_lists/${id}?destroy=true`, {
|
|
24
|
+
headers,
|
|
25
|
+
});
|
|
26
|
+
return true;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* updatePriceList
|
|
31
|
+
* @param session
|
|
32
|
+
* @param headers
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
export async function updatePriceList(headers, body) {
|
|
36
|
+
return handlePossibleAxiosErrors(async () => {
|
|
37
|
+
await httpZauru.patch(`/sales/settings/price_lists/${body.id}`, { price_list: body }, { headers });
|
|
38
|
+
return true;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Session } from "@remix-run/node";
|
|
2
|
+
import { AgencyGraphQL, EmployeeGraphQL, OauthProfile, ProfileResponse, AxiosUtilsResponse } from "@zauru-sdk/types";
|
|
3
|
+
/**
|
|
4
|
+
* getOauthUserInfo
|
|
5
|
+
* @param codeValue
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const getOauthUserInfo: (codeValue: string) => Promise<AxiosUtilsResponse<OauthProfile>>;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param employeeId
|
|
12
|
+
* @param headers
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare const getEmployeeInfo: (id: number, headers: any) => Promise<AxiosUtilsResponse<EmployeeGraphQL>>;
|
|
16
|
+
/**
|
|
17
|
+
* getProfileInformation
|
|
18
|
+
* @param headers
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare const getProfileInformation: (headers: any) => Promise<AxiosUtilsResponse<ProfileResponse>>;
|
|
22
|
+
export declare const changeEntity: (headers: any, entityId: string) => Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param headers
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export declare const getAgencyInfo: (headers: any, session: Session) => Promise<AxiosUtilsResponse<AgencyGraphQL>>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import httpZauru from "./httpZauru.js";
|
|
2
|
+
import httpOauth from "./httpOauth.js";
|
|
3
|
+
import { handlePossibleAxiosErrors } from "@zauru-sdk/common";
|
|
4
|
+
import { config } from "@zauru-sdk/config";
|
|
5
|
+
/**
|
|
6
|
+
* getOauthUserInfo
|
|
7
|
+
* @param codeValue
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export const getOauthUserInfo = async (codeValue) => {
|
|
11
|
+
return handlePossibleAxiosErrors(async () => {
|
|
12
|
+
const response = await httpOauth.get(`/api/userinfo`, {
|
|
13
|
+
headers: {
|
|
14
|
+
Authorization: `Bearer ${codeValue}`,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
return response.data;
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @param employeeId
|
|
23
|
+
* @param headers
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export const getEmployeeInfo = async (id, headers) => {
|
|
27
|
+
return handlePossibleAxiosErrors(async () => {
|
|
28
|
+
const employeeInfo = await httpZauru.get(`/settings/employees/${id}.json`, { headers });
|
|
29
|
+
return employeeInfo.data;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* getProfileInformation
|
|
34
|
+
* @param headers
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
export const getProfileInformation = async (headers) => {
|
|
38
|
+
return handlePossibleAxiosErrors(async () => {
|
|
39
|
+
const response = await httpZauru.get(`/profile.json`, {
|
|
40
|
+
headers,
|
|
41
|
+
});
|
|
42
|
+
return response.data;
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
export const changeEntity = async (headers, entityId) => {
|
|
46
|
+
const changeEntityFetch = await httpZauru.patch(`${config.zauruBaseURL}/company.json`, JSON.stringify({
|
|
47
|
+
selected_entity_id: entityId,
|
|
48
|
+
}), {
|
|
49
|
+
headers,
|
|
50
|
+
});
|
|
51
|
+
return changeEntityFetch.data;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param headers
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
export const getAgencyInfo = async (headers, session) => {
|
|
59
|
+
return handlePossibleAxiosErrors(async () => {
|
|
60
|
+
const agency_id = session.get("agency_id");
|
|
61
|
+
if (!agency_id) {
|
|
62
|
+
throw new Error("No hay una agencia asignada para este usuario... Contacte con su administrador.");
|
|
63
|
+
}
|
|
64
|
+
const response = await httpZauru.get(`/settings/agencies/${agency_id}.json`, {
|
|
65
|
+
headers,
|
|
66
|
+
});
|
|
67
|
+
return response?.data;
|
|
68
|
+
});
|
|
69
|
+
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { Session } from "@remix-run/node";
|
|
2
|
+
import { AxiosUtilsResponse, BasketSchema, CreateNewPurchaseOrderBody, DataTablesFilterBody, HTMLPurchasesListSchema, NewPurchaseOrderResponse, PurchaseOrderGraphQL, PurchasesListResponseSchema, UpdatePurchaseOrderBody } from "@zauru-sdk/types";
|
|
3
|
+
/**
|
|
4
|
+
* markAsReceivePurchaseOrder
|
|
5
|
+
* Esta función sólo se utiliza cuando se van a marcar como recibida toda la órden de compra, se recibe todo lo que se envío
|
|
6
|
+
* si se quiere recibir parcialmente, utilizar el endpoint de /receptions
|
|
7
|
+
* @param headers
|
|
8
|
+
* @param body
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare const markAsReceivePurchaseOrder: (headers: any, body: Partial<PurchaseOrderGraphQL> & {
|
|
12
|
+
fechaVencimiento?: string;
|
|
13
|
+
}) => Promise<AxiosUtilsResponse<boolean>>;
|
|
14
|
+
/**
|
|
15
|
+
* markAsReceivePartialPurchaseOrder
|
|
16
|
+
* @param headers
|
|
17
|
+
* @param body
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
export declare const markAsReceivePartialPurchaseOrder: (headers: any, session: Session, body: Partial<PurchaseOrderGraphQL> & {
|
|
21
|
+
fechaVencimiento?: string;
|
|
22
|
+
}) => Promise<AxiosUtilsResponse<boolean>>;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param headers
|
|
26
|
+
* @param body
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export declare const createNewPurchaseOrder: (headers: any, body: Partial<PurchaseOrderGraphQL>) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL>>;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param headers
|
|
33
|
+
* @param body
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
export declare const createNewAuthorizedPurchaseOrder: (headers: any, body: CreateNewPurchaseOrderBody, withReceive?: boolean) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL>>;
|
|
37
|
+
/**
|
|
38
|
+
* receiveLotPurchaseOrder
|
|
39
|
+
* @param headers
|
|
40
|
+
* @param body
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
export declare const receiveLotPurchaseOrder: (headers: any, body: PurchaseOrderGraphQL & {
|
|
44
|
+
fechaVencimiento: string;
|
|
45
|
+
}) => Promise<AxiosUtilsResponse<boolean>>;
|
|
46
|
+
/**
|
|
47
|
+
* receivePurchaseOrder
|
|
48
|
+
* @param headers
|
|
49
|
+
* @param body
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
export declare const receivePurchaseOrder: (headers: any, body: PurchaseOrderGraphQL) => Promise<AxiosUtilsResponse<boolean>>;
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param headers
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
export declare const getNewPurchaseOrderInfo: (headers: any) => Promise<AxiosUtilsResponse<NewPurchaseOrderResponse>>;
|
|
59
|
+
/**
|
|
60
|
+
* getPurchasesListDataTables Function for get all zauru orden-compras
|
|
61
|
+
* @param headers
|
|
62
|
+
* @returns
|
|
63
|
+
*/
|
|
64
|
+
export declare const getPurchasesListDataTables: (headers: any, body: DataTablesFilterBody) => Promise<AxiosUtilsResponse<PurchasesListResponseSchema<HTMLPurchasesListSchema>>>;
|
|
65
|
+
/**
|
|
66
|
+
* getPurchasesList Function for get all zauru orden-compras
|
|
67
|
+
* @param headers
|
|
68
|
+
* @param params
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
71
|
+
export declare const getPurchasesList: (headers: any, session: Session, params?: {
|
|
72
|
+
fechaInicio?: string;
|
|
73
|
+
fechaFin?: string;
|
|
74
|
+
item?: string | number;
|
|
75
|
+
payeeCategory?: string | number;
|
|
76
|
+
agency_id?: string | number;
|
|
77
|
+
}, config?: {
|
|
78
|
+
fromProduction?: boolean;
|
|
79
|
+
}) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL[]>>;
|
|
80
|
+
/**
|
|
81
|
+
* getPurchase Function for get an especific purchase order
|
|
82
|
+
* @param headers
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
85
|
+
export declare const getPurchase: (headers: any, purchase_order_id: number | string) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL & {
|
|
86
|
+
baskets_memo: BasketSchema[];
|
|
87
|
+
baskets_memo_quantity: number;
|
|
88
|
+
}>>;
|
|
89
|
+
/**
|
|
90
|
+
* enablePurchase Enable a purchase order
|
|
91
|
+
* @param headers
|
|
92
|
+
* @param purchase_order_id
|
|
93
|
+
* @param reception_id
|
|
94
|
+
* @returns
|
|
95
|
+
*/
|
|
96
|
+
export declare const enablePurchase: (headers: any, purchase_order_id: number, reception_id: number) => Promise<AxiosUtilsResponse<any>>;
|
|
97
|
+
/**
|
|
98
|
+
* updatePurchaseOrder
|
|
99
|
+
* @param headers
|
|
100
|
+
* @param body
|
|
101
|
+
* @param purchase_order_id
|
|
102
|
+
* @returns
|
|
103
|
+
*/
|
|
104
|
+
export declare const updatePurchaseOrder: (headers: any, body: UpdatePurchaseOrderBody, purchase_order_id: number) => Promise<AxiosUtilsResponse<any>>;
|
|
105
|
+
/**
|
|
106
|
+
* updatePurchaseOrder
|
|
107
|
+
* @param headers
|
|
108
|
+
* @param body
|
|
109
|
+
* @param purchase_order_id
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
112
|
+
export declare const updateReceivedPurchaseOrder: (headers: any, body: UpdatePurchaseOrderBody, purchase_order_id: number) => Promise<AxiosUtilsResponse<any>>;
|
|
113
|
+
/**
|
|
114
|
+
* getLast100Receptions
|
|
115
|
+
* @param headers
|
|
116
|
+
* @returns
|
|
117
|
+
*/
|
|
118
|
+
export declare const getLast100Receptions: (session: Session, agency_id?: number | string) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL[]>>;
|
|
119
|
+
/**
|
|
120
|
+
* getPurchaseOrder
|
|
121
|
+
* @param headers
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
124
|
+
export declare const getPurchaseOrder: (session: Session, poId: string | number, config?: {
|
|
125
|
+
withLotStocksToMyAgency: boolean;
|
|
126
|
+
}) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL>>;
|
|
127
|
+
/**
|
|
128
|
+
* getPurchaseOrder
|
|
129
|
+
* @param headers
|
|
130
|
+
* @returns
|
|
131
|
+
*/
|
|
132
|
+
export declare const getGraphQLPurchaseOrderBetweenDates: (session: Session, dates: {
|
|
133
|
+
startDate: string;
|
|
134
|
+
endDate: string;
|
|
135
|
+
}, config?: {
|
|
136
|
+
agencyFilter: boolean;
|
|
137
|
+
agencyId?: number;
|
|
138
|
+
useProductionAgencyId?: boolean;
|
|
139
|
+
consolidateIdFilter?: boolean;
|
|
140
|
+
lotItemIdExclusion?: number;
|
|
141
|
+
poDetailTagId?: number;
|
|
142
|
+
withShipmentToMyAgency?: boolean;
|
|
143
|
+
withLotStocksToMyAgency?: boolean;
|
|
144
|
+
itemId?: number | string;
|
|
145
|
+
payeeCategoryId?: number | string;
|
|
146
|
+
}) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL[]>>;
|
|
147
|
+
/**
|
|
148
|
+
* deletePurchaseOrder
|
|
149
|
+
* @param headers
|
|
150
|
+
* @param id
|
|
151
|
+
* @returns
|
|
152
|
+
*/
|
|
153
|
+
export declare const deletePurchaseOrder: (headers: any, id: string | number) => Promise<AxiosUtilsResponse<boolean>>;
|
|
154
|
+
/**
|
|
155
|
+
* getPurchaseOrderByIdNumber
|
|
156
|
+
* @param session
|
|
157
|
+
* @param idNumber
|
|
158
|
+
* @returns
|
|
159
|
+
*/
|
|
160
|
+
export declare const getPurchasesOrderByIdNumber: (session: Session, id_number: string) => Promise<AxiosUtilsResponse<PurchaseOrderGraphQL[]>>;
|