2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 05:26:47 +00:00

Sales order shipment progress (#560)

- Display progress bar for sales order page
This commit is contained in:
Oliver 2024-12-05 17:09:57 +11:00 committed by GitHub
parent 9c12a83176
commit d4b2204baf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -28,6 +28,10 @@ class InvenTreeOrder extends InvenTreeModel {
int get completedLineItemCount => getInt("completed_lines", backup: 0);
int get shipmentCount => getInt("shipments_count", backup: 0);
int get completedShipmentCount => getInt("completed_shipments_count", backup: 0);
bool get complete => completedLineItemCount >= lineItemCount;
bool get overdue => getBool("overdue");

View File

@ -362,6 +362,19 @@ class _SalesOrderDetailState extends RefreshableState<SalesOrderDetailWidget> {
trailing: Text("${widget.order.completedLineItemCount} / ${widget.order.lineItemCount}", style: TextStyle(color: lineColor)),
));
// Shipment progress
if (widget.order.shipmentCount > 0) {
tiles.add(ListTile(
title: Text(L10().shipments),
subtitle: ProgressBar(
widget.order.completedShipmentCount.toDouble(),
maximum: widget.order.shipmentCount.toDouble()
),
leading: Icon(TablerIcons.truck_delivery),
trailing: Text("${widget.order.completedShipmentCount} / ${widget.order.shipmentCount}", style: TextStyle(color: lineColor)),
));
}
// TODO: total price
if (widget.order.targetDate.isNotEmpty) {