@axelor/aos-mobile-purchase 8.3.0
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/README.md +44 -0
- package/lib/api/index.d.ts +5 -0
- package/lib/api/index.js +23 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/product-api.d.ts +4 -0
- package/lib/api/product-api.js +69 -0
- package/lib/api/product-api.js.map +1 -0
- package/lib/api/purchase-request-api.d.ts +23 -0
- package/lib/api/purchase-request-api.js +104 -0
- package/lib/api/purchase-request-api.js.map +1 -0
- package/lib/api/purchase-request-line-api.d.ts +17 -0
- package/lib/api/purchase-request-line-api.js +100 -0
- package/lib/api/purchase-request-line-api.js.map +1 -0
- package/lib/api/supplier-api.d.ts +5 -0
- package/lib/api/supplier-api.js +47 -0
- package/lib/api/supplier-api.js.map +1 -0
- package/lib/api/unit-api.d.ts +4 -0
- package/lib/api/unit-api.js +29 -0
- package/lib/api/unit-api.js.map +1 -0
- package/lib/components/atoms/DropdownRequestCharacteristics/DropdownRequestCharacteristics.d.ts +3 -0
- package/lib/components/atoms/DropdownRequestCharacteristics/DropdownRequestCharacteristics.js +39 -0
- package/lib/components/atoms/DropdownRequestCharacteristics/DropdownRequestCharacteristics.js.map +1 -0
- package/lib/components/atoms/RequestCard/RequestCard.d.ts +11 -0
- package/lib/components/atoms/RequestCard/RequestCard.js +51 -0
- package/lib/components/atoms/RequestCard/RequestCard.js.map +1 -0
- package/lib/components/atoms/RequestHeader/RequestHeader.d.ts +3 -0
- package/lib/components/atoms/RequestHeader/RequestHeader.js +47 -0
- package/lib/components/atoms/RequestHeader/RequestHeader.js.map +1 -0
- package/lib/components/atoms/RequestLineCard/RequestLineCard.d.ts +11 -0
- package/lib/components/atoms/RequestLineCard/RequestLineCard.js +49 -0
- package/lib/components/atoms/RequestLineCard/RequestLineCard.js.map +1 -0
- package/lib/components/atoms/RequestSeeLinesButton/RequestSeeLinesButton.d.ts +3 -0
- package/lib/components/atoms/RequestSeeLinesButton/RequestSeeLinesButton.js +67 -0
- package/lib/components/atoms/RequestSeeLinesButton/RequestSeeLinesButton.js.map +1 -0
- package/lib/components/atoms/index.d.ts +5 -0
- package/lib/components/atoms/index.js +23 -0
- package/lib/components/atoms/index.js.map +1 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.js +22 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/molecules/RequestDropdownCards/RequestDropdownCards.d.ts +5 -0
- package/lib/components/molecules/RequestDropdownCards/RequestDropdownCards.js +33 -0
- package/lib/components/molecules/RequestDropdownCards/RequestDropdownCards.js.map +1 -0
- package/lib/components/molecules/index.d.ts +1 -0
- package/lib/components/molecules/index.js +19 -0
- package/lib/components/molecules/index.js.map +1 -0
- package/lib/components/organisms/RequestButtons/RequestButtons.d.ts +3 -0
- package/lib/components/organisms/RequestButtons/RequestButtons.js +136 -0
- package/lib/components/organisms/RequestButtons/RequestButtons.js.map +1 -0
- package/lib/components/organisms/index.d.ts +1 -0
- package/lib/components/organisms/index.js +19 -0
- package/lib/components/organisms/index.js.map +1 -0
- package/lib/components/templates/CompanyPicker/CompanyPicker.d.ts +9 -0
- package/lib/components/templates/CompanyPicker/CompanyPicker.js +30 -0
- package/lib/components/templates/CompanyPicker/CompanyPicker.js.map +1 -0
- package/lib/components/templates/HorizontalOrRuleText/HorizontalOrRuleText.d.ts +5 -0
- package/lib/components/templates/HorizontalOrRuleText/HorizontalOrRuleText.js +35 -0
- package/lib/components/templates/HorizontalOrRuleText/HorizontalOrRuleText.js.map +1 -0
- package/lib/components/templates/ProductSearchBar/ProductSearchBar.d.ts +13 -0
- package/lib/components/templates/ProductSearchBar/ProductSearchBar.js +35 -0
- package/lib/components/templates/ProductSearchBar/ProductSearchBar.js.map +1 -0
- package/lib/components/templates/RequestCreationButtons/RequestCreationButtons.d.ts +13 -0
- package/lib/components/templates/RequestCreationButtons/RequestCreationButtons.js +59 -0
- package/lib/components/templates/RequestCreationButtons/RequestCreationButtons.js.map +1 -0
- package/lib/components/templates/RequestCreationQuantityCard/RequestCreationQuantityCard.d.ts +10 -0
- package/lib/components/templates/RequestCreationQuantityCard/RequestCreationQuantityCard.js +29 -0
- package/lib/components/templates/RequestCreationQuantityCard/RequestCreationQuantityCard.js.map +1 -0
- package/lib/components/templates/SupplierSearchBar/SupplierSearchBar.d.ts +11 -0
- package/lib/components/templates/SupplierSearchBar/SupplierSearchBar.js +38 -0
- package/lib/components/templates/SupplierSearchBar/SupplierSearchBar.js.map +1 -0
- package/lib/components/templates/UnitSearchBar/UnitSearchBar.d.ts +13 -0
- package/lib/components/templates/UnitSearchBar/UnitSearchBar.js +35 -0
- package/lib/components/templates/UnitSearchBar/UnitSearchBar.js.map +1 -0
- package/lib/components/templates/index.d.ts +7 -0
- package/lib/components/templates/index.js +25 -0
- package/lib/components/templates/index.js.map +1 -0
- package/lib/features/asyncFunctions-index.d.ts +5 -0
- package/lib/features/asyncFunctions-index.js +23 -0
- package/lib/features/asyncFunctions-index.js.map +1 -0
- package/lib/features/index.d.ts +5 -0
- package/lib/features/index.js +23 -0
- package/lib/features/index.js.map +1 -0
- package/lib/features/productSlice.d.ts +16 -0
- package/lib/features/productSlice.js +49 -0
- package/lib/features/productSlice.js.map +1 -0
- package/lib/features/purchaseRequestLineSlice.d.ts +49 -0
- package/lib/features/purchaseRequestLineSlice.js +96 -0
- package/lib/features/purchaseRequestLineSlice.js.map +1 -0
- package/lib/features/purchaseRequestSlice.d.ts +58 -0
- package/lib/features/purchaseRequestSlice.js +101 -0
- package/lib/features/purchaseRequestSlice.js.map +1 -0
- package/lib/features/supplierSlice.d.ts +16 -0
- package/lib/features/supplierSlice.js +49 -0
- package/lib/features/supplierSlice.js.map +1 -0
- package/lib/features/unitSlice.d.ts +16 -0
- package/lib/features/unitSlice.js +49 -0
- package/lib/features/unitSlice.js.map +1 -0
- package/lib/hooks/use-purchase-header-actions.d.ts +1 -0
- package/lib/hooks/use-purchase-header-actions.js +46 -0
- package/lib/hooks/use-purchase-header-actions.js.map +1 -0
- package/lib/i18n/en.json +45 -0
- package/lib/i18n/fr.json +45 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +69 -0
- package/lib/index.js.map +1 -0
- package/lib/models/forms.d.ts +2 -0
- package/lib/models/forms.js +61 -0
- package/lib/models/forms.js.map +1 -0
- package/lib/models/index.d.ts +5 -0
- package/lib/models/index.js +23 -0
- package/lib/models/index.js.map +1 -0
- package/lib/models/objectFields.d.ts +2 -0
- package/lib/models/objectFields.js +49 -0
- package/lib/models/objectFields.js.map +1 -0
- package/lib/models/searchFields.d.ts +2 -0
- package/lib/models/searchFields.js +23 -0
- package/lib/models/searchFields.js.map +1 -0
- package/lib/models/sortFields.d.ts +2 -0
- package/lib/models/sortFields.js +21 -0
- package/lib/models/sortFields.js.map +1 -0
- package/lib/models/typeObjects.d.ts +2 -0
- package/lib/models/typeObjects.js +86 -0
- package/lib/models/typeObjects.js.map +1 -0
- package/lib/screens/RequestCreationScreen.d.ts +3 -0
- package/lib/screens/RequestCreationScreen.js +139 -0
- package/lib/screens/RequestCreationScreen.js.map +1 -0
- package/lib/screens/RequestDetailsScreen.d.ts +5 -0
- package/lib/screens/RequestDetailsScreen.js +67 -0
- package/lib/screens/RequestDetailsScreen.js.map +1 -0
- package/lib/screens/RequestLineFormScreen.d.ts +6 -0
- package/lib/screens/RequestLineFormScreen.js +71 -0
- package/lib/screens/RequestLineFormScreen.js.map +1 -0
- package/lib/screens/RequestLineListScreen.d.ts +5 -0
- package/lib/screens/RequestLineListScreen.js +51 -0
- package/lib/screens/RequestLineListScreen.js.map +1 -0
- package/lib/screens/RequestListScreen.d.ts +5 -0
- package/lib/screens/RequestListScreen.js +47 -0
- package/lib/screens/RequestListScreen.js.map +1 -0
- package/lib/screens/index.d.ts +59 -0
- package/lib/screens/index.js +66 -0
- package/lib/screens/index.js.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +19 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/request-creation.d.ts +7 -0
- package/lib/types/request-creation.js +25 -0
- package/lib/types/request-creation.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export const searchPurchaseRequest: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
2
|
+
state?: unknown;
|
|
3
|
+
dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
|
|
4
|
+
extra?: unknown;
|
|
5
|
+
rejectValue?: unknown;
|
|
6
|
+
serializedErrorType?: unknown;
|
|
7
|
+
pendingMeta?: unknown;
|
|
8
|
+
fulfilledMeta?: unknown;
|
|
9
|
+
rejectedMeta?: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
export const getPurchaseRequest: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
12
|
+
state?: unknown;
|
|
13
|
+
dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
|
|
14
|
+
extra?: unknown;
|
|
15
|
+
rejectValue?: unknown;
|
|
16
|
+
serializedErrorType?: unknown;
|
|
17
|
+
pendingMeta?: unknown;
|
|
18
|
+
fulfilledMeta?: unknown;
|
|
19
|
+
rejectedMeta?: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
export const updatePurchaseRequestStatus: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
22
|
+
state?: unknown;
|
|
23
|
+
dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
|
|
24
|
+
extra?: unknown;
|
|
25
|
+
rejectValue?: unknown;
|
|
26
|
+
serializedErrorType?: unknown;
|
|
27
|
+
pendingMeta?: unknown;
|
|
28
|
+
fulfilledMeta?: unknown;
|
|
29
|
+
rejectedMeta?: unknown;
|
|
30
|
+
}>;
|
|
31
|
+
export const createPurchaseRequest: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
32
|
+
state?: unknown;
|
|
33
|
+
dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
|
|
34
|
+
extra?: unknown;
|
|
35
|
+
rejectValue?: unknown;
|
|
36
|
+
serializedErrorType?: unknown;
|
|
37
|
+
pendingMeta?: unknown;
|
|
38
|
+
fulfilledMeta?: unknown;
|
|
39
|
+
rejectedMeta?: unknown;
|
|
40
|
+
}>;
|
|
41
|
+
export const updatePurchaseRequest: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
42
|
+
state?: unknown;
|
|
43
|
+
dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
|
|
44
|
+
extra?: unknown;
|
|
45
|
+
rejectValue?: unknown;
|
|
46
|
+
serializedErrorType?: unknown;
|
|
47
|
+
pendingMeta?: unknown;
|
|
48
|
+
fulfilledMeta?: unknown;
|
|
49
|
+
rejectedMeta?: unknown;
|
|
50
|
+
}>;
|
|
51
|
+
export const purchaseRequestReducer: import("redux").Reducer<{
|
|
52
|
+
loadingPurchaseRequest: boolean;
|
|
53
|
+
purchaseRequest: {};
|
|
54
|
+
loadingPurchaseRequests: boolean;
|
|
55
|
+
moreLoadingPurchaseRequest: boolean;
|
|
56
|
+
isListEndPurchaseRequest: boolean;
|
|
57
|
+
purchaseRequestList: any[];
|
|
58
|
+
}>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { generateInifiniteScrollCases, handlerApiCall, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { createPurchaseRequest as _createPurchaseRequest, getPurchaseRequest as _getPurchaseRequest, searchPurchaseRequest as _searchPurchaseRequest, updatePurchaseRequest as _updatePurchaseRequest, updatePurchaseRequestStatus as _updatePurchaseRequestStatus, } from '../api/purchase-request-api';
|
|
21
|
+
export const searchPurchaseRequest = createAsyncThunk('purchase_purchaseRequest/searchPurchaseRequest', async function (data, { getState }) {
|
|
22
|
+
return handlerApiCall({
|
|
23
|
+
fetchFunction: _searchPurchaseRequest,
|
|
24
|
+
data,
|
|
25
|
+
action: 'Purchase_SliceAction_SearchPurchaseRequest',
|
|
26
|
+
getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
export const getPurchaseRequest = createAsyncThunk('purchase_purchaseRequest/getPurchaseRequest', async function (data, { getState }) {
|
|
31
|
+
return handlerApiCall({
|
|
32
|
+
fetchFunction: _getPurchaseRequest,
|
|
33
|
+
data,
|
|
34
|
+
action: 'Purchase_SliceAction_GetPurchaseRequest',
|
|
35
|
+
getState,
|
|
36
|
+
responseOptions: { isArrayResponse: false },
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
export const updatePurchaseRequestStatus = createAsyncThunk('purchase_purchaseRequest/updatePurchaseRequestStatus', async function (data, { getState, dispatch }) {
|
|
40
|
+
return handlerApiCall({
|
|
41
|
+
fetchFunction: _updatePurchaseRequestStatus,
|
|
42
|
+
data,
|
|
43
|
+
action: 'Purchase_SliceAction_UpdatePurchaseRequestStatus',
|
|
44
|
+
getState,
|
|
45
|
+
responseOptions: { isArrayResponse: false, showToast: true },
|
|
46
|
+
}).then(() => {
|
|
47
|
+
dispatch(getPurchaseRequest({ id: data.purchaseRequest.id }));
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
export const createPurchaseRequest = createAsyncThunk('purchase_purchaseRequest/createPurchaseRequest', async function (data, { getState }) {
|
|
51
|
+
return handlerApiCall({
|
|
52
|
+
fetchFunction: _createPurchaseRequest,
|
|
53
|
+
data,
|
|
54
|
+
action: 'Purchase_SliceAction_CreatePurchaseRequest',
|
|
55
|
+
getState,
|
|
56
|
+
responseOptions: { isArrayResponse: false, showToast: true },
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
export const updatePurchaseRequest = createAsyncThunk('purchase_purchaseRequest/updatePurchaseRequest', async function (data, { getState, dispatch }) {
|
|
60
|
+
return handlerApiCall({
|
|
61
|
+
fetchFunction: _updatePurchaseRequest,
|
|
62
|
+
data,
|
|
63
|
+
action: 'Purchase_SliceAction_UpdatePurchaseRequest',
|
|
64
|
+
getState,
|
|
65
|
+
responseOptions: { isArrayResponse: false, showToast: true },
|
|
66
|
+
}).then(() => {
|
|
67
|
+
dispatch(getPurchaseRequest({ id: data.purchaseRequest.id }));
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
const initialState = {
|
|
71
|
+
loadingPurchaseRequest: false,
|
|
72
|
+
purchaseRequest: {},
|
|
73
|
+
loadingPurchaseRequests: false,
|
|
74
|
+
moreLoadingPurchaseRequest: false,
|
|
75
|
+
isListEndPurchaseRequest: false,
|
|
76
|
+
purchaseRequestList: [],
|
|
77
|
+
};
|
|
78
|
+
const purchaseRequestSlice = createSlice({
|
|
79
|
+
name: 'purchase_purchaseRequest',
|
|
80
|
+
initialState,
|
|
81
|
+
extraReducers: builder => {
|
|
82
|
+
generateInifiniteScrollCases(builder, searchPurchaseRequest, {
|
|
83
|
+
loading: 'loadingPurchaseRequests',
|
|
84
|
+
moreLoading: 'moreLoadingPurchaseRequest',
|
|
85
|
+
isListEnd: 'isListEndPurchaseRequest',
|
|
86
|
+
list: 'purchaseRequestList',
|
|
87
|
+
});
|
|
88
|
+
builder.addCase(getPurchaseRequest.pending, state => {
|
|
89
|
+
state.loadingPurchaseRequest = true;
|
|
90
|
+
});
|
|
91
|
+
builder.addCase(getPurchaseRequest.rejected, state => {
|
|
92
|
+
state.loadingPurchaseRequest = false;
|
|
93
|
+
});
|
|
94
|
+
builder.addCase(getPurchaseRequest.fulfilled, (state, action) => {
|
|
95
|
+
state.loadingPurchaseRequest = false;
|
|
96
|
+
state.purchaseRequest = action.payload;
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
export const purchaseRequestReducer = purchaseRequestSlice.reducer;
|
|
101
|
+
//# sourceMappingURL=purchaseRequestSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchaseRequestSlice.js","sourceRoot":"","sources":["../../src/features/purchaseRequestSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,IAAI,sBAAsB,EAC/C,kBAAkB,IAAI,mBAAmB,EACzC,qBAAqB,IAAI,sBAAsB,EAC/C,qBAAqB,IAAI,sBAAsB,EAC/C,2BAA2B,IAAI,4BAA4B,GAC5D,MAAM,6BAA6B,CAAC;AAErC,MAAM,CAAC,MAAM,qBAAqB,GAAG,gBAAgB,CACnD,gDAAgD,EAChD,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,sBAAsB;QACrC,IAAI;QACJ,MAAM,EAAE,4CAA4C;QACpD,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,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EAAE;YAC9D,KAAK,CAAC,sBAAsB,GAAG,KAAK,CAAC;YACrC,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const searchSupplier: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
2
|
+
state?: unknown;
|
|
3
|
+
dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
|
|
4
|
+
extra?: unknown;
|
|
5
|
+
rejectValue?: unknown;
|
|
6
|
+
serializedErrorType?: unknown;
|
|
7
|
+
pendingMeta?: unknown;
|
|
8
|
+
fulfilledMeta?: unknown;
|
|
9
|
+
rejectedMeta?: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
export const supplierReducer: import("redux").Reducer<{
|
|
12
|
+
loadingSuppliers: boolean;
|
|
13
|
+
moreLoadingSupplier: boolean;
|
|
14
|
+
isListEndSupplier: boolean;
|
|
15
|
+
supplierList: any[];
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { generateInifiniteScrollCases, handlerApiCall, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { searchSupplier as _searchSupplier } from '../api/supplier-api';
|
|
21
|
+
export const searchSupplier = createAsyncThunk('purchase_supplier/searchSupplier', async function (data, { getState }) {
|
|
22
|
+
return handlerApiCall({
|
|
23
|
+
fetchFunction: _searchSupplier,
|
|
24
|
+
data,
|
|
25
|
+
action: 'Purchase_SliceAction_SearchSupplier',
|
|
26
|
+
getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const initialState = {
|
|
31
|
+
loadingSuppliers: false,
|
|
32
|
+
moreLoadingSupplier: false,
|
|
33
|
+
isListEndSupplier: false,
|
|
34
|
+
supplierList: [],
|
|
35
|
+
};
|
|
36
|
+
const supplierSlice = createSlice({
|
|
37
|
+
name: 'purchase_supplier',
|
|
38
|
+
initialState,
|
|
39
|
+
extraReducers: builder => {
|
|
40
|
+
generateInifiniteScrollCases(builder, searchSupplier, {
|
|
41
|
+
loading: 'loadingSuppliers',
|
|
42
|
+
moreLoading: 'moreLoadingSupplier',
|
|
43
|
+
isListEnd: 'isListEndSupplier',
|
|
44
|
+
list: 'supplierList',
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export const supplierReducer = supplierSlice.reducer;
|
|
49
|
+
//# sourceMappingURL=supplierSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supplierSlice.js","sourceRoot":"","sources":["../../src/features/supplierSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,cAAc,IAAI,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAEtE,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAC5C,kCAAkC,EAClC,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,eAAe;QAC9B,IAAI;QACJ,MAAM,EAAE,qCAAqC;QAC7C,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,gBAAgB,EAAE,KAAK;IACvB,mBAAmB,EAAE,KAAK;IAC1B,iBAAiB,EAAE,KAAK;IACxB,YAAY,EAAE,EAAE;CACjB,CAAC;AAEF,MAAM,aAAa,GAAG,WAAW,CAAC;IAChC,IAAI,EAAE,mBAAmB;IACzB,YAAY;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,4BAA4B,CAAC,OAAO,EAAE,cAAc,EAAE;YACpD,OAAO,EAAE,kBAAkB;YAC3B,WAAW,EAAE,qBAAqB;YAClC,SAAS,EAAE,mBAAmB;YAC9B,IAAI,EAAE,cAAc;SACrB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const searchUnit: import("@reduxjs/toolkit").AsyncThunk<any, void, {
|
|
2
|
+
state?: unknown;
|
|
3
|
+
dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction>;
|
|
4
|
+
extra?: unknown;
|
|
5
|
+
rejectValue?: unknown;
|
|
6
|
+
serializedErrorType?: unknown;
|
|
7
|
+
pendingMeta?: unknown;
|
|
8
|
+
fulfilledMeta?: unknown;
|
|
9
|
+
rejectedMeta?: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
export const unitReducer: import("redux").Reducer<{
|
|
12
|
+
loadingUnits: boolean;
|
|
13
|
+
moreLoadingUnit: boolean;
|
|
14
|
+
isListEndUnit: boolean;
|
|
15
|
+
unitList: any[];
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
19
|
+
import { generateInifiniteScrollCases, handlerApiCall, } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { searchUnit as _searchUnit } from '../api/unit-api';
|
|
21
|
+
export const searchUnit = createAsyncThunk('purchase_unit/searchUnit', async function (data, { getState }) {
|
|
22
|
+
return handlerApiCall({
|
|
23
|
+
fetchFunction: _searchUnit,
|
|
24
|
+
data,
|
|
25
|
+
action: 'Purchase_SliceAction_SearchUnit',
|
|
26
|
+
getState,
|
|
27
|
+
responseOptions: { isArrayResponse: true },
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const initialState = {
|
|
31
|
+
loadingUnits: false,
|
|
32
|
+
moreLoadingUnit: false,
|
|
33
|
+
isListEndUnit: false,
|
|
34
|
+
unitList: [],
|
|
35
|
+
};
|
|
36
|
+
const unitSlice = createSlice({
|
|
37
|
+
name: 'purchase_unit',
|
|
38
|
+
initialState,
|
|
39
|
+
extraReducers: builder => {
|
|
40
|
+
generateInifiniteScrollCases(builder, searchUnit, {
|
|
41
|
+
loading: 'loadingUnits',
|
|
42
|
+
moreLoading: 'moreLoadingUnit',
|
|
43
|
+
isListEnd: 'isListEndUnit',
|
|
44
|
+
list: 'unitList',
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export const unitReducer = unitSlice.reducer;
|
|
49
|
+
//# sourceMappingURL=unitSlice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unitSlice.js","sourceRoot":"","sources":["../../src/features/unitSlice.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,UAAU,IAAI,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAE1D,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CACxC,0BAA0B,EAC1B,KAAK,WAAW,IAAI,EAAE,EAAC,QAAQ,EAAC;IAC9B,OAAO,cAAc,CAAC;QACpB,aAAa,EAAE,WAAW;QAC1B,IAAI;QACJ,MAAM,EAAE,iCAAiC;QACzC,QAAQ;QACR,eAAe,EAAE,EAAC,eAAe,EAAE,IAAI,EAAC;KACzC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,YAAY,EAAE,KAAK;IACnB,eAAe,EAAE,KAAK;IACtB,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,SAAS,GAAG,WAAW,CAAC;IAC5B,IAAI,EAAE,eAAe;IACrB,YAAY;IACZ,aAAa,EAAE,OAAO,CAAC,EAAE;QACvB,4BAA4B,CAAC,OAAO,EAAE,UAAU,EAAE;YAChD,OAAO,EAAE,cAAc;YACvB,WAAW,EAAE,iBAAiB;YAC9B,SAAS,EAAE,eAAe;YAC1B,IAAI,EAAE,UAAU;SACjB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const usePurchaseHeaders: () => void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { useEffect } from 'react';
|
|
19
|
+
import { headerActionsProvider, useSelector } from '@axelor/aos-mobile-core';
|
|
20
|
+
export const usePurchaseHeaders = () => {
|
|
21
|
+
usePurchaseRequestDetailsActions();
|
|
22
|
+
usePurchaseRequestLineDetailsActions();
|
|
23
|
+
};
|
|
24
|
+
const usePurchaseRequestDetailsActions = () => {
|
|
25
|
+
const { mobileSettings } = useSelector(state => state.appConfig);
|
|
26
|
+
const { purchaseRequest } = useSelector(state => state.purchase_purchaseRequest);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
headerActionsProvider.registerModel('purchase_purchaseRequest_details', {
|
|
29
|
+
model: 'com.axelor.apps.purchase.db.PurchaseRequest',
|
|
30
|
+
modelId: purchaseRequest?.id,
|
|
31
|
+
disableMailMessages: !mobileSettings?.isTrackerMessageEnabled,
|
|
32
|
+
});
|
|
33
|
+
}, [mobileSettings, purchaseRequest?.id]);
|
|
34
|
+
};
|
|
35
|
+
const usePurchaseRequestLineDetailsActions = () => {
|
|
36
|
+
const { mobileSettings } = useSelector(state => state.appConfig);
|
|
37
|
+
const { purchaseRequestLine } = useSelector(state => state.purchase_purchaseRequestLine);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
headerActionsProvider.registerModel('purchase_purchaseRequestLine_details', {
|
|
40
|
+
model: 'com.axelor.apps.purchase.db.PurchaseRequestLine',
|
|
41
|
+
modelId: purchaseRequestLine?.id,
|
|
42
|
+
disableMailMessages: !mobileSettings?.isTrackerMessageEnabled,
|
|
43
|
+
});
|
|
44
|
+
}, [mobileSettings, purchaseRequestLine?.id]);
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=use-purchase-header-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-purchase-header-actions.js","sourceRoot":"","sources":["../../src/hooks/use-purchase-header-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,qBAAqB,EAAE,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAE3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,gCAAgC,EAAE,CAAC;IACnC,oCAAoC,EAAE,CAAC;AACzC,CAAC,CAAC;AAEF,MAAM,gCAAgC,GAAG,GAAG,EAAE;IAC5C,MAAM,EAAC,cAAc,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/D,MAAM,EAAC,eAAe,EAAC,GAAG,WAAW,CACnC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,wBAAwB,CACxC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACb,qBAAqB,CAAC,aAAa,CAAC,kCAAkC,EAAE;YACtE,KAAK,EAAE,6CAA6C;YACpD,OAAO,EAAE,eAAe,EAAE,EAAE;YAC5B,mBAAmB,EAAE,CAAC,cAAc,EAAE,uBAAuB;SAC9D,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,oCAAoC,GAAG,GAAG,EAAE;IAChD,MAAM,EAAC,cAAc,EAAC,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/D,MAAM,EAAC,mBAAmB,EAAC,GAAG,WAAW,CACvC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,4BAA4B,CAC5C,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,qBAAqB,CAAC,aAAa,CACjC,sCAAsC,EACtC;YACE,KAAK,EAAE,iDAAiD;YACxD,OAAO,EAAE,mBAAmB,EAAE,EAAE;YAChC,mBAAmB,EAAE,CAAC,cAAc,EAAE,uBAAuB;SAC9D,CACF,CAAC;IACJ,CAAC,EAAE,CAAC,cAAc,EAAE,mBAAmB,EAAE,EAAE,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC"}
|
package/lib/i18n/en.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Purchase_Purchase": "Purchase",
|
|
3
|
+
"Purchase_InternalRequests": "Internal requests",
|
|
4
|
+
"Purchase_InternalRequest": "Internal request",
|
|
5
|
+
"Purchase_Status_Draft": "Draft",
|
|
6
|
+
"Purchase_Status_Requested": "Requested",
|
|
7
|
+
"Purchase_Status_Accepted": "Accepted",
|
|
8
|
+
"Purchase_Status_Purchased": "Purchased",
|
|
9
|
+
"Purchase_Status_Refused": "Refused",
|
|
10
|
+
"Purchase_Status_Canceled": "Canceled",
|
|
11
|
+
"Purchase_Supplier": "Supplier",
|
|
12
|
+
"Purchase_StockLocation": "Stock location",
|
|
13
|
+
"Purchase_RequesterUser": "Requester",
|
|
14
|
+
"Purchase_ValidatorUser": "Validator",
|
|
15
|
+
"Purchase_Characteristics": "Characteristics",
|
|
16
|
+
"Purchase_SeeLines": "See lines",
|
|
17
|
+
"Purchase_Request": "Request",
|
|
18
|
+
"Purchase_Accept": "Accept",
|
|
19
|
+
"Purchase_Refuse": "Refuse",
|
|
20
|
+
"Purchase_NoInformationAvailable": "No information available",
|
|
21
|
+
"Purchase_AddProduct": "Add product",
|
|
22
|
+
"Purchase_NewProduct": "New product",
|
|
23
|
+
"Purchase_ExistingProduct": "Existing product",
|
|
24
|
+
"Purchase_CreateRequest": "Create request",
|
|
25
|
+
"Purchase_Company": "Company",
|
|
26
|
+
"Purchase_Or": "OR",
|
|
27
|
+
"Purchase_Unit": "Unit",
|
|
28
|
+
"Purchase_Quantity": "Quantity",
|
|
29
|
+
"Purchase_ProductTitle": "Product title",
|
|
30
|
+
"Purchase_Products": "Products",
|
|
31
|
+
"Purchase_Product": "Product",
|
|
32
|
+
"Purchase_RequestDescription": "Request description",
|
|
33
|
+
"Purchase_SliceAction_SearchPurchaseRequest": "search purchase request",
|
|
34
|
+
"Purchase_SliceAction_SearchSupplier": "search supplier",
|
|
35
|
+
"Purchase_SliceAction_GetPurchaseRequest": "get purchase request",
|
|
36
|
+
"Purchase_SliceAction_SearchPurchaseRequestLine": "search purchase request lines",
|
|
37
|
+
"Purchase_SliceAction_SearchProduct": "search product",
|
|
38
|
+
"Purchase_SliceAction_SearchUnit": "search unit",
|
|
39
|
+
"Purchase_SliceAction_UpdatePurchaseRequestStatus": "update purchase request status",
|
|
40
|
+
"Purchase_SliceAction_FetchPurchaseRequestLine": "fetch purchase request line",
|
|
41
|
+
"Purchase_SliceAction_CreatePurchaseRequestLine": "create purchase request line",
|
|
42
|
+
"Purchase_SliceAction_UpdatePurchaseRequestLine": "update purchase request line",
|
|
43
|
+
"Purchase_SliceAction_CreatePurchaseRequest": "create purchase request",
|
|
44
|
+
"Purchase_SliceAction_UpdatePurchaseRequest": "update purchase request"
|
|
45
|
+
}
|
package/lib/i18n/fr.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Purchase_Purchase": "Achats",
|
|
3
|
+
"Purchase_InternalRequests": "Demandes internes",
|
|
4
|
+
"Purchase_InternalRequest": "Demande interne",
|
|
5
|
+
"Purchase_Status_Draft": "Brouillon",
|
|
6
|
+
"Purchase_Status_Requested": "Demandée",
|
|
7
|
+
"Purchase_Status_Accepted": "Acceptée",
|
|
8
|
+
"Purchase_Status_Purchased": "Achetée",
|
|
9
|
+
"Purchase_Status_Refused": "Refusée",
|
|
10
|
+
"Purchase_Status_Canceled": "Annulée",
|
|
11
|
+
"Purchase_Supplier": "Fournisseur",
|
|
12
|
+
"Purchase_StockLocation": "Emplacement de stock",
|
|
13
|
+
"Purchase_RequesterUser": "Demandeur",
|
|
14
|
+
"Purchase_ValidatorUser": "Valideur",
|
|
15
|
+
"Purchase_Characteristics": "Caractéristiques",
|
|
16
|
+
"Purchase_SeeLines": "Voir les lignes",
|
|
17
|
+
"Purchase_Request": "Demander",
|
|
18
|
+
"Purchase_Accept": "Accepter",
|
|
19
|
+
"Purchase_Refuse": "Refuser",
|
|
20
|
+
"Purchase_NoInformationAvailable": "Aucune information disponible",
|
|
21
|
+
"Purchase_AddProduct": "Ajouter un produit",
|
|
22
|
+
"Purchase_NewProduct": "Nouveau produit",
|
|
23
|
+
"Purchase_ExistingProduct": "Produit existant",
|
|
24
|
+
"Purchase_CreateRequest": "Créer une demande",
|
|
25
|
+
"Purchase_Company": "Société",
|
|
26
|
+
"Purchase_Or": "OU",
|
|
27
|
+
"Purchase_Unit": "Unité",
|
|
28
|
+
"Purchase_Quantity": "Quantité",
|
|
29
|
+
"Purchase_ProductTitle": "Nom du produit",
|
|
30
|
+
"Purchase_Products": "Produits",
|
|
31
|
+
"Purchase_Product": "Produit",
|
|
32
|
+
"Purchase_RequestDescription": "Description de la demande",
|
|
33
|
+
"Purchase_SliceAction_SearchPurchaseRequest": "recherche sur les demandes d'achat",
|
|
34
|
+
"Purchase_SliceAction_SearchSupplier": "recherche sur les fournisseurs",
|
|
35
|
+
"Purchase_SliceAction_GetPurchaseRequest": "récupération de la demande d'achat",
|
|
36
|
+
"Purchase_SliceAction_SearchPurchaseRequestLine": "recherche sur les lignes de demandes d'achat",
|
|
37
|
+
"Purchase_SliceAction_SearchProduct": "recherche sur les produits",
|
|
38
|
+
"Purchase_SliceAction_SearchUnit": "recherche sur les unités",
|
|
39
|
+
"Purchase_SliceAction_UpdatePurchaseRequestStatus": "mise à jour du statut de la demande d'achat",
|
|
40
|
+
"Purchase_SliceAction_FetchPurchaseRequestLine": "récupération de la ligne de demande d'achat",
|
|
41
|
+
"Purchase_SliceAction_CreatePurchaseRequestLine": "création de la ligne de demande d'achat",
|
|
42
|
+
"Purchase_SliceAction_UpdatePurchaseRequestLine": "mise à jour de la ligne de demande d'achat",
|
|
43
|
+
"Purchase_SliceAction_CreatePurchaseRequest": "création d'une demande d'achat",
|
|
44
|
+
"Purchase_SliceAction_UpdatePurchaseRequest": "mise à jour de demande d'achat"
|
|
45
|
+
}
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import PurchaseScreens from './screens';
|
|
19
|
+
import enTranslations from './i18n/en.json';
|
|
20
|
+
import frTranslations from './i18n/fr.json';
|
|
21
|
+
import * as purchaseReducers from './features';
|
|
22
|
+
import { purchase_formsRegister, purchase_modelAPI, purchase_searchFields, purchase_sortFields, purchase_typeObjects, } from './models';
|
|
23
|
+
import { usePurchaseHeaders } from './hooks/use-purchase-header-actions';
|
|
24
|
+
export const PurchaseModule = {
|
|
25
|
+
name: 'app-purchase',
|
|
26
|
+
title: 'Purchase_Purchase',
|
|
27
|
+
subtitle: 'Purchase_Purchase',
|
|
28
|
+
icon: 'cart-fill',
|
|
29
|
+
compatibilityAOS: {
|
|
30
|
+
moduleName: 'axelor-purchase',
|
|
31
|
+
downToVersion: '8.3.0',
|
|
32
|
+
},
|
|
33
|
+
menus: {
|
|
34
|
+
purchase_menu_internal_request: {
|
|
35
|
+
title: 'Purchase_InternalRequests',
|
|
36
|
+
icon: 'file-earmark-ruled',
|
|
37
|
+
screen: 'RequestListScreen',
|
|
38
|
+
},
|
|
39
|
+
purchase_menu_request_creation: {
|
|
40
|
+
title: 'Purchase_CreateRequest',
|
|
41
|
+
icon: 'cart-plus',
|
|
42
|
+
screen: 'RequestCreationScreen',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
screens: {
|
|
46
|
+
...PurchaseScreens,
|
|
47
|
+
},
|
|
48
|
+
translations: {
|
|
49
|
+
en: enTranslations,
|
|
50
|
+
fr: frTranslations,
|
|
51
|
+
},
|
|
52
|
+
models: {
|
|
53
|
+
headerRegisters: usePurchaseHeaders,
|
|
54
|
+
objectFields: { ...purchase_modelAPI },
|
|
55
|
+
sortFields: { ...purchase_sortFields },
|
|
56
|
+
searchFields: { ...purchase_searchFields },
|
|
57
|
+
formsRegister: { ...purchase_formsRegister },
|
|
58
|
+
typeObjects: purchase_typeObjects,
|
|
59
|
+
},
|
|
60
|
+
reducers: {
|
|
61
|
+
...purchaseReducers,
|
|
62
|
+
},
|
|
63
|
+
requiredConfig: ['AppPurchase'],
|
|
64
|
+
};
|
|
65
|
+
export * from './api';
|
|
66
|
+
export * from './features/asyncFunctions-index';
|
|
67
|
+
export * from './components';
|
|
68
|
+
export * from './screens';
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,eAAe,MAAM,WAAW,CAAC;AACxC,OAAO,cAAc,MAAM,gBAAgB,CAAC;AAC5C,OAAO,cAAc,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,gBAAgB,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAC,kBAAkB,EAAC,MAAM,qCAAqC,CAAC;AAEvE,MAAM,CAAC,MAAM,cAAc,GAAW;IACpC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,mBAAmB;IAC7B,IAAI,EAAE,WAAW;IACjB,gBAAgB,EAAE;QAChB,UAAU,EAAE,iBAAiB;QAC7B,aAAa,EAAE,OAAO;KACvB;IACD,KAAK,EAAE;QACL,8BAA8B,EAAE;YAC9B,KAAK,EAAE,2BAA2B;YAClC,IAAI,EAAE,oBAAoB;YAC1B,MAAM,EAAE,mBAAmB;SAC5B;QACD,8BAA8B,EAAE;YAC9B,KAAK,EAAE,wBAAwB;YAC/B,IAAI,EAAE,WAAW;YACjB,MAAM,EAAE,uBAAuB;SAChC;KACF;IACD,OAAO,EAAE;QACP,GAAG,eAAe;KACnB;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,EAAE,EAAE,cAAc;KACnB;IACD,MAAM,EAAE;QACN,eAAe,EAAE,kBAAkB;QACnC,YAAY,EAAE,EAAC,GAAG,iBAAiB,EAAC;QACpC,UAAU,EAAE,EAAC,GAAG,mBAAmB,EAAC;QACpC,YAAY,EAAE,EAAC,GAAG,qBAAqB,EAAC;QACxC,aAAa,EAAE,EAAC,GAAG,sBAAsB,EAAC;QAC1C,WAAW,EAAE,oBAAoB;KAClC;IACD,QAAQ,EAAE;QACR,GAAG,gBAAgB;KACpB;IACD,cAAc,EAAE,CAAC,aAAa,CAAC;CAChC,CAAC;AAEF,cAAc,OAAO,CAAC;AACtB,cAAc,iCAAiC,CAAC;AAChD,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import { HorizontalOrRuleText, ProductSearchBar, UnitSearchBar, } from '../components';
|
|
19
|
+
export const purchase_formsRegister = {
|
|
20
|
+
purchase_purchaseRequestLine: {
|
|
21
|
+
modelName: 'com.axelor.apps.purchase.db.PurchaseRequestLine',
|
|
22
|
+
fields: {
|
|
23
|
+
product: {
|
|
24
|
+
titleKey: 'Purchase_Product',
|
|
25
|
+
type: 'object',
|
|
26
|
+
widget: 'custom',
|
|
27
|
+
requiredIf: ({ objectState }) => objectState?.productTitle == null,
|
|
28
|
+
customComponent: ProductSearchBar,
|
|
29
|
+
options: { showTitle: true },
|
|
30
|
+
},
|
|
31
|
+
orRule: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
widget: 'custom',
|
|
34
|
+
customComponent: HorizontalOrRuleText,
|
|
35
|
+
},
|
|
36
|
+
productTitle: {
|
|
37
|
+
titleKey: 'Purchase_ProductTitle',
|
|
38
|
+
type: 'string',
|
|
39
|
+
readonlyIf: ({ objectState }) => objectState?.product != null,
|
|
40
|
+
requiredIf: ({ objectState }) => objectState?.product == null,
|
|
41
|
+
dependsOn: {
|
|
42
|
+
product: ({ newValue }) => newValue?.name,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
quantity: {
|
|
46
|
+
titleKey: 'Purchase_Quantity',
|
|
47
|
+
type: 'number',
|
|
48
|
+
widget: 'increment',
|
|
49
|
+
required: true,
|
|
50
|
+
},
|
|
51
|
+
unit: {
|
|
52
|
+
titleKey: 'Purchase_Unit',
|
|
53
|
+
type: 'object',
|
|
54
|
+
widget: 'custom',
|
|
55
|
+
customComponent: UnitSearchBar,
|
|
56
|
+
options: { showTitle: true },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=forms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forms.js","sourceRoot":"","sources":["../../src/models/forms.ts"],"names":[],"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EAAC,SAAS,EAAE,IAAI,EAAC;aAC3B;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
export { purchase_formsRegister } from './forms';
|
|
19
|
+
export { purchase_searchFields } from './searchFields';
|
|
20
|
+
export { purchase_sortFields } from './sortFields';
|
|
21
|
+
export { purchase_modelAPI } from './objectFields';
|
|
22
|
+
export { purchase_typeObjects } from './typeObjects';
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAC,qBAAqB,EAAC,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AACjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAC"}
|