mirror of
https://github.com/inventree/inventree-app.git
synced 2025-08-21 03:15:56 +00:00
Allow purchase orders to be completed directly from the app (#686)
* Allow purchase orders to be completed directly from the app * Code formatting
This commit is contained in:
@@ -27,7 +27,7 @@ We enforce consistent code formatting using Dart's built-in formatter. Before su
|
|||||||
1. Fork the repository and create a feature branch
|
1. Fork the repository and create a feature branch
|
||||||
2. Make your changes
|
2. Make your changes
|
||||||
3. Ensure your code passes all tests and linting
|
3. Ensure your code passes all tests and linting
|
||||||
4. Format your code using `fvm dart format`
|
4. Format your code using `invoke format`
|
||||||
5. Submit a pull request with a clear description of the changes
|
5. Submit a pull request with a clear description of the changes
|
||||||
6. Address any review comments
|
6. Address any review comments
|
||||||
|
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
### TBD - ???
|
### TBD - ???
|
||||||
---
|
---
|
||||||
|
|
||||||
|
- Allow purchase orders to be completed
|
||||||
- Improved UX across the entire app
|
- Improved UX across the entire app
|
||||||
- Fix bug which prevented display of part images for purchase order line items
|
- Fix bug which prevented display of part images for purchase order line items
|
||||||
|
|
||||||
|
@@ -261,6 +261,12 @@
|
|||||||
"companies": "Companies",
|
"companies": "Companies",
|
||||||
"@companies": {},
|
"@companies": {},
|
||||||
|
|
||||||
|
"complete": "Complete",
|
||||||
|
"@complete": {},
|
||||||
|
|
||||||
|
"completeOrder": "Complete Order",
|
||||||
|
"@completeOrder": {},
|
||||||
|
|
||||||
"completionDate": "Completion Date",
|
"completionDate": "Completion Date",
|
||||||
"@completionDate": {},
|
"@completionDate": {},
|
||||||
|
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import "package:flutter/material.dart";
|
import "package:flutter/material.dart";
|
||||||
import "package:flutter_speed_dial/flutter_speed_dial.dart";
|
import "package:flutter_speed_dial/flutter_speed_dial.dart";
|
||||||
import "package:flutter_tabler_icons/flutter_tabler_icons.dart";
|
import "package:flutter_tabler_icons/flutter_tabler_icons.dart";
|
||||||
|
import "package:inventree/api_form.dart";
|
||||||
|
|
||||||
import "package:inventree/app_colors.dart";
|
import "package:inventree/app_colors.dart";
|
||||||
import "package:inventree/barcode/barcode.dart";
|
import "package:inventree/barcode/barcode.dart";
|
||||||
@@ -122,6 +123,18 @@ class _PurchaseOrderDetailState
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (widget.order.isOpen && !widget.order.isPending) {
|
||||||
|
actions.add(
|
||||||
|
SpeedDialChild(
|
||||||
|
child: Icon(TablerIcons.circle_check, color: Colors.green),
|
||||||
|
label: L10().completeOrder,
|
||||||
|
onTap: () async {
|
||||||
|
_completeOrder(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (widget.order.isOpen) {
|
if (widget.order.isOpen) {
|
||||||
actions.add(
|
actions.add(
|
||||||
SpeedDialChild(
|
SpeedDialChild(
|
||||||
@@ -182,6 +195,24 @@ class _PurchaseOrderDetailState
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Complete this order
|
||||||
|
Future<void> _completeOrder(BuildContext context) async {
|
||||||
|
Map<String, Map<String, dynamic>> fields = {"accept_incomplete": {}};
|
||||||
|
|
||||||
|
String URL = "order/po/${widget.order.pk}/complete/";
|
||||||
|
|
||||||
|
launchApiForm(
|
||||||
|
context,
|
||||||
|
L10().completeOrder,
|
||||||
|
URL,
|
||||||
|
fields,
|
||||||
|
method: "POST",
|
||||||
|
onSuccess: (data) async {
|
||||||
|
refresh(context);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/// Cancel this order
|
/// Cancel this order
|
||||||
Future<void> _cancelOrder(BuildContext context) async {
|
Future<void> _cancelOrder(BuildContext context) async {
|
||||||
confirmationDialog(
|
confirmationDialog(
|
||||||
|
Reference in New Issue
Block a user