File tree Expand file tree Collapse file tree 5 files changed +44
-1
lines changed
Expand file tree Collapse file tree 5 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ We enforce consistent code formatting using Dart's built-in formatter. Before su
27271 . Fork the repository and create a feature branch
28282 . Make your changes
29293 . Ensure your code passes all tests and linting
30- 4 . Format your code using ` fvm dart format`
30+ 4 . Format your code using ` invoke format`
31315 . Submit a pull request with a clear description of the changes
32326 . Address any review comments
3333
Original file line number Diff line number Diff line change 11### TBD - ???
22---
33
4+ - Allow purchase orders to be completed
45- Improved UX across the entire app
56- Fix bug which prevented display of part images for purchase order line items
67
Original file line number Diff line number Diff line change 261261 "companies": "Companies",
262262 "@companies": {},
263263
264+ "complete": "Complete",
265+ "@complete": {},
266+
267+ "completeOrder": "Complete Order",
268+ "@completeOrder": {},
269+
264270 "completionDate": "Completion Date",
265271 "@completionDate": {},
266272
Original file line number Diff line number Diff line change 11import "package:flutter/material.dart" ;
22import "package:flutter_speed_dial/flutter_speed_dial.dart" ;
33import "package:flutter_tabler_icons/flutter_tabler_icons.dart" ;
4+ import "package:inventree/api_form.dart" ;
45
56import "package:inventree/app_colors.dart" ;
67import "package:inventree/barcode/barcode.dart" ;
@@ -122,6 +123,18 @@ class _PurchaseOrderDetailState
122123 );
123124 }
124125
126+ if (widget.order.isOpen && ! widget.order.isPending) {
127+ actions.add (
128+ SpeedDialChild (
129+ child: Icon (TablerIcons .circle_check, color: Colors .green),
130+ label: L10 ().completeOrder,
131+ onTap: () async {
132+ _completeOrder (context);
133+ },
134+ ),
135+ );
136+ }
137+
125138 if (widget.order.isOpen) {
126139 actions.add (
127140 SpeedDialChild (
@@ -182,6 +195,24 @@ class _PurchaseOrderDetailState
182195 );
183196 }
184197
198+ /// Complete this order
199+ Future <void > _completeOrder (BuildContext context) async {
200+ Map <String , Map <String , dynamic >> fields = {"accept_incomplete" : {}};
201+
202+ String URL = "order/po/${widget .order .pk }/complete/" ;
203+
204+ launchApiForm (
205+ context,
206+ L10 ().completeOrder,
207+ URL ,
208+ fields,
209+ method: "POST" ,
210+ onSuccess: (data) async {
211+ refresh (context);
212+ },
213+ );
214+ }
215+
185216 /// Cancel this order
186217 Future <void > _cancelOrder (BuildContext context) async {
187218 confirmationDialog (
Original file line number Diff line number Diff line change 55from invoke import task
66
77
8+ @task
9+ def format (c ):
10+ """Code formatting using dart format."""
11+ c .run ("fvm dart format lib" )
12+
813@task
914def clean (c ):
1015 """Clean flutter build."""
You can’t perform that action at this time.
0 commit comments