fixed ledger account listing + quotation listing

This commit is contained in:
Stephan D
2026-01-23 02:48:10 +01:00
parent 218c4e20b3
commit 41f653775f
60 changed files with 469 additions and 283 deletions

View File

@@ -11,3 +11,34 @@ enum LedgerAccountStatusDTO {
@JsonValue('frozen')
frozen,
}
LedgerAccountStatusDTO ledgerAccountStatusFromJson(Object? value) {
final raw = value?.toString() ?? '';
var normalized = raw.trim().toLowerCase();
const prefix = 'account_status_';
if (normalized.startsWith(prefix)) {
normalized = normalized.substring(prefix.length);
}
switch (normalized) {
case 'active':
return LedgerAccountStatusDTO.active;
case 'frozen':
return LedgerAccountStatusDTO.frozen;
case 'unspecified':
case '':
return LedgerAccountStatusDTO.unspecified;
default:
return LedgerAccountStatusDTO.unspecified;
}
}
String ledgerAccountStatusToJson(LedgerAccountStatusDTO value) {
switch (value) {
case LedgerAccountStatusDTO.active:
return 'active';
case LedgerAccountStatusDTO.frozen:
return 'frozen';
case LedgerAccountStatusDTO.unspecified:
return 'unspecified';
}
}