mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-16 12:15:31 +00:00
Display line items in purchase order view
This commit is contained in:
@ -103,6 +103,10 @@ class InvenTreeSupplierPart extends InvenTreeModel {
|
||||
|
||||
int get partId => jsondata['part'] ?? -1;
|
||||
|
||||
String get partImage => jsondata["part_detail"]["thumbnail"] ?? InvenTreeAPI.staticThumb;
|
||||
|
||||
String get partName => jsondata["part_detail"]["full_name"] ?? "";
|
||||
|
||||
@override
|
||||
InvenTreeModel createFromJson(Map<String, dynamic> json) {
|
||||
var part = InvenTreeSupplierPart.fromJson(json);
|
||||
|
@ -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'] ?? "";
|
||||
|
Reference in New Issue
Block a user