2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-15 19:55:27 +00:00

Sales order allocation (#464)

* New string

* Typo fix

* Add model for SalesOrderShipment

* Add placeholder button to sales order item

* Create a new shipment from the sales order detail view

* Fix API URL

* Add paginated shipment list

* Upate colors

* Add API form for allocation of stock to sales order

* Build out sales order line detail widge

* Use unallocated quantity

* Update release notes

* linting fix
This commit is contained in:
Oliver
2023-11-27 22:51:20 +11:00
committed by GitHub
parent 70d0d4de93
commit 3ea5f8934c
8 changed files with 293 additions and 13 deletions

View File

@ -12,6 +12,7 @@ import "package:inventree/app_colors.dart";
import "package:inventree/barcode/barcode.dart";
import "package:inventree/barcode/tones.dart";
import "package:inventree/helpers.dart";
import "package:inventree/inventree/sales_order.dart";
import "package:inventree/l10.dart";
import "package:inventree/inventree/company.dart";
@ -591,6 +592,8 @@ class APIFormField {
switch (model) {
case "supplierpart":
return InvenTreeSupplierPart().defaultListFilters();
case "stockitem":
return InvenTreeStockItem().defaultListFilters();
}
return {};
@ -658,6 +661,16 @@ class APIFormField {
style: TextStyle(fontWeight: selected ? FontWeight.bold : FontWeight.normal),
) : null,
);
case "stockitem":
var item = InvenTreeStockItem.fromJson(data);
return ListTile(
title: Text(
item.partName,
),
leading: InvenTreeAPI().getThumbnail(item.partThumbnail),
trailing: Text(item.quantityString()),
);
case "stocklocation":
var loc = InvenTreeStockLocation.fromJson(data);
@ -672,6 +685,14 @@ class APIFormField {
style: TextStyle(fontWeight: selected ? FontWeight.bold : FontWeight.normal),
) : null,
);
case "salesordershipment":
var shipment = InvenTreeSalesOrderShipment.fromJson(data);
return ListTile(
title: Text(shipment.reference),
subtitle: Text(shipment.tracking_number),
trailing: shipment.shipped ? Text(shipment.shipment_date!) : null,
);
case "owner":
String name = (data["name"] ?? "") as String;
bool isGroup = (data["label"] ?? "") == "group";