Can disable dates extraction
This commit is contained in:
@@ -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,
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user