Chnaged the Expense Naming and Dashboard menu handeling and chart modifications
This commit is contained in:
parent
6b56351a49
commit
11393922e2
@ -129,57 +129,24 @@ class _ChartHeader extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Obx(() {
|
|
||||||
final data = controller.expenseTypeReportData.value;
|
|
||||||
// Calculate total from totalApprovedAmount only
|
|
||||||
final total = data?.report.fold<double>(
|
|
||||||
0,
|
|
||||||
(sum, e) => sum + e.totalApprovedAmount,
|
|
||||||
) ??
|
|
||||||
0;
|
|
||||||
|
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
MyText.bodyMedium('Project Expense Analytics', fontWeight: 700),
|
MyText.bodyMedium('Project Expense Analytics', fontWeight: 700),
|
||||||
const SizedBox(height: 2),
|
SizedBox(height: 2),
|
||||||
MyText.bodySmall('Approved expenses by project',
|
|
||||||
color: Colors.grey),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (total > 0)
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.blueAccent.withOpacity(0.15),
|
|
||||||
borderRadius: BorderRadius.circular(5),
|
|
||||||
border: Border.all(color: Colors.blueAccent, width: 1),
|
|
||||||
),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
MyText.bodySmall(
|
MyText.bodySmall(
|
||||||
'Total Approved',
|
'Approved expenses by project',
|
||||||
color: Colors.blueAccent,
|
color: Colors.grey,
|
||||||
fontSize: 10,
|
|
||||||
),
|
|
||||||
MyText.bodyMedium(
|
|
||||||
Utils.formatCurrency(total),
|
|
||||||
color: Colors.blueAccent,
|
|
||||||
fontWeight: 700,
|
|
||||||
fontSize: 14,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -40,8 +40,8 @@ class ExpenseByStatusWidget extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
MyText.bodyMedium(title, fontWeight: 600),
|
MyText.bodyMedium(title, fontWeight: 600),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
MyText.titleMedium(amount,
|
MyText.bodySmall(amount,
|
||||||
color: Colors.blue, fontWeight: 700),
|
color: Colors.indigo, fontWeight: 600),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -157,7 +157,7 @@ class ExpenseByStatusWidget extends StatelessWidget {
|
|||||||
// ✅ Status tiles
|
// ✅ Status tiles
|
||||||
_buildStatusTile(
|
_buildStatusTile(
|
||||||
icon: Icons.currency_rupee,
|
icon: Icons.currency_rupee,
|
||||||
color: Colors.blue,
|
color: Colors.indigo,
|
||||||
title: "Pending Payment",
|
title: "Pending Payment",
|
||||||
amount: Utils.formatCurrency(data.processPending.totalAmount),
|
amount: Utils.formatCurrency(data.processPending.totalAmount),
|
||||||
count: data.processPending.count.toString(),
|
count: data.processPending.count.toString(),
|
||||||
@ -223,7 +223,7 @@ class ExpenseByStatusWidget extends StatelessWidget {
|
|||||||
MyText.titleLarge(
|
MyText.titleLarge(
|
||||||
Utils.formatCurrency(data.totalAmount),
|
Utils.formatCurrency(data.totalAmount),
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
fontWeight: 700,
|
fontWeight: 600,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
const Icon(Icons.chevron_right,
|
const Icon(Icons.chevron_right,
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class ExpenseAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
MyText.titleLarge('Expenses', fontWeight: 700),
|
MyText.titleLarge('Expense & Reimbursement', fontWeight: 700),
|
||||||
MySpacing.height(2),
|
MySpacing.height(2),
|
||||||
GetBuilder<ProjectController>(
|
GetBuilder<ProjectController>(
|
||||||
builder: (_) {
|
builder: (_) {
|
||||||
|
|||||||
@ -128,7 +128,7 @@ class _FinanceScreenState extends State<FinanceScreen>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ✅ Only allow finance cards if "Expense" menu is allowed
|
// ✅ Only allow finance cards if "Expense" menu is allowed
|
||||||
final isExpenseAllowed = menuController.isMenuAllowed("Expense");
|
final isExpenseAllowed = menuController.isMenuAllowed("Expense & Reimbursement");
|
||||||
|
|
||||||
if (!isExpenseAllowed) {
|
if (!isExpenseAllowed) {
|
||||||
return const Center(
|
return const Center(
|
||||||
@ -161,7 +161,7 @@ class _FinanceScreenState extends State<FinanceScreen>
|
|||||||
// --- Finance Modules (Compact Dashboard-style) ---
|
// --- Finance Modules (Compact Dashboard-style) ---
|
||||||
Widget _buildFinanceModulesCompact() {
|
Widget _buildFinanceModulesCompact() {
|
||||||
final stats = [
|
final stats = [
|
||||||
_FinanceStatItem(LucideIcons.badge_dollar_sign, "Expense",
|
_FinanceStatItem(LucideIcons.badge_dollar_sign, "Expense & Reimbursement",
|
||||||
contentTheme.info, "/dashboard/expense-main-page"),
|
contentTheme.info, "/dashboard/expense-main-page"),
|
||||||
_FinanceStatItem(LucideIcons.receipt_text, "Payment Request",
|
_FinanceStatItem(LucideIcons.receipt_text, "Payment Request",
|
||||||
contentTheme.primary, "/dashboard/payment-request"),
|
contentTheme.primary, "/dashboard/payment-request"),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user