Skip to content

Commit

Permalink
feat: add purchase module (#808)
Browse files Browse the repository at this point in the history
* RM#86191
  • Loading branch information
gca-axelor authored and lme-axelor committed Nov 22, 2024
1 parent 14c5be8 commit 46370a5
Show file tree
Hide file tree
Showing 13 changed files with 171 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@axelor/aos-mobile-intervention": "8.3.0",
"@axelor/aos-mobile-manufacturing": "8.3.0",
"@axelor/aos-mobile-project": "8.3.0",
"@axelor/aos-mobile-purchase": "8.3.0",
"@axelor/aos-mobile-quality": "8.3.0",
"@axelor/aos-mobile-sale": "8.3.0",
"@axelor/aos-mobile-stock": "8.3.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/apps/purchase/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
root: true,
extends: ['@react-native', 'prettier'],
ignorePatterns: ['lib/'],
rules: {
'prettier/prettier': 'off',
},
};
1 change: 1 addition & 0 deletions packages/apps/purchase/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/
5 changes: 5 additions & 0 deletions packages/apps/purchase/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const projectConfig = require('../../../.prettierrc');

module.exports = {
...projectConfig,
};
44 changes: 44 additions & 0 deletions packages/apps/purchase/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Purchase
tags: Readme
---

<h1 align="center">@axelor/aos-mobile-purchase</h1>

<div align="center">
<img src="https://i.imgur.com/KJAAFlT.png" width="30%"/>
</div>

## Presentation

This package was developed for the [Axelor Open Mobile](https://github.com/axelor/axelor-mobile) application.

The purpose of this package is to link with the purchase module of the [Axelor Open Suite (AOS)](https://github.com/axelor/axelor-open-suite) ERP. It provides a simplified version of a number of processes available on the webapp. This package is compatible with AOS from version 8.3.0.

## Usage

Install the library :

```bash
yarn add @axelor/aos-mobile-purchase
```

Compatibility with React v18.2.x and React Native v0.73.x.

To add this package in your application, you need to add it in the _modules_ props of the component `Application` from @axelor/aos-mobile-core package.

```typescript
import React from 'react';
import {Application} from '@axelor/aos-mobile-core';
import {PurchaseModule} from '@axelor/aos-mobile-purchase';

const App = () => {
return <Application modules={[PurchaseModule]} mainMenu="auth_menu_user" />;
};

export default App;
```

## Developpment

This package is developed as part of the Axelor Open Mobile application. To contribute, please go to the [Github project](https://github.com/axelor/axelor-mobile) and follow the guidelines. You will also find an installation guide to help you configure your environment.
3 changes: 3 additions & 0 deletions packages/apps/purchase/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
};
45 changes: 45 additions & 0 deletions packages/apps/purchase/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@axelor/aos-mobile-purchase",
"version": "8.3.0",
"author": "Axelor",
"license": "AGPL-3.0-only",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"types": "lib/index.d.js",
"files": ["lib"],
"scripts": {
"clean": "rm -rf lib/",
"compile": "tsc -p tsconfig.build.json",
"dev": "npm run compile -- --watch",
"build": "npm run clean && npm run compile",
"npm-publish": "npm publish",
"lint": "eslint .",
"format": "prettier --write src/",
"format:check": "prettier --check src/",
"license:add": "npx add-copyright-header --generate --dir 'src'"
},
"peerDependencies": {
"react": "18.2.0",
"react-native": "0.73.9"
},
"dependencies": {
"@axelor/aos-mobile-core": "8.3.0",
"@axelor/aos-mobile-ui": "8.3.0",
"@reduxjs/toolkit": "^2.2.7"
},
"devDependencies": {
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.73.21",
"@react-native/eslint-config": "0.73.2",
"@types/react": "^18.2.6",
"eslint": "8.57.0",
"prettier": "^3.3.3",
"react": "18.2.0",
"react-native": "0.73.9"
},
"resolutions": {
"@types/react": "^18.2.6"
}
}
3 changes: 3 additions & 0 deletions packages/apps/purchase/src/i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Purchase_Purchase": "Purchase"
}
3 changes: 3 additions & 0 deletions packages/apps/purchase/src/i18n/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Purchase_Purchase": "Achats"
}
36 changes: 36 additions & 0 deletions packages/apps/purchase/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Axelor Business Solutions
*
* Copyright (C) 2024 Axelor (<http://axelor.com>).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import {Module} from '@axelor/aos-mobile-core';
import enTranslations from './i18n/en.json';
import frTranslations from './i18n/fr.json';

export const PurchaseModule: Module = {
name: 'app-purchase',
title: 'Purchase_Purchase',
subtitle: 'Purchase_Purchase',
icon: 'cart-fill',
compatibilityAOS: {
moduleName: 'axelor-purchase',
downToVersion: '8.3.0',
},
translations: {
en: enTranslations,
fr: frTranslations,
},
};
12 changes: 12 additions & 0 deletions packages/apps/purchase/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../../tsconfig.build.json",
"compilerOptions": {
"resolveJsonModule": true,
"esModuleInterop": true,
"outDir": "lib",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src"]
}
8 changes: 8 additions & 0 deletions packages/apps/purchase/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
}
}
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {QualityModule} from '@axelor/aos-mobile-quality';
import {InterventionModule} from '@axelor/aos-mobile-intervention';
import {SaleModule} from '@axelor/aos-mobile-sale';
import {ProjectModule} from '@axelor/aos-mobile-project';
import {PurchaseModule} from '@axelor/aos-mobile-purchase';
import {DmsModule} from '@axelor/aos-mobile-dms';
import application_properties from '../package.json';
import {app_config} from './app.config';
Expand All @@ -45,6 +46,7 @@ const App = () => {
SaleModule,
ProjectModule,
DmsModule,
PurchaseModule,
]}
mainMenu="auth_menu_user"
version={application_properties.version}
Expand Down

0 comments on commit 46370a5

Please sign in to comment.