This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e80986e
commit 0009d4e
Showing
8 changed files
with
329 additions
and
2 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
frontend/mgramseva/lib/model/reports/expense_bill_report_data.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
class ExpenseBillReportData { | ||
String? typeOfExpense; | ||
String? vendorName; | ||
int? amount; | ||
int? billDate; | ||
int? taxPeriodFrom; | ||
int? taxPeriodTo; | ||
String? applicationStatus; | ||
int? paidDate; | ||
String? filestoreid; | ||
int? lastModifiedTime; | ||
dynamic? lastModifiedByUuid; | ||
dynamic? lastModifiedBy; | ||
String? tenantId; | ||
|
||
ExpenseBillReportData( | ||
{this.typeOfExpense, | ||
this.vendorName, | ||
this.amount, | ||
this.billDate, | ||
this.taxPeriodFrom, | ||
this.taxPeriodTo, | ||
this.applicationStatus, | ||
this.paidDate, | ||
this.filestoreid, | ||
this.lastModifiedTime, | ||
this.lastModifiedByUuid, | ||
this.lastModifiedBy, | ||
this.tenantId}); | ||
|
||
ExpenseBillReportData.fromJson(Map<String, dynamic> json) { | ||
typeOfExpense = json['typeOfExpense']; | ||
vendorName = json['vendorName']; | ||
amount = json['amount']; | ||
billDate = json['billDate']; | ||
taxPeriodFrom = json['taxPeriodFrom']; | ||
taxPeriodTo = json['taxPeriodTo']; | ||
applicationStatus = json['applicationStatus']; | ||
paidDate = json['paidDate']; | ||
filestoreid = json['filestoreid']; | ||
lastModifiedTime = json['lastModifiedTime']; | ||
lastModifiedByUuid = json['lastModifiedByUuid']; | ||
lastModifiedBy = json['lastModifiedBy']; | ||
tenantId = json['tenantId']; | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
final Map<String, dynamic> data = new Map<String, dynamic>(); | ||
data['typeOfExpense'] = this.typeOfExpense; | ||
data['vendorName'] = this.vendorName; | ||
data['amount'] = this.amount; | ||
data['billDate'] = this.billDate; | ||
data['taxPeriodFrom'] = this.taxPeriodFrom; | ||
data['taxPeriodTo'] = this.taxPeriodTo; | ||
data['applicationStatus'] = this.applicationStatus; | ||
data['paidDate'] = this.paidDate; | ||
data['filestoreid'] = this.filestoreid; | ||
data['lastModifiedTime'] = this.lastModifiedTime; | ||
data['lastModifiedByUuid'] = this.lastModifiedByUuid; | ||
data['lastModifiedBy'] = this.lastModifiedBy; | ||
data['tenantId'] = this.tenantId; | ||
return data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
frontend/mgramseva/lib/screeens/reports/expense_bill_report.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import '../../providers/reports_provider.dart'; | ||
import '../../utils/localization/application_localizations.dart'; | ||
import 'package:mgramseva/utils/constants/i18_key_constants.dart'; | ||
import '../../utils/notifiers.dart'; | ||
import '../../utils/testing_keys/testing_keys.dart'; | ||
import '../../widgets/button.dart'; | ||
|
||
class ExpenseBillReport extends StatefulWidget { | ||
final Function onViewClick; | ||
|
||
ExpenseBillReport({Key? key, required this.onViewClick}) : super(key: key); | ||
|
||
@override | ||
State<StatefulWidget> createState() => _ExpenseBillReportState(); | ||
} | ||
|
||
class _ExpenseBillReportState extends State<ExpenseBillReport> | ||
with SingleTickerProviderStateMixin { | ||
@override | ||
Widget build(BuildContext context) { | ||
return LayoutBuilder(builder: (context, constraints) { | ||
final isWideScreen = constraints.maxWidth > 700; | ||
final containerMargin = isWideScreen | ||
? const EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 10) | ||
: const EdgeInsets.symmetric(vertical: 5.0, horizontal: 8); | ||
return Consumer<ReportsProvider>(builder: (_, reportProvider, child) { | ||
return Container( | ||
margin: containerMargin, | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
children: [ | ||
SizedBox( | ||
height: 30, | ||
), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Container( | ||
width: constraints.maxWidth > 344?constraints.maxWidth / 2.5:constraints.maxWidth / 3, | ||
child: Row( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
"4. ", | ||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), | ||
), | ||
Expanded( | ||
child: Text( | ||
ApplicationLocalizations.of(context) | ||
.translate(i18.dashboard.EXPENSE_BILL_REPORT), | ||
maxLines: 3, | ||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
Row( | ||
children: [ | ||
Container( | ||
width: 50, | ||
child: Button( | ||
ApplicationLocalizations.of(context) | ||
.translate(i18.common.VIEW), | ||
() { | ||
if (reportProvider.selectedBillPeriod == null) { | ||
Notifiers.getToastMessage( | ||
context, 'Select Billing Cycle', 'ERROR'); | ||
} else { | ||
reportProvider.clearTableData(); | ||
reportProvider.getExpenseBillReport(); | ||
widget.onViewClick( | ||
true, i18.dashboard.EXPENSE_BILL_REPORT); | ||
} | ||
}, | ||
key: Keys.billReport.EXPENSE_BILL_REPORT_VIEW_BUTTON, | ||
), | ||
), | ||
SizedBox( | ||
width: 10, | ||
), | ||
TextButton.icon( | ||
onPressed: () { | ||
if (reportProvider.selectedBillPeriod == null) { | ||
Notifiers.getToastMessage( | ||
context, 'Select Billing Cycle', 'ERROR'); | ||
} else { | ||
reportProvider.getExpenseBillReport(download: true); | ||
} | ||
}, | ||
icon: Icon(Icons.download_sharp), | ||
label: Text(ApplicationLocalizations.of(context) | ||
.translate(i18.common.CORE_DOWNLOAD))), | ||
], | ||
), | ||
], | ||
), | ||
], | ||
), | ||
); | ||
}); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.