Can disable dates extraction

This commit is contained in:
2025-07-20 18:14:03 +02:00
parent 71d32d72ef
commit 1788e7f184
4 changed files with 35 additions and 3 deletions

View File

@@ -8,7 +8,10 @@ import 'package:logging/logging.dart';
import 'package:moneymgr_mobile/services/storage/expenses.dart';
/// Attempt to extract information from invoice image
Future<BaseExpenseInfo?> extractInfoFromBill(Uint8List imgBuff) async {
Future<BaseExpenseInfo?> extractInfoFromBill({
required Uint8List imgBuff,
required bool extractDates,
}) async {
final decodedImage = await decodeImageFromList(imgBuff);
final byteData = await decodedImage.toByteData(
@@ -74,6 +77,8 @@ Future<BaseExpenseInfo?> extractInfoFromBill(Uint8List imgBuff) async {
return BaseExpenseInfo(
label: null,
cost: highestCost,
time: newest?.isBefore(currDate) ?? false ? newest! : currDate,
time: extractDates && (newest?.isBefore(currDate) ?? false)
? newest!
: currDate,
);
}