mirror of
https://github.com/inventree/inventree-app.git
synced 2025-10-30 04:45:39 +00:00
SalesOrderShipment (#697)
* Add detail widget for SalesOrderShipment * Support editing of shipment details * Rearrange SalesOrderDetail page * Add support for attachments against shipment model * refactoring * Add shipment details page * Add user actions for shipments: - Check / uncheck - Take photo * Placeholder action to send shipment * Send shipment from app * Display pending shipments on the home screen * Improve rending for shipments list * Add class definition for SalesOrderAllocation * Display list of items allocated against SalesOrderShipment * Bump release notse * Click through to stock item * Bump version number * dart format * cleanup * Remove unused imports
This commit is contained in:
69
lib/widget/order/so_allocation_list.dart
Normal file
69
lib/widget/order/so_allocation_list.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
import "package:flutter/material.dart";
|
||||
import "package:inventree/api.dart";
|
||||
import "package:inventree/inventree/model.dart";
|
||||
import "package:inventree/inventree/part.dart";
|
||||
import "package:inventree/inventree/sales_order.dart";
|
||||
import "package:inventree/inventree/stock.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
import "package:inventree/widget/link_icon.dart";
|
||||
import "package:inventree/widget/paginator.dart";
|
||||
|
||||
class PaginatedSOAllocationList extends PaginatedSearchWidget {
|
||||
const PaginatedSOAllocationList(Map<String, String> filters)
|
||||
: super(filters: filters);
|
||||
|
||||
@override
|
||||
String get searchTitle => L10().allocatedStock;
|
||||
|
||||
@override
|
||||
_PaginatedSOAllocationListState createState() =>
|
||||
_PaginatedSOAllocationListState();
|
||||
}
|
||||
|
||||
class _PaginatedSOAllocationListState
|
||||
extends PaginatedSearchState<PaginatedSOAllocationList> {
|
||||
_PaginatedSOAllocationListState() : super();
|
||||
|
||||
@override
|
||||
String get prefix => "so_allocation_";
|
||||
|
||||
@override
|
||||
Map<String, String> get orderingOptions => {};
|
||||
|
||||
@override
|
||||
Map<String, Map<String, dynamic>> get filterOptions => {};
|
||||
|
||||
@override
|
||||
Future<InvenTreePageResponse?> requestPage(
|
||||
int limit,
|
||||
int offset,
|
||||
Map<String, String> params,
|
||||
) async {
|
||||
final page = await InvenTreeSalesOrderAllocation().listPaginated(
|
||||
limit,
|
||||
offset,
|
||||
filters: params,
|
||||
);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget buildItem(BuildContext context, InvenTreeModel model) {
|
||||
InvenTreeSalesOrderAllocation allocation =
|
||||
model as InvenTreeSalesOrderAllocation;
|
||||
|
||||
InvenTreePart? part = allocation.part;
|
||||
InvenTreeStockItem? stockItem = allocation.stockItem;
|
||||
|
||||
return ListTile(
|
||||
title: Text(part?.fullname ?? ""),
|
||||
subtitle: Text(part?.description ?? ""),
|
||||
onTap: () async {
|
||||
stockItem?.goToDetailPage(context);
|
||||
},
|
||||
leading: InvenTreeAPI().getThumbnail(allocation.part?.thumbnail ?? ""),
|
||||
trailing: LargeText(stockItem?.serialOrQuantityDisplay() ?? ""),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user