Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sales order shipment progress #560

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/inventree/orders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
13 changes: 13 additions & 0 deletions lib/widget/order/sales_order_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading