mirror of
https://github.com/inventree/inventree-app.git
synced 2025-10-29 04:27:36 +00:00
* 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
70 lines
1.9 KiB
Dart
70 lines
1.9 KiB
Dart
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() ?? ""),
|
|
);
|
|
}
|
|
}
|