@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,47 @@
|
|
|
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 React from 'react';
|
|
19
|
+
import { StyleSheet, View } from 'react-native';
|
|
20
|
+
import { Text, LabelText, Badge } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useSelector, useTypeHelpers, useTypes } from '@axelor/aos-mobile-core';
|
|
22
|
+
const RequestHeader = ({}) => {
|
|
23
|
+
const { PurchaseRequest } = useTypes();
|
|
24
|
+
const { getItemColor, getItemTitle } = useTypeHelpers();
|
|
25
|
+
const { purchaseRequest } = useSelector(state => state.purchase_purchaseRequest);
|
|
26
|
+
return (<View style={styles.container}>
|
|
27
|
+
<View style={styles.chlidrenContainer}>
|
|
28
|
+
<Text writingType="title">{purchaseRequest?.purchaseRequestSeq}</Text>
|
|
29
|
+
<Badge title={getItemTitle(PurchaseRequest?.statusSelect, purchaseRequest.statusSelect)} color={getItemColor(PurchaseRequest?.statusSelect, purchaseRequest.statusSelect)}/>
|
|
30
|
+
</View>
|
|
31
|
+
<LabelText iconName="building-fill" size={16} title={purchaseRequest?.company?.name}/>
|
|
32
|
+
</View>);
|
|
33
|
+
};
|
|
34
|
+
const styles = StyleSheet.create({
|
|
35
|
+
container: {
|
|
36
|
+
marginHorizontal: 24,
|
|
37
|
+
marginBottom: 5,
|
|
38
|
+
},
|
|
39
|
+
chlidrenContainer: {
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
justifyContent: 'space-between',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
marginBottom: 5,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
export default RequestHeader;
|
|
47
|
+
//# sourceMappingURL=RequestHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestHeader.js","sourceRoot":"","sources":["../../../../src/components/atoms/RequestHeader/RequestHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAC,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AAE9E,MAAM,aAAa,GAAG,CAAC,EAAE,EAAE,EAAE;IAC3B,MAAM,EAAC,eAAe,EAAC,GAAG,QAAQ,EAAE,CAAC;IACrC,MAAM,EAAC,YAAY,EAAE,YAAY,EAAC,GAAG,cAAc,EAAE,CAAC;IAEtD,MAAM,EAAC,eAAe,EAAC,GAAG,WAAW,CACnC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,wBAAwB,CACxC,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CACpC;QAAA,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,kBAAkB,CAAC,EAAE,IAAI,CACrE;QAAA,CAAC,KAAK,CACJ,KAAK,CAAC,CAAC,YAAY,CACjB,eAAe,EAAE,YAAY,EAC7B,eAAe,CAAC,YAAY,CAC7B,CAAC,CACF,KAAK,CAAC,CAAC,YAAY,CACjB,eAAe,EAAE,YAAY,EAC7B,eAAe,CAAC,YAAY,CAC7B,CAAC,EAEN;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,SAAS,CACR,QAAQ,CAAC,eAAe,CACxB,IAAI,CAAC,CAAC,EAAE,CAAC,CACT,KAAK,CAAC,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,EAE1C;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,gBAAgB,EAAE,EAAE;QACpB,YAAY,EAAE,CAAC;KAChB;IACD,iBAAiB,EAAE;QACjB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,CAAC;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RequestLineCardProps {
|
|
3
|
+
style?: any;
|
|
4
|
+
productName?: string;
|
|
5
|
+
unit?: string;
|
|
6
|
+
qty?: string;
|
|
7
|
+
newProduct?: boolean;
|
|
8
|
+
id: number;
|
|
9
|
+
}
|
|
10
|
+
declare const RequestLineCard: ({ style, productName, unit, qty, newProduct, id, }: RequestLineCardProps) => React.JSX.Element;
|
|
11
|
+
export default RequestLineCard;
|
|
@@ -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 React, { useMemo } from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { ObjectCard, TextUnit, usePriceFormat, useThemeColor, } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useNavigation } from '@axelor/aos-mobile-core';
|
|
22
|
+
const RequestLineCard = ({ style, productName, unit, qty, newProduct, id, }) => {
|
|
23
|
+
const priceFormat = usePriceFormat();
|
|
24
|
+
const navigation = useNavigation();
|
|
25
|
+
const Colors = useThemeColor();
|
|
26
|
+
const borderStyle = useMemo(() => {
|
|
27
|
+
if (newProduct) {
|
|
28
|
+
return getStyles(Colors.plannedColor.background)?.border;
|
|
29
|
+
}
|
|
30
|
+
}, [Colors.plannedColor.background, newProduct]);
|
|
31
|
+
return (<ObjectCard onPress={() => {
|
|
32
|
+
navigation.navigate('RequestLineFormScreen', {
|
|
33
|
+
purchaseRequestLineId: id,
|
|
34
|
+
});
|
|
35
|
+
}} style={[borderStyle, style]} leftContainerFlex={3} iconLeftMargin={5} upperTexts={{
|
|
36
|
+
items: [{ isTitle: true, displayText: productName }],
|
|
37
|
+
}} sideBadges={{
|
|
38
|
+
items: [
|
|
39
|
+
{
|
|
40
|
+
customComponent: (<TextUnit unit={unit} value={priceFormat(qty)} fontSize={20}/>),
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
}}/>);
|
|
44
|
+
};
|
|
45
|
+
const getStyles = (color) => StyleSheet.create({
|
|
46
|
+
border: { borderLeftWidth: 7, borderLeftColor: color },
|
|
47
|
+
});
|
|
48
|
+
export default RequestLineCard;
|
|
49
|
+
//# sourceMappingURL=RequestLineCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestLineCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/RequestLineCard/RequestLineCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EACL,UAAU,EACV,QAAQ,EACR,cAAc,EACd,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAWtD,MAAM,eAAe,GAAG,CAAC,EACvB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,GAAG,EACH,UAAU,EACV,EAAE,GACmB,EAAE,EAAE;IACzB,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;QAC/B,IAAI,UAAU,EAAE;YACd,OAAO,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;SAC1D;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;IAEjD,OAAO,CACL,CAAC,UAAU,CACT,OAAO,CAAC,CAAC,GAAG,EAAE;YACZ,UAAU,CAAC,QAAQ,CAAC,uBAAuB,EAAE;gBAC3C,qBAAqB,EAAE,EAAE;aAC1B,CAAC,CAAC;QACL,CAAC,CAAC,CACF,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAC5B,iBAAiB,CAAC,CAAC,CAAC,CAAC,CACrB,cAAc,CAAC,CAAC,CAAC,CAAC,CAClB,UAAU,CAAC,CAAC;YACV,KAAK,EAAE,CAAC,EAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAC,CAAC;SACnD,CAAC,CACF,UAAU,CAAC,CAAC;YACV,KAAK,EAAE;gBACL;oBACE,eAAe,EAAE,CACf,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAG,CAChE;iBACF;aACF;SACF,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAClC,UAAU,CAAC,MAAM,CAAC;IAChB,MAAM,EAAE,EAAC,eAAe,EAAE,CAAC,EAAE,eAAe,EAAE,KAAK,EAAC;CACrD,CAAC,CAAC;AAEL,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 React, { useMemo } from 'react';
|
|
19
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
20
|
+
import { useNavigation, useSelector, useTranslator, } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { Card, Icon, NumberBubble, useThemeColor, Text, } from '@axelor/aos-mobile-ui';
|
|
22
|
+
const RequestSeeLinesButton = () => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
const Colors = useThemeColor();
|
|
25
|
+
const navigation = useNavigation();
|
|
26
|
+
const styles = useMemo(() => getStyles(Colors.secondaryColor.background), [Colors.secondaryColor.background]);
|
|
27
|
+
const { totalPurchaseRequestLine } = useSelector(state => state.purchase_purchaseRequestLine);
|
|
28
|
+
return (<TouchableOpacity onPress={() => navigation.navigate('RequestLineListScreen')} disabled={totalPurchaseRequestLine === 0} activeOpacity={0.9}>
|
|
29
|
+
<Card style={styles.container}>
|
|
30
|
+
<Text style={styles.text}>{I18n.t('Purchase_SeeLines')}</Text>
|
|
31
|
+
<View style={styles.rightContainer}>
|
|
32
|
+
<NumberBubble style={styles.numberBubble} number={totalPurchaseRequestLine} color={Colors.progressColor} isNeutralBackground={false}/>
|
|
33
|
+
{totalPurchaseRequestLine > 0 && (<Icon name="chevron-right" color={Colors.primaryColor.background}/>)}
|
|
34
|
+
</View>
|
|
35
|
+
</Card>
|
|
36
|
+
</TouchableOpacity>);
|
|
37
|
+
};
|
|
38
|
+
const getStyles = (borderColor) => StyleSheet.create({
|
|
39
|
+
container: {
|
|
40
|
+
width: '90%',
|
|
41
|
+
height: 40,
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
justifyContent: 'space-between',
|
|
44
|
+
alignSelf: 'center',
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
marginRight: 0,
|
|
47
|
+
paddingVertical: 5,
|
|
48
|
+
paddingLeft: 10,
|
|
49
|
+
paddingRight: 10,
|
|
50
|
+
borderWidth: 1,
|
|
51
|
+
borderRadius: 7,
|
|
52
|
+
borderColor: borderColor,
|
|
53
|
+
marginVertical: 3,
|
|
54
|
+
},
|
|
55
|
+
text: {
|
|
56
|
+
fontWeight: 'bold',
|
|
57
|
+
},
|
|
58
|
+
rightContainer: {
|
|
59
|
+
flexDirection: 'row',
|
|
60
|
+
},
|
|
61
|
+
numberBubble: {
|
|
62
|
+
borderRadius: 7,
|
|
63
|
+
marginRight: 4,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
export default RequestSeeLinesButton;
|
|
67
|
+
//# sourceMappingURL=RequestSeeLinesButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestSeeLinesButton.js","sourceRoot":"","sources":["../../../../src/components/atoms/RequestSeeLinesButton/RequestSeeLinesButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAChE,OAAO,EACL,aAAa,EACb,WAAW,EACX,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,IAAI,GACL,MAAM,uBAAuB,CAAC;AAE/B,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACjC,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,MAAM,MAAM,GAAG,OAAO,CACpB,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,EACjD,CAAC,MAAM,CAAC,cAAc,CAAC,UAAU,CA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ACV,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;QACd,eAAe,EAAE,CAAC;QAClB,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,WAAW;QACxB,cAAc,EAAE,CAAC;KAClB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;KACnB;IACD,cAAc,EAAE;QACd,aAAa,EAAE,KAAK;KACrB;IACD,YAAY,EAAE;QACZ,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,CAAC;KACf;CACF,CAAC,CAAC;AAEL,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as DropdownRequestCharacteristics } from './DropdownRequestCharacteristics/DropdownRequestCharacteristics';
|
|
2
|
+
export { default as RequestCard } from './RequestCard/RequestCard';
|
|
3
|
+
export { default as RequestHeader } from './RequestHeader/RequestHeader';
|
|
4
|
+
export { default as RequestLineCard } from './RequestLineCard/RequestLineCard';
|
|
5
|
+
export { default as RequestSeeLinesButton } from './RequestSeeLinesButton/RequestSeeLinesButton';
|
|
@@ -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 { default as DropdownRequestCharacteristics } from './DropdownRequestCharacteristics/DropdownRequestCharacteristics';
|
|
19
|
+
export { default as RequestCard } from './RequestCard/RequestCard';
|
|
20
|
+
export { default as RequestHeader } from './RequestHeader/RequestHeader';
|
|
21
|
+
export { default as RequestLineCard } from './RequestLineCard/RequestLineCard';
|
|
22
|
+
export { default as RequestSeeLinesButton } from './RequestSeeLinesButton/RequestSeeLinesButton';
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/atoms/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,8BAA8B,EAAC,MAAM,iEAAiE,CAAC;AAC1H,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,OAAO,IAAI,qBAAqB,EAAC,MAAM,+CAA+C,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 * from './atoms';
|
|
19
|
+
export * from './molecules';
|
|
20
|
+
export * from './organisms';
|
|
21
|
+
export * from './templates';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 React from 'react';
|
|
19
|
+
import { useTranslator } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { DropdownCardSwitch } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { DropdownRequestCharacteristics } from '../../atoms';
|
|
22
|
+
const RequestDropdownCards = ({ style }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
return (<DropdownCardSwitch style={style} dropdownItems={[
|
|
25
|
+
{
|
|
26
|
+
key: 1,
|
|
27
|
+
title: I18n.t('Purchase_Characteristics'),
|
|
28
|
+
childrenComp: <DropdownRequestCharacteristics />,
|
|
29
|
+
},
|
|
30
|
+
]}/>);
|
|
31
|
+
};
|
|
32
|
+
export default RequestDropdownCards;
|
|
33
|
+
//# sourceMappingURL=RequestDropdownCards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestDropdownCards.js","sourceRoot":"","sources":["../../../../src/components/molecules/RequestDropdownCards/RequestDropdownCards.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAC,8BAA8B,EAAC,MAAM,aAAa,CAAC;AAE3D,MAAM,oBAAoB,GAAG,CAAC,EAAC,KAAK,EAAgB,EAAE,EAAE;IACtD,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAE7B,OAAO,CACL,CAAC,kBAAkB,CACjB,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,aAAa,CAAC,CAAC;YACb;gBACE,GAAG,EAAE,CAAC;gBACN,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC;gBACzC,YAAY,EAAE,CAAC,8BAA8B,CAAC,AAAD,EAAG;aACjD;SACF,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RequestDropdownCards } from './RequestDropdownCards/RequestDropdownCards';
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { default as RequestDropdownCards } from './RequestDropdownCards/RequestDropdownCards';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/molecules/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,oBAAoB,EAAC,MAAM,6CAA6C,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
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 React, { useCallback, useMemo } from 'react';
|
|
19
|
+
import { View, StyleSheet } from 'react-native';
|
|
20
|
+
import { Button, useThemeColor } from '@axelor/aos-mobile-ui';
|
|
21
|
+
import { useDispatch, usePermitted, useSelector, useTranslator, useTypes, } from '@axelor/aos-mobile-core';
|
|
22
|
+
import { updatePurchaseRequestStatus } from '../../../features/purchaseRequestSlice';
|
|
23
|
+
const RequestButtons = () => {
|
|
24
|
+
const Colors = useThemeColor();
|
|
25
|
+
const I18n = useTranslator();
|
|
26
|
+
const { PurchaseRequest } = useTypes();
|
|
27
|
+
const { readonly } = usePermitted({
|
|
28
|
+
modelName: 'com.axelor.apps.purchase.db.PurchaseRequest',
|
|
29
|
+
});
|
|
30
|
+
const dispatch = useDispatch();
|
|
31
|
+
const { purchaseRequest } = useSelector(state => state.purchase_purchaseRequest);
|
|
32
|
+
const getButtonsForStatus = useCallback(status => {
|
|
33
|
+
switch (status) {
|
|
34
|
+
case PurchaseRequest.statusSelect.Draft:
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
title: I18n.t('Purchase_Request'),
|
|
38
|
+
onPress: () => dispatch(updatePurchaseRequestStatus({
|
|
39
|
+
purchaseRequest,
|
|
40
|
+
status: 'request',
|
|
41
|
+
})),
|
|
42
|
+
width: '45%',
|
|
43
|
+
iconName: 'check-lg',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
title: I18n.t('Base_Cancel'),
|
|
47
|
+
onPress: () => dispatch(updatePurchaseRequestStatus({
|
|
48
|
+
purchaseRequest,
|
|
49
|
+
status: 'cancel',
|
|
50
|
+
})),
|
|
51
|
+
width: '45%',
|
|
52
|
+
color: Colors.cautionColor,
|
|
53
|
+
iconName: 'reply-fill',
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
case PurchaseRequest.statusSelect.Requested:
|
|
57
|
+
return [
|
|
58
|
+
{
|
|
59
|
+
title: I18n.t('Purchase_Accept'),
|
|
60
|
+
onPress: () => dispatch(updatePurchaseRequestStatus({
|
|
61
|
+
purchaseRequest,
|
|
62
|
+
status: 'accept',
|
|
63
|
+
})),
|
|
64
|
+
width: '45%',
|
|
65
|
+
iconName: 'check-lg',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
title: I18n.t('Purchase_Refuse'),
|
|
69
|
+
onPress: () => dispatch(updatePurchaseRequestStatus({
|
|
70
|
+
purchaseRequest,
|
|
71
|
+
status: 'refuse',
|
|
72
|
+
})),
|
|
73
|
+
width: '45%',
|
|
74
|
+
color: Colors.errorColor,
|
|
75
|
+
iconName: 'x-lg',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: I18n.t('Base_Cancel'),
|
|
79
|
+
onPress: () => dispatch(updatePurchaseRequestStatus({
|
|
80
|
+
purchaseRequest,
|
|
81
|
+
status: 'cancel',
|
|
82
|
+
})),
|
|
83
|
+
width: '94%',
|
|
84
|
+
color: Colors.cautionColor,
|
|
85
|
+
iconName: 'reply-fill',
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
case PurchaseRequest.statusSelect.Accepted:
|
|
89
|
+
case PurchaseRequest.statusSelect.Purchased:
|
|
90
|
+
case PurchaseRequest.statusSelect.Refused:
|
|
91
|
+
return [
|
|
92
|
+
{
|
|
93
|
+
title: I18n.t('Base_Cancel'),
|
|
94
|
+
onPress: () => dispatch(updatePurchaseRequestStatus({
|
|
95
|
+
purchaseRequest,
|
|
96
|
+
status: 'cancel',
|
|
97
|
+
})),
|
|
98
|
+
width: '90%',
|
|
99
|
+
color: Colors.cautionColor,
|
|
100
|
+
iconName: 'reply-fill',
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
case PurchaseRequest.statusSelect.Canceled:
|
|
104
|
+
return [
|
|
105
|
+
{
|
|
106
|
+
title: I18n.t('Purchase_Status_Draft'),
|
|
107
|
+
onPress: () => dispatch(updatePurchaseRequestStatus({
|
|
108
|
+
purchaseRequest,
|
|
109
|
+
status: 'draft',
|
|
110
|
+
})),
|
|
111
|
+
width: '90%',
|
|
112
|
+
color: Colors.secondaryColor,
|
|
113
|
+
iconName: 'reply-all-fill',
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
default:
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
}, [Colors, I18n, PurchaseRequest.statusSelect, dispatch, purchaseRequest]);
|
|
120
|
+
const buttons = useMemo(() => getButtonsForStatus(purchaseRequest?.statusSelect), [getButtonsForStatus, purchaseRequest?.statusSelect]);
|
|
121
|
+
if (buttons.length === 0 || readonly) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
return (<View style={styles.buttonContainer}>
|
|
125
|
+
{buttons.map((btn, idx) => (<Button key={idx} {...btn} width={btn.width}/>))}
|
|
126
|
+
</View>);
|
|
127
|
+
};
|
|
128
|
+
const styles = StyleSheet.create({
|
|
129
|
+
buttonContainer: {
|
|
130
|
+
flexWrap: 'wrap',
|
|
131
|
+
flexDirection: 'row',
|
|
132
|
+
justifyContent: 'space-evenly',
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
export default RequestButtons;
|
|
136
|
+
//# sourceMappingURL=RequestButtons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestButtons.js","sourceRoot":"","sources":["../../../../src/components/organisms/RequestButtons/RequestButtons.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAClD,OAAO,EAAC,IAAI,EAAE,UAAU,EAAiB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,WAAW,E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AQ,EAAE,MAAM;QAChB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,cAAc;KAC/B;CACF,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RequestButtons } from './RequestButtons/RequestButtons';
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { default as RequestButtons } from './RequestButtons/RequestButtons';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/organisms/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface CompanyPickerProps {
|
|
3
|
+
style?: any;
|
|
4
|
+
company?: any;
|
|
5
|
+
emptyValue?: boolean;
|
|
6
|
+
onChange: (state: any) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const CompanyPicker: ({ style, company, onChange, emptyValue, }: CompanyPickerProps) => React.JSX.Element;
|
|
9
|
+
export default CompanyPicker;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 React from 'react';
|
|
19
|
+
import { useSelector, useTranslator } from '@axelor/aos-mobile-core';
|
|
20
|
+
import { Picker } from '@axelor/aos-mobile-ui';
|
|
21
|
+
const CompanyPicker = ({ style, company, onChange = () => { }, emptyValue = true, }) => {
|
|
22
|
+
const I18n = useTranslator();
|
|
23
|
+
const { user } = useSelector((state) => state.user);
|
|
24
|
+
if (!Array.isArray(user?.companySet) || user.companySet.length <= 1) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return (<Picker placeholder={I18n.t('Purchase_Company')} style={style} defaultValue={company} listItems={user?.companySet} valueField="id" labelField="name" onValueChange={onChange} isValueItem emptyValue={emptyValue} translator={I18n.t}/>);
|
|
28
|
+
};
|
|
29
|
+
export default CompanyPicker;
|
|
30
|
+
//# sourceMappingURL=CompanyPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompanyPicker.js","sourceRoot":"","sources":["../../../../src/components/templates/CompanyPicker/Compan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
|
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 React from 'react';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { useTranslator } from '@axelor/aos-mobile-core';
|
|
21
|
+
import { HorizontalRuleText } from '@axelor/aos-mobile-ui';
|
|
22
|
+
const HorizontalOrRuleTextAux = ({ style }) => {
|
|
23
|
+
const I18n = useTranslator();
|
|
24
|
+
return (<HorizontalRuleText text={I18n.t('Purchase_Or')} style={[styles.rule, style]}/>);
|
|
25
|
+
};
|
|
26
|
+
const HorizontalOrRuleText = ({ style }) => {
|
|
27
|
+
return <HorizontalOrRuleTextAux style={style}/>;
|
|
28
|
+
};
|
|
29
|
+
const styles = StyleSheet.create({
|
|
30
|
+
rule: {
|
|
31
|
+
width: '80%',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
export default HorizontalOrRuleText;
|
|
35
|
+
//# sourceMappingURL=HorizontalOrRuleText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HorizontalOrRuleText.js","sourceRoot":"","sources":["../../../../src/components/templates/HorizontalOrRuleText/HorizontalOrRuleText.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAEzD,MAAM,uBAAuB,GAAG,CAAC,EAAC,KAAK,EAAgB,EAAE,EAAE;IACzD,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAE7B,OAAO,CACL,CAAC,kBAAkB,CACjB,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAC5B,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EAC5B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,CAAC,EAAC,KAAK,EAAgB,EAAE,EAAE;IACtD,OAAO,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAG,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,KAAK,EAAE,KAAK;KACb;CACF,CAAC,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ProductSearchBarProps {
|
|
3
|
+
style?: any;
|
|
4
|
+
title?: string;
|
|
5
|
+
showTitle?: boolean;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onChange?: (any: any) => void;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
isScrollViewContainer?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const ProductSearchBar: ({ style, title, showTitle, defaultValue, onChange, readonly, required, isScrollViewContainer, }: ProductSearchBarProps) => React.JSX.Element;
|
|
13
|
+
export default ProductSearchBar;
|