Sales order support (#438)

* Add new models for SalesOrder

- Create generic Order and OrderLine models with common functionality

* Refactor

- Move some widgets around
- Cleanup directory structure

* Add link to home screen and nav drawer

* Add SalesOrder list widget

* Linting fixes

* Fix string

* Refactor PurchaseOrderDetailWidget

* Tweaks to existing code

* linting

* Fixes for drawer widget

* Add "detail" page for SalesOrder

* Add more tiles to SalesOrder detail

* Allow editing of salesorder

* add list filters for sales orders

* Display list of line items

* Customer updates

- Display customer icon on home screen
- Fetch sales orders for customer detail page

* Cleanup company detail view

* Create new sales order from list

* Stricter typing for formFields method

* Create new PurchaseOrder and SalesOrder from company deatil

* Status code updates

- Add function for name comparison
- Remove hard-coded values

* Update view permission checks for home widget

* Add ability to manually add SalesOrderLineItem

* Add nice progress bar widgets

* Display detail view for sales order line item

* edit SalesOrderLineItem

* Fix unused import

* Hide "shipped items" tab

- Will be added in a future update
This commit is contained in:
Oliver 2023-11-12 23:13:22 +11:00 committed by GitHub
parent c1c0d46957
commit bdd5470e68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 1565 additions and 284 deletions

View file

@ -105,6 +105,24 @@ class InvenTreeStatusCode {
}
}
// Return the 'name' (untranslated) associated with a given status code
String name(int status) {
Map<String, dynamic> _entry = entry(status);
String _name = (_entry["name"] ?? "") as String;
if (_name.isEmpty) {
debug("No match for status code ${status} at '${URL}'");
}
return _name;
}
// Test if the name associated with the given code is in the provided list
bool isNameIn(int code, List<String> names) {
return names.contains(name(code));
}
// Return the 'color' associated with a given status code
Color color(int status) {
Map<String, dynamic> _entry = entry(status);