2025-08-23 16:29:32 +07:00
|
|
|
import 'package:flutter/material.dart';
|
feat: multi-grup sumber, batch send, & perbaikan tip
Multi-Grup Sumber & UI:
- Model ReceiptGroup: satu struk bisa punya banyak grup sumber (
revenue)
- Tombol "Tambah Sumber" dengan dashed border (max 10 grup)
- Hapus label "Dari:" di SourceAccountSelector (chip saja)
- Default 1 grup kosong di ReceiptProvider constructor &
_resetState
Akun Tujuan ke Config:
- Pindah DestinationAccountSelector dari receipt body ke Config
screen
- Persist & load via SharedPreferences (permanen, tidak di-reset)
- Dropdown auto-load dari cache/mirror saat buka Config
- Tombol "Sinkronisasi Manual" sekarang simpan ke mirror &
refresh dropdown
Batch Send via SubmissionTask:
- Model SubmissionTask: konteks per-grup (group/tip +
destination + date)
- TransactionSubmissionDialog refactor: terima
List<SubmissionTask>
- Helper buildTasksFromReceipt &
buildTasksFromAllUnsubmittedReceipts
- LocalReceiptsScreen: tombol "Kirim Semua Nota" + post-process
status
Bug Fix:
- copyWith sentinel pattern: field nullable (tipSourceAccount,
destinationAccount, fireflyUrl, accessToken) kini bisa di-set
ke null
- Tip dapat dibersihkan dengan "Batal Tip" & reset antar
transaksi
- Hapus tombol "Muat Akun" (redundan dgn Sinkronisasi Manual)
Lainnya:
- Date picker untuk tanggal transaksi
- Font courier prime caching via CourierStyles
- Perf: compute() untuk decode image, cancel stream bluetooth,
fix rebuild loop
- External link: <queries> AndroidManifest + skip canLaunchUrl
- Layout cetak: hapus Ke:, sederhanakan separator grup, hapus
TIP: TIDAK
- Hapus TransactionLinksScreen, ganti inline copy/open di popup
2026-06-27 20:18:51 +07:00
|
|
|
import 'package:cashumit/utils/app_text_styles.dart';
|
2025-08-23 16:29:32 +07:00
|
|
|
|
feat: multi-grup sumber, batch send, & perbaikan tip
Multi-Grup Sumber & UI:
- Model ReceiptGroup: satu struk bisa punya banyak grup sumber (
revenue)
- Tombol "Tambah Sumber" dengan dashed border (max 10 grup)
- Hapus label "Dari:" di SourceAccountSelector (chip saja)
- Default 1 grup kosong di ReceiptProvider constructor &
_resetState
Akun Tujuan ke Config:
- Pindah DestinationAccountSelector dari receipt body ke Config
screen
- Persist & load via SharedPreferences (permanen, tidak di-reset)
- Dropdown auto-load dari cache/mirror saat buka Config
- Tombol "Sinkronisasi Manual" sekarang simpan ke mirror &
refresh dropdown
Batch Send via SubmissionTask:
- Model SubmissionTask: konteks per-grup (group/tip +
destination + date)
- TransactionSubmissionDialog refactor: terima
List<SubmissionTask>
- Helper buildTasksFromReceipt &
buildTasksFromAllUnsubmittedReceipts
- LocalReceiptsScreen: tombol "Kirim Semua Nota" + post-process
status
Bug Fix:
- copyWith sentinel pattern: field nullable (tipSourceAccount,
destinationAccount, fireflyUrl, accessToken) kini bisa di-set
ke null
- Tip dapat dibersihkan dengan "Batal Tip" & reset antar
transaksi
- Hapus tombol "Muat Akun" (redundan dgn Sinkronisasi Manual)
Lainnya:
- Date picker untuk tanggal transaksi
- Font courier prime caching via CourierStyles
- Perf: compute() untuk decode image, cancel stream bluetooth,
fix rebuild loop
- External link: <queries> AndroidManifest + skip canLaunchUrl
- Layout cetak: hapus Ke:, sederhanakan separator grup, hapus
TIP: TIDAK
- Hapus TransactionLinksScreen, ganti inline copy/open di popup
2026-06-27 20:18:51 +07:00
|
|
|
/// Selector untuk akun sumber (revenue) — dipakai per-grup.
|
|
|
|
|
/// Tanpa label "Dari:" — hanya chip dropdown saja.
|
|
|
|
|
class SourceAccountSelector extends StatelessWidget {
|
|
|
|
|
final String sourceAccount;
|
|
|
|
|
final VoidCallback onSelectSource;
|
|
|
|
|
|
|
|
|
|
const SourceAccountSelector({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.sourceAccount,
|
|
|
|
|
required this.onSelectSource,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
onTap: onSelectSource,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets.symmetric(horizontal: 8.0, vertical: 6.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(color: Colors.grey),
|
|
|
|
|
borderRadius: BorderRadius.circular(4.0),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Text(
|
|
|
|
|
sourceAccount,
|
|
|
|
|
style: CourierStyles.base,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Icon(Icons.arrow_drop_down, size: 16),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Selector untuk akun tujuan (asset) — dipakai di level struk (dibagikan).
|
|
|
|
|
class DestinationAccountSelector extends StatelessWidget {
|
|
|
|
|
final String destinationAccount;
|
|
|
|
|
final VoidCallback onSelectDestination;
|
|
|
|
|
|
|
|
|
|
const DestinationAccountSelector({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.destinationAccount,
|
|
|
|
|
required this.onSelectDestination,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return _AccountChip(
|
|
|
|
|
label: 'Ke:',
|
|
|
|
|
value: destinationAccount,
|
|
|
|
|
onTap: onSelectDestination,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _AccountChip extends StatelessWidget {
|
|
|
|
|
final String label;
|
|
|
|
|
final String value;
|
|
|
|
|
final VoidCallback onTap;
|
|
|
|
|
|
|
|
|
|
const _AccountChip({
|
|
|
|
|
required this.label,
|
|
|
|
|
required this.value,
|
|
|
|
|
required this.onTap,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Text(label, style: CourierStyles.bold),
|
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: GestureDetector(
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 8.0, vertical: 6.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(color: Colors.grey),
|
|
|
|
|
borderRadius: BorderRadius.circular(4.0),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Text(
|
|
|
|
|
value,
|
|
|
|
|
style: CourierStyles.base,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Icon(Icons.arrow_drop_down, size: 16),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Widget lama (compat) — menampilkan Dari + Ke berdampingan.
|
|
|
|
|
/// Tetap dipertahankan agar tidak merusak import lain.
|
2025-08-23 16:29:32 +07:00
|
|
|
class AccountSettingsWidget extends StatelessWidget {
|
|
|
|
|
final String sourceAccount;
|
|
|
|
|
final String destinationAccount;
|
|
|
|
|
final VoidCallback onSelectSource;
|
|
|
|
|
final VoidCallback onSelectDestination;
|
|
|
|
|
|
|
|
|
|
const AccountSettingsWidget({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.sourceAccount,
|
|
|
|
|
required this.destinationAccount,
|
|
|
|
|
required this.onSelectSource,
|
|
|
|
|
required this.onSelectDestination,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
feat: multi-grup sumber, batch send, & perbaikan tip
Multi-Grup Sumber & UI:
- Model ReceiptGroup: satu struk bisa punya banyak grup sumber (
revenue)
- Tombol "Tambah Sumber" dengan dashed border (max 10 grup)
- Hapus label "Dari:" di SourceAccountSelector (chip saja)
- Default 1 grup kosong di ReceiptProvider constructor &
_resetState
Akun Tujuan ke Config:
- Pindah DestinationAccountSelector dari receipt body ke Config
screen
- Persist & load via SharedPreferences (permanen, tidak di-reset)
- Dropdown auto-load dari cache/mirror saat buka Config
- Tombol "Sinkronisasi Manual" sekarang simpan ke mirror &
refresh dropdown
Batch Send via SubmissionTask:
- Model SubmissionTask: konteks per-grup (group/tip +
destination + date)
- TransactionSubmissionDialog refactor: terima
List<SubmissionTask>
- Helper buildTasksFromReceipt &
buildTasksFromAllUnsubmittedReceipts
- LocalReceiptsScreen: tombol "Kirim Semua Nota" + post-process
status
Bug Fix:
- copyWith sentinel pattern: field nullable (tipSourceAccount,
destinationAccount, fireflyUrl, accessToken) kini bisa di-set
ke null
- Tip dapat dibersihkan dengan "Batal Tip" & reset antar
transaksi
- Hapus tombol "Muat Akun" (redundan dgn Sinkronisasi Manual)
Lainnya:
- Date picker untuk tanggal transaksi
- Font courier prime caching via CourierStyles
- Perf: compute() untuk decode image, cancel stream bluetooth,
fix rebuild loop
- External link: <queries> AndroidManifest + skip canLaunchUrl
- Layout cetak: hapus Ke:, sederhanakan separator grup, hapus
TIP: TIDAK
- Hapus TransactionLinksScreen, ganti inline copy/open di popup
2026-06-27 20:18:51 +07:00
|
|
|
child: SourceAccountSelector(
|
|
|
|
|
sourceAccount: sourceAccount,
|
|
|
|
|
onSelectSource: onSelectSource,
|
2025-08-23 16:29:32 +07:00
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 16),
|
|
|
|
|
Expanded(
|
feat: multi-grup sumber, batch send, & perbaikan tip
Multi-Grup Sumber & UI:
- Model ReceiptGroup: satu struk bisa punya banyak grup sumber (
revenue)
- Tombol "Tambah Sumber" dengan dashed border (max 10 grup)
- Hapus label "Dari:" di SourceAccountSelector (chip saja)
- Default 1 grup kosong di ReceiptProvider constructor &
_resetState
Akun Tujuan ke Config:
- Pindah DestinationAccountSelector dari receipt body ke Config
screen
- Persist & load via SharedPreferences (permanen, tidak di-reset)
- Dropdown auto-load dari cache/mirror saat buka Config
- Tombol "Sinkronisasi Manual" sekarang simpan ke mirror &
refresh dropdown
Batch Send via SubmissionTask:
- Model SubmissionTask: konteks per-grup (group/tip +
destination + date)
- TransactionSubmissionDialog refactor: terima
List<SubmissionTask>
- Helper buildTasksFromReceipt &
buildTasksFromAllUnsubmittedReceipts
- LocalReceiptsScreen: tombol "Kirim Semua Nota" + post-process
status
Bug Fix:
- copyWith sentinel pattern: field nullable (tipSourceAccount,
destinationAccount, fireflyUrl, accessToken) kini bisa di-set
ke null
- Tip dapat dibersihkan dengan "Batal Tip" & reset antar
transaksi
- Hapus tombol "Muat Akun" (redundan dgn Sinkronisasi Manual)
Lainnya:
- Date picker untuk tanggal transaksi
- Font courier prime caching via CourierStyles
- Perf: compute() untuk decode image, cancel stream bluetooth,
fix rebuild loop
- External link: <queries> AndroidManifest + skip canLaunchUrl
- Layout cetak: hapus Ke:, sederhanakan separator grup, hapus
TIP: TIDAK
- Hapus TransactionLinksScreen, ganti inline copy/open di popup
2026-06-27 20:18:51 +07:00
|
|
|
child: DestinationAccountSelector(
|
|
|
|
|
destinationAccount: destinationAccount,
|
|
|
|
|
onSelectDestination: onSelectDestination,
|
2025-08-23 16:29:32 +07:00
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|