mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 19:46:25 +00:00
Display and edit project code for purchase orders
This commit is contained in:
parent
340c3ba766
commit
8d1f6161fa
6 changed files with 44 additions and 1 deletions
|
|
@ -335,7 +335,7 @@ class InvenTreePart extends InvenTreeModel {
|
|||
double get building => getDouble("building");
|
||||
|
||||
// Get the number of BOMs this Part is used in (if it is a component)
|
||||
int get usedInCount => getInt("used_in");
|
||||
int get usedInCount => jsondata.containsKey("used_in") ? getInt("used_in", backup: 0) : 0;
|
||||
|
||||
bool get isAssembly => getBool("assembly");
|
||||
|
||||
|
|
|
|||
|
|
@ -23,4 +23,6 @@ class InvenTreeProjectCode extends InvenTreeModel {
|
|||
"description": {},
|
||||
};
|
||||
}
|
||||
|
||||
String get code => getString("code");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class InvenTreePurchaseOrder extends InvenTreeModel {
|
|||
},
|
||||
"supplier_reference": {},
|
||||
"description": {},
|
||||
"project_code": {},
|
||||
"target_date": {},
|
||||
"link": {},
|
||||
"responsible": {},
|
||||
|
|
@ -77,6 +78,15 @@ class InvenTreePurchaseOrder extends InvenTreeModel {
|
|||
|
||||
int get supplierId => getInt("supplier");
|
||||
|
||||
// Project code information
|
||||
int get projectCodeId => getInt("project_code");
|
||||
|
||||
String get projectCode => getString("code", subKey: "project_code_detail");
|
||||
|
||||
String get projectCodeDescription => getString("description", subKey: "project_code_detail");
|
||||
|
||||
bool get hasProjectCode => projectCode.isNotEmpty;
|
||||
|
||||
InvenTreeCompany? get supplier {
|
||||
|
||||
dynamic supplier_detail = jsondata["supplier_detail"];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue