mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Display line items in purchase order view
This commit is contained in:
parent
cca56299f8
commit
54d8c1759c
5 changed files with 109 additions and 12 deletions
|
|
@ -52,7 +52,7 @@ class InvenTreePurchaseOrder extends InvenTreeModel {
|
|||
|
||||
String get targetDate => jsondata['target_date'] ?? "";
|
||||
|
||||
int get lineItems => jsondata['line_items'] ?? 0;
|
||||
int get lineItemCount => jsondata['line_items'] ?? 0;
|
||||
|
||||
bool get overdue => jsondata['overdue'] ?? false;
|
||||
|
||||
|
|
@ -144,10 +144,14 @@ class InvenTreePOLineItem extends InvenTreeModel {
|
|||
};
|
||||
}
|
||||
|
||||
bool get isComplete => received >= quantity;
|
||||
|
||||
double get quantity => jsondata['quantity'] ?? 0;
|
||||
|
||||
double get received => jsondata['received'] ?? 0;
|
||||
|
||||
double get outstanding => quantity - received;
|
||||
|
||||
String get reference => jsondata['reference'] ?? "";
|
||||
|
||||
int get orderId => jsondata['order'] ?? -1;
|
||||
|
|
@ -164,6 +168,17 @@ class InvenTreePOLineItem extends InvenTreeModel {
|
|||
}
|
||||
}
|
||||
|
||||
InvenTreeSupplierPart? get supplierPart {
|
||||
|
||||
dynamic detail = jsondata["supplier_part_detail"] ?? null;
|
||||
|
||||
if (detail == null) {
|
||||
return null;
|
||||
} else {
|
||||
return InvenTreeSupplierPart.fromJson(detail);
|
||||
}
|
||||
}
|
||||
|
||||
double get purchasePrice => double.parse(jsondata['purchase_price']);
|
||||
|
||||
String get purchasePriceCurrency => jsondata['purchase_price_currency'] ?? "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue