diff --git a/business-services/billing-service/src/main/java/org/egov/demand/util/migration/DemandMigration.java b/business-services/billing-service/src/main/java/org/egov/demand/util/migration/DemandMigration.java index d6b1deb7b..cf8e611e5 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/util/migration/DemandMigration.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/util/migration/DemandMigration.java @@ -96,12 +96,32 @@ public int compare(DemandDetail dD1, DemandDetail dD2) { } }; } - - public Map migrateToV1(Integer startBatch, Integer batchSizeInput) { + + public static String getCountQuery(String stateLevelTenantId){ + return new String("select count(*) from egbs_demand where businessservice IN ('TL','PT') AND tenantid ilike '"+stateLevelTenantId+"%';"); + } + public static String getSelectQuery(String stateLevelTenantId){ + return new String("select d.id as did,dl.id as dlid,dl.demandid as dldemandid," + + "d.consumercode as dconsumercode,d.consumertype as dconsumertype,d.taxperiodfrom as dtaxperiodfrom," + + "d.taxperiodto as dtaxperiodto,U.uuid as payer,null as dbillexpirytime," + + " d.businessservice as dbusinessservice,d.status as status,d.minimumamountpayable as dminimumamountpayable, " + + " (CASE WHEN taxheadcode='PT_DECIMAL_CEILING_CREDIT' OR taxheadcode='PT_DECIMAL_CEILING_DEBIT' THEN 'PT_ROUNDOFF' else taxheadcode END)" + + " as dltaxheadcode, (CASE WHEN taxheadcode IN ('PT_TIME_REBATE', 'PT_ADVANCE_CARRYFORWARD', 'PT_OWNER_EXEMPTION','PT_UNIT_USAGE_EXEMPTION'" + + ", 'PT_ADHOC_REBATE', 'PT_DECIMAL_CEILING_DEBIT','TL_ADHOC_REBATE') then taxamount*-1 else taxamount END) as dltaxamount," + + " dl.collectionamount as dlcollectionamount, dl.createdby as dlcreatedby,dl.createdtime as dlcreatedtime,dl.lastmodifiedby as dllastmodifiedby," + + " dl.lastmodifiedtime as dllastmodifiedtime,dl.tenantid as dltenantid, d.createdby as dcreatedby,d.createdtime as dcreatedtime," + + " d.lastmodifiedby as dlastmodifiedby,d.lastmodifiedtime as dlastmodifiedtime,d.tenantid as dtenantid " + + " from egbs_demand d inner join egbs_demanddetail dl ON d.id=dl.demandid AND d.tenantid=dl.tenantid " + + " LEFT OUTER JOIN eg_user U ON U.id::CHARACTER VARYING=d.owner" + + " WHERE d.businessservice IN ('TL','PT') AND d.tenantid ilike '"+stateLevelTenantId+"%' " + + " AND d.id IN (select id from egbs_demand order by id offset ? limit ?);"); + } + + public Map migrateToV1(Integer startBatch, Integer batchSizeInput,String stateLevelTenantId) { Map responseMap = new HashMap<>(); - int count = jdbcTemplate.queryForObject(COUNT_QUERY, Integer.class); + int count = jdbcTemplate.queryForObject(getCountQuery(stateLevelTenantId), Integer.class); int i = 0; if (null != startBatch && startBatch > 0) i = startBatch; @@ -111,7 +131,7 @@ public Map migrateToV1(Integer startBatch, Integer batchSizeInpu for( ; i demands = jdbcTemplate.query(SELECT_QUERY, new Object[] { i, batchSize }, demandRowMapper); + List demands = jdbcTemplate.query(getSelectQuery(stateLevelTenantId), new Object[] { i, batchSize }, demandRowMapper); try { apportionDemands(demands); @@ -128,7 +148,7 @@ public Map migrateToV1(Integer startBatch, Integer batchSizeInpu return responseMap; } - + private void addResponseToMap(List demands, Map responseMap, String message) { demands.forEach(demand -> { diff --git a/business-services/billing-service/src/main/java/org/egov/demand/web/controller/DemandController.java b/business-services/billing-service/src/main/java/org/egov/demand/web/controller/DemandController.java index 944b1854d..6d3331a67 100644 --- a/business-services/billing-service/src/main/java/org/egov/demand/web/controller/DemandController.java +++ b/business-services/billing-service/src/main/java/org/egov/demand/web/controller/DemandController.java @@ -146,7 +146,7 @@ public ResponseEntity search(@RequestBody RequestInfoWrapper requestInfoWrapp public ResponseEntity migrate(@RequestBody @Valid RequestInfoWrapper wrapper, @RequestParam(required=false) Integer batchStart, @RequestParam(required=true) Integer batchSizeInput) { - Map resultMap = migrationService.migrateToV1(batchStart, batchSizeInput); + Map resultMap = migrationService.migrateToV1(batchStart, batchSizeInput, wrapper.getRequestInfo().getUserInfo().getTenantId().substring(0,2)); return new ResponseEntity<>(resultMap, HttpStatus.OK); } diff --git a/frontend/mgramseva/.metadata b/frontend/mgramseva/.metadata index 56bfc2c4d..d22992edb 100644 --- a/frontend/mgramseva/.metadata +++ b/frontend/mgramseva/.metadata @@ -4,7 +4,42 @@ # This file should be version controlled and should not be manually edited. version: - revision: f4abaa0735eba4dfd8f33f73363911d63931fe03 - channel: stable + revision: "db7ef5bf9f59442b0e200a90587e8fa5e0c6336a" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: android + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: ios + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: linux + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: macos + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: web + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + - platform: windows + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/frontend/mgramseva/README.md b/frontend/mgramseva/README.md index 02c1210a3..968155668 100644 --- a/frontend/mgramseva/README.md +++ b/frontend/mgramseva/README.md @@ -8,6 +8,7 @@ mGramSeva is a Hybrid Application (web + App(Android + IOS)) built using Open So ## Commands for flutter - **flutter run** : Command to run the app +- **flutter run --no-enable-impeller** : Command to run the app on mac virtual machine without GPU Passthrough - **flutter build web** : Command to build web - **flutter build apk --release** : Command to build the apk of the application diff --git a/frontend/mgramseva/android/app/src/main/AndroidManifest.xml b/frontend/mgramseva/android/app/src/main/AndroidManifest.xml index 5e9b650e1..b97fd4e28 100644 --- a/frontend/mgramseva/android/app/src/main/AndroidManifest.xml +++ b/frontend/mgramseva/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,11 @@ - - + + + + + @@ -14,7 +17,8 @@ 10.18.0) + - Firebase/CoreOnly (10.18.0): + - FirebaseCore (= 10.18.0) + - firebase_analytics (10.7.1): + - Firebase/Analytics (= 10.18.0) + - firebase_core + - Flutter + - firebase_core (2.23.0): + - Firebase/CoreOnly (= 10.18.0) + - Flutter + - FirebaseAnalytics (10.18.0): + - FirebaseAnalytics/AdIdSupport (= 10.18.0) + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - FirebaseAnalytics/AdIdSupport (10.18.0): + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleAppMeasurement (= 10.18.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - FirebaseCore (10.18.0): + - FirebaseCoreInternal (~> 10.0) + - GoogleUtilities/Environment (~> 7.12) + - GoogleUtilities/Logger (~> 7.12) + - FirebaseCoreInternal (10.18.0): + - "GoogleUtilities/NSData+zlib (~> 7.8)" + - FirebaseInstallations (10.18.0): + - FirebaseCore (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/UserDefaults (~> 7.8) + - PromisesObjC (~> 2.1) + - Flutter (1.0.0) + - flutter_downloader (0.0.1): + - Flutter + - flutter_keyboard_visibility (0.0.1): + - Flutter + - flutter_secure_storage (6.0.0): + - Flutter + - flutter_share_me (0.0.1): + - FBSDKCoreKit (~> 14.0.0) + - FBSDKLoginKit (~> 14.0.0) + - FBSDKShareKit (~> 14.0.0) + - Flutter + - GoogleAppMeasurement (10.18.0): + - GoogleAppMeasurement/AdIdSupport (= 10.18.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - GoogleAppMeasurement/AdIdSupport (10.18.0): + - GoogleAppMeasurement/WithoutAdIdSupport (= 10.18.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - GoogleAppMeasurement/WithoutAdIdSupport (10.18.0): + - GoogleUtilities/AppDelegateSwizzler (~> 7.11) + - GoogleUtilities/MethodSwizzler (~> 7.11) + - GoogleUtilities/Network (~> 7.11) + - "GoogleUtilities/NSData+zlib (~> 7.11)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - GoogleUtilities/AppDelegateSwizzler (7.12.0): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Environment (7.12.0): + - PromisesObjC (< 3.0, >= 1.2) + - GoogleUtilities/Logger (7.12.0): + - GoogleUtilities/Environment + - GoogleUtilities/MethodSwizzler (7.12.0): + - GoogleUtilities/Logger + - GoogleUtilities/Network (7.12.0): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (7.12.0)" + - GoogleUtilities/Reachability (7.12.0): + - GoogleUtilities/Logger + - GoogleUtilities/UserDefaults (7.12.0): + - GoogleUtilities/Logger + - image_picker_ios (0.0.1): + - Flutter + - integration_test (0.0.1): + - Flutter + - nanopb (2.30909.1): + - nanopb/decode (= 2.30909.1) + - nanopb/encode (= 2.30909.1) + - nanopb/decode (2.30909.1) + - nanopb/encode (2.30909.1) + - network_info_plus (0.0.1): + - Flutter + - open_filex (0.0.2): + - Flutter + - package_info_plus (0.4.5): + - Flutter + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - permission_handler_apple (9.1.1): + - Flutter + - print_bluetooth_thermal (0.0.1): + - Flutter + - printing (1.0.0): + - Flutter + - PromisesObjC (2.3.1) + - SDWebImage (5.18.5): + - SDWebImage/Core (= 5.18.5) + - SDWebImage/Core (5.18.5) + - SwiftyGif (5.4.4) + - thermal_printer (1.0.0): + - Flutter + - url_launcher_ios (0.0.1): + - Flutter + +DEPENDENCIES: + - charset_converter (from `.symlinks/plugins/charset_converter/ios`) + - file_picker (from `.symlinks/plugins/file_picker/ios`) + - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - Flutter (from `Flutter`) + - flutter_downloader (from `.symlinks/plugins/flutter_downloader/ios`) + - flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`) + - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) + - flutter_share_me (from `.symlinks/plugins/flutter_share_me/ios`) + - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) + - integration_test (from `.symlinks/plugins/integration_test/ios`) + - network_info_plus (from `.symlinks/plugins/network_info_plus/ios`) + - open_filex (from `.symlinks/plugins/open_filex/ios`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) + - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) + - print_bluetooth_thermal (from `.symlinks/plugins/print_bluetooth_thermal/ios`) + - printing (from `.symlinks/plugins/printing/ios`) + - thermal_printer (from `.symlinks/plugins/thermal_printer/ios`) + - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) + +SPEC REPOS: + trunk: + - DKImagePickerController + - DKPhotoGallery + - FBAEMKit + - FBSDKCoreKit + - FBSDKCoreKit_Basics + - FBSDKLoginKit + - FBSDKShareKit + - Firebase + - FirebaseAnalytics + - FirebaseCore + - FirebaseCoreInternal + - FirebaseInstallations + - GoogleAppMeasurement + - GoogleUtilities + - nanopb + - PromisesObjC + - SDWebImage + - SwiftyGif + +EXTERNAL SOURCES: + charset_converter: + :path: ".symlinks/plugins/charset_converter/ios" + file_picker: + :path: ".symlinks/plugins/file_picker/ios" + firebase_analytics: + :path: ".symlinks/plugins/firebase_analytics/ios" + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" + Flutter: + :path: Flutter + flutter_downloader: + :path: ".symlinks/plugins/flutter_downloader/ios" + flutter_keyboard_visibility: + :path: ".symlinks/plugins/flutter_keyboard_visibility/ios" + flutter_secure_storage: + :path: ".symlinks/plugins/flutter_secure_storage/ios" + flutter_share_me: + :path: ".symlinks/plugins/flutter_share_me/ios" + image_picker_ios: + :path: ".symlinks/plugins/image_picker_ios/ios" + integration_test: + :path: ".symlinks/plugins/integration_test/ios" + network_info_plus: + :path: ".symlinks/plugins/network_info_plus/ios" + open_filex: + :path: ".symlinks/plugins/open_filex/ios" + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/darwin" + permission_handler_apple: + :path: ".symlinks/plugins/permission_handler_apple/ios" + print_bluetooth_thermal: + :path: ".symlinks/plugins/print_bluetooth_thermal/ios" + printing: + :path: ".symlinks/plugins/printing/ios" + thermal_printer: + :path: ".symlinks/plugins/thermal_printer/ios" + url_launcher_ios: + :path: ".symlinks/plugins/url_launcher_ios/ios" + +SPEC CHECKSUMS: + charset_converter: 215c7b04932ec2b9ba43be96a9bc34afed3e5322 + DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac + DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 + FBAEMKit: d00064597439e75885c70d9adbcb5f3e9ad84f5d + FBSDKCoreKit: e5d3acfffe5063a9d0b967ba2ad1f5afc460cf43 + FBSDKCoreKit_Basics: 1ff46a12e80f0b66e6c00e1ef32d6a5b5b9008a5 + FBSDKLoginKit: dbe86ef42ab142f3bd0f1c904a21bb33f31c5569 + FBSDKShareKit: 2f6a6a1445cc1b8ea0f733e60d02d2f7c4ebf8be + file_picker: 15fd9539e4eb735dc54bae8c0534a7a9511a03de + Firebase: 414ad272f8d02dfbf12662a9d43f4bba9bec2a06 + firebase_analytics: 3e5dba777bb51d1e0358b5a37adefa69746a94bd + firebase_core: 29d66baf806970cda37c93621b27cd369b27db1b + FirebaseAnalytics: 4d310b35c48eaa4a058ddc04bdca6bdb5dc0fe80 + FirebaseCore: 2322423314d92f946219c8791674d2f3345b598f + FirebaseCoreInternal: 8eb002e564b533bdcf1ba011f33f2b5c10e2ed4a + FirebaseInstallations: e842042ec6ac1fd2e37d7706363ebe7f662afea4 + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + flutter_downloader: b7301ae057deadd4b1650dc7c05375f10ff12c39 + flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 + flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be + flutter_share_me: 1fb559741e0dff56a9d2bdeaf4d966b0b47449ae + GoogleAppMeasurement: 70ce9aa438cff1cfb31ea3e660bcc67734cb716e + GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34 + image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 + integration_test: 13825b8a9334a850581300559b8839134b124670 + nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5 + network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f + open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4 + package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85 + path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 + permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 + print_bluetooth_thermal: 54a9ba9436479dd633d18f393669ee793ee498fa + printing: 233e1b73bd1f4a05615548e9b5a324c98588640b + PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4 + SDWebImage: 7ac2b7ddc5e8484c79aa90fc4e30b149d6a2c88f + SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f + thermal_printer: 1885c43c3f17b912ca2c29e7f44822dddc2c24b9 + url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b + +PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 + +COCOAPODS: 1.14.3 diff --git a/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj b/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj index a85457607..3ca8421fc 100644 --- a/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj +++ b/frontend/mgramseva/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -162,7 +162,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -207,10 +207,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -260,6 +262,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -365,7 +368,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 12; + CURRENT_PROJECT_VERSION = 35; DEVELOPMENT_TEAM = JP48C27R32; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -374,7 +377,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.14; + MARKETING_VERSION = 1.2.18; PRODUCT_BUNDLE_IDENTIFIER = com.dwss.mgramseva; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -501,7 +504,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 12; + CURRENT_PROJECT_VERSION = 35; DEVELOPMENT_TEAM = JP48C27R32; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -510,7 +513,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.14; + MARKETING_VERSION = 1.2.18; PRODUCT_BUNDLE_IDENTIFIER = com.dwss.mgramseva; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -529,7 +532,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 12; + CURRENT_PROJECT_VERSION = 35; DEVELOPMENT_TEAM = JP48C27R32; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -538,7 +541,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.14; + MARKETING_VERSION = 1.2.18; PRODUCT_BUNDLE_IDENTIFIER = com.dwss.mgramseva; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/frontend/mgramseva/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/frontend/mgramseva/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a33..a6b826db2 100644 --- a/frontend/mgramseva/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/frontend/mgramseva/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ CADisableMinimumFrameDurationOnPhone + UIApplicationSupportsIndirectInputEvents + diff --git a/frontend/mgramseva/lib/components/dashboard/bills_table.dart b/frontend/mgramseva/lib/components/dashboard/bills_table.dart index 8a75c9cf5..7eb43c4c2 100644 --- a/frontend/mgramseva/lib/components/dashboard/bills_table.dart +++ b/frontend/mgramseva/lib/components/dashboard/bills_table.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:horizontal_data_table/horizontal_data_table.dart'; import 'package:mgramseva/utils/localization/application_localizations.dart'; import 'package:mgramseva/utils/models.dart'; @@ -83,7 +82,6 @@ class _BillsTable extends State { var index = 0; return widget.headerList.map((e) { index++; - ; if (e.isSortingRequired ?? false) { return TextButton( style: TextButton.styleFrom( diff --git a/frontend/mgramseva/lib/components/dashboard/dashboard_card.dart b/frontend/mgramseva/lib/components/dashboard/dashboard_card.dart index cd6ed3c8d..c73746779 100644 --- a/frontend/mgramseva/lib/components/dashboard/dashboard_card.dart +++ b/frontend/mgramseva/lib/components/dashboard/dashboard_card.dart @@ -38,7 +38,7 @@ class DashboardCard extends StatelessWidget { dashBoardProvider.selectedMonth, context), style: Theme.of(context) .textTheme - .subtitle1 + .titleMedium ?.apply( color: Theme.of(context).primaryColor), ), diff --git a/frontend/mgramseva/lib/components/house_connection_and_bill/consumer_bill_payment.dart b/frontend/mgramseva/lib/components/house_connection_and_bill/consumer_bill_payment.dart index 3905a5414..6800b26dd 100644 --- a/frontend/mgramseva/lib/components/house_connection_and_bill/consumer_bill_payment.dart +++ b/frontend/mgramseva/lib/components/house_connection_and_bill/consumer_bill_payment.dart @@ -90,7 +90,7 @@ class ConsumerBillPaymentsState extends State { listen: false); screenshotController - .captureFromWidget( + .captureFromLongWidget( Container( width: kIsWeb ? 375 : 195, margin: EdgeInsets.zero, @@ -374,18 +374,9 @@ class ConsumerBillPaymentsState extends State { "tenantId": commonProvider .userDetails!.selectedtenant!.code, }, item.mobileNumber, item, "Share"), - style: ButtonStyle( - alignment: Alignment.center, - padding: MaterialStateProperty.all( - EdgeInsets.symmetric(vertical: 8)), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - side: BorderSide( - width: 2, - color: Theme.of(context).primaryColor), - borderRadius: BorderRadius.circular(0.0), - )), - ), + style: ElevatedButton.styleFrom(padding:EdgeInsets.symmetric(vertical: 8),alignment: Alignment.center,side:BorderSide( + width: 1, + color: Theme.of(context).disabledColor)), icon: (Image.asset('assets/png/whats_app.png')), label: Padding( padding: const EdgeInsets.symmetric(vertical: 5), @@ -393,7 +384,7 @@ class ConsumerBillPaymentsState extends State { ApplicationLocalizations.of(context).translate(i18 .consumerReciepts .CONSUMER_RECIEPT_SHARE_RECEIPT), - style: Theme.of(context).textTheme.subtitle2, + style: Theme.of(context).textTheme.titleSmall, ), ), ), @@ -405,14 +396,15 @@ class ConsumerBillPaymentsState extends State { : MediaQuery.of(context).size.width / 2.2, child: ElevatedButton.icon( onPressed: () => _capturePng(item), - icon: Icon(Icons.print), + icon: Icon(Icons.print,color: Colors.white,), + style: ElevatedButton.styleFrom(backgroundColor: Color.fromRGBO(244, 119, 56, 1)), label: Text( ApplicationLocalizations.of(context).translate( i18.consumerReciepts .CONSUMER_RECEIPT_PRINT), style: Theme.of(context) .textTheme - .subtitle1! + .titleMedium! .apply(color: Colors.white))), ), ]), diff --git a/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart b/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart index fcae9b2a7..c34d417b1 100644 --- a/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart +++ b/frontend/mgramseva/lib/components/house_connection_and_bill/generate_new_bill.dart @@ -53,7 +53,7 @@ class _GenerateNewBillState extends State { if (demandList.demands!.isNotEmpty) { int? num = demandList.demands?.first.auditDetails?.createdTime; var houseHoldProvider = - Provider.of(context, listen: false);; + Provider.of(context, listen: false); return LayoutBuilder(builder: (context, constraints) { return Column( children: [ @@ -222,7 +222,7 @@ class _GenerateNewBillState extends State { .GENERATE_BILL_LABEL), style: Theme.of(context) .textTheme - .subtitle2)), + .titleSmall)), )), Expanded( child: ShortButton( diff --git a/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart b/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart index 45c43ef42..a57411937 100644 --- a/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart +++ b/frontend/mgramseva/lib/components/house_connection_and_bill/new_consumer_bill.dart @@ -320,7 +320,7 @@ class NewConsumerBillState extends State { : MediaQuery.of(context) .size .width / - 1.12, + 2.2, child: OutlinedButton.icon( onPressed: () => commonProvider .getFileFromPDFBillService( @@ -347,28 +347,9 @@ class NewConsumerBillState extends State { billList.bill!.first, "Share", ), - style: ButtonStyle( - alignment: - Alignment.center, - padding: - MaterialStateProperty - .all(EdgeInsets - .symmetric( - vertical: - 0)), - shape: MaterialStateProperty - .all( - RoundedRectangleBorder( - side: BorderSide( - width: 2, - color: Theme.of( - context) - .primaryColor), - borderRadius: - BorderRadius - .circular(0.0), - )), - ), + style: ElevatedButton.styleFrom(padding:EdgeInsets.symmetric(vertical: 8),alignment: Alignment.center,side:BorderSide( + width: 1, + color: Theme.of(context).disabledColor)), icon: (Image.asset( 'assets/png/whats_app.png')), label: Padding( diff --git a/frontend/mgramseva/lib/env/app_config.dart b/frontend/mgramseva/lib/env/app_config.dart index f10823029..a5dc5ba55 100644 --- a/frontend/mgramseva/lib/env/app_config.dart +++ b/frontend/mgramseva/lib/env/app_config.dart @@ -1,3 +1,4 @@ +import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/foundation.dart'; import 'package:universal_html/html.dart'; @@ -38,3 +39,22 @@ Map stageConstants = { Map prodConstants = { _baseUrl: "https://api.production.com/", }; + +class FirebaseConfigurations { + static const _apiKey = "AIzaSyBWQkRGvXiKu_fLAA5O8SvQzZTWeQTqMZ8"; + static const _authDomain = "mgramseva-qa.egov.org.in"; + static const _projectId = "sample-mgramseva"; + static const _storageBucket = "sample-mgramseva.appspot.com"; + static const _messagingSenderId ="1026518772539"; + static const _appId = "1:1026518772539:android:bfa7ff7ef250f28789251e"; + +//Make some getter functions + String get apiKey => _apiKey; + String get authDomain => _authDomain; + String get projectId => _projectId; + String get storageBucket => _storageBucket; + String get messagingSenderId => _messagingSenderId; + String get appId => _appId; + + static FirebaseOptions get firebaseOptions => FirebaseOptions(apiKey: _apiKey, appId: _appId, messagingSenderId: _messagingSenderId, projectId: _projectId, storageBucket: _storageBucket, authDomain: _authDomain); +} diff --git a/frontend/mgramseva/lib/main.dart b/frontend/mgramseva/lib/main.dart index 6be500513..eb9e13865 100644 --- a/frontend/mgramseva/lib/main.dart +++ b/frontend/mgramseva/lib/main.dart @@ -3,8 +3,8 @@ import 'dart:io'; import 'dart:isolate'; import 'dart:ui'; +// import 'package:dart_ping_ios/dart_ping_ios.dart'; import 'package:firebase_analytics/firebase_analytics.dart'; -import 'package:firebase_analytics/observer.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -46,20 +46,25 @@ import 'package:mgramseva/utils/error_logging.dart'; import 'package:mgramseva/utils/global_variables.dart'; import 'package:mgramseva/utils/loaders.dart'; import 'package:mgramseva/utils/notifiers.dart'; -import 'package:open_file/open_file.dart'; +import 'package:open_filex/open_filex.dart'; import 'package:provider/provider.dart'; import 'package:url_strategy/url_strategy.dart'; import 'providers/collect_payment_provider.dart'; import 'providers/dashboard_provider.dart'; import 'providers/revenue_dashboard_provider.dart'; +import 'package:flutter_dotenv/flutter_dotenv.dart'; void main() { HttpOverrides.global = new MyHttpOverrides(); setPathUrlStrategy(); //configureApp(); setEnvironment(Environment.dev); - + // Register DartPingIOS + // if (Platform.isIOS) { + // DartPingIOS.register(); + // } + // Uncomment when compiling on iOS runZonedGuarded(() async { FlutterError.onError = (FlutterErrorDetails details) { FlutterError.dumpErrorToConsole(details); @@ -68,10 +73,15 @@ void main() { }; WidgetsFlutterBinding.ensureInitialized(); - - if (Firebase.apps.length == 0) { + await dotenv.load(fileName: 'assets/.env'); + if(kIsWeb){ + await Firebase.initializeApp(options: FirebaseConfigurations.firebaseOptions); + }else{ await Firebase.initializeApp(); } + if (Firebase.apps.length == 0) { + + } if (!kIsWeb) { await FlutterDownloader.initialize( @@ -104,7 +114,7 @@ class MyApp extends StatefulWidget { class _MyAppState extends State { late Locale _locale = Locale('en', 'IN'); - static FirebaseAnalytics analytics = FirebaseAnalytics(); + static FirebaseAnalytics analytics = FirebaseAnalytics.instance; static FirebaseAnalyticsObserver observer = FirebaseAnalyticsObserver(analytics: analytics); ReceivePort _port = ReceivePort(); @@ -126,13 +136,13 @@ class _MyAppState extends State { IsolateNameServer.removePortNameMapping('downloader_send_port'); super.dispose(); } - + @pragma('vm:entry-point') static void downloadCallback( - String id, DownloadTaskStatus status, int progress) { + String id, int status, int progress) { final SendPort send = IsolateNameServer.lookupPortByName('downloader_send_port')!; - send.send([id, status, progress]); + send.send([id, DownloadTaskStatus.values.elementAt(status), progress]); } afterViewBuild() async { @@ -142,11 +152,11 @@ class _MyAppState extends State { _port.listen((dynamic data) { String id = data[0]; DownloadTaskStatus status = data[1]; - int progress = data[2]; + // int progress = data[2]; + // print("Download progress: "+progress.toString()); if (status == DownloadTaskStatus.complete) { if (CommonProvider.downloadUrl.containsKey(id)) { - if (Platform.isIOS && CommonProvider.downloadUrl[id] != null) - OpenFile.open(CommonProvider.downloadUrl[id] ?? ''); + if (CommonProvider.downloadUrl[id] != null) OpenFilex.open(CommonProvider.downloadUrl[id] ?? ''); CommonProvider.downloadUrl.remove(id); } else if (status == DownloadTaskStatus.failed || status == DownloadTaskStatus.canceled || @@ -155,7 +165,9 @@ class _MyAppState extends State { CommonProvider.downloadUrl.remove(id); } } - setState(() {}); + setState(() { + // print("Download progress: "+progress.toString()); + }); }); FlutterDownloader.registerCallback(downloadCallback); } diff --git a/frontend/mgramseva/lib/model/common/demand.dart b/frontend/mgramseva/lib/model/common/demand.dart index 37212510a..23dec86b7 100644 --- a/frontend/mgramseva/lib/model/common/demand.dart +++ b/frontend/mgramseva/lib/model/common/demand.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; part 'demand.g.dart'; diff --git a/frontend/mgramseva/lib/model/dashboard/revenue_chart.dart b/frontend/mgramseva/lib/model/dashboard/revenue_chart.dart index 4fc0454bb..d00297d77 100644 --- a/frontend/mgramseva/lib/model/dashboard/revenue_chart.dart +++ b/frontend/mgramseva/lib/model/dashboard/revenue_chart.dart @@ -1,5 +1,5 @@ import 'package:json_annotation/json_annotation.dart'; -import 'package:charts_flutter/flutter.dart' as charts; +import 'package:community_charts_flutter/community_charts_flutter.dart' as charts; import '../../screeens/dashboard/revenue_expense_dashboard/revenue.dart'; diff --git a/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart b/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart index 68c6ae4d1..018f62fa8 100644 --- a/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart +++ b/frontend/mgramseva/lib/model/expenses_details/expenses_details.dart @@ -2,11 +2,8 @@ import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:mgramseva/model/expenses_details/vendor.dart'; import 'package:mgramseva/model/file/file_store.dart'; -import 'package:mgramseva/providers/expenses_details_provider.dart'; import 'package:mgramseva/utils/date_formats.dart'; -import 'package:provider/provider.dart'; -import '../../utils/global_variables.dart'; part 'expenses_details.g.dart'; diff --git a/frontend/mgramseva/lib/model/expenses_details/vendor.dart b/frontend/mgramseva/lib/model/expenses_details/vendor.dart index 62eef28bb..0fd90569c 100644 --- a/frontend/mgramseva/lib/model/expenses_details/vendor.dart +++ b/frontend/mgramseva/lib/model/expenses_details/vendor.dart @@ -1,6 +1,4 @@ import 'package:json_annotation/json_annotation.dart'; -import 'package:flutter/material.dart'; -import 'package:mgramseva/utils/date_formats.dart'; part 'vendor.g.dart'; diff --git a/frontend/mgramseva/lib/model/file/file_store.dart b/frontend/mgramseva/lib/model/file/file_store.dart index 96cfecf44..3bc2eb663 100644 --- a/frontend/mgramseva/lib/model/file/file_store.dart +++ b/frontend/mgramseva/lib/model/file/file_store.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; part 'file_store.g.dart'; diff --git a/frontend/mgramseva/lib/model/localization/language.dart b/frontend/mgramseva/lib/model/localization/language.dart index 1837735e7..4b508f973 100644 --- a/frontend/mgramseva/lib/model/localization/language.dart +++ b/frontend/mgramseva/lib/model/localization/language.dart @@ -29,7 +29,8 @@ class LanguageList { return data; } } -class PSPCLIntegration{ + +class PSPCLIntegration { List? accountNumberGpMapping; PSPCLIntegration({this.accountNumberGpMapping}); @@ -52,6 +53,7 @@ class PSPCLIntegration{ return data; } } + class AccountNumberGpMapping { String? accountNumber; String? departmentEntityName; @@ -59,8 +61,8 @@ class AccountNumberGpMapping { AccountNumberGpMapping( {this.accountNumber, - this.departmentEntityName, - this.departmentEntityCode}); + this.departmentEntityName, + this.departmentEntityCode}); AccountNumberGpMapping.fromJson(Map json) { accountNumber = json['accountNumber']; @@ -76,6 +78,7 @@ class AccountNumberGpMapping { return data; } } + class MdmsRes { CommonMasters? commonMasters; BillingService? billingService; diff --git a/frontend/mgramseva/lib/model/localization/localization_label.dart b/frontend/mgramseva/lib/model/localization/localization_label.dart index 7627eed0b..248aba7d0 100644 --- a/frontend/mgramseva/lib/model/localization/localization_label.dart +++ b/frontend/mgramseva/lib/model/localization/localization_label.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; part 'localization_label.g.dart'; diff --git a/frontend/mgramseva/lib/model/mdms/payment_type.dart b/frontend/mgramseva/lib/model/mdms/payment_type.dart index d45117918..79a4243e7 100644 --- a/frontend/mgramseva/lib/model/mdms/payment_type.dart +++ b/frontend/mgramseva/lib/model/mdms/payment_type.dart @@ -3,7 +3,7 @@ import '../localization/language.dart'; class PaymentType { - dynamic? responseInfo; + dynamic responseInfo; MdmsRes? mdmsRes; PaymentType({this.responseInfo, this.mdmsRes}); diff --git a/frontend/mgramseva/lib/model/mdms/tax_period.dart b/frontend/mgramseva/lib/model/mdms/tax_period.dart index 8e308d8cc..26b3bdfc2 100644 --- a/frontend/mgramseva/lib/model/mdms/tax_period.dart +++ b/frontend/mgramseva/lib/model/mdms/tax_period.dart @@ -29,6 +29,11 @@ class TaxPeriod { factory TaxPeriod.fromJson(Map json) => _$TaxPeriodFromJson(json); Map toJson() => _$TaxPeriodToJson(this); + + @override + String toString() { + return '$financialYear'; + } } diff --git a/frontend/mgramseva/lib/model/reports/expense_bill_report_data.dart b/frontend/mgramseva/lib/model/reports/expense_bill_report_data.dart new file mode 100644 index 000000000..f017e5f5f --- /dev/null +++ b/frontend/mgramseva/lib/model/reports/expense_bill_report_data.dart @@ -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; + String? lastModifiedByUuid; + String? 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 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']??0; + filestoreid = json['filestoreid']; + lastModifiedTime = json['lastModifiedTime']??0; + lastModifiedByUuid = json['lastModifiedByUuid']; + lastModifiedBy = json['lastModifiedBy']??'-'; + tenantId = json['tenantId']; + } + + Map toJson() { + final Map data = new Map(); + 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; + } +} \ No newline at end of file diff --git a/frontend/mgramseva/lib/model/reports/vendor_report_data.dart b/frontend/mgramseva/lib/model/reports/vendor_report_data.dart new file mode 100644 index 000000000..5b8e6815a --- /dev/null +++ b/frontend/mgramseva/lib/model/reports/vendor_report_data.dart @@ -0,0 +1,36 @@ +class VendorReportData { + String? tenantId; + String? vendorName; + String? mobileNo; + String? typeOfExpense; + String? billId; + String? ownerUuid; + + VendorReportData( + {this.tenantId, + this.vendorName, + this.mobileNo, + this.typeOfExpense, + this.billId, + this.ownerUuid}); + + VendorReportData.fromJson(Map json) { + tenantId = json['tenantId']; + vendorName = json['vendor_name']; + mobileNo = json['mobile_no']; + typeOfExpense = json['type_of_expense']; + billId = json['bill_id']; + ownerUuid = json['owner_uuid']; + } + + Map toJson() { + final Map data = new Map(); + data['tenantId'] = this.tenantId; + data['vendor_name'] = this.vendorName; + data['mobile_no'] = this.mobileNo; + data['type_of_expense'] = this.typeOfExpense; + data['bill_id'] = this.billId; + data['owner_uuid'] = this.ownerUuid; + return data; + } +} \ No newline at end of file diff --git a/frontend/mgramseva/lib/model/success_handler.dart b/frontend/mgramseva/lib/model/success_handler.dart index 065566105..ac808a5a1 100644 --- a/frontend/mgramseva/lib/model/success_handler.dart +++ b/frontend/mgramseva/lib/model/success_handler.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; part 'success_handler.g.dart'; diff --git a/frontend/mgramseva/lib/providers/authentication_provider.dart b/frontend/mgramseva/lib/providers/authentication_provider.dart index b6f080985..7e7943d55 100644 --- a/frontend/mgramseva/lib/providers/authentication_provider.dart +++ b/frontend/mgramseva/lib/providers/authentication_provider.dart @@ -43,27 +43,25 @@ class AuthenticationProvider with ChangeNotifier { Navigator.pop(context); - if (loginResponse != null) { - var userInfo = await AuthenticationRepository().getProfile({ - "tenantId": loginResponse.userRequest!.tenantId, - "id": [loginResponse.userRequest!.id], - "mobileNumber": loginResponse.userRequest!.mobileNumber - }, loginResponse.accessToken!); - var commonProvider = - Provider.of(context, listen: false); - loginResponse.isFirstTimeLogin = userInfo.user!.first.defaultPwdChgd; - commonProvider.loginCredentials = loginResponse; - if (userInfo.user!.first.defaultPwdChgd == false) { - commonProvider.userProfile = userInfo; - Navigator.pushNamed(context, Routes.UPDATE_PASSWORD, - arguments: loginResponse); - return; - } else { - Navigator.of(context).pushNamedAndRemoveUntil( - Routes.HOME, (Route route) => false); - } + var userInfo = await AuthenticationRepository().getProfile({ + "tenantId": loginResponse.userRequest!.tenantId, + "id": [loginResponse.userRequest!.id], + "mobileNumber": loginResponse.userRequest!.mobileNumber + }, loginResponse.accessToken!); + var commonProvider = + Provider.of(context, listen: false); + loginResponse.isFirstTimeLogin = userInfo.user!.first.defaultPwdChgd; + commonProvider.loginCredentials = loginResponse; + if (userInfo.user!.first.defaultPwdChgd == false) { + commonProvider.userProfile = userInfo; + Navigator.pushNamed(context, Routes.UPDATE_PASSWORD, + arguments: loginResponse); + return; + } else { + Navigator.of(context).pushNamedAndRemoveUntil( + Routes.HOME, (Route route) => false); } - } on CustomException catch (e, s) { + } on CustomException catch (e, s) { Navigator.pop(context); if (ErrorHandler.handleApiException(context, e, s)) { Notifiers.getToastMessage(context, e.message, 'ERROR'); diff --git a/frontend/mgramseva/lib/providers/bill_generation_details_provider.dart b/frontend/mgramseva/lib/providers/bill_generation_details_provider.dart index ce93b1da3..c9d5e3216 100644 --- a/frontend/mgramseva/lib/providers/bill_generation_details_provider.dart +++ b/frontend/mgramseva/lib/providers/bill_generation_details_provider.dart @@ -31,6 +31,7 @@ import 'package:mgramseva/widgets/error_page.dart'; import 'package:provider/provider.dart'; import 'common_provider.dart'; +import 'ifix_hierarchy_provider.dart'; class BillGenerationProvider with ChangeNotifier { var streamController = StreamController.broadcast(); @@ -176,10 +177,17 @@ class BillGenerationProvider with ChangeNotifier { billGenerateDetails.billYear = selectedBillYear; notifyListeners(); } - - void onChangeOfBillCycle(val) { - var result = DateTime.parse(val); - selectedBillCycle = (DateFormats.getMonth(result)); + void clearBillYear() { + selectedBillYear = null; + billGenerateDetails.billYear = null; + selectedBillCycle = null; + billGenerateDetails.billCycle = null; + notifyListeners(); + } + void onChangeOfBillCycle(cycle) { + var val = cycle['code']; + DateTime result = DateTime.parse(val.toString()); + selectedBillCycle = cycle; selectedBillPeriod = (DateFormats.getFilteredDate( result.toLocal().toString(), dateFormat: "dd/MM/yyyy")) + @@ -189,7 +197,7 @@ class BillGenerationProvider with ChangeNotifier { .toLocal() .toString(), dateFormat: "dd/MM/yyyy"); - billGenerateDetails.billCycle = val; + billGenerateDetails.billCycle = result.toLocal().toString(); notifyListeners(); } @@ -284,59 +292,57 @@ class BillGenerationProvider with ChangeNotifier { "businessService": "WS" }).then((value) => billList = value); Navigator.pop(context); - if (billResponse1 != null) { - late String localizationText; - localizationText = - '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.GENERATE_BILL_SUCCESS_SUBTEXT)}'; - localizationText = localizationText.replaceFirst( - '{number}', '(+91 - ${billList.bill!.first.mobileNumber})'); - Navigator.of(context).pushReplacement( - new MaterialPageRoute(builder: (BuildContext context) { - return CommonSuccess( - SuccessHandler( - ApplicationLocalizations.of(context) - .translate(i18.demandGenerate.GENERATE_BILL_SUCCESS), - localizationText, - ApplicationLocalizations.of(context) - .translate(i18.common.COLLECT_PAYMENT), - Routes.BILL_GENERATE, - downloadLink: '', - downloadLinkLabel: ApplicationLocalizations.of(context) - .translate(i18.common.DOWNLOAD), - whatsAppShare: '', - subHeader: - '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.BILL_ID_NO)}', - subHeaderText: - '${billList.bill!.first.billNumber.toString()}'), - callBack: () => - onClickOfCollectPayment(billList.bill!.first, context), - callBackDownload: () => commonProvider - .getFileFromPDFBillService({ - "Bill": [billList.bill!.first] - }, { - "key": waterconnection.connectionType == 'Metered' - ? "ws-bill" - : "ws-bill-nm", - "tenantId": - commonProvider.userDetails!.selectedtenant!.code, - }, billList.bill!.first.mobileNumber, billList.bill!.first, - "Download"), - callBackWhatsApp: () => commonProvider - .getFileFromPDFBillService({ - "Bill": [billList.bill!.first], - }, { - "key": waterconnection.connectionType == 'Metered' - ? "ws-bill" - : "ws-bill-nm", - "tenantId": - commonProvider.userDetails!.selectedtenant!.code, - }, billList.bill!.first.mobileNumber, billList.bill!.first, - "Share"), - backButton: true, - ); - })); - } - } catch (e) { + late String localizationText; + localizationText = + '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.GENERATE_BILL_SUCCESS_SUBTEXT)}'; + localizationText = localizationText.replaceFirst( + '{number}', '(+91 - ${billList.bill!.first.mobileNumber})'); + Navigator.of(context).pushReplacement( + new MaterialPageRoute(builder: (BuildContext context) { + return CommonSuccess( + SuccessHandler( + ApplicationLocalizations.of(context) + .translate(i18.demandGenerate.GENERATE_BILL_SUCCESS), + localizationText, + ApplicationLocalizations.of(context) + .translate(i18.common.COLLECT_PAYMENT), + Routes.BILL_GENERATE, + downloadLink: '', + downloadLinkLabel: ApplicationLocalizations.of(context) + .translate(i18.common.DOWNLOAD), + whatsAppShare: '', + subHeader: + '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.BILL_ID_NO)}', + subHeaderText: + '${billList.bill!.first.billNumber.toString()}'), + callBack: () => + onClickOfCollectPayment(billList.bill!.first, context), + callBackDownload: () => commonProvider + .getFileFromPDFBillService({ + "Bill": [billList.bill!.first] + }, { + "key": waterconnection.connectionType == 'Metered' + ? "ws-bill" + : "ws-bill-nm", + "tenantId": + commonProvider.userDetails!.selectedtenant!.code, + }, billList.bill!.first.mobileNumber, billList.bill!.first, + "Download"), + callBackWhatsApp: () => commonProvider + .getFileFromPDFBillService({ + "Bill": [billList.bill!.first], + }, { + "key": waterconnection.connectionType == 'Metered' + ? "ws-bill" + : "ws-bill-nm", + "tenantId": + commonProvider.userDetails!.selectedtenant!.code, + }, billList.bill!.first.mobileNumber, billList.bill!.first, + "Share"), + backButton: true, + ); + })); + } catch (e) { Navigator.pop(context); Navigator.of(context).pushReplacement( new MaterialPageRoute(builder: (BuildContext context) { @@ -350,39 +356,100 @@ class BillGenerationProvider with ChangeNotifier { } } else if (formKey.currentState!.validate() && billGenerateDetails.serviceType == "Non_Metered") { - try { - Loaders.showLoadingDialog(context); - var commonProvider = Provider.of( - navigatorKey.currentContext!, - listen: false); - var res2 = { - "tenantId": commonProvider.userDetails!.selectedtenant!.code, - "billingPeriod": selectedBillPeriod - }; - var billResponse2 = await BillGenerateRepository().bulkDemand(res2); - Navigator.pop(context); - if (billResponse2 != null) { - String localizationText = getSubtitleText(context); - Navigator.of(context).pushReplacement( - new MaterialPageRoute(builder: (BuildContext context) { - return CommonSuccess(SuccessHandler( - ApplicationLocalizations.of(context) - .translate(i18.demandGenerate.GENERATE_DEMAND_SUCCESS), - localizationText, - i18.common.BACK_HOME, - Routes.BILL_GENERATE, - subHeader: - '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.BILLING_CYCLE_LABEL)}', - subTextFun: () => getLocalizedText(context), - subtitleFun: () => getSubtitleText(context))); - })); - } - } catch (e) { - Navigator.of(context).pushReplacement( - new MaterialPageRoute(builder: (BuildContext context) { - return ErrorPage(e.toString()); - })); - } + var rateProvider = Provider.of( + navigatorKey.currentContext!, + listen: false); + var rate = rateProvider.wcBillingSlabs!.wCBillingSlabs!.where((element) => element.connectionType=='Non_Metered').toList(); + showDialog(context: context, builder: (context)=>AlertDialog( + surfaceTintColor: Colors.white, + title: Text('${ApplicationLocalizations.of(context).translate(i18.common.CORE_CONFIRM)}'), + content: Container( + height: 370, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('${ApplicationLocalizations.of(context).translate(i18.demandGenerate.ARE_YOU_SURE_TO_GENERATE_DEMAND_FOR)} "${ApplicationLocalizations.of(context).translate(billGenerateDetails.serviceType!)}" ${ApplicationLocalizations.of(context).translate(i18.demandGenerate.WITH_MINIMUM_CHARGE_OF)} : '), + SizedBox(height: 10,), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: DataTable( + border: TableBorder.all( + width: 0.5, borderRadius: BorderRadius.all(Radius.circular(5))), columns: [ + DataColumn( + label: Text( + "${ApplicationLocalizations.of(context).translate(i18.searchWaterConnection.CONNECTION_TYPE)}", + style: + TextStyle(color: Colors.black, fontWeight: FontWeight.bold), + )), + DataColumn( + label: Text( + "${ApplicationLocalizations.of(context).translate(i18.common.RATE_PERCENTAGE)}", + style: + TextStyle(color: Colors.black, fontWeight: FontWeight.bold), + )),], rows: [ + ...rate.map((e) => DataRow(cells: [ + DataCell(Text( + "${ApplicationLocalizations.of(context).translate("${e.buildingType}")}")), + DataCell(Text("${e.minimumCharge}")) + ])).toList() + ],), + ), + SizedBox(height: 10,), + Text('${ApplicationLocalizations.of(context).translate(i18.demandGenerate.NO_DEMAND_GEN_WITH_RATE_0)}'), //* Note : No Demand will be generated for the Service Type with rate set to 0. + ], + ), + ), + actions: + (rateProvider.wcBillingSlabs!.wCBillingSlabs!.where((element) => element.connectionType=='Non_Metered').length- rateProvider.wcBillingSlabs!.wCBillingSlabs!.where((element) => element.connectionType=='Non_Metered' && element.minimumCharge==0).length == 0 ) + ? + [TextButton(onPressed: (){ + Navigator.pop(context); + }, child: Text('${ApplicationLocalizations.of(context).translate(i18.consumerReciepts.CLOSE)}'))] + : + [TextButton(onPressed: () async{ + if(rateProvider.wcBillingSlabs!.wCBillingSlabs!.where((element) => element.connectionType=='Non_Metered').length- rateProvider.wcBillingSlabs!.wCBillingSlabs!.where((element) => element.connectionType=='Non_Metered' && element.minimumCharge==0).length == 0 ){ + Navigator.pop(context); + Notifiers.getToastMessage(context, '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.NO_SERVICE_PRESENT_WITH_RATE_MORE_THAN_0)}', 'ERROR'); //No Service type present with rate more than 0. + return; + } + try { + Loaders.showLoadingDialog(context); + var commonProvider = Provider.of( + navigatorKey.currentContext!, + listen: false); + var res2 = { + "tenantId": commonProvider.userDetails!.selectedtenant!.code, + "billingPeriod": selectedBillPeriod + }; + var billResponse2 = await BillGenerateRepository().bulkDemand(res2); + Navigator.pop(context); + String localizationText = getSubtitleText(context); + Navigator.of(context).pushReplacement( + new MaterialPageRoute(builder: (BuildContext context) { + return CommonSuccess(SuccessHandler( + ApplicationLocalizations.of(context) + .translate(i18.demandGenerate.GENERATE_DEMAND_SUCCESS), + localizationText, + i18.common.BACK_HOME, + Routes.BILL_GENERATE, + subHeader: + '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.BILLING_CYCLE_LABEL)}', + subTextFun: () => getLocalizedText(context), + subtitleFun: () => getSubtitleText(context))); + })); + } catch (e) { + Navigator.of(context).pushReplacement( + new MaterialPageRoute(builder: (BuildContext context) { + return ErrorPage(e.toString()); + })); + } + }, child: Text('${ApplicationLocalizations.of(context).translate(i18.common.YES)}')), + TextButton(onPressed: (){ + Navigator.pop(context); + }, child: Text('${ApplicationLocalizations.of(context).translate(i18.common.NO)}')),] + , + )); } else { autoValidation = true; notifyListeners(); @@ -396,78 +463,64 @@ class BillGenerationProvider with ChangeNotifier { '${ApplicationLocalizations.of(context).translate(i18.demandGenerate.GENERATE_DEMAND_SUCCESS_SUBTEXT)}'; localizationText = localizationText.replaceFirst( '{billing cycle}', - '${ApplicationLocalizations.of(context).translate(selectedBillCycle.toString())}' + + '${ApplicationLocalizations.of(context).translate(selectedBillCycle['name'].toString())} | ' + ' ${selectedBillYear.financialYear!.toString().substring(2)}'); return localizationText; } String getLocalizedText(BuildContext context) { - return '${ApplicationLocalizations.of(context).translate(selectedBillCycle)}' + + return '${ApplicationLocalizations.of(context).translate(selectedBillCycle['name'])} | ' + ' ${selectedBillYear.financialYear!.toString().substring(2)}'; } - List> getPropertyTypeList() { + List getPropertyTypeList() { if (languageList?.mdmsRes?.propertyTax?.PropertyTypeList != null) { return (languageList?.mdmsRes?.propertyTax?.PropertyTypeList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text(value.code!), - ); + return value.code!; }).toList(); } - return >[]; + return []; } - List> getConnectionTypeList() { + List getConnectionTypeList() { if (languageList?.mdmsRes?.connection?.connectionTypeList != null) { return (languageList?.mdmsRes?.connection?.connectionTypeList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text( - ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate(value.code!)), - ); + return value.code!; }).toList(); } - return >[]; + return []; } - List> getFinancialYearList() { + List getFinancialYearList() { if (languageList?.mdmsRes?.billingService?.taxPeriodList != null) { CommonMethods.getFilteredFinancialYearList(languageList?.mdmsRes?.billingService?.taxPeriodList ?? []); languageList?.mdmsRes?.billingService?.taxPeriodList!.sort((a,b)=>a.fromDate!.compareTo(b.fromDate!)); return (languageList?.mdmsRes?.billingService?.taxPeriodList ?? []) .map((value) { - return DropdownMenuItem( - value: value, - child: new Text((value.financialYear!)), - ); + return value; }).toList().reversed.toList(); } - return >[]; + return []; } - List> getServiceCategoryList() { + List getServiceCategoryList() { if (languageList?.mdmsRes?.billingService?.taxHeadMasterList != null) { return (languageList?.mdmsRes?.billingService?.taxHeadMasterList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text((value.code!)), - ); + return value.code!; }).toList(); } - return >[]; + return []; } - List> getBillingCycle() { - dates = []; + List> getBillingCycle() { + var dates = >[]; if (billGenerateDetails.billYear != null && selectedBillYear != null) { DatePeriod ytd; var fromDate = DateFormats.getFormattedDateToDateTime( @@ -486,23 +539,16 @@ class BillGenerationProvider with ChangeNotifier { for (var i = 0; i < months.length; i++) { var prevMonth = months[i].startDate; - var r = {"code": prevMonth, "name": prevMonth}; + Map r = {"code": prevMonth, "name": "${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate((Constants.MONTHS[prevMonth.month - 1])) + + " - " + + prevMonth.year.toString()}"}; dates.add(r); } } if (dates.length > 0) { - return (dates).map((value) { - var d = value['name']; - return DropdownMenuItem( - value: value['code'].toLocal().toString(), - child: new Text( - ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate((Constants.MONTHS[d.month - 1])) + - " - " + - d.year.toString()), - ); - }).toList(); + return dates; } - return >[]; + return >[]; } } diff --git a/frontend/mgramseva/lib/providers/change_password_details_provider.dart b/frontend/mgramseva/lib/providers/change_password_details_provider.dart index 83bd560d9..beac78ded 100644 --- a/frontend/mgramseva/lib/providers/change_password_details_provider.dart +++ b/frontend/mgramseva/lib/providers/change_password_details_provider.dart @@ -19,15 +19,13 @@ class ChangePasswordProvider with ChangeNotifier { var changePasswordResponse = await ChangePasswordRepository().updatePassword(body); Navigator.pop(context); - if (changePasswordResponse != null) { - Notifiers.getToastMessage( - context, i18.password.CHANGE_PASSWORD_SUCCESS, 'SUCCESS'); - new Future.delayed(const Duration(seconds: 5), - () => Navigator.pop(context), - ); + Notifiers.getToastMessage( + context, i18.password.CHANGE_PASSWORD_SUCCESS, 'SUCCESS'); + new Future.delayed(const Duration(seconds: 5), + () => Navigator.pop(context), + ); - } - } catch (e, s) { + } catch (e, s) { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); } diff --git a/frontend/mgramseva/lib/providers/common_provider.dart b/frontend/mgramseva/lib/providers/common_provider.dart index 0b2378a41..22a16977b 100644 --- a/frontend/mgramseva/lib/providers/common_provider.dart +++ b/frontend/mgramseva/lib/providers/common_provider.dart @@ -4,6 +4,7 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter_share_me/flutter_share_me.dart'; import 'package:mgramseva/model/bill/bill_payments.dart'; import 'package:mgramseva/model/demand/demand_list.dart'; @@ -76,11 +77,9 @@ class CommonProvider with ChangeNotifier { }; var response = await CoreRepository().getLocilisation(query); - if (response != null) { - labels = localizedStrings = response; - setLocalizationLabels(response); - } - } catch (e) { + labels = localizedStrings = response; + setLocalizationLabels(response); + } catch (e) { print(e); } return labels; @@ -264,7 +263,7 @@ class CommonProvider with ChangeNotifier { Future getAppVersionDetails() async { try { var localizationList = - await CoreRepository().getMdms(initRequestBody({"tenantId": "pb"})); + await CoreRepository().getMdms(initRequestBody({"tenantId": dotenv.get('STATE_LEVEL_TENANT_ID')})); appVersion = localizationList.mdmsRes!.commonMasters!.appVersion!.first; } catch (e) { print(e.toString()); diff --git a/frontend/mgramseva/lib/providers/consumer_details_provider.dart b/frontend/mgramseva/lib/providers/consumer_details_provider.dart index 897198ddf..2048a5d92 100644 --- a/frontend/mgramseva/lib/providers/consumer_details_provider.dart +++ b/frontend/mgramseva/lib/providers/consumer_details_provider.dart @@ -152,11 +152,15 @@ class ConsumerProvider with ChangeNotifier { isEdit = true; waterconnection = data; waterconnection.getText(); - selectedcycle = DateFormats.timeStampToDate( - waterconnection.previousReadingDate, - format: 'yyyy-MM-dd') - .toString() + - " 00:00:00.000"; + selectedcycle = {'code':DateTime.fromMillisecondsSinceEpoch(waterconnection.previousReadingDate!), + 'name':"${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate(DateFormats.timeStampToDate( + waterconnection.previousReadingDate, + format: 'MMMM')) + + " - " + + DateFormats.timeStampToDate( + waterconnection.previousReadingDate, + format: 'yyyy')}"}; if (waterconnection.previousReadingDate != null && (languageList?.mdmsRes?.billingService?.taxPeriodList?.isNotEmpty ?? false)) { @@ -346,7 +350,7 @@ class ConsumerProvider with ChangeNotifier { streamController.add(property); Notifiers.getToastMessage( context, i18.consumer.REGISTER_SUCCESS, 'SUCCESS'); - selectedcycle = ''; + selectedcycle = null; waterconnection.connectionType = ''; Navigator.pop(context); } @@ -460,6 +464,7 @@ class ConsumerProvider with ChangeNotifier { } catch (e) { print(e); } + return null; } Future fetchBoundary() async { @@ -514,57 +519,43 @@ class ConsumerProvider with ChangeNotifier { notifyListeners(); } - List> getBoundaryList() { + List getBoundaryList() { if (boundaryList.length > 0) { - return (boundaryList).map((value) { - return DropdownMenuItem( - value: value, - child: new Text(value.code!), - ); - }).toList(); + return boundaryList; } - return >[]; + return []; } - List> getCategoryList() { + List getCategoryList() { if (languageList?.mdmsRes?.category != null) { return (languageList?.mdmsRes?.category?.categoryList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text((value.code!)), - ); - }).toList(); - } - return >[]; + return value.code!; + }).toList(); + } + return []; } - List> getSubCategoryList() { + List getSubCategoryList() { if (languageList?.mdmsRes?.subCategory != null) { return (languageList?.mdmsRes?.subCategory?.subcategoryList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text((value.code!)), - ); + return value.code!; }).toList(); } - return >[]; + return []; } - List> getPropertyTypeList() { + List getPropertyTypeList() { if (languageList?.mdmsRes?.propertyTax?.PropertyTypeList != null) { return (languageList?.mdmsRes?.propertyTax?.PropertyTypeList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text(value.code!), - ); + return value.code!; }).toList(); } - return >[]; + return []; } onChangeOfConnectionType(val) { @@ -582,30 +573,28 @@ class ConsumerProvider with ChangeNotifier { onChangeBillingCycle(val) { selectedcycle = val; + DateTime result = DateTime.parse(val['code'].toString()); waterconnection.previousReadingDateCtrl.clear(); - waterconnection.BillingCycleCtrl.text = selectedcycle ?? ''; - waterconnection.meterInstallationDateCtrl.text = selectedcycle ?? ''; + waterconnection.BillingCycleCtrl.text = result.toLocal().toString(); + waterconnection.meterInstallationDateCtrl.text = result.toLocal().toString(); notifyListeners(); } //Displaying ConnectionType data Fetched From MDMD (Ex Metered, Non Metered..) - List> getConnectionTypeList() { + List getConnectionTypeList() { if (languageList?.mdmsRes?.connection?.connectionTypeList != null) { return (languageList?.mdmsRes?.connection?.connectionTypeList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text((value.code!)), - ); + return value.code!; }).toList(); } - return >[]; + return []; } //Displaying Billing Cycle Vaule (EX- JAN-2021,,) - List> getBillingCycle() { - dates = []; + List> getBillingCycle() { + var dates = >[]; if (billYear != null) { DatePeriod ytd; var fromDate = DateFormats.getFormattedDateToDateTime( @@ -624,24 +613,17 @@ class ConsumerProvider with ChangeNotifier { for (var i = 0; i < months.length; i++) { var prevMonth = months[i].startDate; - var r = {"code": prevMonth, "name": prevMonth}; + var r = {"code": prevMonth, "name": '${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate((Constants.MONTHS[prevMonth.month - 1])) + + " - " + + prevMonth.year.toString()}'}; dates.add(r); } } if (dates.length > 0 && waterconnection.connectionType == 'Non_Metered') { - return (dates).map((value) { - var d = value['name']; - return DropdownMenuItem( - value: value['code'].toLocal().toString(), - child: new Text( - ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate((Constants.MONTHS[d.month - 1])) + - " - " + - d.year.toString()), - ); - }).toList(); + return dates; } - return >[]; + return >[]; } incrementIndex(index, consumerGenderKey) async { @@ -673,22 +655,17 @@ class ConsumerProvider with ChangeNotifier { notifyListeners(); } - List> getFinancialYearList() { + List getFinancialYearList() { if (languageList?.mdmsRes?.billingService?.taxPeriodList != null) { - CommonMethods.getFilteredFinancialYearList( - languageList?.mdmsRes?.billingService?.taxPeriodList ?? - []); + CommonMethods.getFilteredFinancialYearList(languageList?.mdmsRes?.billingService?.taxPeriodList ?? []); languageList?.mdmsRes?.billingService?.taxPeriodList!.sort((a,b)=>a.fromDate!.compareTo(b.fromDate!)); return (languageList?.mdmsRes?.billingService?.taxPeriodList ?? - []) + []) .map((value) { - return DropdownMenuItem( - value: value, - child: new Text((value.financialYear!)), - ); + return value; }).toList().reversed.toList(); } - return >[]; + return []; } void onChangeOfAmountType(value) { diff --git a/frontend/mgramseva/lib/providers/dashboard_provider.dart b/frontend/mgramseva/lib/providers/dashboard_provider.dart index 95f92d8cc..6798a477c 100644 --- a/frontend/mgramseva/lib/providers/dashboard_provider.dart +++ b/frontend/mgramseva/lib/providers/dashboard_provider.dart @@ -307,41 +307,39 @@ class DashBoardProvider with ChangeNotifier { isLoaderEnabled = false; if (selectedDashboardType != DashBoardType.collections) return; - if (response != null) { - if (waterConnectionsDetails == null) { - waterConnectionsDetails = response; - - if (selectedTab == 'all') { - collectionCountHolder['all'] = response.totalCount ?? 0; - propertyTaxList.forEach((key) { - collectionCountHolder[key.code!] = - int.parse(response.tabData?[key.code!] ?? '0'); - }); - } else if (searchResponse != null) { - collectionCountHolder['all'] = searchResponse.totalCount ?? 0; - propertyTaxList.forEach((key) { - collectionCountHolder[key.code!] = - int.parse(searchResponse.tabData?[key.code!] ?? '0'); - }); - } + if (waterConnectionsDetails == null) { + waterConnectionsDetails = response; - notifyListeners(); - } else { - waterConnectionsDetails?.totalCount = response.totalCount; - waterConnectionsDetails?.waterConnection - ?.addAll(response.waterConnection ?? []); + if (selectedTab == 'all') { + collectionCountHolder['all'] = response.totalCount ?? 0; + propertyTaxList.forEach((key) { + collectionCountHolder[key.code!] = + int.parse(response.tabData?[key.code!] ?? '0'); + }); + } else if (searchResponse != null) { + collectionCountHolder['all'] = searchResponse.totalCount ?? 0; + propertyTaxList.forEach((key) { + collectionCountHolder[key.code!] = + int.parse(searchResponse.tabData?[key.code!] ?? '0'); + }); } + notifyListeners(); - streamController.add(waterConnectionsDetails!.waterConnection!.isEmpty - ? [] - : waterConnectionsDetails?.waterConnection?.sublist( - offSet - 1, - ((offset + limit - 1) > - (waterConnectionsDetails?.totalCount ?? 0)) - ? (waterConnectionsDetails!.totalCount!) - : (offset + limit) - 1)); + } else { + waterConnectionsDetails?.totalCount = response.totalCount; + waterConnectionsDetails?.waterConnection + ?.addAll(response.waterConnection ?? []); } - } catch (e, s) { + notifyListeners(); + streamController.add(waterConnectionsDetails!.waterConnection!.isEmpty + ? [] + : waterConnectionsDetails?.waterConnection?.sublist( + offSet - 1, + ((offset + limit - 1) > + (waterConnectionsDetails?.totalCount ?? 0)) + ? (waterConnectionsDetails!.totalCount!) + : (offset + limit) - 1)); + } catch (e, s) { isLoaderEnabled = false; notifyListeners(); streamController.addError('error'); diff --git a/frontend/mgramseva/lib/providers/expenses_details_provider.dart b/frontend/mgramseva/lib/providers/expenses_details_provider.dart index b6495b768..c7aa47077 100644 --- a/frontend/mgramseva/lib/providers/expenses_details_provider.dart +++ b/frontend/mgramseva/lib/providers/expenses_details_provider.dart @@ -61,7 +61,7 @@ class ExpensesDetailsProvider with ChangeNotifier { Provider.of(context, listen: false); if (languageList?.mdmsRes?.expense?.expenseList != null) { var res = languageList?.mdmsRes?.pspclIntegration?.accountNumberGpMapping?.where((element) => element.departmentEntityCode==commonProvider.userDetails?.selectedtenant?.city?.code).toList(); - if(res!.isNotEmpty){ + if(res!=null && res.isNotEmpty){ isPSPCLEnabled = true; notifyListeners(); }else{ @@ -98,6 +98,7 @@ class ExpensesDetailsProvider with ChangeNotifier { if(this.expenditureDetails.expenseType=='ELECTRICITY_BILL' && isPSPCLEnabled){ this.expenditureDetails.allowEdit = false; } + notifyListeners(); streamController.add(this.expenditureDetails); } on CustomException catch (e, s) { ErrorHandler.handleApiException(context, e, s); @@ -545,25 +546,22 @@ class ExpensesDetailsProvider with ChangeNotifier { notifyListeners(); } - List> getExpenseTypeList({bool isSearch=false}) { + List getExpenseTypeList({bool isSearch=false}) { var commonProvider = Provider.of( navigatorKey.currentContext!, listen: false); if (languageList?.mdmsRes?.expense?.expenseList != null) { var res = languageList?.mdmsRes?.pspclIntegration?.accountNumberGpMapping?.where((element) => element.departmentEntityCode==commonProvider.userDetails?.selectedtenant?.city?.code).toList(); - var temp_list = languageList?.mdmsRes?.expense?.expenseList?.toList(); - if(res!.isNotEmpty){ - isSearch?{}:temp_list!.removeWhere((element) => element.code=="ELECTRICITY_BILL"); + var tempList = languageList?.mdmsRes?.expense?.expenseList?.toList(); + if(res!=null && res.isNotEmpty){ + isSearch?{}:tempList!.removeWhere((element) => element.code=="ELECTRICITY_BILL"); } - return (temp_list ?? []) + return (tempList ?? []) .map((value) { - return DropdownMenuItem( - value: value.code, - child: new Text((value.code!)), - ); + return value.code; }).toList(); } - return >[]; + return []; } incrementindex(index, expenseKey) async { @@ -584,6 +582,7 @@ class ExpensesDetailsProvider with ChangeNotifier { Vendor(vendorList[index].name.trim(), vendorList[index].id); expenditureDetails.selectedVendor?.owner ??= Owner(mobileNumber); } + notifyListeners(); } callNotifyer() { diff --git a/frontend/mgramseva/lib/providers/fetch_bill_provider.dart b/frontend/mgramseva/lib/providers/fetch_bill_provider.dart index 274c63d5a..c3b71941f 100644 --- a/frontend/mgramseva/lib/providers/fetch_bill_provider.dart +++ b/frontend/mgramseva/lib/providers/fetch_bill_provider.dart @@ -19,23 +19,17 @@ class FetchBillProvider with ChangeNotifier { "consumerCode": data.connectionNo.toString(), "businessService": "WS" }); - if (res != null) { - if (res.bill!.isNotEmpty) { - res.bill?.first.billDetails - ?.sort((a, b) => b.fromPeriod!.compareTo(a.fromPeriod!)); - billList = res; - streamController.add(res); - } else { - billList = new BillList(); - billList.bill = []; - streamController.add(billList); - } + if (res.bill!.isNotEmpty) { + res.bill?.first.billDetails + ?.sort((a, b) => b.fromPeriod!.compareTo(a.fromPeriod!)); + billList = res; + streamController.add(res); } else { billList = new BillList(); billList.bill = []; streamController.add(billList); } - } catch (e, s) { + } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); streamController.addError('error'); } diff --git a/frontend/mgramseva/lib/providers/forgot_password_provider.dart b/frontend/mgramseva/lib/providers/forgot_password_provider.dart index a699d3cec..f64ec3835 100644 --- a/frontend/mgramseva/lib/providers/forgot_password_provider.dart +++ b/frontend/mgramseva/lib/providers/forgot_password_provider.dart @@ -30,11 +30,9 @@ class ForgotPasswordProvider with ChangeNotifier { await ForgotPasswordRepository().forgotPassword(body, context); Navigator.pop(context); - if (otpResponse != null) { - Navigator.of(context) - .pushNamed(Routes.RESET_PASSWORD, arguments: {"id": mobileNumber}); - } - } catch (e, s) { + Navigator.of(context) + .pushNamed(Routes.RESET_PASSWORD, arguments: {"id": mobileNumber}); + } catch (e, s) { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); } diff --git a/frontend/mgramseva/lib/providers/household_details_provider.dart b/frontend/mgramseva/lib/providers/household_details_provider.dart index fe59b7e33..98a40253e 100644 --- a/frontend/mgramseva/lib/providers/household_details_provider.dart +++ b/frontend/mgramseva/lib/providers/household_details_provider.dart @@ -61,8 +61,7 @@ class HouseHoldProvider with ChangeNotifier { "tenantId": commonProvider.userDetails!.selectedtenant!.code, ...{'connectionNumber': id}, }); - if (res != null && - res.waterConnection != null && + if (res.waterConnection != null && res.waterConnection!.isNotEmpty) { data = res.waterConnection!.first; } diff --git a/frontend/mgramseva/lib/providers/household_register_provider.dart b/frontend/mgramseva/lib/providers/household_register_provider.dart index 476f5c067..abdc982d1 100644 --- a/frontend/mgramseva/lib/providers/household_register_provider.dart +++ b/frontend/mgramseva/lib/providers/household_register_provider.dart @@ -128,40 +128,38 @@ class HouseholdRegisterProvider with ChangeNotifier { isLoaderEnabled = false; - if (response != null) { - if (selectedTab == Constants.ALL) { - collectionCountHolder[Constants.ALL] = response.totalCount ?? 0; - collectionCountHolder[Constants.PAID] = - response.collectionDataCount?.collectionPaid ?? 0; - collectionCountHolder[Constants.PENDING] = - response.collectionDataCount?.collectionPending ?? 0; - } else if (searchResponse != null) { - collectionCountHolder[Constants.ALL] = searchResponse.totalCount ?? 0; - collectionCountHolder[Constants.PAID] = - searchResponse.collectionDataCount?.collectionPaid ?? 0; - collectionCountHolder[Constants.PENDING] = - searchResponse.collectionDataCount?.collectionPending ?? 0; - } - - if (waterConnectionsDetails == null) { - waterConnectionsDetails = response; - notifyListeners(); - } else { - waterConnectionsDetails?.totalCount = response.totalCount; - waterConnectionsDetails?.waterConnection - ?.addAll(response.waterConnection ?? []); - } + if (selectedTab == Constants.ALL) { + collectionCountHolder[Constants.ALL] = response.totalCount ?? 0; + collectionCountHolder[Constants.PAID] = + response.collectionDataCount?.collectionPaid ?? 0; + collectionCountHolder[Constants.PENDING] = + response.collectionDataCount?.collectionPending ?? 0; + } else if (searchResponse != null) { + collectionCountHolder[Constants.ALL] = searchResponse.totalCount ?? 0; + collectionCountHolder[Constants.PAID] = + searchResponse.collectionDataCount?.collectionPaid ?? 0; + collectionCountHolder[Constants.PENDING] = + searchResponse.collectionDataCount?.collectionPending ?? 0; + } + + if (waterConnectionsDetails == null) { + waterConnectionsDetails = response; notifyListeners(); - streamController.add(waterConnectionsDetails!.waterConnection!.isEmpty - ? [] - : waterConnectionsDetails?.waterConnection?.sublist( - offSet - 1, - ((offset + limit - 1) > - (waterConnectionsDetails?.totalCount ?? 0)) - ? (waterConnectionsDetails!.totalCount!) - : (offset + limit) - 1)); + } else { + waterConnectionsDetails?.totalCount = response.totalCount; + waterConnectionsDetails?.waterConnection + ?.addAll(response.waterConnection ?? []); } - } catch (e, s) { + notifyListeners(); + streamController.add(waterConnectionsDetails!.waterConnection!.isEmpty + ? [] + : waterConnectionsDetails?.waterConnection?.sublist( + offSet - 1, + ((offset + limit - 1) > + (waterConnectionsDetails?.totalCount ?? 0)) + ? (waterConnectionsDetails!.totalCount!) + : (offset + limit) - 1)); + } catch (e, s) { isLoaderEnabled = false; notifyListeners(); streamController.addError('error'); diff --git a/frontend/mgramseva/lib/providers/language.dart b/frontend/mgramseva/lib/providers/language.dart index 263a26fe3..3cfff2860 100644 --- a/frontend/mgramseva/lib/providers/language.dart +++ b/frontend/mgramseva/lib/providers/language.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:mgramseva/model/localization/language.dart'; import 'package:mgramseva/repository/core_repo.dart'; import 'package:mgramseva/services/local_storage.dart'; @@ -36,7 +37,7 @@ class LanguageProvider with ChangeNotifier { streamController.add(stateInfos); } else { var localizationList = - await CoreRepository().getMdms(initRequestBody({"tenantId": "pb"})); + await CoreRepository().getMdms(initRequestBody({"tenantId": dotenv.get('STATE_LEVEL_TENANT_ID')})); stateInfo = localizationList.mdmsRes?.commonMasters?.stateInfo?.first; if (stateInfo != null) { stateInfo?.languages?.first.isSelected = true; diff --git a/frontend/mgramseva/lib/providers/notification_screen_provider.dart b/frontend/mgramseva/lib/providers/notification_screen_provider.dart index 884c062c6..891d11d38 100644 --- a/frontend/mgramseva/lib/providers/notification_screen_provider.dart +++ b/frontend/mgramseva/lib/providers/notification_screen_provider.dart @@ -28,7 +28,7 @@ class NotificationScreenProvider with ChangeNotifier { var commonProvider = Provider.of( navigatorKey.currentContext!, listen: false); - if (notifications != null && notifications.length > 0) { + if (notifications.length > 0) { final jsonList = notifications.map((item) => jsonEncode(item)).toList(); final uniqueJsonList = jsonList.toSet().toList(); var result = new EventsList.fromJson( diff --git a/frontend/mgramseva/lib/providers/notifications_provider.dart b/frontend/mgramseva/lib/providers/notifications_provider.dart index 14f29ae50..ddf39661d 100644 --- a/frontend/mgramseva/lib/providers/notifications_provider.dart +++ b/frontend/mgramseva/lib/providers/notifications_provider.dart @@ -22,7 +22,7 @@ class NotificationProvider with ChangeNotifier { List res = [] ..addAll(notifications2!.events!) ..addAll(notifications1!.events!); - if (res != null && res.length > 0) { + if (res.length > 0) { final jsonList = res.map((item) => jsonEncode(item)).toList(); final uniqueJsonList = jsonList.toSet().toList(); var result = EventsList.fromJson({ diff --git a/frontend/mgramseva/lib/providers/reports_provider.dart b/frontend/mgramseva/lib/providers/reports_provider.dart index 6b20c213f..bbc0480b1 100644 --- a/frontend/mgramseva/lib/providers/reports_provider.dart +++ b/frontend/mgramseva/lib/providers/reports_provider.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:mgramseva/model/reports/InactiveConsumerReportData.dart'; -import 'package:mgramseva/utils/common_widgets.dart'; +import 'package:mgramseva/model/reports/vendor_report_data.dart'; import 'package:provider/provider.dart'; import 'package:syncfusion_flutter_xlsio/xlsio.dart'; @@ -11,6 +11,7 @@ import '../model/localization/language.dart'; import '../model/mdms/tax_period.dart'; import '../model/reports/bill_report_data.dart'; import '../model/reports/collection_report_data.dart'; +import '../model/reports/expense_bill_report_data.dart'; import '../repository/core_repo.dart'; import '../repository/reports_repo.dart'; import '../utils/common_methods.dart'; @@ -28,7 +29,7 @@ import 'package:mgramseva/services/mdms.dart' as mdms; class ReportsProvider with ChangeNotifier { var streamController = StreamController.broadcast(); - LanguageList? languageList; + LanguageList? billingYearList; var selectedBillYear; var selectedBillPeriod; var selectedBillCycle; @@ -37,6 +38,8 @@ class ReportsProvider with ChangeNotifier { List? demandreports; List? collectionreports; List? inactiveconsumers; + List? expenseBillReportData; + List? vendorReportData; BillsTableData genericTableData = BillsTableData([], []); int limit = 10; int offset = 1; @@ -89,6 +92,27 @@ class ReportsProvider with ChangeNotifier { TableHeader(i18.common.INACTIVATED_DATE), TableHeader(i18.common.INACTIVATED_BY_NAME), ]; + List get expenseBillReportHeaderList => [ + TableHeader(i18.expense.EXPENSE_TYPE), + TableHeader(i18.expense.VENDOR_NAME), + TableHeader(i18.expense.AMOUNT), + TableHeader(i18.expense.BILL_DATE), + TableHeader(i18.expense.EXPENSE_START_DATE), + TableHeader(i18.expense.EXPENSE_END_DATE), + TableHeader(i18.expense.APPLICATION_STATUS), + TableHeader(i18.expense.PAID_DATE), + TableHeader(i18.expense.HAS_ATTACHMENT), + TableHeader(i18.expense.CANCELLED_TIME), + TableHeader(i18.expense.CANCELLED_BY), + + ]; + + List get vendorReportHeaderList => [ + TableHeader(i18.expense.VENDOR_NAME), + TableHeader(i18.common.MOBILE_NUMBER), + TableHeader(i18.expense.EXPENSE_TYPE), + TableHeader(i18.common.BILL_ID), + ]; void onChangeOfPageLimit( PaginationResponse response, String type, BuildContext context) { @@ -101,6 +125,12 @@ class ReportsProvider with ChangeNotifier { if (type == i18.dashboard.INACTIVE_CONSUMER_REPORT) { getInactiveConsumerReport(limit: response.limit, offset: response.offset); } + if (type == i18.dashboard.EXPENSE_BILL_REPORT) { + getExpenseBillReport(limit: response.limit, offset: response.offset); + } + if (type == i18.dashboard.VENDOR_REPORT) { + getVendorReport(limit: response.limit, offset: response.offset); + } } List getDemandsData(List list, @@ -173,21 +203,71 @@ class ReportsProvider with ChangeNotifier { TableData('${inactivatedBy ?? '-'}'), ]); } + List getExpenseBillReportData(List list, + {bool isExcel = false}) { + return list.map((e) => getExpenseBillReportDataRow(e, isExcel: isExcel)).toList(); + } + TableDataRow getExpenseBillReportDataRow(ExpenseBillReportData data, + {bool isExcel = false}) { + String? vendorName = CommonMethods.truncateWithEllipsis(20, data.vendorName!); + String? typeOfExpense = CommonMethods.truncateWithEllipsis(20, data.typeOfExpense!); + String? applicationStatus = CommonMethods.truncateWithEllipsis(20, data.applicationStatus!); + String? lastModifiedBy = CommonMethods.truncateWithEllipsis(20, data.lastModifiedBy!); + String? fileLink = CommonMethods.truncateWithEllipsis(20, data.filestoreid!); + var billDate = DateFormats.timeStampToDate(data.billDate?.toInt(),format: "dd/MM/yyyy"); + var taxPeriodFrom = DateFormats.timeStampToDate(data.taxPeriodFrom?.toInt(),format: "dd/MM/yyyy"); + var taxPeriodTo = DateFormats.timeStampToDate(data.taxPeriodTo?.toInt(),format: "dd/MM/yyyy"); + var paidDate = data.paidDate==0?'-':DateFormats.timeStampToDate(data.paidDate?.toInt(),format: "dd/MM/yyyy"); + var lastModifiedTime = data.lastModifiedTime==0?'-':DateFormats.timeStampToDate(data.lastModifiedTime?.toInt(),format: "dd/MM/yyyy"); + return TableDataRow([ + TableData('${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(typeOfExpense ?? '-')}'), + TableData('${vendorName ?? '-'}'), + TableData('${data.amount ?? '-'}'), + TableData('${billDate ?? '-'}'), + TableData('${taxPeriodFrom ?? '-'}'), + TableData('${taxPeriodTo ?? '-'}'), + TableData('${applicationStatus ?? '-'}'), + TableData('${paidDate ?? '-'}'), + TableData('${fileLink ?? '-'}'), + TableData('${lastModifiedTime ?? '-'}'), + TableData('${lastModifiedBy ?? '-'}'), + ]); + } + List getVendorReportData(List list, + {bool isExcel = false}) { + return list.map((e) => getVendorReportDataRow(e, isExcel: isExcel)).toList(); + } + TableDataRow getVendorReportDataRow(VendorReportData data, + {bool isExcel = false}) { + String? vendorName = CommonMethods.truncateWithEllipsis(20, data.vendorName!); + String? typeOfExpense = CommonMethods.truncateWithEllipsis(20, data.typeOfExpense!); + String? billId = CommonMethods.truncateWithEllipsis(20, data.billId!); + return TableDataRow([ + TableData('${vendorName ?? '-'}'), + TableData('${data.mobileNo ?? '-'}'), + TableData('${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(typeOfExpense ?? '-')}'), + TableData('${billId ?? '-'}'), + ]); + } + void callNotifier() { notifyListeners(); } void onChangeOfBillYear(val) { selectedBillYear = val; + print(val.toString()); + billingyearCtrl.text = val.toString(); billingcycleCtrl.clear(); selectedBillCycle = null; selectedBillPeriod = null; notifyListeners(); } - void onChangeOfBillCycle(val) { - var result = DateTime.parse(val); - selectedBillCycle = (DateFormats.getMonth(result)); + void onChangeOfBillCycle(cycle) { + var val = cycle['code']; + var result = DateTime.parse(val.toString()); + selectedBillCycle = cycle; selectedBillPeriod = (DateFormats.getFilteredDate( result.toLocal().toString(), dateFormat: "dd/MM/yyyy")) + @@ -207,16 +287,70 @@ class ReportsProvider with ChangeNotifier { listen: false); var res = await CoreRepository().getMdms(mdms.getTenantFinancialYearList( commonProvider.userDetails!.userRequest!.tenantId.toString())); - languageList = res; + billingYearList = res; notifyListeners(); - streamController.add(languageList); + streamController.add(billingYearList); } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); streamController.addError('error'); } } + List getFinancialYearListDropdownA( + LanguageList? languageList) { + if (languageList?.mdmsRes?.billingService?.taxPeriodList != null) { + CommonMethods.getFilteredFinancialYearList( + languageList?.mdmsRes?.billingService?.taxPeriodList ?? + []); + languageList?.mdmsRes?.billingService?.taxPeriodList! + .sort((a, b) => a.fromDate!.compareTo(b.fromDate!)); + return (languageList?.mdmsRes?.billingService?.taxPeriodList ?? + []) + .reversed + .toList(); + } + return []; + } + List> getBillingCycleDropdownA( + dynamic selectedBillYear) { + List> dates = []; + if (selectedBillYear != null) { + DatePeriod ytd; + var fromDate = DateFormats.getFormattedDateToDateTime( + DateFormats.timeStampToDate(selectedBillYear.fromDate)) as DateTime; + + var toDate = DateFormats.getFormattedDateToDateTime( + DateFormats.timeStampToDate(selectedBillYear.toDate)) as DateTime; + + ytd = DatePeriod(fromDate, toDate, DateType.YTD); + + /// Get months based on selected billing year + var months = CommonMethods.getPastMonthUntilFinancialYTD(ytd, + showCurrentMonth: true); - List> getFinancialYearListDropdown( + /// if selected year is future year means all the months will be removed + if (fromDate.year > ytd.endDate.year) months.clear(); + + for (var i = 0; i < months.length; i++) { + var prevMonth = months[i].startDate; + var r = {"code": prevMonth, "name": '${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate((Constants.MONTHS[prevMonth.month - 1])) + + " - " + + prevMonth.year.toString()}'}; + dates.add(r); + } + } + // if (dates.length > 0) { + // return (dates).map((value) { + // var d = value['name']; + // return "${ApplicationLocalizations.of(navigatorKey.currentContext!) + // .translate((Constants.MONTHS[d.month - 1])) + + // " - " + + // d.year.toString()}"; + // }).toList(); + // } + return dates; + } + List getFinancialYearListDropdown( LanguageList? languageList) { if (languageList?.mdmsRes?.billingService?.taxPeriodList != null) { CommonMethods.getFilteredFinancialYearList( @@ -227,21 +361,18 @@ class ReportsProvider with ChangeNotifier { return (languageList?.mdmsRes?.billingService?.taxPeriodList ?? []) .map((value) { - return DropdownMenuItem( - value: value, - child: new Text((value.financialYear!)), - ); + return value; }) .toList() .reversed .toList(); } - return >[]; + return []; } - List> getBillingCycleDropdown( + List> getBillingCycleDropdown( dynamic selectedBillYear) { - var dates = []; + var dates = >[]; if (selectedBillYear != null) { DatePeriod ytd; var fromDate = DateFormats.getFormattedDateToDateTime( @@ -261,24 +392,17 @@ class ReportsProvider with ChangeNotifier { for (var i = 0; i < months.length; i++) { var prevMonth = months[i].startDate; - var r = {"code": prevMonth, "name": prevMonth}; + Map r = {"code": prevMonth, "name": "${ApplicationLocalizations.of(navigatorKey.currentContext!) + .translate((Constants.MONTHS[prevMonth.month - 1])) + + " - " + + prevMonth.year.toString()}"}; dates.add(r); } } if (dates.length > 0) { - return (dates).map((value) { - var d = value['name']; - return DropdownMenuItem( - value: value['code'].toLocal().toString(), - child: new Text( - ApplicationLocalizations.of(navigatorKey.currentContext!) - .translate((Constants.MONTHS[d.month - 1])) + - " - " + - d.year.toString()), - ); - }).toList(); + return dates; } - return >[]; + return >[]; } Future getDemandReport( @@ -291,7 +415,7 @@ class ReportsProvider with ChangeNotifier { navigatorKey.currentContext!, listen: false); if (selectedBillPeriod == null) { - throw Exception('Select Billing Cycle'); + throw Exception('${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.common.SELECT_BILLING_CYCLE)}'); } Map params = { 'tenantId': commonProvider.userDetails!.selectedtenant!.code, @@ -357,7 +481,7 @@ class ReportsProvider with ChangeNotifier { navigatorKey.currentContext!, listen: false); if (selectedBillPeriod == null) { - throw Exception('Select Billing Cycle'); + throw Exception('${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.common.SELECT_BILLING_CYCLE)}'); } Map params = { 'tenantId': commonProvider.userDetails!.selectedtenant!.code, @@ -423,7 +547,7 @@ class ReportsProvider with ChangeNotifier { navigatorKey.currentContext!, listen: false); if (selectedBillPeriod == null) { - throw Exception('Select Billing Cycle'); + throw Exception('${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.common.SELECT_BILLING_CYCLE)}'); } Map params = { 'tenantId': commonProvider.userDetails!.selectedtenant!.code, @@ -478,6 +602,135 @@ class ReportsProvider with ChangeNotifier { callNotifier(); } } + Future getExpenseBillReport( + {bool download = false, + int offset = 1, + int limit = 10, + String sortOrder = "ASC"}) async { + try { + var commonProvider = Provider.of( + navigatorKey.currentContext!, + listen: false); + if (selectedBillPeriod == null) { + throw Exception('${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.common.SELECT_BILLING_CYCLE)}'); + } + Map params = { + 'tenantId': commonProvider.userDetails!.selectedtenant!.code, + 'monthstartDate': selectedBillPeriod?.split('-')[0], + 'monthendDate': selectedBillPeriod?.split('-')[1], + 'offset': '${offset - 1}', + 'limit': '${download ? -1 : limit}', + 'sortOrder': '$sortOrder' + }; + var response = await ReportsRepo().fetchExpenseBillReport(params); + if (response != null) { + expenseBillReportData = response; + if (download) { + generateExcel( + expenseBillReportHeaderList + .map((e) => + '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(e.label)}') + .toList(), + getExpenseBillReportData(expenseBillReportData!, isExcel: true) + .map>( + (e) => e.tableRow.map((e) => e.label).toList()) + .toList() ?? + [], + title: + 'ExpenseBillReport_${commonProvider.userDetails?.selectedtenant?.code?.substring(3)}_${selectedBillPeriod.toString().replaceAll('/', '_')}', + optionalData: [ + 'Expense Bill Report', + '$selectedBillPeriod', + '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(commonProvider.userDetails!.selectedtenant!.code!)}', + '${commonProvider.userDetails?.selectedtenant?.code?.substring(3)}', + 'Downloaded On ${DateFormats.timeStampToDate(DateTime.now().millisecondsSinceEpoch, format: 'dd/MMM/yyyy')}' + ]); + } else { + if (expenseBillReportData != null && expenseBillReportData!.isNotEmpty) { + this.limit = limit; + this.offset = offset; + this.genericTableData = BillsTableData( + expenseBillReportHeaderList, getExpenseBillReportData(expenseBillReportData!)); + } + } + streamController.add(response); + callNotifier(); + } else { + streamController.add('error'); + throw Exception('API Error'); + } + } + catch (e, s) { + ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); + streamController.addError('error'); + callNotifier(); + } + } + + Future getVendorReport( + {bool download = false, + int offset = 1, + int limit = 10, + String sortOrder = "ASC"}) async { + try { + var commonProvider = Provider.of( + navigatorKey.currentContext!, + listen: false); + if (selectedBillPeriod == null) { + throw Exception('${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.common.SELECT_BILLING_CYCLE)}'); + } + Map params = { + 'tenantId': commonProvider.userDetails!.selectedtenant!.code, + 'monthStartDate': selectedBillPeriod?.split('-')[0], + 'monthEndDate': selectedBillPeriod?.split('-')[1], + 'offset': '${offset - 1}', + 'limit': '${download ? -1 : limit}', + 'sortOrder': '$sortOrder' + }; + var response = await ReportsRepo().fetchVendorReport(params); + if (response != null) { + vendorReportData = response; + if (download) { + generateExcel( + vendorReportHeaderList + .map((e) => + '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(e.label)}') + .toList(), + getVendorReportData(vendorReportData!, isExcel: true) + .map>( + (e) => e.tableRow.map((e) => e.label).toList()) + .toList() ?? + [], + title: + 'VendorReport_${commonProvider.userDetails?.selectedtenant?.code?.substring(3)}_${selectedBillPeriod.toString().replaceAll('/', '_')}', + optionalData: [ + 'Vendor Report', + '$selectedBillPeriod', + '${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(commonProvider.userDetails!.selectedtenant!.code!)}', + '${commonProvider.userDetails?.selectedtenant?.code?.substring(3)}', + 'Downloaded On ${DateFormats.timeStampToDate(DateTime.now().millisecondsSinceEpoch, format: 'dd/MMM/yyyy')}' + ]); + } else { + if (vendorReportData != null && vendorReportData!.isNotEmpty) { + this.limit = limit; + this.offset = offset; + this.genericTableData = BillsTableData( + vendorReportHeaderList, getVendorReportData(vendorReportData!)); + } + } + streamController.add(response); + callNotifier(); + } else { + streamController.add('error'); + throw Exception('API Error'); + } + } + catch (e, s) { + ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); + streamController.addError('error'); + callNotifier(); + } + } void clearBuildTableData() { genericTableData = BillsTableData([], []); diff --git a/frontend/mgramseva/lib/providers/revenue_dashboard_provider.dart b/frontend/mgramseva/lib/providers/revenue_dashboard_provider.dart index e2c7f8ceb..ab687738c 100644 --- a/frontend/mgramseva/lib/providers/revenue_dashboard_provider.dart +++ b/frontend/mgramseva/lib/providers/revenue_dashboard_provider.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:community_charts_flutter/community_charts_flutter.dart' as charts; import 'package:flutter/material.dart'; import 'package:mgramseva/model/dashboard/revenue_dashboard.dart'; import 'package:mgramseva/providers/common_provider.dart'; @@ -14,7 +15,6 @@ import 'package:mgramseva/model/dashboard/revenue_dashboard.dart' as expense; import '../screeens/dashboard/revenue_expense_dashboard/revenue.dart'; import 'dashboard_provider.dart'; -import 'package:charts_flutter/flutter.dart' as charts; class RevenueDashboard with ChangeNotifier { int selectedIndex = 0; diff --git a/frontend/mgramseva/lib/providers/search_connection_provider.dart b/frontend/mgramseva/lib/providers/search_connection_provider.dart index 5beab8563..e5ea0342b 100644 --- a/frontend/mgramseva/lib/providers/search_connection_provider.dart +++ b/frontend/mgramseva/lib/providers/search_connection_provider.dart @@ -59,7 +59,7 @@ class SearchConnectionProvider with ChangeNotifier { try { Loaders.showLoadingDialog(context); var inputJson = searchconnection.toJson(); - inputJson.removeWhere((key, value) => key == null || value == ""); + inputJson.removeWhere((key, value) => value == ""); var connectionresults = isNameSearch == true ? SearchConnectionRepository().getConnectionName({ "tenantId": commonProvider.userDetails!.selectedtenant!.code, ...inputJson @@ -70,30 +70,28 @@ class SearchConnectionProvider with ChangeNotifier { /// popping the loader - if (connectionresults != null) { - connectionresults.then( - (value) => { - Navigator.pop(context), - if (value.waterConnectionData!.length > 0 || value.waterConnection!.length > 0) - { - waterConnections = value, - Navigator.pushNamed( - context, Routes.SEARCH_CONSUMER_RESULT, - arguments: {...inputJson, ...arguments, "isNameSearch" : isNameSearch }) - } - else - { - Notifiers.getToastMessage( - context, - i18.searchWaterConnection.NO_CONNECTION_FOUND, - "ERROR") - } - }, onError: (e, s) { - Navigator.pop(context); - ErrorHandler().allExceptionsHandler(context, e, s); - }); - } - } catch (e, s) { + connectionresults.then( + (value) => { + Navigator.pop(context), + if (value.waterConnectionData!.length > 0 || value.waterConnection!.length > 0) + { + waterConnections = value, + Navigator.pushNamed( + context, Routes.SEARCH_CONSUMER_RESULT, + arguments: {...inputJson, ...arguments, "isNameSearch" : isNameSearch }) + } + else + { + Notifiers.getToastMessage( + context, + i18.searchWaterConnection.NO_CONNECTION_FOUND, + "ERROR") + } + }, onError: (e, s) { + Navigator.pop(context); + ErrorHandler().allExceptionsHandler(context, e, s); + }); + } catch (e, s) { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); } diff --git a/frontend/mgramseva/lib/providers/tenants_provider.dart b/frontend/mgramseva/lib/providers/tenants_provider.dart index fe45b15f4..90d6c4e41 100644 --- a/frontend/mgramseva/lib/providers/tenants_provider.dart +++ b/frontend/mgramseva/lib/providers/tenants_provider.dart @@ -25,11 +25,9 @@ class TenantsProvider with ChangeNotifier { navigatorKey.currentContext!, listen: false); var userResponse = await TenantRepo().fetchTenants(getTenantsMDMS(commonProvider.userDetails!.userRequest!.tenantId.toString())); - if (userResponse != null) { - tenants = userResponse; - streamController.add(userResponse); - } - } catch (e, s) { + tenants = userResponse; + streamController.add(userResponse); + } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); streamController.addError('error'); } diff --git a/frontend/mgramseva/lib/providers/user_edit_profile_provider.dart b/frontend/mgramseva/lib/providers/user_edit_profile_provider.dart index ac0c6e111..91a205bfd 100644 --- a/frontend/mgramseva/lib/providers/user_edit_profile_provider.dart +++ b/frontend/mgramseva/lib/providers/user_edit_profile_provider.dart @@ -25,21 +25,18 @@ class UserEditProfileProvider with ChangeNotifier { var edituserResponse = await UserEditProfileRepository().editProfile(body); Navigator.pop(context); - if (edituserResponse != null) { - Notifiers.getToastMessage( - context, i18.profileEdit.PROFILE_EDIT_SUCCESS, 'SUCCESS'); - streamController.add(edituserResponse); - if(edituserResponse.user?.isNotEmpty ?? false) { - Provider.of(context, listen: false) - ..userDetails?.userRequest?.name = edituserResponse.user?.first.name - ..userDetails?.userRequest?.emailId = edituserResponse.user?.first - .emailId - ..loginCredentials = Provider.of(context, listen: false).userDetails; - } - Navigator.pop(context); - Navigator.pop(context); + Notifiers.getToastMessage( + context, i18.profileEdit.PROFILE_EDIT_SUCCESS, 'SUCCESS'); + streamController.add(edituserResponse); + if(edituserResponse.user?.isNotEmpty ?? false) { + Provider.of(context, listen: false) + ..userDetails?.userRequest?.name = edituserResponse.user?.first.name + ..userDetails?.userRequest?.emailId = edituserResponse.user?.first + .emailId + ..loginCredentials = Provider.of(context, listen: false).userDetails; } - } catch (e, s) { + Navigator.pop(context); + } catch (e, s) { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); } diff --git a/frontend/mgramseva/lib/providers/user_profile_provider.dart b/frontend/mgramseva/lib/providers/user_profile_provider.dart index 2a1bad62d..3c2f2cfc0 100644 --- a/frontend/mgramseva/lib/providers/user_profile_provider.dart +++ b/frontend/mgramseva/lib/providers/user_profile_provider.dart @@ -19,11 +19,9 @@ class UserProfileProvider with ChangeNotifier { Future getUserProfileDetails(body, BuildContext context) async { try { var userResponse = await UserProfileRepository().getProfile(body); - if (userResponse != null) { - streamController.add(userResponse.user?.first); - profileDetails = userResponse.user!.first; - } - } catch (e, s) { + streamController.add(userResponse.user?.first); + profileDetails = userResponse.user!.first; + } catch (e, s) { ErrorHandler().allExceptionsHandler(context, e, s); streamController.addError('error'); } diff --git a/frontend/mgramseva/lib/repository/core_repo.dart b/frontend/mgramseva/lib/repository/core_repo.dart index 1b83ffcdd..b65bd4d97 100644 --- a/frontend/mgramseva/lib/repository/core_repo.dart +++ b/frontend/mgramseva/lib/repository/core_repo.dart @@ -248,12 +248,11 @@ class CoreRepository extends BaseService { headers: header, body: jsonEncode({"url": inputUrl})); - if (response.body != null) { - return response.body; - } - } catch (e, s) { + return response.body; + } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); } + return null; } Future getFileStorefromPdfService(body, params) async { @@ -288,6 +287,7 @@ class CoreRepository extends BaseService { } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); } + return null; } Future fetchNotifications(params) async { @@ -320,6 +320,7 @@ class CoreRepository extends BaseService { } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); } + return null; } Future updateNotifications(events) async { @@ -350,6 +351,7 @@ class CoreRepository extends BaseService { } catch (e, s) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e, s); } + return null; } Future fileDownload(BuildContext context, String url, @@ -370,11 +372,19 @@ class CoreRepository extends BaseService { } else if (Platform.isIOS) { downloadPath = (await getApplicationDocumentsDirectory()).path; } else { - downloadPath = (await getExternalStorageDirectory())?.path; + downloadPath = (await getDownloadsDirectory())?.path; } var status = await Permission.storage.status; + var status2 = await Permission.photos.status; + var status1 = await Permission.notification.status; if (!status.isGranted) { await Permission.storage.request(); + }if (!status1.isGranted) { + await Permission.notification.request(); + } + if (!status2.isGranted) { + await Permission.photos.request(); + await Permission.videos.request(); } final response = await FlutterDownloader.enqueue( @@ -392,6 +402,7 @@ class CoreRepository extends BaseService { } catch (e, s) { ErrorHandler().allExceptionsHandler(context, e, s); } + return null; } Future submitFeedBack(Map body) async { diff --git a/frontend/mgramseva/lib/repository/reports_repo.dart b/frontend/mgramseva/lib/repository/reports_repo.dart index 575853ebc..4dc71a920 100644 --- a/frontend/mgramseva/lib/repository/reports_repo.dart +++ b/frontend/mgramseva/lib/repository/reports_repo.dart @@ -1,3 +1,5 @@ +import 'package:mgramseva/model/reports/expense_bill_report_data.dart'; +import 'package:mgramseva/model/reports/vendor_report_data.dart'; import 'package:mgramseva/services/urls.dart'; import 'package:mgramseva/services/base_service.dart'; import 'package:provider/provider.dart'; @@ -121,4 +123,75 @@ class ReportsRepo extends BaseService{ } return inactiveConsumers; } + Future?> fetchExpenseBillReport(Map params, + [String? token]) async { + var commonProvider = Provider.of( + navigatorKey.currentContext!, + listen: false); + List? expenseBillReports; + final requestInfo = RequestInfo( + APIConstants.API_MODULE_NAME, + APIConstants.API_VERSION, + APIConstants.API_TS, + '_get', + APIConstants.API_DID, + APIConstants.API_KEY, + APIConstants.API_MESSAGE_ID, + commonProvider.userDetails?.accessToken, + commonProvider.userDetails?.userRequest?.toJson()); + + var res = await makeRequest( + url: Url.EXPENSE_BILL_REPORT, + queryParameters: params, + requestInfo: requestInfo, + body: {}, + method: RequestType.POST); + if (res != null && res['ExpenseBillReportData'] != null) { + try { + expenseBillReports = []; + res['ExpenseBillReportData'].forEach((val){ + expenseBillReports?.add(ExpenseBillReportData.fromJson(val)); + }); + } catch (e) { + print(e); + expenseBillReports = null; + } + } + return expenseBillReports; + } + Future?> fetchVendorReport(Map params, + [String? token]) async { + var commonProvider = Provider.of( + navigatorKey.currentContext!, + listen: false); + List? vendorReports; + final requestInfo = RequestInfo( + APIConstants.API_MODULE_NAME, + APIConstants.API_VERSION, + APIConstants.API_TS, + '_get', + APIConstants.API_DID, + APIConstants.API_KEY, + APIConstants.API_MESSAGE_ID, + commonProvider.userDetails?.accessToken, + commonProvider.userDetails?.userRequest?.toJson()); + var res = await makeRequest( + url: Url.VENDOR_REPORT, + queryParameters: params, + requestInfo: requestInfo, + body: {}, + method: RequestType.POST); + if (res != null && res['VendorReportData'] != null) { + try { + vendorReports = []; + res['VendorReportData'].forEach((val){ + vendorReports?.add(VendorReportData.fromJson(val)); + }); + } catch (e) { + print(e); + vendorReports = null; + } + } + return vendorReports; + } } \ No newline at end of file diff --git a/frontend/mgramseva/lib/routing.dart b/frontend/mgramseva/lib/routing.dart index 759901f36..08b7fb3c3 100644 --- a/frontend/mgramseva/lib/routing.dart +++ b/frontend/mgramseva/lib/routing.dart @@ -167,7 +167,7 @@ class Routing { } if (kIsWeb) { - FirebaseAnalytics analytics = FirebaseAnalytics(); + FirebaseAnalytics analytics = FirebaseAnalytics.instance; analytics.logEvent(name: "screen_view", parameters: { 'firebase_screen': "$path", 'screen_name': "$path", diff --git a/frontend/mgramseva/lib/screeens/add_expense/add_expense_walk_through/expense_walk_through.dart b/frontend/mgramseva/lib/screeens/add_expense/add_expense_walk_through/expense_walk_through.dart index 4e426135c..4d256d1a6 100644 --- a/frontend/mgramseva/lib/screeens/add_expense/add_expense_walk_through/expense_walk_through.dart +++ b/frontend/mgramseva/lib/screeens/add_expense/add_expense_walk_through/expense_walk_through.dart @@ -20,6 +20,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ), }, { diff --git a/frontend/mgramseva/lib/screeens/add_expense/expense_details.dart b/frontend/mgramseva/lib/screeens/add_expense/expense_details.dart index 292cc5e96..2ad06955a 100644 --- a/frontend/mgramseva/lib/screeens/add_expense/expense_details.dart +++ b/frontend/mgramseva/lib/screeens/add_expense/expense_details.dart @@ -1,5 +1,3 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:mgramseva/widgets/keyboard_focus_watcher.dart'; @@ -108,7 +106,7 @@ class _ExpenseDetailsState extends State { return CommonWidgets.buildEmptyMessage( snapshot.data, context); } - return _buildUserView(snapshot.data); + return _buildUserView(); } else if (snapshot.hasError) { return Notifiers.networkErrorPage( context, @@ -155,7 +153,7 @@ class _ExpenseDetailsState extends State { print(context); } - Widget _buildUserView(ExpensesDetailsModel expenseDetails) { + Widget _buildUserView() { return FormWrapper(Consumer( builder: (_, expenseProvider, child) => Column( mainAxisAlignment: MainAxisAlignment.start, @@ -206,28 +204,31 @@ class _ExpenseDetailsState extends State { if (isUpdate) BuildTextField( '${i18.common.BILL_ID}', - expenseDetails.challanNumberCtrl, + expensesDetailsProvider.expenditureDetails.challanNumberCtrl, isDisabled: true, ), SelectFieldBuilder( i18.expense.EXPENSE_TYPE, - expenseDetails.expenseType, + expensesDetailsProvider.expenditureDetails.expenseType, '', '', expensesDetailsProvider.onChangeOfExpenses, expensesDetailsProvider.getExpenseTypeList(isSearch: isUpdate), true, - isEnabled: expenseDetails.allowEdit, + readOnly: !expensesDetailsProvider.expenditureDetails.allowEdit!, requiredMessage: i18.expense.SELECT_EXPENDITURE_CATEGORY, contextKey: expenseProvider.expenseWalkthrougList[0].key, - controller: expenseDetails.expenseTypeController, + controller: expensesDetailsProvider.expenditureDetails.expenseTypeController, key: Keys.expense.EXPENSE_TYPE, + itemAsString: (i) =>'${ApplicationLocalizations.of(context) + .translate( + i.toString())}', ), AutoCompleteView( labelText: i18.expense.VENDOR_NAME, - controller: expenseDetails.vendorNameCtrl, + controller: expensesDetailsProvider.expenditureDetails.vendorNameCtrl, suggestionsBoxController: expensesDetailsProvider .suggestionsBoxController, onSuggestionSelected: @@ -236,7 +237,7 @@ class _ExpenseDetailsState extends State { expensesDetailsProvider.onSearchVendorList, listTile: buildTile, isRequired: true, - isEnabled: expenseDetails.allowEdit, + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit, requiredMessage: i18.expense.MENTION_NAME_OF_VENDOR, inputFormatter: [ @@ -247,10 +248,10 @@ class _ExpenseDetailsState extends State { expenseProvider.expenseWalkthrougList[1].key, key: Keys.expense.VENDOR_NAME, ), - if (expenseDetails.vendorNameCtrl.text.trim().isNotEmpty) + if (expensesDetailsProvider.expenditureDetails.vendorNameCtrl.text.trim().isNotEmpty) BuildTextField( '${i18.common.MOBILE_NUMBER}', - expenseDetails.mobileNumberController, + expensesDetailsProvider.expenditureDetails.mobileNumberController, isRequired: true, prefixText: '+91 - ', textInputType: TextInputType.number, @@ -270,7 +271,7 @@ class _ExpenseDetailsState extends State { ), BuildTextField( '${i18.expense.AMOUNT}', - expenseDetails.expensesAmount!.first.amountCtrl, + expensesDetailsProvider.expenditureDetails.expensesAmount!.first.amountCtrl, isRequired: true, textInputType: TextInputType.number, inputFormatter: [ @@ -279,7 +280,7 @@ class _ExpenseDetailsState extends State { ], placeHolder: '${i18.expense.AMOUNT} (₹)', labelSuffix: '(₹)', - isDisabled: (expenseDetails.allowEdit ?? true) + isDisabled: (expensesDetailsProvider.expenditureDetails.allowEdit ?? true) ? false : true, requiredMessage: @@ -307,23 +308,23 @@ class _ExpenseDetailsState extends State { BasicDateField( i18.expense.BILL_DATE, true, - expenseDetails.billDateCtrl, - firstDate: expenseDetails.billIssuedDateCtrl.text + expensesDetailsProvider.expenditureDetails.billDateCtrl, + firstDate: expensesDetailsProvider.expenditureDetails.billIssuedDateCtrl.text .trim() .isEmpty ? null : DateFormats.getFormattedDateToDateTime( - expenseDetails.billIssuedDateCtrl.text + expensesDetailsProvider.expenditureDetails.billIssuedDateCtrl.text .trim(), ), initialDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text.trim(), + expensesDetailsProvider.expenditureDetails.billDateCtrl.text.trim(), ), lastDate: DateTime.now(), onChangeOfDate: expensesDetailsProvider.onChangeOfBillDate, - isEnabled: expenseDetails.allowEdit, + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit, requiredMessage: i18.expense.DATE_BILL_ENTERED_IN_RECORDS, contextKey: @@ -334,13 +335,13 @@ class _ExpenseDetailsState extends State { BasicDateField( i18.expense.EXPENSE_START_DATE, true, - expenseDetails.fromDateCtrl, + expensesDetailsProvider.expenditureDetails.fromDateCtrl, onChangeOfDate: expensesDetailsProvider.onChangeOfStartEndDate, lastDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text.trim(), + expensesDetailsProvider.expenditureDetails.billDateCtrl.text.trim(), ) ?? DateTime.now(), - isEnabled: expenseDetails.allowEdit, + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit, validator: (val) => expensesDetailsProvider.fromToDateValidator(val, true), autoValidation: expenseProvider.dateAutoValidation ? AutovalidateMode.always : AutovalidateMode.disabled, @@ -349,16 +350,16 @@ class _ExpenseDetailsState extends State { BasicDateField( i18.expense.EXPENSE_END_DATE, true, - expenseDetails.toDateCtrl, + expensesDetailsProvider.expenditureDetails.toDateCtrl, initialDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text.trim(), + expensesDetailsProvider.expenditureDetails.billDateCtrl.text.trim(), ), lastDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text.trim(), + expensesDetailsProvider.expenditureDetails.billDateCtrl.text.trim(), ) ?? DateTime.now(), onChangeOfDate: expensesDetailsProvider.onChangeOfStartEndDate, - isEnabled: expenseDetails.allowEdit, + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit, validator: expensesDetailsProvider.fromToDateValidator, autoValidation: expenseProvider.dateAutoValidation ? AutovalidateMode.always : AutovalidateMode.disabled, @@ -372,20 +373,20 @@ class _ExpenseDetailsState extends State { BasicDateField( i18.expense.PARTY_BILL_DATE, false, - expenseDetails.billIssuedDateCtrl, + expensesDetailsProvider.expenditureDetails.billIssuedDateCtrl, initialDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billIssuedDateCtrl.text.trim(), + expensesDetailsProvider.expenditureDetails.billIssuedDateCtrl.text.trim(), ), - lastDate: expenseDetails.billDateCtrl.text + lastDate: expensesDetailsProvider.expenditureDetails.billDateCtrl.text .trim() .isEmpty ? DateTime.now() : DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text.trim()), + expensesDetailsProvider.expenditureDetails.billDateCtrl.text.trim()), onChangeOfDate: expensesDetailsProvider.onChangeOfDate, - isEnabled: expenseDetails.allowEdit, + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit, contextKey: expenseProvider.expenseWalkthrougList[4].key, key: Keys.expense.EXPENSE_PARTY_DATE, @@ -393,31 +394,31 @@ class _ExpenseDetailsState extends State { RadioButtonFieldBuilder( context, i18.expense.HAS_THIS_BILL_PAID, - expenseDetails.isBillPaid, + expensesDetailsProvider.expenditureDetails.isBillPaid, '', '', true, Constants.EXPENSESTYPE, expensesDetailsProvider.onChangeOfBillPaid, - isEnabled: expenseDetails.allowEdit), - if (expenseDetails.isBillPaid ?? false) + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit), + if (expensesDetailsProvider.expenditureDetails.isBillPaid ?? false) BasicDateField(i18.expense.PAYMENT_DATE, true, - expenseDetails.paidDateCtrl, + expensesDetailsProvider.expenditureDetails.paidDateCtrl, firstDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.billDateCtrl.text + expensesDetailsProvider.expenditureDetails.billDateCtrl.text .trim()), lastDate: DateTime.now(), initialDate: DateFormats.getFormattedDateToDateTime( - expenseDetails.paidDateCtrl.text + expensesDetailsProvider.expenditureDetails.paidDateCtrl.text .trim()), onChangeOfDate: expensesDetailsProvider.onChangeOfDate, - isEnabled: expenseDetails.allowEdit), + isEnabled: expensesDetailsProvider.expenditureDetails.allowEdit), if (isUpdate && - expenseDetails.fileStoreList != null && - expenseDetails.fileStoreList!.isNotEmpty) + expensesDetailsProvider.expenditureDetails.fileStoreList != null && + expensesDetailsProvider.expenditureDetails.fileStoreList!.isNotEmpty) Container( margin: const EdgeInsets.only( top: 20.0, bottom: 5, right: 20, left: 20), @@ -432,7 +433,7 @@ class _ExpenseDetailsState extends State { fontSize: 19, fontWeight: FontWeight.normal)), Wrap( - children: expenseDetails.fileStoreList! + children: expensesDetailsProvider.expenditureDetails.fileStoreList! .map((e) => InkWell( onTap: () => expensesDetailsProvider @@ -463,7 +464,7 @@ class _ExpenseDetailsState extends State { ], ), ), - if (expenseDetails.allowEdit ?? true) + if (expensesDetailsProvider.expenditureDetails.allowEdit ?? true) FilePickerDemo( key: expensesDetailsProvider.filePickerKey, callBack: @@ -473,7 +474,7 @@ class _ExpenseDetailsState extends State { .expenseWalkthrougList[5].key, ), if (isUpdate) - expensesDetailsProvider.isPSPCLEnabled && expenseDetails.expenseType=='ELECTRICITY_BILL'?Container(): + expensesDetailsProvider.isPSPCLEnabled && expensesDetailsProvider.expenditureDetails.expenseType=='ELECTRICITY_BILL'?Container(): Container( alignment: Alignment.centerLeft, padding: EdgeInsets.symmetric( @@ -487,7 +488,7 @@ class _ExpenseDetailsState extends State { width: 20, height: 20, child: Checkbox( - value: expenseDetails.isBillCancelled, + value: expensesDetailsProvider.expenditureDetails.isBillCancelled, onChanged: expensesDetailsProvider .onChangeOfCheckBox), ), diff --git a/frontend/mgramseva/lib/screeens/change_password/change_password.dart b/frontend/mgramseva/lib/screeens/change_password/change_password.dart index 1300326f6..ea786bedf 100644 --- a/frontend/mgramseva/lib/screeens/change_password/change_password.dart +++ b/frontend/mgramseva/lib/screeens/change_password/change_password.dart @@ -135,7 +135,7 @@ class _ChangePasswordState extends State { Provider.of(context, listen: false); return FocusWatcher( child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: BaseAppBar( Text(i18.common.MGRAM_SEVA), AppBar(), diff --git a/frontend/mgramseva/lib/screeens/common/payment_failure.dart b/frontend/mgramseva/lib/screeens/common/payment_failure.dart index 4e99e2439..d0ce426e2 100644 --- a/frontend/mgramseva/lib/screeens/common/payment_failure.dart +++ b/frontend/mgramseva/lib/screeens/common/payment_failure.dart @@ -38,7 +38,7 @@ class _PaymentFailureState extends State { var languageProvider = Provider.of(context, listen: false); return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: AppBar( title: Text('mGramSeva'), automaticallyImplyLeading: false, diff --git a/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart b/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart index 037ed349f..da6729b67 100644 --- a/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart +++ b/frontend/mgramseva/lib/screeens/connection_results/connection_details_card.dart @@ -1,6 +1,4 @@ -import 'dart:ui'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:mgramseva/model/connection/water_connections.dart'; import 'package:mgramseva/providers/common_provider.dart'; import 'package:mgramseva/routers/routers.dart'; diff --git a/frontend/mgramseva/lib/screeens/connection_results/connection_results.dart b/frontend/mgramseva/lib/screeens/connection_results/connection_results.dart index eea4d2c7b..f37112189 100644 --- a/frontend/mgramseva/lib/screeens/connection_results/connection_results.dart +++ b/frontend/mgramseva/lib/screeens/connection_results/connection_results.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:mgramseva/model/connection/water_connections.dart'; import 'package:mgramseva/providers/search_connection_provider.dart'; import 'package:mgramseva/screeens/connection_results/connection_details_card.dart'; @@ -43,7 +42,7 @@ class _SearchConsumerResultState extends State { Provider.of(context, listen: false); return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart b/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart index 480b6875e..cf5db6c13 100644 --- a/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart +++ b/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart @@ -1,7 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_focus_watcher/flutter_focus_watcher.dart'; import 'package:mgramseva/model/connection/search_connection.dart'; import 'package:mgramseva/providers/search_connection_provider.dart'; @@ -44,7 +42,7 @@ class _SearchConsumerConnectionState extends State { Provider.of(context, listen: false); return FocusWatcher( child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart index d670622b2..226c66d02 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details.dart @@ -298,6 +298,7 @@ class _ConsumerDetailsState extends State { false, // contextkey: consumerProvider // .consmerWalkthrougList[6].key, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.toString())}', controller: consumerProvider.waterconnection.categoryCtrl, key: Keys.createConsumer.CONSUMER_CATEORY_KEY, @@ -315,6 +316,7 @@ class _ConsumerDetailsState extends State { consumerProvider.onChangeOfSubCategory, consumerProvider.getSubCategoryList(), false, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.toString())}', // contextkey: consumerProvider // .consmerWalkthrougList[6].key, controller: consumerProvider @@ -364,6 +366,7 @@ class _ConsumerDetailsState extends State { consumerProvider.onChangeOfLocality, consumerProvider.getBoundaryList(), true, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.code!.toString())}', contextKey: consumerProvider .consmerWalkthrougList[5].key) : Container()), @@ -379,6 +382,7 @@ class _ConsumerDetailsState extends State { consumerProvider.onChangeOfPropertyType, consumerProvider.getPropertyTypeList(), true, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.toString())}', contextKey: consumerProvider.consmerWalkthrougList[6].key, controller: property.address.propertyCtrl, @@ -400,14 +404,15 @@ class _ConsumerDetailsState extends State { consumerProvider .getConnectionTypeList(), true, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.toString())}', contextKey: consumerProvider .consmerWalkthrougList[7].key, controller: consumerProvider .waterconnection.ServiceTypeCtrl, - isEnabled: consumerProvider.isEdit == - false || + readOnly: consumerProvider.isEdit == + true || consumerProvider.isFirstDemand == - false, + true, key: Keys.createConsumer .CONSUMER_SERVICE_KEY, ), @@ -510,6 +515,7 @@ class _ConsumerDetailsState extends State { consumerProvider .getFinancialYearList(), true, + itemAsString: (i) =>'${ApplicationLocalizations.of(context).translate(i.financialYear)}', controller: consumerProvider .waterconnection .billingCycleYearCtrl, @@ -528,6 +534,7 @@ class _ConsumerDetailsState extends State { consumerProvider .getBillingCycle(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i['name'])}", controller: consumerProvider .waterconnection .BillingCycleCtrl, @@ -619,7 +626,7 @@ class _ConsumerDetailsState extends State { var userProvider = Provider.of(context, listen: false); return KeyboardFocusWatcher( child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart index 8062bedbe..f5ed41bd0 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walk_through.dart @@ -63,6 +63,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { @@ -75,6 +76,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { @@ -87,6 +89,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { diff --git a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walkthrough_1.dart b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walkthrough_1.dart index 8062bedbe..f5ed41bd0 100644 --- a/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walkthrough_1.dart +++ b/frontend/mgramseva/lib/screeens/consumer_details/consumer_details_walk_through/walkthrough_1.dart @@ -63,6 +63,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { @@ -75,6 +76,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { @@ -87,6 +89,7 @@ var json = [ (val) => {}, [], true, + itemAsString: (i) =>i.toString(), ) }, { diff --git a/frontend/mgramseva/lib/screeens/dashboard/IndividualTab.dart b/frontend/mgramseva/lib/screeens/dashboard/IndividualTab.dart index 7b239998e..4f9794f04 100644 --- a/frontend/mgramseva/lib/screeens/dashboard/IndividualTab.dart +++ b/frontend/mgramseva/lib/screeens/dashboard/IndividualTab.dart @@ -62,7 +62,7 @@ class _IndividualTabState extends State { (expenseList is List ? 5 : 3)); var tableData = expenseList is List ? dashBoardProvider - .getExpenseData(expenseList as List) + .getExpenseData(expenseList) : dashBoardProvider .getCollectionsData(expenseList as List); var extraHeight = 0.0; @@ -70,7 +70,7 @@ class _IndividualTabState extends State { if (e.tableRow.first.label.length > 28) extraHeight += e.tableRow.first.label.substring(28).length.toDouble(); }); - return tableData == null || tableData.isEmpty + return tableData.isEmpty ? SizedBox( height: 100, child: CommonWidgets.buildEmptyMessage( diff --git a/frontend/mgramseva/lib/screeens/dashboard/individual_tab.dart b/frontend/mgramseva/lib/screeens/dashboard/individual_tab.dart index 72ce20505..1fa49938c 100644 --- a/frontend/mgramseva/lib/screeens/dashboard/individual_tab.dart +++ b/frontend/mgramseva/lib/screeens/dashboard/individual_tab.dart @@ -62,7 +62,7 @@ class _IndividualTabState extends State { (expenseList is List ? 5 : 3)); var tableData = expenseList is List ? dashBoardProvider - .getExpenseData(expenseList as List) + .getExpenseData(expenseList) : dashBoardProvider .getCollectionsData(expenseList as List); var extraHeight = 0.0; @@ -70,7 +70,7 @@ class _IndividualTabState extends State { if (e.tableRow.first.label.length > 28) extraHeight += e.tableRow.first.label.substring(28).length.toDouble(); }); - return tableData == null || tableData.isEmpty + return tableData.isEmpty ? SizedBox( height: 100, child: CommonWidgets.buildEmptyMessage( diff --git a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/custom_label_widget/custom_tooltip_label_render.dart b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/custom_label_widget/custom_tooltip_label_render.dart index 2089b6164..17e4b7c87 100644 --- a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/custom_label_widget/custom_tooltip_label_render.dart +++ b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/custom_label_widget/custom_tooltip_label_render.dart @@ -1,13 +1,12 @@ import 'dart:math'; -import 'package:charts_flutter/src/text_element.dart' as ChartText; -import 'package:charts_flutter/src/text_style.dart' as ChartStyle; -import 'package:charts_flutter/flutter.dart'; +import 'package:community_charts_flutter/community_charts_flutter.dart'; +import 'package:community_charts_flutter/src/text_element.dart' as ChartTextElement; +import 'package:community_charts_flutter/src/text_style.dart' as ChartTextStyle; String? _xAxis; String? _pointColor; num? _maxVal; - class ToolTipMgr { static String? get xAxis => _xAxis; @@ -57,14 +56,14 @@ class CustomTooltipLabelRenderer extends CircleSymbolRenderer { roundTopLeft: true, roundTopRight: true, roundBottomLeft: true, roundBottomRight: true, radius: 4); - ChartStyle.TextStyle textStyle = ChartStyle.TextStyle(); + ChartTextStyle.TextStyle textStyle = ChartTextStyle.TextStyle(); textStyle.color = Color.fromHex(code: ToolTipMgr.pointColor ?? '#505A5F'); textStyle.fontSize = 12; canvas.drawText( - ChartText.TextElement('₹ ${ToolTipMgr.xAxis}', style: textStyle), + ChartTextElement.TextElement('₹ ${ToolTipMgr.xAxis}', style: textStyle), (bounds.left - bounds.width ).round(), -10); } diff --git a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue.dart b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue.dart index f8231f54c..01bad0e16 100644 --- a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue.dart +++ b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue.dart @@ -1,9 +1,9 @@ -import 'package:charts_flutter/flutter.dart'; +import 'package:community_charts_flutter/community_charts_flutter.dart'; import 'package:mgramseva/model/dashboard/revenue_dashboard.dart'; import 'package:mgramseva/model/dashboard/revenue_chart.dart'; -import 'package:charts_flutter/flutter.dart' as charts; +import 'package:community_charts_flutter/community_charts_flutter.dart' as charts; import 'package:mgramseva/utils/models.dart'; class RevenueDataHolder { diff --git a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue_charts.dart b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue_charts.dart index 2ba826eac..10bc4fbd3 100644 --- a/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue_charts.dart +++ b/frontend/mgramseva/lib/screeens/dashboard/revenue_expense_dashboard/revenue_charts.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:charts_flutter/flutter.dart' as charts; +import 'package:community_charts_flutter/community_charts_flutter.dart' as charts; import 'package:mgramseva/providers/revenue_dashboard_provider.dart'; import 'package:mgramseva/utils/localization/application_localizations.dart'; import 'package:mgramseva/utils/common_widgets.dart'; diff --git a/frontend/mgramseva/lib/screeens/expense/expense_results.dart b/frontend/mgramseva/lib/screeens/expense/expense_results.dart index ecbcabdc6..6a13b8fdb 100644 --- a/frontend/mgramseva/lib/screeens/expense/expense_results.dart +++ b/frontend/mgramseva/lib/screeens/expense/expense_results.dart @@ -22,7 +22,7 @@ class ExpenseResults extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/expense/search_expense.dart b/frontend/mgramseva/lib/screeens/expense/search_expense.dart index f7cc46c0f..046fbeff9 100644 --- a/frontend/mgramseva/lib/screeens/expense/search_expense.dart +++ b/frontend/mgramseva/lib/screeens/expense/search_expense.dart @@ -45,7 +45,7 @@ class _SearchExpenseState extends State { @override Widget build(BuildContext context) { return KeyboardFocusWatcher(child:Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), @@ -87,7 +87,9 @@ class _SearchExpenseState extends State { hint: '${ApplicationLocalizations.of(context).translate(i18.common.ELECTRICITY_HINT)}', controller: expenseTypeCtrl, - key: Keys.expense.SEARCH_EXPENSE_TYPE, + key: Keys.expense.SEARCH_EXPENSE_TYPE, itemAsString: (i) =>'${ApplicationLocalizations.of(context) + .translate( + i.toString())}', ); } , diff --git a/frontend/mgramseva/lib/screeens/feedback/feed_back.dart b/frontend/mgramseva/lib/screeens/feedback/feed_back.dart index 37ecdffe6..572e816b5 100644 --- a/frontend/mgramseva/lib/screeens/feedback/feed_back.dart +++ b/frontend/mgramseva/lib/screeens/feedback/feed_back.dart @@ -52,7 +52,7 @@ class _PaymentFeedBackState extends State { Widget build(BuildContext context) { return FocusWatcher( child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: AppBar( title: Text('mGramSeva'), automaticallyImplyLeading: false, diff --git a/frontend/mgramseva/lib/screeens/generate_bill/generate_bill.dart b/frontend/mgramseva/lib/screeens/generate_bill/generate_bill.dart index bd4e35fec..b8260fa2a 100644 --- a/frontend/mgramseva/lib/screeens/generate_bill/generate_bill.dart +++ b/frontend/mgramseva/lib/screeens/generate_bill/generate_bill.dart @@ -22,6 +22,9 @@ import 'package:mgramseva/widgets/text_field_builder.dart'; import 'package:mgramseva/widgets/footer.dart'; import 'package:provider/provider.dart'; +import '../../providers/ifix_hierarchy_provider.dart'; +import '../../utils/localization/application_localizations.dart'; + class GenerateBill extends StatefulWidget { final String? id; final WaterConnection? waterconnection; @@ -38,6 +41,11 @@ class _GenerateBillState extends State { WidgetsBinding.instance.addPostFrameCallback((_) => afterViewBuild()); super.initState(); } + @override + void dispose() { + Provider.of(context, listen: false).clearBillYear(); + super.dispose(); + } afterViewBuild() { Provider.of(context, listen: false) @@ -45,7 +53,11 @@ class _GenerateBillState extends State { ..readingExist ..getServiceTypePropertyTypeandConnectionType() ..autoValidation = false + ..clearBillYear() ..formKey = GlobalKey(); + + Provider.of(context,listen: false) + ..getBillingSlabs(); } var metVal = ""; @@ -62,7 +74,10 @@ class _GenerateBillState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - HomeBack(), + HomeBack(callback: (){ + Provider.of(context, listen: false).clearBillYear(); + Navigator.pop(context); + },), Container( width: MediaQuery.of(context).size.width, child: Card( @@ -96,8 +111,8 @@ class _GenerateBillState extends State { billgenerationprovider .getServiceCategoryList(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i.toString())}", readOnly: true, - isEnabled: false, controller: billgenerationprovider .billGenerateDetails .serviceCategoryCtrl, @@ -118,8 +133,8 @@ class _GenerateBillState extends State { billgenerationprovider .getConnectionTypeList(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i.toString())}", readOnly: true, - isEnabled: false, controller: billgenerationprovider .billGenerateDetails @@ -150,8 +165,8 @@ class _GenerateBillState extends State { billgenerationprovider .getPropertyTypeList(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i.toString())}", readOnly: true, - isEnabled: false, controller: billgenerationprovider .billGenerateDetails .propertyTypeCtrl)), @@ -262,6 +277,7 @@ class _GenerateBillState extends State { billgenerationprovider .getFinancialYearList(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i.financialYear)}", controller: billgenerationprovider .billGenerateDetails .billingyearCtrl, @@ -276,8 +292,7 @@ class _GenerateBillState extends State { i18.demandGenerate .BILLING_CYCLE_LABEL, billgenerationprovider - .billGenerateDetails - .billCycle, + .selectedBillCycle, '', '', billgenerationprovider @@ -285,6 +300,7 @@ class _GenerateBillState extends State { billgenerationprovider .getBillingCycle(), true, + itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i['name'])}", controller: billgenerationprovider .billGenerateDetails .billingcycleCtrl, @@ -301,7 +317,7 @@ class _GenerateBillState extends State { Provider.of(context, listen: false); return KeyboardFocusWatcher( child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: BaseAppBar( Text(i18.common.MGRAM_SEVA), AppBar(), diff --git a/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_boundary_detail_card.dart b/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_boundary_detail_card.dart index 0da24079b..8682d3aa0 100644 --- a/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_boundary_detail_card.dart +++ b/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_boundary_detail_card.dart @@ -9,7 +9,6 @@ import 'package:provider/provider.dart'; import '../../utils/localization/application_localizations.dart'; import '../../utils/common_widgets.dart'; import '../../utils/loaders.dart'; -import '../../utils/notifiers.dart'; import '../../widgets/label_text.dart'; import 'gpwsc_card.dart'; diff --git a/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_rate_card.dart b/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_rate_card.dart index dc1360066..defa16463 100644 --- a/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_rate_card.dart +++ b/frontend/mgramseva/lib/screeens/gpwsc_details/gpwsc_rate_card.dart @@ -93,8 +93,7 @@ class GPWSCRateCard extends StatelessWidget { wcBillingSlabs.wCBillingSlabs ?.where( (element) => element.connectionType?.compareTo("Metered") == 0) - .forEach((e) => { - e.slabs?.forEach((slabs) => rows.add(DataRow(cells: [ + .forEach((e) => e.slabs?.forEach((slabs) => rows.add(DataRow(cells: [ DataCell(Text( "${ApplicationLocalizations.of(context).translate(i18.common.WATER_CHARGES)}-10101")), DataCell(Text( @@ -104,7 +103,7 @@ class GPWSCRateCard extends StatelessWidget { "${ApplicationLocalizations.of(context).translate("${e.buildingType}")}")), DataCell(Text("${slabs.charge}")) ]))) - }); + ); return rows; } diff --git a/frontend/mgramseva/lib/screeens/home/home.dart b/frontend/mgramseva/lib/screeens/home/home.dart index 4f86e8b3d..456266158 100644 --- a/frontend/mgramseva/lib/screeens/home/home.dart +++ b/frontend/mgramseva/lib/screeens/home/home.dart @@ -80,7 +80,7 @@ class _HomeState extends State { var languageProvider = Provider.of(context, listen: false); return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/home/home_card.dart b/frontend/mgramseva/lib/screeens/home/home_card.dart index 3b8c9e17e..78bc8a9ec 100644 --- a/frontend/mgramseva/lib/screeens/home/home_card.dart +++ b/frontend/mgramseva/lib/screeens/home/home_card.dart @@ -40,13 +40,14 @@ class _HomeCard extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Icon(item.iconData, size: 35), + Icon(item.iconData, size: 30), Container( margin: EdgeInsets.all(10), child: Center( child: new Text( ApplicationLocalizations.of(context) .translate(item.label), + textScaleFactor: MediaQuery.of(context).size.width<400 ? 0.90 : 1, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w400), textAlign: TextAlign.center, diff --git a/frontend/mgramseva/lib/screeens/home/home_walk_through/home_walk_through_container.dart b/frontend/mgramseva/lib/screeens/home/home_walk_through/home_walk_through_container.dart index de4f39976..d4dc2126a 100644 --- a/frontend/mgramseva/lib/screeens/home/home_walk_through/home_walk_through_container.dart +++ b/frontend/mgramseva/lib/screeens/home/home_walk_through/home_walk_through_container.dart @@ -81,11 +81,11 @@ class _HomeWalkThroughContainerState extends State { ))))), Consumer(builder: (_, notificationProvider, child) => Positioned( - left: position.dx + 5, + left: position.dx + 3.7, top: notificationProvider.enableNotification == true ? box.size.height + position.dy : (homeProvider.activeIndex == 6 || homeProvider.activeIndex == 7 || homeProvider.activeIndex == 8) - ? position.dy - 25 + ? position.dy - 15 : box.size.height + position.dy, child: CustomPaint( painter: TrianglePainter( @@ -94,8 +94,8 @@ class _HomeWalkThroughContainerState extends State { paintingStyle: PaintingStyle.fill, ), child: Container( - height: 30, - width: 30, + height: 20, + width: 20, ), ))), Consumer(builder: (_, notificationProvider, child) => @@ -103,13 +103,13 @@ class _HomeWalkThroughContainerState extends State { left: ((homeProvider.activeIndex + 1) % 3 == 0) ? position.dx - 140 : position.dx, - top: notificationProvider.enableNotification == true ? box.size.height + position.dy + 25 : (homeProvider.activeIndex == 6 || + top: notificationProvider.enableNotification == true ? box.size.height + position.dy + 15 : (homeProvider.activeIndex == 6 || homeProvider.activeIndex == 7 || homeProvider.activeIndex == 8) ? position.dy - box.size.height - (MediaQuery.of(context).size.width > 720 ? 55 : 25) - : box.size.height + position.dy + 25, + : box.size.height + position.dy + 15, child: Container( width: MediaQuery.of(context).size.width > 720 ? MediaQuery.of(context).size.width / 3 @@ -118,6 +118,9 @@ class _HomeWalkThroughContainerState extends State { alignment: Alignment.centerRight, padding: EdgeInsets.only(right: 15), child: Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only(topLeft:((homeProvider.activeIndex + 1) % 3 == 0)?Radius.circular(10):Radius.circular(0),topRight:Radius.circular(10),bottomLeft: Radius.circular(10),bottomRight: Radius.circular(10)), + ), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart b/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart index 6f6d510c0..623505356 100644 --- a/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart +++ b/frontend/mgramseva/lib/screeens/household_detail/household_detail.dart @@ -91,7 +91,7 @@ class _HouseholdDetailState extends State { var houseHoldProvider = Provider.of(context, listen: false); return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: CustomAppBar(), drawer: DrawerWrapper( Drawer(child: SideBar()), diff --git a/frontend/mgramseva/lib/screeens/household_register/household_list.dart b/frontend/mgramseva/lib/screeens/household_register/household_list.dart index afb96c25a..148583319 100644 --- a/frontend/mgramseva/lib/screeens/household_register/household_list.dart +++ b/frontend/mgramseva/lib/screeens/household_register/household_list.dart @@ -58,7 +58,7 @@ class _HouseholdListState extends State { constraints.maxWidth < 760 ? 115.0 : (constraints.maxWidth / 6); var tableData = householdProvider .getCollectionsData(expenseList as List); - return tableData == null || tableData.isEmpty + return tableData.isEmpty ? CommonWidgets.buildEmptyMessage( ApplicationLocalizations.of(context) .translate(i18.dashboard.NO_RECORDS_MSG), diff --git a/frontend/mgramseva/lib/screeens/login/login.dart b/frontend/mgramseva/lib/screeens/login/login.dart index 85ea80595..642e1ebf6 100644 --- a/frontend/mgramseva/lib/screeens/login/login.dart +++ b/frontend/mgramseva/lib/screeens/login/login.dart @@ -130,44 +130,48 @@ class _LoginState extends State { color: Theme.of(context).primaryColor), ))), ), - RichText( - text: TextSpan( - children: [ - TextSpan( - text: 'By continuing you accept our ', - style: TextStyle( - color: Colors.black - ) - ), - TextSpan( - text: 'Privacy Policy', - style: TextStyle( - color: Theme.of(context).primaryColor, // set link color - decoration: TextDecoration.underline, - ), - recognizer: TapGestureRecognizer() - ..onTap = () { - Navigator.pushNamed(context, Routes.PRIVACY_POLICY,arguments:true); - }, - ), - TextSpan( - text: ' and ', + Padding( + padding: const EdgeInsets.symmetric(horizontal: 8.0 ), + child: RichText( + maxLines: 3, + text: TextSpan( + children: [ + TextSpan( + text: '${ApplicationLocalizations.of(context).translate(i18.common.BY_CONTINUING_YOU_ACCEPT_OUR)} ', style: TextStyle( color: Colors.black ) - ), - TextSpan( - text: 'Terms of use', - style: TextStyle( - color: Theme.of(context).primaryColor, // set link color - decoration: TextDecoration.underline, ), - recognizer: TapGestureRecognizer() - ..onTap = () { - Navigator.pushNamed(context, Routes.TERMS_OF_USE,arguments:true); - }, - ), - ], + TextSpan( + text: '${ApplicationLocalizations.of(context).translate(i18.common.PRIVACY_POLICY)}', + style: TextStyle( + color: Theme.of(context).primaryColor, // set link color + decoration: TextDecoration.underline, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + Navigator.pushNamed(context, Routes.PRIVACY_POLICY,arguments:true); + }, + ), + TextSpan( + text: ' ${ApplicationLocalizations.of(context).translate(i18.common.AND)} ', + style: TextStyle( + color: Colors.black + ) + ), + TextSpan( + text: '${ApplicationLocalizations.of(context).translate(i18.common.TERMS_OF_USE)}', + style: TextStyle( + color: Theme.of(context).primaryColor, // set link color + decoration: TextDecoration.underline, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + Navigator.pushNamed(context, Routes.TERMS_OF_USE,arguments:true); + }, + ), + ], + ), ), ), Padding( diff --git a/frontend/mgramseva/lib/screeens/notifications/notification_screen.dart b/frontend/mgramseva/lib/screeens/notifications/notification_screen.dart index 7e6e71979..6117e7f72 100644 --- a/frontend/mgramseva/lib/screeens/notifications/notification_screen.dart +++ b/frontend/mgramseva/lib/screeens/notifications/notification_screen.dart @@ -44,7 +44,7 @@ class _NotificationScreen extends State { ..notifications.clear() ..getNotifications(notificationProvider.offset, notificationProvider.limit); } - catch (e, s) { + catch (e) { ErrorHandler().allExceptionsHandler(navigatorKey.currentContext!, e); } } diff --git a/frontend/mgramseva/lib/screeens/password_success/password_success.dart b/frontend/mgramseva/lib/screeens/password_success/password_success.dart index 416cebbb9..4638be568 100644 --- a/frontend/mgramseva/lib/screeens/password_success/password_success.dart +++ b/frontend/mgramseva/lib/screeens/password_success/password_success.dart @@ -1,4 +1,3 @@ -import 'package:mgramseva/providers/common_provider.dart'; import 'package:mgramseva/routers/routers.dart'; import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import 'package:mgramseva/utils/localization/application_localizations.dart'; @@ -8,7 +7,6 @@ import 'package:mgramseva/widgets/logo.dart'; import 'package:mgramseva/widgets/mobile_view.dart'; import 'package:mgramseva/widgets/success_page.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class PasswordSuccess extends StatefulWidget { State createState() { diff --git a/frontend/mgramseva/lib/screeens/privacy_and_terms/PrivacyAndTerms.dart b/frontend/mgramseva/lib/screeens/privacy_and_terms/PrivacyAndTerms.dart index 1517b4fec..c0b6c82ac 100644 --- a/frontend/mgramseva/lib/screeens/privacy_and_terms/PrivacyAndTerms.dart +++ b/frontend/mgramseva/lib/screeens/privacy_and_terms/PrivacyAndTerms.dart @@ -22,8 +22,11 @@ class _PrivacyAndTermsState extends State { var languageProvider = Provider.of(context, listen: false); return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: AppBar( + iconTheme: IconThemeData( + color: Colors.white, //change your color here + ), titleSpacing: 0, centerTitle: true, automaticallyImplyLeading: widget.showLeading, diff --git a/frontend/mgramseva/lib/screeens/profile/edit_profile.dart b/frontend/mgramseva/lib/screeens/profile/edit_profile.dart index 92002024d..55ff220e6 100644 --- a/frontend/mgramseva/lib/screeens/profile/edit_profile.dart +++ b/frontend/mgramseva/lib/screeens/profile/edit_profile.dart @@ -136,7 +136,7 @@ class _EditProfileState extends State { var userProvider = Provider.of(context, listen: false); return FocusWatcher(child: Scaffold( - backgroundColor: Theme.of(context).backgroundColor, + backgroundColor: Theme.of(context).colorScheme.background, appBar: BaseAppBar( Text(i18.common.MGRAM_SEVA), AppBar(), diff --git a/frontend/mgramseva/lib/screeens/reports/bill_report.dart b/frontend/mgramseva/lib/screeens/reports/bill_report.dart index fe83f5a16..b8544abd6 100644 --- a/frontend/mgramseva/lib/screeens/reports/bill_report.dart +++ b/frontend/mgramseva/lib/screeens/reports/bill_report.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../../model/common/BillsTableData.dart'; import '../../providers/reports_provider.dart'; import '../../utils/localization/application_localizations.dart'; @@ -10,7 +9,6 @@ import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import '../../utils/notifiers.dart'; import '../../utils/testing_keys/testing_keys.dart'; import '../../widgets/button.dart'; -import 'generic_report_table.dart'; class BillReport extends StatefulWidget { final Function onViewClick; @@ -28,11 +26,13 @@ class _BillReport extends State @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(builder: (_, reportProvider, child) { return Container( - margin: constraints.maxWidth > 700 - ? const EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 10) - : const EdgeInsets.only(top: 5.0, bottom: 5, right: 8, left: 8), + margin: containerMargin, child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -42,28 +42,37 @@ class _BillReport extends State Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - children: [ - Text("1. ", - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), - Text( - ApplicationLocalizations.of(context) - .translate(i18.dashboard.BILL_REPORT), - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), - ], + Container( + width: constraints.maxWidth > 344?constraints.maxWidth / 2.5:constraints.maxWidth / 3, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "1. ", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + Expanded( + child: Text( + ApplicationLocalizations.of(context) + .translate(i18.dashboard.BILL_REPORT), + maxLines: 3, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + ), + ], + ), ), Row( children: [ Container( width: 50, child: Button( - "View", + ApplicationLocalizations.of(context) + .translate(i18.common.VIEW), () { if (reportProvider.selectedBillPeriod == null) { Notifiers.getToastMessage( - context, 'Select Billing Cycle', 'ERROR'); + context, '${ApplicationLocalizations.of(context).translate(i18.common.SELECT_BILLING_CYCLE)}', 'ERROR'); } else { reportProvider.clearTableData(); reportProvider.getDemandReport(); @@ -81,7 +90,7 @@ class _BillReport extends State onPressed: () { if (reportProvider.selectedBillPeriod == null) { Notifiers.getToastMessage( - context, 'Select Billing Cycle', 'ERROR'); + context, '${ApplicationLocalizations.of(context).translate(i18.common.SELECT_BILLING_CYCLE)}', 'ERROR'); } else { reportProvider.getDemandReport(download: true); } diff --git a/frontend/mgramseva/lib/screeens/reports/collection_report.dart b/frontend/mgramseva/lib/screeens/reports/collection_report.dart index d6e228832..bd31bfec9 100644 --- a/frontend/mgramseva/lib/screeens/reports/collection_report.dart +++ b/frontend/mgramseva/lib/screeens/reports/collection_report.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:mgramseva/model/common/BillsTableData.dart'; import 'package:provider/provider.dart'; import '../../providers/reports_provider.dart'; @@ -10,7 +9,6 @@ import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import '../../utils/notifiers.dart'; import '../../utils/testing_keys/testing_keys.dart'; import '../../widgets/button.dart'; -import 'generic_report_table.dart'; class CollectionReport extends StatefulWidget { final Function onViewClick; @@ -28,11 +26,13 @@ class _CollectionReport extends State @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(builder: (_, reportProvider, child) { return Container( - margin: constraints.maxWidth > 700 - ? const EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 10) - : const EdgeInsets.only(top: 5.0, bottom: 5, right: 8, left: 8), + margin: containerMargin, child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -42,28 +42,37 @@ class _CollectionReport extends State Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - children: [ - Text("2. ", - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), - Text( - ApplicationLocalizations.of(context) - .translate(i18.dashboard.COLLECTION_REPORT), - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), - ], + Container( + width: constraints.maxWidth > 344?constraints.maxWidth / 2.5:constraints.maxWidth / 3, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "2. ", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + Expanded( + child: Text( + ApplicationLocalizations.of(context) + .translate(i18.dashboard.COLLECTION_REPORT), + maxLines: 3, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + ), + ], + ), ), Row( children: [ Container( width: 50, child: Button( - "View", + ApplicationLocalizations.of(context) + .translate(i18.common.VIEW), () { if (reportProvider.selectedBillPeriod == null) { Notifiers.getToastMessage( - context, 'Select Billing Cycle', 'ERROR'); + context, '${ApplicationLocalizations.of(context).translate(i18.common.SELECT_BILLING_CYCLE)}', 'ERROR'); } else { reportProvider.clearTableData(); reportProvider.getCollectionReport(); @@ -81,7 +90,7 @@ class _CollectionReport extends State onPressed: () { if (reportProvider.selectedBillPeriod == null) { Notifiers.getToastMessage( - context, 'Select Billing Cycle', 'ERROR'); + context, '${ApplicationLocalizations.of(context).translate(i18.common.SELECT_BILLING_CYCLE)}', 'ERROR'); } else { reportProvider.getCollectionReport( download: true); diff --git a/frontend/mgramseva/lib/screeens/reports/expense_bill_report.dart b/frontend/mgramseva/lib/screeens/reports/expense_bill_report.dart new file mode 100644 index 000000000..4c3c0f1b1 --- /dev/null +++ b/frontend/mgramseva/lib/screeens/reports/expense_bill_report.dart @@ -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 createState() => _ExpenseBillReportState(); +} + +class _ExpenseBillReportState extends State + 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(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, '${ApplicationLocalizations.of(context).translate(i18.common.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, '${ApplicationLocalizations.of(context).translate(i18.common.SELECT_BILLING_CYCLE)}', 'ERROR'); + } else { + reportProvider.getExpenseBillReport(download: true); + } + }, + icon: Icon(Icons.download_sharp), + label: Text(ApplicationLocalizations.of(context) + .translate(i18.common.CORE_DOWNLOAD))), + ], + ), + ], + ), + ], + ), + ); + }); + }); + } +} diff --git a/frontend/mgramseva/lib/screeens/reports/generic_report_table.dart b/frontend/mgramseva/lib/screeens/reports/generic_report_table.dart index fb060d743..d1f502591 100644 --- a/frontend/mgramseva/lib/screeens/reports/generic_report_table.dart +++ b/frontend/mgramseva/lib/screeens/reports/generic_report_table.dart @@ -1,10 +1,7 @@ import 'package:flutter/material.dart'; import 'package:mgramseva/components/dashboard/bills_table.dart'; -import 'package:provider/provider.dart'; import '../../model/common/BillsTableData.dart'; -import '../../providers/reports_provider.dart'; -import '../../utils/common_widgets.dart'; import '../../utils/localization/application_localizations.dart'; import 'package:mgramseva/utils/constants/i18_key_constants.dart'; diff --git a/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart b/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart index f5ee4fa51..b585fc88a 100644 --- a/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart +++ b/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart @@ -1,16 +1,12 @@ import 'package:flutter/material.dart'; -import 'package:mgramseva/model/common/BillsTableData.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'; -import 'generic_report_table.dart'; class InactiveConsumerReport extends StatefulWidget { final Function onViewClick; @@ -27,77 +23,85 @@ class _CollectionReport extends State with SingleTickerProviderStateMixin { @override Widget build(BuildContext context) { + final reportProvider = Provider.of(context); + return LayoutBuilder(builder: (context, constraints) { - return Consumer(builder: (_, reportProvider, child) { - return Container( - margin: constraints.maxWidth > 700 - ? const EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 10) - : const EdgeInsets.only(top: 5.0, bottom: 5, right: 8, left: 8), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( + 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 Container( + margin: containerMargin, + width: constraints.maxWidth, + 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("3. ", - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), Text( + "3. ", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + Expanded( + child: Text( ApplicationLocalizations.of(context) .translate(i18.dashboard.INACTIVE_CONSUMER_REPORT), - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), - ], - ), - Row( - children: [ - Container( - width: 50, - child: Button( - "View", - () { - if (reportProvider.selectedBillPeriod == null) { - Notifiers.getToastMessage( - context, 'Select Billing Cycle', 'ERROR'); - } else { - reportProvider.clearTableData(); - reportProvider.getInactiveConsumerReport(); - widget.onViewClick( - true, i18.dashboard.INACTIVE_CONSUMER_REPORT); - } - }, - key: Keys.billReport.INACTIVE_CONSUMER_REPORT_VIEW_BUTTON, + maxLines: 3, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), ), ), - SizedBox( - width: 10, - ), - TextButton.icon( - onPressed: () { - if (reportProvider.selectedBillPeriod == null) { - Notifiers.getToastMessage( - context, 'Select Billing Cycle', 'ERROR'); - } else { - reportProvider.getInactiveConsumerReport( - download: true); - } - }, - icon: Icon(Icons.download_sharp), - label: Text(ApplicationLocalizations.of(context) - .translate(i18.common.CORE_DOWNLOAD))), ], ), - ], - ), - ], - ), - ); - }); + ), + + Row( + children: [ + Container( + width: 50, + child: Button( + ApplicationLocalizations.of(context) + .translate(i18.common.VIEW), + () { + if (reportProvider.selectedBillPeriod == null) { + Notifiers.getToastMessage(context, '${ApplicationLocalizations.of(context).translate(i18.common.SELECT_BILLING_CYCLE)}', 'ERROR'); + } else { + reportProvider.clearTableData(); + reportProvider.getInactiveConsumerReport(); + widget.onViewClick( + true, i18.dashboard.INACTIVE_CONSUMER_REPORT); + } + }, + key: Keys.billReport.INACTIVE_CONSUMER_REPORT_VIEW_BUTTON, + ), + ), + SizedBox(width: 10), + TextButton.icon( + onPressed: () { + if (reportProvider.selectedBillPeriod == null) { + Notifiers.getToastMessage(context, '${ApplicationLocalizations.of(context).translate(i18.common.SELECT_BILLING_CYCLE)}', 'ERROR'); + } else { + reportProvider.getInactiveConsumerReport(download: true); + } + }, + icon: Icon(Icons.download_sharp), + label: Text(ApplicationLocalizations.of(context) + .translate(i18.common.CORE_DOWNLOAD)), + ), + ], + ), + ], + ), + ], + ), + ); }); } } diff --git a/frontend/mgramseva/lib/screeens/reports/reports.dart b/frontend/mgramseva/lib/screeens/reports/reports.dart index 8f00250ed..53305da4a 100644 --- a/frontend/mgramseva/lib/screeens/reports/reports.dart +++ b/frontend/mgramseva/lib/screeens/reports/reports.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:mgramseva/screeens/reports/expense_bill_report.dart'; import 'package:mgramseva/screeens/reports/inactive_consumer_report.dart'; +import 'package:mgramseva/screeens/reports/vendor_report.dart'; import 'package:mgramseva/screeens/reports/view_table.dart'; import 'package:provider/provider.dart'; @@ -17,7 +19,6 @@ import '../../widgets/select_field_builder.dart'; import '../../widgets/side_bar.dart'; import 'bill_report.dart'; import 'collection_report.dart'; -import 'generic_report_table.dart'; class Reports extends StatefulWidget { const Reports({Key? key}) : super(key: key); @@ -166,12 +167,13 @@ class _Reports extends State with SingleTickerProviderStateMixin { reportProvider .getFinancialYearListDropdown( reportProvider - .languageList), + .billingYearList), true, + readOnly: false, controller: reportProvider .billingyearCtrl, key: Keys.billReport - .BILL_REPORT_BILLING_YEAR, + .BILL_REPORT_BILLING_YEAR, itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i.financialYear)}", ), SelectFieldBuilder( i18.demandGenerate @@ -187,10 +189,11 @@ class _Reports extends State with SingleTickerProviderStateMixin { reportProvider .selectedBillYear), true, + readOnly: false, controller: reportProvider .billingcycleCtrl, key: Keys.billReport - .BILL_REPORT_BILLING_CYCLE, + .BILL_REPORT_BILLING_CYCLE, itemAsString: (i) =>"${ApplicationLocalizations.of(context).translate(i['name'])}", ), ], ), @@ -213,7 +216,9 @@ class _Reports extends State with SingleTickerProviderStateMixin { children: [ BillReport(onViewClick: showTable), CollectionReport(onViewClick: showTable), - InactiveConsumerReport(onViewClick: showTable,) + InactiveConsumerReport(onViewClick: showTable,), + ExpenseBillReport(onViewClick: showTable,), + VendorReport(onViewClick: showTable,) ], ), ), diff --git a/frontend/mgramseva/lib/screeens/reports/vendor_report.dart b/frontend/mgramseva/lib/screeens/reports/vendor_report.dart new file mode 100644 index 000000000..63a34285c --- /dev/null +++ b/frontend/mgramseva/lib/screeens/reports/vendor_report.dart @@ -0,0 +1,112 @@ +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 VendorReport extends StatefulWidget { + final Function onViewClick; + + VendorReport({Key? key, required this.onViewClick}) : super(key: key); + + @override + State createState() => _VendorReportState(); +} + +class _VendorReportState extends State + 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(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( + "5. ", + style: TextStyle( + fontSize: 14, fontWeight: FontWeight.w700), + ), + Expanded( + child: Text( + ApplicationLocalizations.of(context) + .translate(i18.dashboard.VENDOR_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, '${ApplicationLocalizations.of(context).translate(i18.common.SELECT_BILLING_CYCLE)}', 'ERROR'); + } else { + reportProvider.clearTableData(); + reportProvider.getVendorReport(); + widget.onViewClick( + true, i18.dashboard.VENDOR_REPORT); + } + }, + key: Keys.billReport.VENDOR_REPORT_VIEW_BUTTON, + ), + ), + SizedBox( + width: 10, + ), + TextButton.icon( + onPressed: () { + if (reportProvider.selectedBillPeriod == null) { + Notifiers.getToastMessage( + context, '${ApplicationLocalizations.of(context).translate(i18.common.SELECT_BILLING_CYCLE)}', 'ERROR'); + } else { + reportProvider.getVendorReport( + download: true); + } + }, + icon: Icon(Icons.download_sharp), + label: Text(ApplicationLocalizations.of(context) + .translate(i18.common.CORE_DOWNLOAD))), + ], + ), + ], + ), + ], + ), + ); + }); + }); + } +} \ No newline at end of file diff --git a/frontend/mgramseva/lib/screeens/reports/view_table.dart b/frontend/mgramseva/lib/screeens/reports/view_table.dart index 457e78eed..ac837027b 100644 --- a/frontend/mgramseva/lib/screeens/reports/view_table.dart +++ b/frontend/mgramseva/lib/screeens/reports/view_table.dart @@ -1,7 +1,5 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import '../../providers/reports_provider.dart'; import '../../utils/constants.dart'; import '../../utils/date_formats.dart'; diff --git a/frontend/mgramseva/lib/screeens/reset_password/reset_password.dart b/frontend/mgramseva/lib/screeens/reset_password/reset_password.dart index 9a9b8eaa0..cee5a42d5 100644 --- a/frontend/mgramseva/lib/screeens/reset_password/reset_password.dart +++ b/frontend/mgramseva/lib/screeens/reset_password/reset_password.dart @@ -298,14 +298,12 @@ class _ResetPasswordState extends State { var resetResponse = await ResetPasswordRepository().forgotPassword(body, context); Navigator.pop(context); - if (resetResponse != null) { - Navigator.push( - context, - MaterialPageRoute( - builder: (_) => PasswordSuccess(), - settings: RouteSettings(name: '/resetPasswordSuccess'))); - } - } catch (e, s) { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => PasswordSuccess(), + settings: RouteSettings(name: '/resetPasswordSuccess'))); + } catch (e, s) { Navigator.pop(context); ErrorHandler().allExceptionsHandler(context, e, s); } diff --git a/frontend/mgramseva/lib/screeens/select_language/language_selection_desktop_view.dart b/frontend/mgramseva/lib/screeens/select_language/language_selection_desktop_view.dart index 35fede434..99ebab331 100644 --- a/frontend/mgramseva/lib/screeens/select_language/language_selection_desktop_view.dart +++ b/frontend/mgramseva/lib/screeens/select_language/language_selection_desktop_view.dart @@ -8,9 +8,7 @@ import 'package:mgramseva/widgets/background_container.dart'; import 'package:mgramseva/widgets/button.dart'; import 'package:mgramseva/widgets/language_card.dart'; import 'package:mgramseva/widgets/footer_banner.dart'; -import 'package:provider/provider.dart'; -import '../../providers/language.dart'; class LanguageSelectionDesktopView extends StatelessWidget { final StateInfo stateInfo; diff --git a/frontend/mgramseva/lib/services/urls.dart b/frontend/mgramseva/lib/services/urls.dart index 9972db9f3..d99b7ae45 100644 --- a/frontend/mgramseva/lib/services/urls.dart +++ b/frontend/mgramseva/lib/services/urls.dart @@ -50,6 +50,7 @@ class Url { static const String FETCH_WC_CONNECTION = 'ws-services/wc/_search'; static const String VENDOR_SEARCH = 'vendor/v1/_search'; static const String CREATE_VENDOR = 'vendor/v1/_create'; + static const String VENDOR_REPORT = 'vendor/v1/_vendorReport'; static const String EGOV_LOCATIONS = 'egov-location/location/v11/boundarys/_search'; @@ -93,6 +94,8 @@ class Url { 'ws-services/wc/_collectionReport'; static const String INACTIVE_CONSUMER_REPORT= 'ws-services/wc/_inactiveConsumerReport'; + static const String EXPENSE_BILL_REPORT= + 'echallan-services/eChallan/v1/_expenseBillReport'; } diff --git a/frontend/mgramseva/lib/theme.dart b/frontend/mgramseva/lib/theme.dart index af06d0cc3..b03d3ffe5 100644 --- a/frontend/mgramseva/lib/theme.dart +++ b/frontend/mgramseva/lib/theme.dart @@ -2,13 +2,19 @@ import 'package:flutter/material.dart'; import 'package:mgramseva/utils/color_codes.dart'; ThemeData get theme => ThemeData( - primarySwatch: createMaterialColor(Color(0XFFf47738)), highlightColor: createMaterialColor(Color(0XFFC7E0F1)), - backgroundColor: createMaterialColor(Color.fromRGBO(238, 238, 238, 1)), hintColor: createMaterialColor(Color(0XFF3498DB)), primaryColorDark: Color.fromRGBO(11, 12, 12, 1), primaryColorLight: Color.fromRGBO(80, 90, 95, 1), + primaryColor: Color.fromRGBO(244, 119, 56, 1), disabledColor: Colors.grey, + cardTheme: CardTheme(surfaceTintColor: Colors.white,shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(3))), + datePickerTheme: DatePickerThemeData( + surfaceTintColor: Colors.white + ), + drawerTheme: DrawerThemeData( + surfaceTintColor: Colors.white + ), // accentColor: Color(0xff0B4B66), appBarTheme: AppBarTheme( @@ -16,15 +22,17 @@ ThemeData get theme => ThemeData( centerTitle: false, ), textTheme: TextTheme( - headline1: TextStyle(fontWeight: FontWeight.w700, fontSize: 32, fontStyle: FontStyle.normal, color: Color.fromRGBO(11, 12, 12, 1)), - headline2: TextStyle(fontWeight: FontWeight.w700, fontSize: 24), - button: TextStyle(fontWeight: FontWeight.w500, fontSize: 19, color: Colors.white), // Elevated Button(Orange) - subtitle1: TextStyle(fontWeight: FontWeight.w400, fontSize: 16), - subtitle2: TextStyle(fontWeight: FontWeight.w400, fontSize: 16, color: Color.fromRGBO(244, 119, 56, 1)) // Only for outlined button text + displayLarge: TextStyle(fontWeight: FontWeight.w700, fontSize: 32, fontStyle: FontStyle.normal, color: Color.fromRGBO(11, 12, 12, 1)), + displayMedium: TextStyle(fontWeight: FontWeight.w700, fontSize: 24), + labelLarge: TextStyle(fontWeight: FontWeight.w500, fontSize: 19, color: Colors.white), // Elevated Button(Orange) + labelMedium: TextStyle(fontWeight: FontWeight.w500, fontSize: 14, color: Colors.white), // Elevated Button(Orange) + labelSmall: TextStyle(fontWeight: FontWeight.w500, fontSize: 10, color: Colors.white), // Elevated Button(Orange) + titleMedium: TextStyle(fontWeight: FontWeight.w400, fontSize: 16), + titleSmall: TextStyle(fontWeight: FontWeight.w400, fontSize: 16, color: Color.fromRGBO(244, 119, 56, 1)) // Only for outlined button text ), /// Background color - // scaffoldBackgroundColor: Color.fromRGBO(238, 238, 238, 1), + scaffoldBackgroundColor: Color.fromRGBO(238, 238, 238, 1), textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom( @@ -67,7 +75,7 @@ ThemeData get theme => ThemeData( iconTheme: IconThemeData( color: ColorCodes.HOME_ICON, // size: 25 - )); + ), colorScheme: ColorScheme.fromSwatch(primarySwatch: createMaterialColor(Color(0XFFf47738))).copyWith(background: createMaterialColor(Color.fromRGBO(238, 238, 238, 1)))); MaterialColor createMaterialColor(Color color) { List strengths = [.05]; diff --git a/frontend/mgramseva/lib/utils/common_methods.dart b/frontend/mgramseva/lib/utils/common_methods.dart index 648a3f651..633b4d38f 100644 --- a/frontend/mgramseva/lib/utils/common_methods.dart +++ b/frontend/mgramseva/lib/utils/common_methods.dart @@ -58,56 +58,63 @@ class CommonMethods { * * */ - static List getPastMonthUntilFinancialYTD(DatePeriod ytd,{bool showCurrentMonth = false}) { + static List getPastMonthUntilFinancialYTD(DatePeriod ytd, + {bool showCurrentMonth = false}) { var monthList = []; final currentTime = DateTime.now(); - if(currentTime.year < ytd.startDate.year){ + if (currentTime.year < ytd.startDate.year) { return []; } if (currentTime.year == ytd.startDate.year) { //when current year is same as start year of financial year - for (int i = ytd.startDate.month; i <= (showCurrentMonth?currentTime.month:currentTime.month-1); i++) { + for (int i = ytd.startDate.month; + i <= (showCurrentMonth ? currentTime.month : currentTime.month - 1); + i++) { monthList.add(DateTime(currentTime.year, i)); } - } else if(currentTime.year == ytd.endDate.year){ + } else if (currentTime.year == ytd.endDate.year) { //when current year is same as end year of financial year for (int i = ytd.startDate.month; i <= 12; i++) { monthList.add(DateTime(ytd.startDate.year, i)); } for (int i = 1; - i <= (currentTime.month <= ytd.endDate.month ? showCurrentMonth?currentTime.month:currentTime.month-1: ytd.endDate.month); - /* + i <= + (currentTime.month <= ytd.endDate.month + ? showCurrentMonth + ? currentTime.month + : currentTime.month - 1 + : ytd.endDate.month); + /* * if current month is less than or equal to end month of financial year * we are using months less than current month and if it is more than * end month of financial year we are using till end month of financial * year */ - i++) { + i++) { monthList.add(DateTime(ytd.endDate.year, i)); } - }else{ + } else { for (int i = ytd.startDate.month; i <= 12; i++) { monthList.add(DateTime(ytd.startDate.year, i)); } - for (int i = 1; - i <= ytd.endDate.month; - i++) { - monthList.add(DateTime(ytd.endDate.year , i)); + for (int i = 1; i <= ytd.endDate.month; i++) { + monthList.add(DateTime(ytd.endDate.year, i)); } } var list = monthList .map((e) => DatePeriod(DateTime(e.year, e.month, 1), - DateTime(e.year, e.month + 1, 0, 23, 59, 59, 999), DateType.MONTH)) + DateTime(e.year, e.month + 1, 0, 23, 59, 59, 999), DateType.MONTH)) .toList() .reversed .toList(); return list; } - static List getPastMonthIncludingCurrentMonthUntilFinancialYTD(DatePeriod ytd) { + static List getPastMonthIncludingCurrentMonthUntilFinancialYTD( + DatePeriod ytd) { var monthList = []; final currentTime = DateTime.now(); - if(currentTime.year < ytd.startDate.year){ + if (currentTime.year < ytd.startDate.year) { return []; } if (currentTime.year == ytd.startDate.year) { @@ -115,35 +122,36 @@ class CommonMethods { for (int i = ytd.startDate.month; i <= currentTime.month; i++) { monthList.add(DateTime(currentTime.year, i)); } - } else if(currentTime.year == ytd.endDate.year){ + } else if (currentTime.year == ytd.endDate.year) { //when current year is same as end year of financial year for (int i = ytd.startDate.month; i <= 12; i++) { monthList.add(DateTime(ytd.startDate.year, i)); } for (int i = 1; - i <= (currentTime.month <= ytd.endDate.month ? currentTime.month: ytd.endDate.month); - /* + i <= + (currentTime.month <= ytd.endDate.month + ? currentTime.month + : ytd.endDate.month); + /* * if current month is less than or equal to end month of financial year * we are using months less than current month and if it is more than * end month of financial year we are using till end month of financial * year */ - i++) { + i++) { monthList.add(DateTime(ytd.endDate.year, i)); } - }else{ + } else { for (int i = ytd.startDate.month; i <= 12; i++) { monthList.add(DateTime(ytd.startDate.year, i)); } - for (int i = 1; - i <= ytd.endDate.month; - i++) { - monthList.add(DateTime(ytd.endDate.year , i)); + for (int i = 1; i <= ytd.endDate.month; i++) { + monthList.add(DateTime(ytd.endDate.year, i)); } } var list = monthList .map((e) => DatePeriod(DateTime(e.year, e.month, 1), - DateTime(e.year, e.month + 1, 0, 23, 59, 59, 999), DateType.MONTH)) + DateTime(e.year, e.month + 1, 0, 23, 59, 59, 999), DateType.MONTH)) .toList() .reversed .toList(); @@ -179,7 +187,9 @@ class CommonMethods { } return yearWithMonths; } - static List getFinancialYearListWithCurrentMonthForCurrentYear([int count = 5]) { + + static List + getFinancialYearListWithCurrentMonthForCurrentYear([int count = 5]) { var yearWithMonths = []; if (DateTime.now().month >= 4) { diff --git a/frontend/mgramseva/lib/utils/common_widgets.dart b/frontend/mgramseva/lib/utils/common_widgets.dart index e6bc0b09f..5032db618 100644 --- a/frontend/mgramseva/lib/utils/common_widgets.dart +++ b/frontend/mgramseva/lib/utils/common_widgets.dart @@ -17,7 +17,7 @@ class CommonWidgets { static Widget buildEmptyMessage(String label, BuildContext context) { return Container( alignment: Alignment.center, - child: Text('${ApplicationLocalizations.of(context).translate(label)}', style: Theme.of(context).textTheme.subtitle1), + child: Text('${ApplicationLocalizations.of(context).translate(label)}', style: Theme.of(context).textTheme.titleMedium), ); } } \ No newline at end of file diff --git a/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart b/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart index cb186d523..1b1573ec4 100644 --- a/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart +++ b/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart @@ -68,6 +68,7 @@ class Common { String get BACK => 'BACK'; String get DEAR => 'DEAR'; String get VIEW_ALL => 'VIEW_ALL'; + String get VIEW => 'VIEW'; String get ALL_NOTIFICATIONS => 'ALL_NOTIFICATIONS'; String get CORE_FATHER_NAME => 'CORE_FATHER_NAME'; @@ -128,7 +129,12 @@ class Common { String get WATER_CHARGES => 'WS_CHARGE'; //Please enter Mobile number String get ARREARS => 'ARREARS'; //Please enter Mobile number String get COLLECT_PAYMENT => 'COLLECT_PAYMENT'; + String get BY_CONTINUING_YOU_ACCEPT_OUR => 'BY_CONTINUING_YOU_ACCEPT_OUR'; String get ONLINE => 'ONLINE'; + String get AND => 'AND'; + String get PRIVACY_POLICY => 'PRIVACY_POLICY'; + String get TERMS_OF_USE => 'TERMS_OF_USE'; + String get SELECT_BILLING_CYCLE => 'SELECT_BILLING_CYCLE'; String get CHEQUE => 'CHEQUE'; String get CASH => 'CASH'; String get DD => 'DD'; @@ -356,6 +362,11 @@ class Expense { String get HAS_THIS_BILL_PAID => 'HAS_THIS_BILL_PAID'; String get CANCELLED => 'CANCELLED'; String get ADD_NEW_EXPENSE => 'ADD_NEW_EXPENSE'; + String get APPLICATION_STATUS => 'APPLICATION_STATUS'; + String get PAID_DATE => 'PAID_DATE'; + String get HAS_ATTACHMENT => 'HAS_ATTACHMENT'; + String get CANCELLED_TIME => 'CANCELLED_TIME'; + String get CANCELLED_BY => 'CANCELLED_BY'; } class CreateConsumer { @@ -470,6 +481,10 @@ class DemandGenerate { String get METER_NUMBER_LABEL => 'GENERATE_DEMAND_METER_NUMBER_LABEL'; String get BILLING_YEAR_LABEL => 'GENERATE_DEMAND_BILLING_YEAR_LABEL'; String get BILLING_CYCLE_LABEL => 'GENERATE_DEMAND_BILLING_CYCLE_LABEL'; + String get NO_DEMAND_GEN_WITH_RATE_0 => 'NO_DEMAND_GEN_WITH_RATE_0'; + String get NO_SERVICE_PRESENT_WITH_RATE_MORE_THAN_0 => 'NO_SERVICE_PRESENT_WITH_RATE_MORE_THAN_0'; + String get ARE_YOU_SURE_TO_GENERATE_DEMAND_FOR => 'ARE_YOU_SURE_TO_GENERATE_DEMAND_FOR'; + String get WITH_MINIMUM_CHARGE_OF => 'WITH_MINIMUM_CHARGE_OF'; String get PREV_METER_READING_LABEL => 'GENERATE_DEMAND_PREV_METER_READING_LABEL'; String get NEW_METER_READING_LABEL => @@ -655,6 +670,7 @@ class _DashBoard { String get PENDING_EXPENDITURE => 'PENDING_EXPENDITURE'; String get ACTUAL_PAYMENT => 'ACTUAL_PAYMENT'; String get SUMMARY_REPORT => 'SUMMARY_REPORT'; + String get EXPENSE_BILL_REPORT => 'EXPENSE_BILL_REPORT'; String get USER_GAVE_FEEDBACK => 'USER_GAVE_FEEDBACK'; String get ANNUAL_SHARE_MSG_WEB => 'ANNUAL_SHARE_MSG_WEB'; @@ -682,6 +698,7 @@ class _DashBoard { String get CORE_REPORTS => 'CORE_REPORTS'; String get BILL_REPORT => 'BILL_REPORT'; String get COLLECTION_REPORT => 'COLLECTION_REPORT'; + String get VENDOR_REPORT => 'VENDOR_REPORT'; String get INACTIVE_CONSUMER_REPORT => 'INACTIVE_CONSUMER_REPORT'; String get GPWSC_RATE_INFO => 'GPWSC_RATE_INFO'; } diff --git a/frontend/mgramseva/lib/utils/date_formats.dart b/frontend/mgramseva/lib/utils/date_formats.dart index 41fae3fbf..7007c13b1 100644 --- a/frontend/mgramseva/lib/utils/date_formats.dart +++ b/frontend/mgramseva/lib/utils/date_formats.dart @@ -9,21 +9,21 @@ import 'models.dart'; class DateFormats { static getFilteredDate(String date, {String? dateFormat}) { - if (date == null || date.trim().isEmpty) return ''; + if (date.trim().isEmpty) return ''; try { var dateTime = DateTime.parse(date).toLocal(); return DateFormat(dateFormat ?? "dd-MM-yyyy").format(dateTime); - } on Exception catch (e) { + } on Exception { return ''; } } static DateTime? getDateFromString(String date) { - if (date == null || date.trim().isEmpty) return null; + if (date.trim().isEmpty) return null; try { var dateTime = DateTime.parse(date).toLocal(); return dateTime; - } on Exception catch (e) { + } on Exception { return null; } } @@ -38,17 +38,17 @@ class DateFormats { } var inputDate = inputFormat.parse(date); return inputDate; - } on Exception catch (e) { + } on Exception { return null; } } static String getTime(String date) { - if (date == null || date.trim().isEmpty) return ''; + if (date.trim().isEmpty) return ''; try { var dateTime = getDateFromString(date); return DateFormat.Hms().format(dateTime!); - } on Exception catch (e, stackTrace) { + } on Exception { return ''; } } @@ -57,7 +57,7 @@ class DateFormats { try { var dateTime = getDateFromString(date); return DateFormat.jm().format(dateTime!); - } on Exception catch (e, stackTrace) { + } on Exception { return ''; } } diff --git a/frontend/mgramseva/lib/utils/excel_download/save_file_mobile.dart b/frontend/mgramseva/lib/utils/excel_download/save_file_mobile.dart index c7ddbff8b..72954f956 100644 --- a/frontend/mgramseva/lib/utils/excel_download/save_file_mobile.dart +++ b/frontend/mgramseva/lib/utils/excel_download/save_file_mobile.dart @@ -1,9 +1,11 @@ import 'dart:io'; -import 'package:open_file/open_file.dart' as open_file; +import 'package:flutter/foundation.dart'; +import 'package:open_filex/open_filex.dart' as open_file; import 'package:path_provider/path_provider.dart' as path_provider; // ignore: depend_on_referenced_packages import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; +import 'save_file_web.dart' as sfw; ///To save the Excel file in the device ///To save the Excel file in the device @@ -25,7 +27,7 @@ Future saveAndLaunchFile(List bytes, String fileName) async { await file.writeAsBytes(bytes, flush: true); if (Platform.isAndroid || Platform.isIOS) { //Launch the file (used open_file package) - await open_file.OpenFile.open('$path/$fileName'); + await open_file.OpenFilex.open('$path/$fileName'); } else if (Platform.isWindows) { await Process.run('start', ['$path\\$fileName'], runInShell: true); } else if (Platform.isMacOS) { @@ -33,5 +35,7 @@ Future saveAndLaunchFile(List bytes, String fileName) async { } else if (Platform.isLinux) { await Process.run('xdg-open', ['$path/$fileName'], runInShell: true); + }else if (kIsWeb){ + sfw.saveAndLaunchFile(bytes,fileName); } } diff --git a/frontend/mgramseva/lib/utils/excel_download/save_file_web.dart b/frontend/mgramseva/lib/utils/excel_download/save_file_web.dart index 08f09f2d3..5503dcff0 100644 --- a/frontend/mgramseva/lib/utils/excel_download/save_file_web.dart +++ b/frontend/mgramseva/lib/utils/excel_download/save_file_web.dart @@ -1,12 +1,12 @@ import 'dart:async'; import 'dart:convert'; // ignore: avoid_web_libraries_in_flutter -import 'dart:html'; +import 'package:universal_html/html.dart' as htmlk; ///To save the Excel file in the device ///To save the Excel file in the device Future saveAndLaunchFile(List bytes, String fileName) async { - AnchorElement( + htmlk.AnchorElement( href: 'data:application/octet-stream;charset=utf-16le;base64,${base64.encode(bytes)}') ..setAttribute('download', fileName) diff --git a/frontend/mgramseva/lib/utils/loaders.dart b/frontend/mgramseva/lib/utils/loaders.dart index 242314651..a4dce80bf 100644 --- a/frontend/mgramseva/lib/utils/loaders.dart +++ b/frontend/mgramseva/lib/utils/loaders.dart @@ -34,7 +34,7 @@ class Loaders { // controller: AnimationController(vsync: this, duration: const Duration(milliseconds: 1200)), // ), CircularProgressIndicator( - color: Theme.of(context).accentColor, + color: Theme.of(context).primaryColor, ), const SizedBox( height: 10, diff --git a/frontend/mgramseva/lib/utils/localization/application_localizations.dart b/frontend/mgramseva/lib/utils/localization/application_localizations.dart index a83fe129f..922961f06 100644 --- a/frontend/mgramseva/lib/utils/localization/application_localizations.dart +++ b/frontend/mgramseva/lib/utils/localization/application_localizations.dart @@ -1,6 +1,4 @@ import 'dart:async'; -import 'dart:convert'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:mgramseva/model/localization/localization_label.dart'; import 'package:mgramseva/providers/common_provider.dart'; diff --git a/frontend/mgramseva/lib/utils/notifiers.dart b/frontend/mgramseva/lib/utils/notifiers.dart index f37b7a3b9..a7771eba3 100644 --- a/frontend/mgramseva/lib/utils/notifiers.dart +++ b/frontend/mgramseva/lib/utils/notifiers.dart @@ -20,6 +20,9 @@ class Notifiers { Padding( padding: EdgeInsets.all(12.0), child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color.fromRGBO(244, 119, 56, 0.7) + ), onPressed: callBack, child: Text( 'Retry', diff --git a/frontend/mgramseva/lib/utils/print_bluetooth.dart b/frontend/mgramseva/lib/utils/print_bluetooth.dart index 2fed16914..f51f4d016 100644 --- a/frontend/mgramseva/lib/utils/print_bluetooth.dart +++ b/frontend/mgramseva/lib/utils/print_bluetooth.dart @@ -1,14 +1,13 @@ import 'dart:typed_data'; -import 'printer/esc_pos_utils_platform/esc_pos_utils_platform.dart'; import 'package:mgramseva/utils/printer/image_utils.dart'; import 'package:flutter/material.dart'; import 'package:mgramseva/utils/constants/i18_key_constants.dart'; -import 'package:nearby_connections/nearby_connections.dart'; import 'package:image/image.dart' as img; import 'package:permission_handler/permission_handler.dart'; import 'package:print_bluetooth_thermal/print_bluetooth_thermal.dart'; +import 'package:mgramseva/utils/printer/esc_pos_utils_platform/esc_pos_utils_platform.dart'; import 'localization/application_localizations.dart'; @@ -89,8 +88,9 @@ class PrintBluetooth { print(isPermissionGranted); if (!isPermissionGranted) { await Permission.bluetooth.request(); + await Permission.bluetoothScan.request(); await Permission.location.request(); - await Nearby().askLocationPermission(); + await Permission.bluetoothConnect.request(); } bool? isConnected = await PrintBluetoothThermal.connectionStatus; if (isConnected) { @@ -110,11 +110,11 @@ class PrintBluetooth { final generator = Generator(PaperSize.mm58, profile); final Uint8List imageBytes = value; final decodedImage = img.decodeImage(imageBytes)!; - img.Image thumbnail = img.copyResize(decodedImage,width: PaperSize.mm58.width); + img.Image thumbnail = img.copyResize(decodedImage,width: PaperSize.mm58.width,maintainAspect: false,); // creates a copy of the original image with set dimensions - img.Image originalImg = img.copyResize(decodedImage, width: PaperSize.mm58.width); + img.Image originalImg = img.copyResize(decodedImage, width: PaperSize.mm58.width,maintainAspect: false, ); // fills the original image with a white background - img.fill(originalImg, img.getColor(255, 255, 255)); + img.fill(originalImg, color: img.ColorRgb8(255, 255, 255)); // var padding = (originalImg.width - thumbnail.width) / 2; // // //insert the image inside the frame and center it diff --git a/frontend/mgramseva/lib/utils/printer/esc_pos_utils_platform/src/generator.dart b/frontend/mgramseva/lib/utils/printer/esc_pos_utils_platform/src/generator.dart index 82662fb40..0f1b16fcc 100644 --- a/frontend/mgramseva/lib/utils/printer/esc_pos_utils_platform/src/generator.dart +++ b/frontend/mgramseva/lib/utils/printer/esc_pos_utils_platform/src/generator.dart @@ -137,7 +137,7 @@ class Generator { // Create a black bottom layer final biggerImage = img.copyResize(image, width: widthPx, height: heightPx); - img.fill(biggerImage, img.getColor(255,255, 255)); + img.fill(biggerImage, color:img.ColorRgb8(255,255, 255)); // Insert source image into bigger one drawImage(biggerImage, image, dstX: 0, dstY: 0); @@ -145,7 +145,7 @@ class Generator { final List> blobs = []; while (left < widthPx) { - final img.Image slice = img.copyCrop(biggerImage, left, 0, lineHeight, heightPx); + final img.Image slice = img.copyCrop(biggerImage, x:left, y:0, width:lineHeight, height: heightPx,); final Uint8List bytes = slice.getBytes(); // slice.getBytes(format: luminance) blobs.add(bytes); left += lineHeight; @@ -681,8 +681,8 @@ class Generator { const bool highDensityVertical = true; img.invert(image); - img.flip(image, img.Flip.horizontal); - final img.Image imageRotated = img.copyRotate(image, 270); + img.flip(image, direction: img.FlipDirection.horizontal); + final img.Image imageRotated = img.copyRotate(image, angle: 270); // ignore: dead_code const int lineHeight = highDensityVertical ? 3 : 1; diff --git a/frontend/mgramseva/lib/utils/testing_keys/testing_keys.dart b/frontend/mgramseva/lib/utils/testing_keys/testing_keys.dart index abae97452..4da92c398 100644 --- a/frontend/mgramseva/lib/utils/testing_keys/testing_keys.dart +++ b/frontend/mgramseva/lib/utils/testing_keys/testing_keys.dart @@ -138,4 +138,6 @@ class BillReportKeys { Key get COLLECTION_REPORT_DOWNLOAD_BUTTON => Key("collection_report_download_button"); Key get BILL_REPORT_BILLING_YEAR => Key("bill_report_billing_year"); Key get BILL_REPORT_BILLING_CYCLE => Key("bill_report_billing_cycle"); + Key get EXPENSE_BILL_REPORT_VIEW_BUTTON => Key("expense_bill_report_view_button"); + Key get VENDOR_REPORT_VIEW_BUTTON => Key("vendor_report_view_button"); } \ No newline at end of file diff --git a/frontend/mgramseva/lib/utils/validators/validators.dart b/frontend/mgramseva/lib/utils/validators/validators.dart index 1fb309612..dffa31df9 100644 --- a/frontend/mgramseva/lib/utils/validators/validators.dart +++ b/frontend/mgramseva/lib/utils/validators/validators.dart @@ -1,7 +1,6 @@ import 'package:mgramseva/utils/constants/i18_key_constants.dart'; import 'package:mgramseva/utils/localization/application_localizations.dart'; import 'package:mgramseva/utils/global_variables.dart'; -import 'dart:math' as math; class Validators { static validate(value, type) { diff --git a/frontend/mgramseva/lib/widgets/bottom_button_bar.dart b/frontend/mgramseva/lib/widgets/bottom_button_bar.dart index 65489bfa2..674756c32 100644 --- a/frontend/mgramseva/lib/widgets/bottom_button_bar.dart +++ b/frontend/mgramseva/lib/widgets/bottom_button_bar.dart @@ -45,10 +45,11 @@ class BottomButtonBar extends StatelessWidget { print(ApplicationLocalizations.of(context).translate(this.label)); return ElevatedButton( style: ElevatedButton.styleFrom( - primary: callBack != null ? Color.fromRGBO(244, 119, 56, 0.7) : Color.fromRGBO(235,235,228, 0.7) + backgroundColor: callBack != null ? Color.fromRGBO(244, 119, 56, 1) : Color.fromRGBO(235,235,228, 0.7) ), child: Text( ApplicationLocalizations.of(context).translate(this.label), + style: Theme.of(context).textTheme.labelLarge, ), onPressed: () => callBack != null ? callBack!() : null, ); diff --git a/frontend/mgramseva/lib/widgets/button.dart b/frontend/mgramseva/lib/widgets/button.dart index b399b0101..8c91a1d58 100644 --- a/frontend/mgramseva/lib/widgets/button.dart +++ b/frontend/mgramseva/lib/widgets/button.dart @@ -15,12 +15,11 @@ class Button extends StatelessWidget { decoration: CommonStyles.buttonBottomDecoration, child: new ElevatedButton( style: ElevatedButton.styleFrom( - minimumSize: Size(double.infinity, 50), - primary: widgetFunction == null ? Color.fromRGBO(244, 119, 56, 0.7) : null + minimumSize: Size(double.infinity, 50), backgroundColor: widgetFunction != null ? Color.fromRGBO(244, 119, 56, 1) : Color.fromRGBO(244, 119, 56, 0.7) // padding: EdgeInsets.all(15), ), child: new Text(ApplicationLocalizations.of(context).translate(label), - style: Theme.of(context).textTheme.button), + style: Theme.of(context).textTheme.labelLarge), onPressed: () => widgetFunction != null ? widgetFunction!() : null ), )); diff --git a/frontend/mgramseva/lib/widgets/button_group.dart b/frontend/mgramseva/lib/widgets/button_group.dart index dfd579bc8..a562d8d1e 100644 --- a/frontend/mgramseva/lib/widgets/button_group.dart +++ b/frontend/mgramseva/lib/widgets/button_group.dart @@ -32,28 +32,23 @@ class ButtonGroup extends StatelessWidget { child: Row( children: [ Expanded( - child: OutlinedButton.icon( - onPressed: callBackIcon, - style: ButtonStyle( - alignment: Alignment.center, - padding: MaterialStateProperty.all( - EdgeInsets.symmetric(vertical: 0.0)), - shape: - MaterialStateProperty.all(RoundedRectangleBorder( - borderRadius: BorderRadius.circular(0.0), - side: BorderSide( - width: 2, - color: Theme.of(context).primaryColor), - )), - ), - icon: (Image.asset('assets/png/whats_app.png', fit: BoxFit.fitHeight,)), - label: Padding( - padding: const EdgeInsets.symmetric(vertical: 15), - child: Text( - ApplicationLocalizations.of(context) - .translate(i18.common.SHARE_BILL_PDF), - style: Theme.of(context).textTheme.subtitle2)), - )), + child: Container( + height: 48, + child: OutlinedButton.icon( + onPressed: callBackIcon, + style: ElevatedButton.styleFrom(padding:EdgeInsets.symmetric(vertical: 5),alignment: Alignment.center,side:BorderSide( + width: 1, + color: Theme.of(context).disabledColor), + ), + icon: (Image.asset('assets/png/whats_app.png', fit: BoxFit.fitHeight,)), + label: Padding( + padding: const EdgeInsets.symmetric(vertical: 0), + child: Text( + ApplicationLocalizations.of(context) + .translate(i18.common.SHARE_BILL_PDF), + style: Theme.of(context).textTheme.titleSmall)), + )), + ), Expanded(child: ShortButton(label, callBack)) ], ), diff --git a/frontend/mgramseva/lib/widgets/common_success_page.dart b/frontend/mgramseva/lib/widgets/common_success_page.dart index 0f9882a49..9520c18f1 100644 --- a/frontend/mgramseva/lib/widgets/common_success_page.dart +++ b/frontend/mgramseva/lib/widgets/common_success_page.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:mgramseva/model/success_handler.dart'; import 'package:mgramseva/utils/constants/i18_key_constants.dart'; @@ -112,6 +113,7 @@ class CommonSuccess extends StatelessWidget { null ? successHandler.downloadLinkLabel! : ''), + textScaleFactor: MediaQuery.of(context).size.width>360?0.9:0.68, style: TextStyle( fontSize: 16, color: Theme.of(context).primaryColor)), @@ -132,6 +134,7 @@ class CommonSuccess extends StatelessWidget { successHandler.printLabel != null ? successHandler.printLabel! : ''), + textScaleFactor: MediaQuery.of(context).size.width>360?0.9:0.68, style: TextStyle( fontSize: 16, color: Theme.of(context).primaryColor)), @@ -146,6 +149,7 @@ class CommonSuccess extends StatelessWidget { label: Text( ApplicationLocalizations.of(context) .translate(i18.common.SHARE_BILL), + textScaleFactor: MediaQuery.of(context).size.width>360?0.9:0.68, style: TextStyle( fontSize: 16, color: Theme.of(context).primaryColor), diff --git a/frontend/mgramseva/lib/widgets/confirmation_pop_up.dart b/frontend/mgramseva/lib/widgets/confirmation_pop_up.dart index 923bd22eb..18ab5a56c 100644 --- a/frontend/mgramseva/lib/widgets/confirmation_pop_up.dart +++ b/frontend/mgramseva/lib/widgets/confirmation_pop_up.dart @@ -39,7 +39,7 @@ class _ConfirmationPopUpState extends State { alignment: Alignment.center, constraints: BoxConstraints( minHeight: 160, - maxHeight: 180 + maxHeight: 190 ), width: MediaQuery.of(context).size.width > 720 ? MediaQuery.of(context).size.width / 3.5 : MediaQuery.of(context).size.width , padding: EdgeInsets.only(right: 8.0, left: 8.0), diff --git a/frontend/mgramseva/lib/widgets/custom_app_bar.dart b/frontend/mgramseva/lib/widgets/custom_app_bar.dart index cdbd0bf51..b6bb07c1b 100644 --- a/frontend/mgramseva/lib/widgets/custom_app_bar.dart +++ b/frontend/mgramseva/lib/widgets/custom_app_bar.dart @@ -130,15 +130,13 @@ class _CustomAppBarState extends State { ), onChanged: (text) { if(text.isEmpty){ - stateSetter(()=>{ - visibleTenants = tenants.asMap().values.toList() - }); + stateSetter(()=>visibleTenants = tenants.asMap().values.toList() + ); }else{ var tresult = tenants.where((e) => "${ApplicationLocalizations.of(context) .translate(e.code!)}-${e.city!.code!}".toLowerCase().trim().contains(text.toLowerCase().trim())).toList(); - stateSetter(()=>{ - visibleTenants = tresult - }); + stateSetter(()=>visibleTenants = tresult + ); } }, ), @@ -236,10 +234,10 @@ class _CustomAppBarState extends State { children: [ Text(ApplicationLocalizations.of(context) .translate(commonProvider - .userDetails!.selectedtenant!.code!)), + .userDetails!.selectedtenant!.code!),style: Theme.of(context).textTheme.labelMedium,), Text(ApplicationLocalizations.of(context) .translate(commonProvider.userDetails! - .selectedtenant!.city!.code!)) + .selectedtenant!.city!.code!),style: Theme.of(context).textTheme.labelSmall,) ])), Icon(Icons.arrow_drop_down) ], @@ -255,6 +253,7 @@ class _CustomAppBarState extends State { Provider.of(context, listen: false); return AppBar( titleSpacing: 0, + iconTheme: IconThemeData(color: Colors.white), title: Image( width: 130, image: NetworkImage( diff --git a/frontend/mgramseva/lib/widgets/file_picker.dart b/frontend/mgramseva/lib/widgets/file_picker.dart index 1835bda00..dfce5ab44 100644 --- a/frontend/mgramseva/lib/widgets/file_picker.dart +++ b/frontend/mgramseva/lib/widgets/file_picker.dart @@ -60,7 +60,7 @@ class FilePickerDemoState extends State { if(paths != null){ var isNotValidSize = false; for(var path in paths){ - if (!(await CommonMethods.isValidFileSize(path.size))) isNotValidSize = true;; + if (!(await CommonMethods.isValidFileSize(path.size))) isNotValidSize = true; } if(isNotValidSize){ @@ -333,7 +333,7 @@ class FilePickerDemoState extends State { if (!(await CommonMethods.isValidFileSize(await file.length()))){ Notifiers.getToastMessage(context, i18.common.FILE_SIZE, 'ERROR'); return; - }; + } if(_multiPick){ _selectedFiles.addAll([file]); }else{ diff --git a/frontend/mgramseva/lib/widgets/label_text.dart b/frontend/mgramseva/lib/widgets/label_text.dart index 53c7a29fa..d9034d392 100644 --- a/frontend/mgramseva/lib/widgets/label_text.dart +++ b/frontend/mgramseva/lib/widgets/label_text.dart @@ -15,7 +15,7 @@ class LabelText extends StatelessWidget { padding: padding ?? (constraints.maxWidth > 760 ? const EdgeInsets.all(20.0) : const EdgeInsets.all(8.0)), child: Text( ApplicationLocalizations.of(context).translate(input), - style: Theme.of(context).textTheme.headline1, + style: Theme.of(context).textTheme.displayLarge, textAlign: TextAlign.left, ), ))); diff --git a/frontend/mgramseva/lib/widgets/no_login_success_page.dart b/frontend/mgramseva/lib/widgets/no_login_success_page.dart index 6a8bfc932..f906f2c2e 100644 --- a/frontend/mgramseva/lib/widgets/no_login_success_page.dart +++ b/frontend/mgramseva/lib/widgets/no_login_success_page.dart @@ -89,6 +89,7 @@ class NoLoginSuccess extends StatelessWidget { successHandler.downloadLinkLabel != null ? successHandler.downloadLinkLabel! : ''), + textScaleFactor: MediaQuery.of(context).size.width>360?0.9:0.68, style: TextStyle( fontSize: 16, color: Theme.of(context).primaryColor)), @@ -108,6 +109,7 @@ class NoLoginSuccess extends StatelessWidget { successHandler.printLabel != null ? successHandler.printLabel! : ''), + textScaleFactor: MediaQuery.of(context).size.width>360?0.9:0.68, style: TextStyle( fontSize: 16, color: Theme.of(context).primaryColor)), @@ -122,6 +124,7 @@ class NoLoginSuccess extends StatelessWidget { label: Text( ApplicationLocalizations.of(context) .translate(i18.common.SHARE_BILL), + textScaleFactor: MediaQuery.of(context).size.width>360?0.9:0.68, style: TextStyle( fontSize: 16, color: Theme.of(context).primaryColor), diff --git a/frontend/mgramseva/lib/widgets/pagination.dart b/frontend/mgramseva/lib/widgets/pagination.dart index 144e4544e..1042f88af 100644 --- a/frontend/mgramseva/lib/widgets/pagination.dart +++ b/frontend/mgramseva/lib/widgets/pagination.dart @@ -52,7 +52,7 @@ class _PaginationState extends State { } get dropDownItems { - return [1,2,3,10, 20, 30, 40, 50].map((value) { + return [10, 20, 30, 40, 50].map((value) { return DropdownMenuItem( key: Key('$value'), value: value, diff --git a/frontend/mgramseva/lib/widgets/radio_button_field_builder.dart b/frontend/mgramseva/lib/widgets/radio_button_field_builder.dart index 82a2a6d5b..f21641bf7 100644 --- a/frontend/mgramseva/lib/widgets/radio_button_field_builder.dart +++ b/frontend/mgramseva/lib/widgets/radio_button_field_builder.dart @@ -1,4 +1,3 @@ -import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:mgramseva/utils/localization/application_localizations.dart'; @@ -7,7 +6,7 @@ import 'package:mgramseva/utils/models.dart'; class RadioButtonFieldBuilder extends StatelessWidget { final BuildContext context; final String labelText; - final dynamic? controller; + final dynamic controller; final bool isRequired; final String input; diff --git a/frontend/mgramseva/lib/widgets/search_select_field_builder.dart b/frontend/mgramseva/lib/widgets/search_select_field_builder.dart index 41088136f..11c34414d 100644 --- a/frontend/mgramseva/lib/widgets/search_select_field_builder.dart +++ b/frontend/mgramseva/lib/widgets/search_select_field_builder.dart @@ -7,7 +7,7 @@ import 'package:provider/provider.dart'; class SearchSelectField extends StatefulWidget { final String labelText; - final List> options; + final List options; final dynamic value; final Function(dynamic) widget; final bool? isEnabled; @@ -35,7 +35,7 @@ class SearchSelectFieldState extends State { _focusNode.addListener(() { if (_focusNode.hasFocus) { this._overlayEntry = this._createOverlayEntry(); - Overlay.of(context)!.insert(this._overlayEntry); + Overlay.of(context).insert(this._overlayEntry); } else { this._overlayEntry.remove(); } @@ -47,10 +47,10 @@ class SearchSelectFieldState extends State { afterViewBuild() { var res = widget.options - .where((e) => (e.value == (widget.value))); + .where((e) => (e.toString() == (widget.value))); if (res.isNotEmpty && _focusNode.hasFocus == false) { widget.controller?.text = ApplicationLocalizations.of(context) - .translate((res.first.child as Text).data.toString()); + .translate((res.first).toString()); } } @@ -59,16 +59,24 @@ class SearchSelectFieldState extends State { setState(() { isInit = true; Options = widget.options - .where((element) => (element.child as Text) - .data + .where((element) => element .toString() .toLowerCase() - .contains(val.toString().toLowerCase())) - .toList(); + .contains(val.toString().toLowerCase())).map((e) => + DropdownMenuItem( + value: e, + child: new Text(('${e.toString()}')), + ), + ).toList(); }); } else { setState(() { - Options = widget.options; + Options = widget.options.map((e) => + DropdownMenuItem( + value: e, + child: new Text(('${e.toString()}')), + ), + ).toList(); }); } } @@ -105,16 +113,15 @@ class SearchSelectFieldState extends State { child: ListTile( title: Text(ApplicationLocalizations.of(context) .translate( - (item.child as Text).data.toString())), + item.toString())), onTap: () { - Text txt = item.child as Text; - widget.widget(item.value); + widget.widget(item.toString()); setState(() { - selectedCode = item.value; + selectedCode = item; }); widget.controller?.text = ApplicationLocalizations.of(context) - .translate((txt.data.toString())); + .translate((item.toString())); _focusNode.unfocus(); }, )), @@ -156,7 +163,7 @@ class SearchSelectFieldState extends State { } else if (widget.options .where((element) => ApplicationLocalizations.of(context) - .translate((element.child as Text).data.toString()) + .translate((element).toString()) .toLowerCase() == (value.toString().toLowerCase())) .toList() diff --git a/frontend/mgramseva/lib/widgets/select_field_builder.dart b/frontend/mgramseva/lib/widgets/select_field_builder.dart index fa30ec834..2945df97c 100644 --- a/frontend/mgramseva/lib/widgets/select_field_builder.dart +++ b/frontend/mgramseva/lib/widgets/select_field_builder.dart @@ -1,3 +1,4 @@ +import 'package:dropdown_search/dropdown_search.dart'; import 'package:flutter/material.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:mgramseva/providers/language.dart'; @@ -12,11 +13,12 @@ class SelectFieldBuilder extends StatefulWidget { final String input; final String prefixText; final Function(dynamic) widget; - final List> options; + final String Function(dynamic) itemAsString; + final List options; final bool isRequired; final String? hint; final bool? readOnly; - final bool? isEnabled; + final bool showSearchBox; final String? requiredMessage; final GlobalKey? contextKey; final TextEditingController? controller; @@ -26,11 +28,10 @@ class SelectFieldBuilder extends StatefulWidget { const SelectFieldBuilder(this.labelText, this.value, this.input, this.prefixText, this.widget, this.options, this.isRequired, {this.hint, - this.isEnabled, - this.readOnly, + this.readOnly = false, this.requiredMessage, this.contextKey, - this.controller,this.key, this.suggestionKey}); + this.controller,this.key, this.suggestionKey, required this.itemAsString, this.showSearchBox = false}); @override State createState() => SelectFieldBuilderState(); @@ -49,7 +50,7 @@ class SelectFieldBuilderState extends State { style: TextStyle( fontWeight: FontWeight.w400, fontSize: 16, - color: (widget.isEnabled ?? true) + color: (!widget.readOnly!) ? Theme.of(context).primaryColorDark : Colors.grey)), Visibility( @@ -59,7 +60,7 @@ class SelectFieldBuilderState extends State { style: TextStyle( fontWeight: FontWeight.w400, fontSize: 16, - color: (widget.isEnabled ?? true) + color: (!widget.readOnly! ?? true) ? Theme.of(context).primaryColorDark : Colors.grey)), ), @@ -107,15 +108,31 @@ class SelectFieldBuilderState extends State { children: [ Consumer( builder: (_, consumerProvider, child) => - SearchSelectField( - widget.labelText, - widget.options, - widget.controller, - widget.widget, - widget.value, - widget.isEnabled, - widget.isRequired, - widget.requiredMessage, key : widget.suggestionKey)), + // SearchSelectField( + // widget.labelText, + // widget.options, + // widget.controller, + // widget.widget, + // widget.value, + // widget.isEnabled, + // widget.isRequired, + // widget.requiredMessage, key : widget.suggestionKey), + DropdownSearch( + key: widget.suggestionKey, + selectedItem: widget.value, + itemAsString: widget.itemAsString, + items: widget.options, + onChanged: widget.widget, + enabled: !widget.readOnly!, + popupProps: PopupProps.menu( + showSearchBox: widget.showSearchBox, + fit: FlexFit.loose, + searchDelay: Duration(seconds: 0), + //comment this if you want that the items do not takes all available height + constraints: BoxConstraints(maxHeight: 400), + ), + ) + ), CommonWidgets().buildHint( widget.hint, context, @@ -134,8 +151,26 @@ class SelectFieldBuilderState extends State { child: new Align( alignment: Alignment.centerLeft, child: textLabelWidget)), Consumer(builder: (_, consumerProvider, child) { - return SearchSelectField(widget.labelText, widget.options, widget.controller, widget.widget, - widget.value, widget.isEnabled, widget.isRequired, widget.requiredMessage, key: widget.suggestionKey,); + return DropdownSearch( + key: widget.suggestionKey, + selectedItem: widget.value, + itemAsString: widget.itemAsString, + items: widget.options, + onChanged: widget.widget, + enabled: !widget.readOnly!, + dropdownDecoratorProps: DropDownDecoratorProps( + baseStyle: TextStyle( + color: !widget.readOnly!?Theme.of(context).primaryColorDark:Colors.grey + ) + ), + popupProps: PopupProps.menu( + showSearchBox: widget.showSearchBox, + fit: FlexFit.loose, + searchDelay: Duration(seconds: 0), + //comment this if you want that the items do not takes all available height + constraints: BoxConstraints(maxHeight: 200), + ), + ); }), CommonWidgets().buildHint(widget.hint, context) ]), diff --git a/frontend/mgramseva/lib/widgets/short_button.dart b/frontend/mgramseva/lib/widgets/short_button.dart index 168143037..2d1e1964e 100644 --- a/frontend/mgramseva/lib/widgets/short_button.dart +++ b/frontend/mgramseva/lib/widgets/short_button.dart @@ -17,13 +17,14 @@ class ShortButton extends StatelessWidget { decoration: CommonStyles.buttonBottomDecoration, child: new ElevatedButton( style: ElevatedButton.styleFrom( - padding: EdgeInsets.symmetric(vertical: 13) + padding: EdgeInsets.symmetric(vertical: 13), + backgroundColor: callBack!=null?Theme.of(context).primaryColor:Theme.of(context).disabledColor ), key: key, child: new Text( ApplicationLocalizations.of(context).translate(label), style: - Theme.of(context).textTheme.subtitle1!.apply(color: Colors.white) + Theme.of(context).textTheme.titleMedium!.apply(color: Colors.white) ), onPressed: callBack ), diff --git a/frontend/mgramseva/lib/widgets/success_page.dart b/frontend/mgramseva/lib/widgets/success_page.dart index 3834102f1..a0a9b4641 100644 --- a/frontend/mgramseva/lib/widgets/success_page.dart +++ b/frontend/mgramseva/lib/widgets/success_page.dart @@ -23,7 +23,7 @@ class SuccessPage extends StatelessWidget { child: Text(ApplicationLocalizations.of(context).translate(label), textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context).backgroundColor, + color: Theme.of(context).colorScheme.background, fontSize: 32, fontFamily: 'Roboto Condensed', fontWeight: FontWeight.w700 @@ -35,10 +35,10 @@ class SuccessPage extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - amount==null?SizedBox():Text('₹${amount}', + amount==null?SizedBox():Text('₹$amount', textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context).backgroundColor, + color: Theme.of(context).colorScheme.background, fontSize: 32, fontFamily: 'Roboto Condensed', fontWeight: FontWeight.w700 @@ -46,7 +46,7 @@ class SuccessPage extends StatelessWidget { SizedBox(width: 8,), Icon( Icons.check_circle, - color: Theme.of(context).backgroundColor, + color: Theme.of(context).colorScheme.background, size: 32, ), ], @@ -60,7 +60,7 @@ class SuccessPage extends StatelessWidget { child: Text(ApplicationLocalizations.of(context).translate(subTextHeader ?? ''), textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context).backgroundColor, + color: Theme.of(context).colorScheme.background, fontSize: 18, fontWeight: FontWeight.w700 )), @@ -71,7 +71,7 @@ class SuccessPage extends StatelessWidget { child: Text(ApplicationLocalizations.of(context).translate(subText ?? ''), textAlign: TextAlign.center, style: TextStyle( - color: Theme.of(context).backgroundColor, + color: Theme.of(context).colorScheme.background, fontSize: 24, fontWeight: FontWeight.w700 )), diff --git a/frontend/mgramseva/lib/widgets/toast/toster.dart b/frontend/mgramseva/lib/widgets/toast/toster.dart index 3a1dc2539..00579b32a 100644 --- a/frontend/mgramseva/lib/widgets/toast/toster.dart +++ b/frontend/mgramseva/lib/widgets/toast/toster.dart @@ -20,7 +20,7 @@ class ToastUtils { } _overlayEntry = createOverlayEntry(context, message, type); - Overlay.of(context)!.insert(_overlayEntry!); + Overlay.of(context).insert(_overlayEntry!); toastTimer = Timer(Duration(seconds: 10), () { if (_overlayEntry != null) { _overlayEntry!.remove(); diff --git a/frontend/mgramseva/package.json b/frontend/mgramseva/package.json index 651dd7a74..7734c7a85 100644 --- a/frontend/mgramseva/package.json +++ b/frontend/mgramseva/package.json @@ -1,5 +1,5 @@ { "name": "mgramseva", - "version": "1.2.15", + "version": "1.2.18", "license": "egov" } diff --git a/frontend/mgramseva/pubspec.lock b/frontend/mgramseva/pubspec.lock index 87e1ebf01..e744e5644 100644 --- a/frontend/mgramseva/pubspec.lock +++ b/frontend/mgramseva/pubspec.lock @@ -5,331 +5,434 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 + url: "https://pub.dev" source: hosted - version: "22.0.0" + version: "64.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: dd68ecea9f1e3556d385521bd21c7bafd6311a8c1e11abe2595ca27974f468ee + url: "https://pub.dev" + source: hosted + version: "1.3.13" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" + url: "https://pub.dev" source: hosted - version: "1.7.2" + version: "6.2.0" archive: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + sha256: "7b875fd4a20b165a3084bd2d210439b22ebc653f21cea4842729c0c30c82596b" + url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.4.9" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" barcode: dependency: transitive description: name: barcode - url: "https://pub.dartlang.org" + sha256: "789f898eef0bd88312470bdb2cc996f895ad7dd5f89e9adde84b204546a90b45" + url: "https://pub.dev" source: hosted - version: "2.2.0" - bluetooth_thermal_printer: - dependency: "direct main" + version: "2.2.4" + bidi: + dependency: transitive description: - name: bluetooth_thermal_printer - url: "https://pub.dartlang.org" + name: bidi + sha256: "1a7d0c696324b2089f72e7671fd1f1f64fef44c980f3cebc84e803967c597b63" + url: "https://pub.dev" source: hosted - version: "0.0.6" + version: "2.0.10" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.4.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.dartlang.org" + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "4.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.dartlang.org" + sha256: "64e12b0521812d1684b1917bc80945625391cb9bdd4312536b1d69dcb6133ed8" + url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.4.1" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.dartlang.org" + sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.4.6" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.dartlang.org" + sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185 + url: "https://pub.dev" source: hosted - version: "7.1.0" + version: "7.2.11" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + sha256: "69acb7007eb2a31dc901512bfe0f7b767168be34cb734835d54c070bfa74c1b2" + url: "https://pub.dev" source: hosted - version: "8.1.2" + version: "8.8.0" buttons_tabbar: dependency: "direct main" description: name: buttons_tabbar - url: "https://pub.dartlang.org" + sha256: "3f0969c26574ef15c0c9ff1dee42c3c4b0d3563d2c8607804372490fb8b76896" + url: "https://pub.dev" source: hosted - version: "1.3.6" + version: "1.3.8" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" source: hosted version: "1.3.1" charset_converter: dependency: "direct main" description: name: charset_converter - url: "https://pub.dartlang.org" + sha256: e4827b2d623ab75c2b6767d69e03485ea5bc894db6f6bdcb2ffeda58446bbe26 + url: "https://pub.dev" source: hosted - version: "2.0.0" - charts_common: - dependency: transitive - description: - name: charts_common - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.0" - charts_flutter: - dependency: "direct main" - description: - name: charts_flutter - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.0" + version: "2.1.1" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.3" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.dartlang.org" + sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7 + url: "https://pub.dev" source: hosted - version: "0.3.3" + version: "0.4.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + sha256: b2151ce26a06171005b379ecff6e08d34c470180ffe16b8e14b6d52be292b55f + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.8.0" collection: dependency: "direct main" description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.18.0" + community_charts_common: + dependency: transitive + description: + name: community_charts_common + sha256: "20697244c826df0545237ebe01d61caa96a2a2e4d23c6f88890441636a4d5220" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + community_charts_flutter: + dependency: "direct main" + description: + name: community_charts_flutter + sha256: ca5bd07337e162daee13c19679f602cd8b3f704520d242beeebbc2e312f84f89 + url: "https://pub.dev" + source: hosted + version: "1.0.2" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.1" cross_file: dependency: transitive description: name: cross_file - url: "https://pub.dartlang.org" + sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5" + url: "https://pub.dev" source: hosted - version: "0.3.1+5" + version: "0.3.3+7" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" csslib: dependency: transitive description: name: csslib - url: "https://pub.dartlang.org" + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "1.0.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.6" + dart_ping: + dependency: transitive + description: + name: dart_ping + sha256: "2f5418d0a5c64e53486caaac78677b25725b1e13c33c5be834ce874ea18bd24f" + url: "https://pub.dev" + source: hosted + version: "9.0.1" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368" + url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.3.4" datetime_picker_formfield: dependency: "direct main" description: name: datetime_picker_formfield - url: "https://pub.dartlang.org" + sha256: "6d0412c98cc5da18a5dca1f81f82a834fbacdb5d249fd6d9bed42d912339720e" + url: "https://pub.dev" source: hosted - version: "2.0.0" - esc_pos_utils: + version: "2.0.1" + dbus: + dependency: transitive + description: + name: dbus + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" + url: "https://pub.dev" + source: hosted + version: "0.7.10" + dropdown_search: dependency: "direct main" description: - name: esc_pos_utils - url: "https://pub.dartlang.org" + name: dropdown_search + sha256: "55106e8290acaa97ed15bea1fdad82c3cf0c248dd410e651f5a8ac6870f783ab" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "5.0.6" + enum_to_string: + dependency: transitive + description: + name: enum_to_string + sha256: bd9e83a33b754cb43a75b36a9af2a0b92a757bfd9847d2621ca0b1bed45f8e7a + url: "https://pub.dev" + source: hosted + version: "2.0.1" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.1.0" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.4" file_picker: dependency: "direct main" description: name: file_picker - url: "https://pub.dartlang.org" + sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6" + url: "https://pub.dev" + source: hosted + version: "6.1.1" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" + url: "https://pub.dev" + source: hosted + version: "0.9.2+1" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: b15c3da8bd4908b9918111fa486903f5808e388b8d1c559949f584725a6594d6 + url: "https://pub.dev" + source: hosted + version: "0.9.3+3" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: "0aa47a725c346825a2bd396343ce63ac00bda6eff2fbc43eabe99737dede8262" + url: "https://pub.dev" source: hosted - version: "4.0.0" - firebase: + version: "2.6.1" + file_selector_windows: dependency: transitive description: - name: firebase - url: "https://pub.dartlang.org" + name: file_selector_windows + sha256: d3547240c20cabf205c7c7f01a50ecdbc413755814d6677f3cb366f04abcead0 + url: "https://pub.dev" source: hosted - version: "9.0.3" + version: "0.9.3+1" firebase_analytics: dependency: "direct main" description: name: firebase_analytics - url: "https://pub.dartlang.org" + sha256: de3d73b5c5618bf31004308b017b4067b7d9156b96e97b62d59ae5eab71081ec + url: "https://pub.dev" source: hosted - version: "8.3.4" + version: "10.7.1" firebase_analytics_platform_interface: dependency: transitive description: name: firebase_analytics_platform_interface - url: "https://pub.dartlang.org" + sha256: ffc59c0b00a572cd1fbf915a1d50cb4ccdc61e429614aa6ae9a598ee5723b96a + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.8.1" firebase_analytics_web: dependency: transitive description: name: firebase_analytics_web - url: "https://pub.dartlang.org" + sha256: "0e725a7dcdeb0a59e44d93d1d45dfec94efe54329ac9d6aa145e24d31429100c" + url: "https://pub.dev" source: hosted - version: "0.3.0+1" + version: "0.5.5+8" firebase_core: - dependency: transitive + dependency: "direct main" description: name: firebase_core - url: "https://pub.dartlang.org" + sha256: "471b46ea6a9af503184d4de691566887daedd312aec5baac5baa42d819f56446" + url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "2.23.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - url: "https://pub.dartlang.org" + sha256: c437ae5d17e6b5cc7981cf6fd458a5db4d12979905f9aafd1fea930428a9fe63 + url: "https://pub.dev" source: hosted - version: "4.4.1" + version: "5.0.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - url: "https://pub.dartlang.org" + sha256: "0631a2ec971dbc540275e2fa00c3a8a2676f0a7adbc3c197d6fba569db689d97" + url: "https://pub.dev" source: hosted - version: "1.6.5" + version: "2.8.1" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -339,16 +442,26 @@ packages: dependency: "direct main" description: name: flutter_countdown_timer - url: "https://pub.dartlang.org" + sha256: dfcbd7d6f76a5589f78f3f3ba2f9ea2e199368eccc1adce4153ce985b9587bc5 + url: "https://pub.dev" source: hosted version: "4.1.0" + flutter_dotenv: + dependency: "direct main" + description: + name: flutter_dotenv + sha256: "9357883bdd153ab78cbf9ffa07656e336b8bbb2b5a3ca596b0b27e119f7c7d77" + url: "https://pub.dev" + source: hosted + version: "5.1.0" flutter_downloader: dependency: "direct main" description: name: flutter_downloader - url: "https://pub.dartlang.org" + sha256: "36c16cc6657274f3cf7ccb681aeca89df62531ff5956f85e175f6be4b8d6b140" + url: "https://pub.dev" source: hosted - version: "1.8.0+1" + version: "1.11.5" flutter_driver: dependency: transitive description: flutter @@ -358,37 +471,66 @@ packages: dependency: "direct main" description: name: flutter_focus_watcher - url: "https://pub.dartlang.org" + sha256: a72ee539ae0237961308a25839887ca93a0b1cb6f87b0d492b139c8fccff8e79 + url: "https://pub.dev" source: hosted version: "2.0.0" flutter_keyboard_visibility: dependency: transitive description: name: flutter_keyboard_visibility - url: "https://pub.dartlang.org" + sha256: "4983655c26ab5b959252ee204c2fffa4afeb4413cd030455194ec0caa3b8e7cb" + url: "https://pub.dev" + source: hosted + version: "5.4.1" + flutter_keyboard_visibility_linux: + dependency: transitive + description: + name: flutter_keyboard_visibility_linux + sha256: "6fba7cd9bb033b6ddd8c2beb4c99ad02d728f1e6e6d9b9446667398b2ac39f08" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + flutter_keyboard_visibility_macos: + dependency: transitive + description: + name: flutter_keyboard_visibility_macos + sha256: c5c49b16fff453dfdafdc16f26bdd8fb8d55812a1d50b0ce25fc8d9f2e53d086 + url: "https://pub.dev" source: hosted - version: "5.0.3" + version: "1.0.0" flutter_keyboard_visibility_platform_interface: dependency: transitive description: name: flutter_keyboard_visibility_platform_interface - url: "https://pub.dartlang.org" + sha256: e43a89845873f7be10cb3884345ceb9aebf00a659f479d1c8f4293fcb37022a4 + url: "https://pub.dev" source: hosted version: "2.0.0" flutter_keyboard_visibility_web: dependency: transitive description: name: flutter_keyboard_visibility_web - url: "https://pub.dartlang.org" + sha256: d3771a2e752880c79203f8d80658401d0c998e4183edca05a149f5098ce6e3d1 + url: "https://pub.dev" source: hosted version: "2.0.0" + flutter_keyboard_visibility_windows: + dependency: transitive + description: + name: flutter_keyboard_visibility_windows + sha256: fc4b0f0b6be9b93ae527f3d527fb56ee2d918cd88bbca438c478af7bcfd0ef73 + url: "https://pub.dev" + source: hosted + version: "1.0.0" flutter_launcher_icons: dependency: "direct dev" description: name: flutter_launcher_icons - url: "https://pub.dartlang.org" + sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" + url: "https://pub.dev" source: hosted - version: "0.9.2" + version: "0.13.1" flutter_localizations: dependency: "direct main" description: flutter @@ -398,44 +540,90 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.17" flutter_rating_bar: dependency: "direct main" description: name: flutter_rating_bar - url: "https://pub.dartlang.org" + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.1" flutter_secure_storage: dependency: "direct main" description: name: flutter_secure_storage - url: "https://pub.dartlang.org" + sha256: ffdbb60130e4665d2af814a0267c481bcf522c41ae2e43caf69fa0146876d685 + url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "9.0.0" + flutter_secure_storage_linux: + dependency: transitive + description: + name: flutter_secure_storage_linux + sha256: "3d5032e314774ee0e1a7d0a9f5e2793486f0dff2dd9ef5a23f4e3fb2a0ae6a9e" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + flutter_secure_storage_macos: + dependency: transitive + description: + name: flutter_secure_storage_macos + sha256: bd33935b4b628abd0b86c8ca20655c5b36275c3a3f5194769a7b3f37c905369c + url: "https://pub.dev" + source: hosted + version: "3.0.1" + flutter_secure_storage_platform_interface: + dependency: transitive + description: + name: flutter_secure_storage_platform_interface + sha256: "0d4d3a5dd4db28c96ae414d7ba3b8422fd735a8255642774803b2532c9a61d7e" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + flutter_secure_storage_web: + dependency: transitive + description: + name: flutter_secure_storage_web + sha256: "30f84f102df9dcdaa2241866a958c2ec976902ebdaa8883fbfe525f1f2f3cf20" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + flutter_secure_storage_windows: + dependency: transitive + description: + name: flutter_secure_storage_windows + sha256: "5809c66f9dd3b4b93b0a6e2e8561539405322ee767ac2f64d084e2ab5429d108" + url: "https://pub.dev" + source: hosted + version: "3.0.0" flutter_share_me: dependency: "direct main" description: name: flutter_share_me - url: "https://pub.dartlang.org" + sha256: "2cd97783bcd7c61eaee20b11c2952bb57a94608f25c3504ff3c08803134609c2" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" flutter_spinkit: dependency: "direct main" description: name: flutter_spinkit - url: "https://pub.dartlang.org" + sha256: b39c753e909d4796906c5696a14daf33639a76e017136c8d82bf3e620ce5bb8e + url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.2.0" flutter_svg: dependency: "direct main" description: name: flutter_svg - url: "https://pub.dartlang.org" + sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c + url: "https://pub.dev" source: hosted - version: "0.22.0" + version: "2.0.9" flutter_test: dependency: "direct dev" description: flutter @@ -445,9 +633,10 @@ packages: dependency: "direct main" description: name: flutter_typeahead - url: "https://pub.dartlang.org" + sha256: b9942bd5b7611a6ec3f0730c477146cffa4cd4b051077983ba67ddfc9e7ee818 + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.8.0" flutter_web_plugins: dependency: "direct main" description: flutter @@ -457,9 +646,10 @@ packages: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "3.2.0" fuchsia_remote_debug_protocol: dependency: transitive description: flutter @@ -469,93 +659,146 @@ packages: dependency: transitive description: name: gbk_codec - url: "https://pub.dartlang.org" + sha256: "3af5311fc9393115e3650ae6023862adf998051a804a08fb804f042724999f61" + url: "https://pub.dev" source: hosted version: "0.4.0" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.2" graphs: dependency: transitive description: name: graphs - url: "https://pub.dartlang.org" + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.3.1" hex: dependency: transitive description: name: hex - url: "https://pub.dartlang.org" + sha256: "4e7cd54e4b59ba026432a6be2dd9d96e4c5205725194997193bf871703b82c4a" + url: "https://pub.dev" source: hosted version: "0.2.0" horizontal_data_table: dependency: "direct main" description: name: horizontal_data_table - url: "https://pub.dartlang.org" + sha256: c8ab5256bbced698a729f3e0ff2cb0e8e97416cdbb082860370eaf883badf722 + url: "https://pub.dev" source: hosted - version: "4.1.4" + version: "4.3.1" html: dependency: transitive description: name: html - url: "https://pub.dartlang.org" + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" source: hosted - version: "0.15.0" + version: "0.15.4" http: dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + url: "https://pub.dev" source: hosted - version: "0.13.3" + version: "1.1.0" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.2" image: dependency: transitive description: name: image - url: "https://pub.dartlang.org" + sha256: "028f61960d56f26414eb616b48b04eb37d700cbe477b7fb09bf1d7ce57fd9271" + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "4.1.3" image_picker: dependency: "direct main" description: name: image_picker - url: "https://pub.dartlang.org" + sha256: "7d7f2768df2a8b0a3cefa5ef4f84636121987d403130e70b17ef7e2cf650ba84" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: d6a6e78821086b0b737009b09363018309bbc6de3fd88cc5c26bc2bb44a4957f + url: "https://pub.dev" source: hosted - version: "0.8.4" + version: "0.8.8+2" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - url: "https://pub.dartlang.org" + sha256: "50bc9ae6a77eea3a8b11af5eb6c661eeb858fdd2f734c2a4fd17086922347ef7" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: "76ec722aeea419d03aa915c2c96bf5b47214b053899088c9abb4086ceecf97a7" + url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "0.8.8+4" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "3f5ad1e8112a9a6111c46d0b57a7be2286a9a07fc6e1976fdf5be2bd31d4ff62" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.dartlang.org" + sha256: ed9b00e63977c93b0d2d2b343685bed9c324534ba5abafbb3dfbd6a780b1b514 + url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.9.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" integration_test: dependency: "direct dev" description: flutter @@ -565,359 +808,458 @@ packages: dependency: transitive description: name: intl - url: "https://pub.dartlang.org" + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.1" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" jiffy: dependency: transitive description: name: jiffy - url: "https://pub.dartlang.org" + sha256: cc1d4b75016a9156c29b5d61f0c9176c3e0fb0580cc5a0e0422b5d2cab3fbfff + url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.2.1" js: dependency: "direct main" description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.7" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.8.1" json_serializable: dependency: "direct dev" description: name: json_serializable - url: "https://pub.dartlang.org" + sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969 + url: "https://pub.dev" source: hosted - version: "4.1.4" + version: "6.7.1" lint: dependency: transitive description: name: lint - url: "https://pub.dartlang.org" + sha256: "4a539aa34ec5721a2c7574ae2ca0336738ea4adc2a34887d54b7596310b33c85" + url: "https://pub.dev" source: hosted - version: "1.7.2" + version: "1.10.0" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.2.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.10.0" mime: dependency: "direct main" description: name: mime - url: "https://pub.dartlang.org" + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.4" nearby_connections: dependency: "direct main" description: name: nearby_connections - url: "https://pub.dartlang.org" + sha256: "7a7237421c4654867a60a0a3314f150962097c0383ebab8ad2d5942cedd54da6" + url: "https://pub.dev" source: hosted - version: "3.2.0" + version: "4.0.1" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" source: hosted version: "1.0.0" - new_version: + network_info_plus: + dependency: transitive + description: + name: network_info_plus + sha256: "2d9e88b9a459e5d4e224f828d26cc38ea140511e89b943116939994324be5c96" + url: "https://pub.dev" + source: hosted + version: "4.1.0" + network_info_plus_platform_interface: + dependency: transitive + description: + name: network_info_plus_platform_interface + sha256: "881f5029c5edaf19c616c201d3d8b366c5b1384afd5c1da5a49e4345de82fb8b" + url: "https://pub.dev" + source: hosted + version: "1.1.3" + new_version_plus: dependency: "direct main" description: - name: new_version - url: "https://pub.dartlang.org" + name: new_version_plus + sha256: e0d8027223488cc7f7c78f6ff286f1b5d9808f88814aecfa0bb12254d25f48ca + url: "https://pub.dev" source: hosted - version: "0.2.3" + version: "0.0.11" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" number_to_words: dependency: "direct main" description: name: number_to_words - url: "https://pub.dartlang.org" + sha256: "279af97baabe7460e3e724be5e797ab1902bcf0ce52d065dd2409a4be423f05c" + url: "https://pub.dev" source: hosted version: "1.0.0" - open_file: + open_filex: dependency: "direct main" description: - name: open_file - url: "https://pub.dartlang.org" + name: open_filex + sha256: a6c95237767c5647e68b71a476602fcf4f1bfc530c126265e53addae22ef5fc2 + url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "4.3.4" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" package_info_plus: dependency: "direct main" description: name: package_info_plus - url: "https://pub.dartlang.org" + sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" + url: "https://pub.dev" source: hosted - version: "1.3.0" - package_info_plus_linux: - dependency: transitive - description: - name: package_info_plus_linux - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - package_info_plus_macos: - dependency: transitive - description: - name: package_info_plus_macos - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "4.2.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - package_info_plus_web: - dependency: transitive - description: - name: package_info_plus_web - url: "https://pub.dartlang.org" + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + url: "https://pub.dev" source: hosted - version: "1.0.4" - package_info_plus_windows: - dependency: transitive - description: - name: package_info_plus_windows - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" + version: "2.0.1" path: dependency: "direct main" description: name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.2" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "1.8.3" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.dartlang.org" + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" source: hosted - version: "0.2.1" + version: "1.0.1" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + url: "https://pub.dev" source: hosted - version: "2.0.2" - path_provider_linux: + version: "2.1.1" + path_provider_android: dependency: transitive description: - name: path_provider_linux - url: "https://pub.dartlang.org" + name: path_provider_android + sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72 + url: "https://pub.dev" source: hosted - version: "2.0.2" - path_provider_macos: + version: "2.2.1" + path_provider_foundation: dependency: transitive description: - name: path_provider_macos - url: "https://pub.dartlang.org" + name: path_provider_foundation + sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.1" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.2.1" pdf: dependency: "direct main" description: name: pdf - url: "https://pub.dartlang.org" + sha256: aa8835fcb9cfaf57ab2f1970e8548ceed3d0cb53eda7da906648f8153eaf37c9 + url: "https://pub.dev" source: hosted - version: "3.8.1" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" + version: "3.10.6" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.dartlang.org" + sha256: "860c6b871c94c78e202dc69546d4d8fd84bd59faeb36f8fb9888668a53ff4f78" + url: "https://pub.dev" source: hosted - version: "8.1.4+2" + version: "11.1.0" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + sha256: "2f1bec180ee2f5665c22faada971a8f024761f632e93ddc23310487df52dcfa6" + url: "https://pub.dev" + source: hosted + version: "12.0.1" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + sha256: "1a816084338ada8d574b1cb48390e6e8b19305d5120fe3a37c98825bacc78306" + url: "https://pub.dev" + source: hosted + version: "9.2.0" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: d96ff56a757b7f04fa825c469d296c5aebc55f743e87bd639fef91a466a24da8 + url: "https://pub.dev" + source: hosted + version: "0.1.0+1" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.dartlang.org" + sha256: d87349312f7eaf6ce0adaf668daf700ac5b06af84338bd8b8574dfbd93ffe1a1 + url: "https://pub.dev" + source: hosted + version: "4.0.2" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + sha256: "1e8640c1e39121128da6b816d236e714d2cf17fac5a105dd6acdd3403a628004" + url: "https://pub.dev" source: hosted - version: "3.6.1" + version: "0.2.0" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: eeb2d1428ee7f4170e2bd498827296a18d4e7fc462b71727d111c0ac7707cfa6 + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "6.0.1" pin_input_text_field: dependency: "direct main" description: name: pin_input_text_field - url: "https://pub.dartlang.org" + sha256: "8d6fc670aa673a4df5976086f0e8039972a5b2bcb783c8db8dd3b9b4b072ca90" + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.5.1" + ping_discover_network_forked: + dependency: transitive + description: + name: ping_discover_network_forked + sha256: d3975c4f3fbaa388f78fb4037ad9c33059d8e2ec0e804ed45e05277d2451fe77 + url: "https://pub.dev" + source: hosted + version: "0.0.1" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.7" + pointer_interceptor: + dependency: transitive + description: + name: pointer_interceptor + sha256: adf7a637f97c077041d36801b43be08559fd4322d2127b3f20bb7be1b9eebc22 + url: "https://pub.dev" + source: hosted + version: "0.9.3+7" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" + url: "https://pub.dev" + source: hosted + version: "3.7.3" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.5.1" print_bluetooth_thermal: dependency: "direct main" description: name: print_bluetooth_thermal - url: "https://pub.dartlang.org" + sha256: aecc2c8e799e524e4622e3ab298bfc8cc44bc3d61de425591e17f1cacf6a3f5a + url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.9" printing: dependency: "direct main" description: name: printing - url: "https://pub.dartlang.org" + sha256: ad39a42a5f83125952457dfd94f395c8cf0eb1f7759583dadb769be5c7f99d24 + url: "https://pub.dev" source: hosted - version: "5.9.1" + version: "5.11.1" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" source: hosted version: "4.2.4" provider: dependency: "direct main" description: name: provider - url: "https://pub.dartlang.org" + sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096" + url: "https://pub.dev" source: hosted - version: "6.0.5" + version: "6.1.1" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.4" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.2.3" qr: dependency: transitive description: name: qr - url: "https://pub.dartlang.org" + sha256: "64957a3930367bf97cc211a5af99551d630f2f4625e38af10edd6b19131b64b3" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.1" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" + url: "https://pub.dev" + source: hosted + version: "0.27.7" screenshot: dependency: "direct main" description: name: screenshot - url: "https://pub.dartlang.org" + sha256: "455284ff1f5b911d94a43c25e1385485cf6b4f288293eba68f15dad711c7b81c" + url: "https://pub.dev" source: hosted - version: "1.2.3" + version: "2.1.0" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.4.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.4" sky_engine: dependency: transitive description: flutter @@ -927,226 +1269,322 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.4.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + url: "https://pub.dev" + source: hosted + version: "1.3.4" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" sync_http: dependency: transitive description: name: sync_http - url: "https://pub.dartlang.org" + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" source: hosted version: "0.3.1" syncfusion_flutter_core: dependency: transitive description: name: syncfusion_flutter_core - url: "https://pub.dartlang.org" + sha256: "8a1220f978491f56431c66dacf1bb97bf2abcd1458b542fe0dfbf1a630c67260" + url: "https://pub.dev" source: hosted - version: "20.3.60" + version: "23.2.4" syncfusion_flutter_xlsio: dependency: "direct main" description: name: syncfusion_flutter_xlsio - url: "https://pub.dartlang.org" + sha256: "1587750fc3d3550a63fe89e12f60b82cd781ecea336a8c5b536354ebc7820707" + url: "https://pub.dev" source: hosted - version: "20.3.60-beta" + version: "23.2.4" syncfusion_officecore: dependency: transitive description: name: syncfusion_officecore - url: "https://pub.dartlang.org" + sha256: "9dca5adca8e79b485b7217708e199366466a9b7ccbbf4a2a967d3d78771ad4b7" + url: "https://pub.dev" source: hosted - version: "20.3.60-beta" + version: "23.2.4" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.6.1" + thermal_printer: + dependency: "direct main" + description: + name: thermal_printer + sha256: d04fd0ade194df0143bcef57af18cad59fa053be6e7102c5d341f378325c7508 + url: "https://pub.dev" + source: hosted + version: "1.0.4" timing: dependency: transitive description: name: timing - url: "https://pub.dartlang.org" + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" universal_html: dependency: "direct main" description: name: universal_html - url: "https://pub.dartlang.org" + sha256: "56536254004e24d9d8cfdb7dbbf09b74cf8df96729f38a2f5c238163e3d58971" + url: "https://pub.dev" source: hosted - version: "2.0.8" + version: "2.2.4" universal_io: dependency: transitive description: name: universal_io - url: "https://pub.dartlang.org" + sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" + url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.2.2" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + sha256: b1c9e98774adf8820c96fbc7ae3601231d324a7d5ebd8babe27b6dfac91357ba + url: "https://pub.dev" + source: hosted + version: "6.2.1" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def" + url: "https://pub.dev" source: hosted - version: "6.0.9" + version: "6.2.0" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3 + url: "https://pub.dev" + source: hosted + version: "6.2.1" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.1.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.1.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50" + url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.2.0" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + sha256: "138bd45b3a456dcfafc46d1a146787424f8d2edfbf2809c9324361e58f851cf7" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.2.1" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "3.1.0" url_strategy: dependency: "direct main" description: name: url_strategy - url: "https://pub.dartlang.org" + sha256: "42b68b42a9864c4d710401add17ad06e28f1c1d5500c93b98c431f6b0ea4ab87" + url: "https://pub.dev" source: hosted version: "0.2.0" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "0f0c746dd2d6254a0057218ff980fc7f5670fd0fcf5e4db38a490d31eed4ad43" + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "0edf6d630d1bfd5589114138ed8fada3234deacc37966bec033d3047c29248b7" + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: d24333727332d9bd20990f1483af4e09abdb9b1fc7c3db940b56ab5c42790c26 + url: "https://pub.dev" + source: hosted + version: "1.1.9+1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583 + url: "https://pub.dev" source: hosted - version: "9.0.0" + version: "11.10.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.4.0" webdriver: dependency: transitive description: name: webdriver - url: "https://pub.dartlang.org" + sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.2" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: "7c99c0e1e2fa190b48d25c81ca5e42036d5cac81430ef249027d97b0935c553f" + url: "https://pub.dev" source: hosted - version: "2.2.6" + version: "5.1.0" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "1.0.3" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: af5e77e9b83f2f4adc5d3f0a4ece1c7f45a2467b695c2540381bac793e34e556 + url: "https://pub.dev" source: hosted - version: "5.1.2" + version: "6.4.2" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" sdks: - dart: ">=2.17.0 <3.0.0" - flutter: ">=3.0.0" \ No newline at end of file + dart: ">=3.2.0 <4.0.0" + flutter: ">=3.16.0" diff --git a/frontend/mgramseva/pubspec.yaml b/frontend/mgramseva/pubspec.yaml index 841bc4a7b..8a45a54a2 100644 --- a/frontend/mgramseva/pubspec.yaml +++ b/frontend/mgramseva/pubspec.yaml @@ -16,64 +16,68 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.2.18+34 +version: 1.2.20+36 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.2 + gbk_codec: ^0.4.0 + hex: ^0.2.0 + flutter_dotenv: ^5.1.0 +# dart_ping_ios: ^4.0.2 //uncomment iOS universal_html: ^2.0.8 - flutter_secure_storage: ^4.2.0 - flutter_svg: ^0.22.0 + flutter_secure_storage: ^9.0.0 + flutter_svg: ^2.0.7 datetime_picker_formfield: ^2.0.0 horizontal_data_table: ^4.1.3 - file_picker: ^4.0.3 - http: ^0.13.3 + file_picker: ^6.1.1 + http: ^1.1.0 provider: ^6.0.0 flutter_spinkit: ^5.0.0 json_annotation: ^4.8.0 url_strategy: ^0.2.0 - screenshot: ^1.2.3 + screenshot: ^2.1.0 number_to_words: ^1.0.0 flutter_localizations: sdk: flutter flutter_typeahead: ^4.0.0 - flutter_downloader: ^1.8.0+1 + flutter_downloader: ^1.11.5 js: ^0.6.3 - path_provider: ^2.0.2 - permission_handler: ^8.1.4+2 + path_provider: ^2.1.1 + permission_handler: ^11.1.0 buttons_tabbar: ^1.3.6 url_launcher: ^6.0.9 pin_input_text_field: ^4.1.0 flutter_countdown_timer: ^4.1.0 - flutter_rating_bar: ^4.0.0 + flutter_rating_bar: ^4.0.1 collection: ^1.15.0 - image_picker: ^0.8.4 + image_picker: ^1.0.4 flutter_focus_watcher: ^2.0.0 path: ^1.8.0 - esc_pos_utils: ^1.1.0 - new_version: ^0.2.3 + new_version_plus: ^0.0.11 pdf: ^3.8.1 flutter_share_me: ^1.3.0 - printing: ^5.9.1 - mime: ^1.0.1 - charts_flutter: ^0.12.0 + printing: ^5.10.4 + mime: ^1.0.4 + community_charts_flutter: ^1.0.1 flutter_web_plugins: sdk: flutter - firebase_analytics: ^8.3.4 - package_info_plus: ^1.3.0 - open_file: ^3.2.1 #use for web - #open_file_safe: ^3.2.3 #use for mobiles - syncfusion_flutter_xlsio: ^20.3.59-beta + firebase_analytics: ^10.7.1 + firebase_core: ^2.23.0 + package_info_plus: ^4.0.2 + open_filex: ^4.3.4 + syncfusion_flutter_xlsio: ^23.2.4 print_bluetooth_thermal: ^1.0.9 - nearby_connections: ^3.2.0 + nearby_connections: ^4.0.1 + dropdown_search: ^5.0.6 dev_dependencies: - flutter_launcher_icons: "^0.9.2" + flutter_launcher_icons: ^0.13.1 build_runner: ^2.1.2 flutter_test: sdk: flutter @@ -106,7 +110,10 @@ flutter: assets: - assets/png/ - assets/icons/ + - assets/svg/ + - assets/.env - assets/json/ + # To add assets to your application, add an assets section, like this: # - images/a_dot_ham.jpeg diff --git a/frontend/mgramseva/web/favicon-32x32.png b/frontend/mgramseva/web/favicon-32x32.png deleted file mode 100644 index 14bf16898..000000000 Binary files a/frontend/mgramseva/web/favicon-32x32.png and /dev/null differ diff --git a/frontend/mgramseva/web/favicon-48x48.png b/frontend/mgramseva/web/favicon-48x48.png new file mode 100644 index 000000000..ac0f4ecad Binary files /dev/null and b/frontend/mgramseva/web/favicon-48x48.png differ diff --git a/frontend/mgramseva/web/favicon.png b/frontend/mgramseva/web/favicon.png index ac0f4ecad..14bf16898 100644 Binary files a/frontend/mgramseva/web/favicon.png and b/frontend/mgramseva/web/favicon.png differ diff --git a/frontend/mgramseva/web/icons/Icon-16.png b/frontend/mgramseva/web/icons/Icon-16.png new file mode 100644 index 000000000..7d607a21f Binary files /dev/null and b/frontend/mgramseva/web/icons/Icon-16.png differ diff --git a/frontend/mgramseva/web/icons/Icon-192.png b/frontend/mgramseva/web/icons/Icon-192.png index 7d607a21f..f3f595226 100644 Binary files a/frontend/mgramseva/web/icons/Icon-192.png and b/frontend/mgramseva/web/icons/Icon-192.png differ diff --git a/frontend/mgramseva/web/icons/Icon-512.png b/frontend/mgramseva/web/icons/Icon-512.png index 14bf16898..a56794cef 100644 Binary files a/frontend/mgramseva/web/icons/Icon-512.png and b/frontend/mgramseva/web/icons/Icon-512.png differ diff --git a/frontend/mgramseva/web/index.html b/frontend/mgramseva/web/index.html index 68f2b2563..0e0ece8a3 100644 --- a/frontend/mgramseva/web/index.html +++ b/frontend/mgramseva/web/index.html @@ -21,12 +21,18 @@ - + - mgramseva + mGramSeva + + + - - - - - loading.. - loading.. +loading.. +loading.. - - - - - - - - + + + - -
-
-
+
+
+
diff --git a/frontend/mgramseva/web/manifest.json b/frontend/mgramseva/web/manifest.json index 94d618ec1..937175bf3 100644 --- a/frontend/mgramseva/web/manifest.json +++ b/frontend/mgramseva/web/manifest.json @@ -1,11 +1,11 @@ { - "name": "mgramseva", - "short_name": "mgramseva", + "name": "mGramSeva", + "short_name": "mGramSeva", "start_url": ".", "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", + "background_color": "#eeeeee", + "theme_color": "#0B4B66", + "description": "A mobile-based application that enables the gram panchayat water committee to collect & manage revenue and expenditure.", "orientation": "portrait-primary", "prefer_related_applications": false, "icons": [ @@ -19,5 +19,21 @@ "sizes": "512x512", "type": "image/png" } + ], + "screenshots": [ + { + "src": "screenshots/mGramSeva.jpg", + "sizes": "320x640", + "type": "image/jpeg", + "form_factor": "narrow", + "label": "mGramSeva" + }, + { + "src": "screenshots/mGramSeva-web.png", + "sizes": "640x320", + "type": "image/png", + "form_factor": "wide", + "label": "mGramSeva-web" + } ] } diff --git a/frontend/mgramseva/web/screenshots/mGramSeva-web.png b/frontend/mgramseva/web/screenshots/mGramSeva-web.png new file mode 100644 index 000000000..ddccffd9c Binary files /dev/null and b/frontend/mgramseva/web/screenshots/mGramSeva-web.png differ diff --git a/frontend/mgramseva/web/screenshots/mGramSeva.jpg b/frontend/mgramseva/web/screenshots/mGramSeva.jpg new file mode 100644 index 000000000..37afb579e Binary files /dev/null and b/frontend/mgramseva/web/screenshots/mGramSeva.jpg differ diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java index f1aa28045..32c8509e4 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/config/ChallanConfiguration.java @@ -80,10 +80,7 @@ public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectM @Value("${persister.update.challan.topic}") private String updateChallanTopic; - - @Value("${persister.update.challan.topic}") - private String updateNewChallanTopic; - + @Value("${persister.update.status.challan.topic}") private String updateStatusChallanTopic; diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java index 0b19292f0..420be7d3b 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/ChallanRepository.java @@ -24,8 +24,10 @@ import org.egov.echallan.producer.Producer; import org.egov.echallan.repository.builder.ChallanQueryBuilder; import org.egov.echallan.repository.rowmapper.ChallanRowMapper; +import org.egov.echallan.repository.rowmapper.ExpenseBillReportRowMapper; import org.egov.echallan.service.ChallanService; import org.egov.echallan.util.CommonUtils; +import org.egov.echallan.web.models.ExpenseBillReportData; import org.egov.echallan.web.models.collection.Bill; import org.egov.echallan.web.models.collection.PaymentDetail; import org.egov.echallan.web.models.collection.PaymentRequest; @@ -63,7 +65,9 @@ public class ChallanRepository { private ChallanQueryBuilder queryBuilder; private ChallanRowMapper rowMapper; - + + private ExpenseBillReportRowMapper expenseBillReportRowMapper; + private RestTemplate restTemplate; @Autowired @@ -79,13 +83,14 @@ public class ChallanRepository { private ObjectMapper mapper; @Autowired public ChallanRepository(Producer producer, ChallanConfiguration config,ChallanQueryBuilder queryBuilder, - JdbcTemplate jdbcTemplate,ChallanRowMapper rowMapper,RestTemplate restTemplate) { + JdbcTemplate jdbcTemplate,ChallanRowMapper rowMapper,RestTemplate restTemplate, ExpenseBillReportRowMapper expenseBillReportRowMapper) { this.producer = producer; this.config = config; this.jdbcTemplate = jdbcTemplate; this.queryBuilder = queryBuilder ; this.rowMapper = rowMapper; this.restTemplate = restTemplate; + this.expenseBillReportRowMapper = expenseBillReportRowMapper; } @@ -105,13 +110,7 @@ public void save(ChallanRequest challanRequest) { * @param ChallanRequest The challan create request */ public void update(ChallanRequest challanRequest) { - -// if(challanRequest.getChallan().getPaidDate()!=null) -// { -// log.info("Setting NewpaidDate as PaidDate"); -// challanRequest.getChallan().setNewpaidDate(Long.valueOf(challanRequest.getChallan().getPaidDate())); -// } - log.info("CHALLAN ISBILLPAID:"+challanRequest.getChallan().getIsBillPaid() +" | PAID DATE: "+challanRequest.getChallan().getPaidDate()); + log.info("CHALLAN ISBILLPAID:"+challanRequest.getChallan().getIsBillPaid() +" | PAID DATE: "+challanRequest.getChallan().getPaidDate()+" | STATUS: "+challanRequest.getChallan().getApplicationStatus()); producer.push(config.getUpdateChallanTopic(), challanRequest); } @@ -485,4 +484,40 @@ public List fetchESIds(SearchCriteria criteria) { new SingleColumnRowMapper<>(String.class)); return ids; } + + public List getExpenseBillReport(Long monthStartDateTime, Long monthEndDateTime, String tenantId, Integer offset, Integer limit) + { + StringBuilder expenseBillQuery =new StringBuilder(queryBuilder.EXPENSEBILLQUERY); + + List preparedStatement=new ArrayList<>(); + preparedStatement.add(tenantId); + preparedStatement.add(tenantId); + preparedStatement.add(monthStartDateTime); + preparedStatement.add(monthEndDateTime); + + Integer newLimit=config.getDefaultLimit(); + Integer newOffset=config.getDefaultOffset(); + + if(limit==null && offset==null) + newLimit=config.getMaxSearchLimit(); + if(limit!=null && limit<=config.getMaxSearchLimit()) + newLimit=limit; + if(limit!=null && limit>=config.getMaxSearchLimit()) + newLimit=config.getMaxSearchLimit(); + + if(offset!=null) + newOffset=offset; + + if(newLimit>0) + { + expenseBillQuery.append("offset ? limit ? ;"); + preparedStatement.add(newOffset); + preparedStatement.add(newLimit); + } + + log.info("Query of expense bill report " +expenseBillQuery.toString()+" prepared statement "+preparedStatement); + List expenseBillReportDataList=new ArrayList<>(); + expenseBillReportDataList=jdbcTemplate.query(expenseBillQuery.toString(), preparedStatement.toArray(),expenseBillReportRowMapper); + return expenseBillReportDataList; + } } diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/builder/ChallanQueryBuilder.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/builder/ChallanQueryBuilder.java index 465e12455..d3735c0f7 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/builder/ChallanQueryBuilder.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/builder/ChallanQueryBuilder.java @@ -45,7 +45,7 @@ public ChallanQueryBuilder(ChallanConfiguration config) { public static final String FILESTOREID_UPDATE_SQL = "UPDATE eg_echallan SET filestoreid=? WHERE id=?"; - public static final String CANCEL_RECEIPT_UPDATE_SQL = "UPDATE eg_echallan SET applicationStatus='ACTIVE' WHERE referenceId=? and businessService=?"; + public static final String CANCEL_RECEIPT_UPDATE_SQL = "UPDATE eg_echallan SET applicationStatus='CANCELLED' WHERE referenceId=? and businessService=?"; private static final String TENANTIDS = "SELECT distinct(tenantid) FROM eg_echallan challan"; @@ -85,8 +85,20 @@ public ChallanQueryBuilder(ChallanConfiguration config) { public static final String PENDINGEXPCOLLTILLDATE = "SELECT coalesce(SUM(DMDL.TAXAMOUNT - DMDL.COLLECTIONAMOUNT),0) FROM EGBS_DEMAND_V1 DMD INNER JOIN EGBS_DEMANDDETAIL_V1 DMDL ON DMD.ID=DMDL.DEMANDID AND DMD.TENANTID=DMDL.TENANTID INNER JOIN EG_ECHALLAN CH ON CH.referenceId=DMD.CONSUMERCODE AND DMD.TENANTID=CH.TENANTID WHERE DMD.BUSINESSSERVICE LIKE '%EXPENSE%' and DMD.status='ACTIVE' "; - - public String getChallanSearchQuery(SearchCriteria criteria, List preparedStmtList) { + public static final String EXPENSEBILLQUERY="SELECT challan.typeofexpense,vendor.name,challan.billdate, " + + " challan.taxperiodfrom,challan.taxperiodto,challan.applicationstatus, " + + " challan.paiddate,challan.filestoreid,challan.lastmodifiedtime, " + + " challan.lastmodifiedby as lastmodifiedbyUuid,SUM(dd.taxamount) as total_taxamount " + + " FROM eg_echallan challan LEFT JOIN eg_vendor vendor ON challan.vendor = vendor.id " + + " LEFT JOIN egbs_demand_v1 d ON challan.challanno = d.consumercode " + + " LEFT JOIN egbs_demanddetail_v1 dd ON d.id = dd.demandid WHERE " + + " challan.tenantid = ? AND dd.tenantid = ? " + + " AND challan.createdtime >= ? AND challan.createdtime <= ?" + + " GROUP BY challan.typeofexpense,vendor.name,challan.billdate,challan.taxperiodfrom, " + + " challan.taxperiodto,challan.applicationstatus,challan.paiddate,challan.filestoreid, " + + " challan.lastmodifiedtime,challan.lastmodifiedby,challan.createdtime ORDER BY challan.createdtime DESC "; + + public String getChallanSearchQuery(SearchCriteria criteria, List preparedStmtList) { StringBuilder builder = new StringBuilder(QUERY); diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/rowmapper/ExpenseBillReportRowMapper.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/rowmapper/ExpenseBillReportRowMapper.java new file mode 100644 index 000000000..127dbad55 --- /dev/null +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/repository/rowmapper/ExpenseBillReportRowMapper.java @@ -0,0 +1,91 @@ +package org.egov.echallan.repository.rowmapper; + +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.egov.echallan.model.UserInfo; +import org.egov.echallan.service.UserService; +import org.egov.echallan.web.models.ExpenseBillReportData; +import org.egov.echallan.web.models.ExpenseBillReportResponse; +import org.egov.echallan.web.models.user.User; +import org.egov.echallan.web.models.user.UserDetailResponse; +import org.egov.echallan.web.models.user.UserSearchRequest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataAccessException; +import org.springframework.jdbc.core.ResultSetExtractor; +import org.springframework.stereotype.Component; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.*; + +@Component +@Slf4j +public class ExpenseBillReportRowMapper implements ResultSetExtractor> +{ + @Autowired + private ObjectMapper mapper; + + @Autowired + private UserService userService; + + @Override + public List extractData(ResultSet resultSet) throws SQLException, DataAccessException { + + List expenseBillReportDataList=new ArrayList<>(); + + while(resultSet.next()) + { + ExpenseBillReportData expenseBillReportData=new ExpenseBillReportData(); + expenseBillReportData.setTypeOfExpense(resultSet.getString("typeofexpense")); + expenseBillReportData.setVendorName(resultSet.getString("name")); + expenseBillReportData.setAmount(resultSet.getLong("total_taxamount")); + expenseBillReportData.setBillDate(resultSet.getLong("billdate")); + expenseBillReportData.setTaxPeriodFrom(resultSet.getLong("taxperiodfrom")); + expenseBillReportData.setTaxPeriodTo(resultSet.getLong("taxperiodto")); + expenseBillReportData.setApplicationStatus(resultSet.getString("applicationstatus")); + + if(resultSet.getString("paiddate")!=null) + expenseBillReportData.setPaidDate(resultSet.getLong("paiddate")); + else + expenseBillReportData.setPaidDate(0L); + if(resultSet.getString("filestoreid")!=null) + expenseBillReportData.setFilestoreid("Yes"); + else + expenseBillReportData.setFilestoreid("No"); + if(Objects.equals(resultSet.getString("applicationstatus"), "CANCELLED")) { + expenseBillReportData.setLastModifiedTime(resultSet.getLong("lastmodifiedtime")); + expenseBillReportData.setLastModifiedByUuid(resultSet.getString("lastmodifiedbyUuid")); + enrichExpenseHolderDetails(expenseBillReportData); + } + else + { + expenseBillReportData.setLastModifiedTime(0L); + expenseBillReportData.setLastModifiedBy(null); + } + expenseBillReportDataList.add(expenseBillReportData); + } + return expenseBillReportDataList; + } + + private void enrichExpenseHolderDetails(ExpenseBillReportData expenseBillReportData) + { + UserSearchRequest userSearchRequest=new UserSearchRequest(); + userSearchRequest.setUuid(Collections.singletonList(expenseBillReportData.getLastModifiedByUuid())); + log.info("Uuid's for searching users"+userSearchRequest.getUuid().toString()); + + UserDetailResponse userDetailResponse=userService.getUsers(userSearchRequest); + log.info("User after searching"+userDetailResponse.getUser().toString()); + + enrichConnectionHolderInfo(userDetailResponse,expenseBillReportData); + } + + private void enrichConnectionHolderInfo(UserDetailResponse userDetailResponse, ExpenseBillReportData expenseBillReportData) + { + List connectionHolderInfos= userDetailResponse.getUser(); + if (connectionHolderInfos.isEmpty()) { + return; + } + log.info("Users in enrichConnectionHolderInfo method"+connectionHolderInfos.toString()); + expenseBillReportData.setLastModifiedBy(connectionHolderInfos.get(0).getName()); + } +} diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java index 174a1f956..016658101 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/ChallanService.java @@ -2,18 +2,13 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.Month; -import java.time.YearMonth; -import java.time.ZoneId; +import java.time.*; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; import java.util.*; import javax.validation.Valid; -import io.swagger.models.auth.In; import org.egov.common.contract.request.RequestInfo; import org.egov.echallan.config.ChallanConfiguration; import org.egov.echallan.expense.service.PaymentService; @@ -23,16 +18,19 @@ import org.egov.echallan.model.ChallanRequest; import org.egov.echallan.model.LastMonthSummary; import org.egov.echallan.model.SearchCriteria; +import org.egov.echallan.model.biiling.service.BillResponseDTO; import org.egov.echallan.repository.BillingServiceRepository; import org.egov.echallan.repository.ChallanRepository; import org.egov.echallan.util.CommonUtils; import org.egov.echallan.validator.ChallanValidator; import org.egov.echallan.web.models.ChallanCollectionData; +import org.egov.echallan.web.models.ExpenseBillReportData; import org.egov.echallan.web.models.ExpenseDashboard; import org.egov.echallan.web.models.user.UserDetailResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; @Service @@ -161,7 +159,7 @@ public Challan update(ChallanRequest request, Map finalData) { enrichmentService.enrichUpdateRequest(request, searchResult.get(0)); calculationService.addCalculation(request); repository.update(request); - if (request.getChallan().getApplicationStatus() == StatusEnum.PAID && searchResult.get(0).getApplicationStatus() == StatusEnum.ACTIVE) + if (request.getChallan().getApplicationStatus() == StatusEnum.PAID && searchResult.get(0).getApplicationStatus() == StatusEnum.ACTIVE) paymentService.createPayment(request); if (searchResult.get(0).getApplicationStatus() == StatusEnum.PAID) paymentService.updatePayment(request); @@ -377,4 +375,19 @@ public List getChallansWithOwnerInfoForPlaneSearch(SearchCriteria crite challans = enrichmentService.enrichChallanSearch(challans,criteria,requestInfo); return challans; } + + public List expenseBillReport(RequestInfo requestInfo, String monthstartDate,String monthendDate, String tenantId, Integer offset, Integer limit) + { + DateTimeFormatter dtf=DateTimeFormatter.ofPattern("dd/MM/yyyy"); + LocalDate startDate=LocalDate.parse(monthstartDate,dtf); + LocalDate endDate=LocalDate.parse(monthendDate,dtf); + + Long monthStartDateTime=LocalDateTime.of(startDate.getYear(),startDate.getMonth(),startDate.getDayOfMonth(), + 0,0,0).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); + Long monthEndDateTime=LocalDateTime.of(endDate, LocalTime.MAX).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); + + List expenseBillReport=repository.getExpenseBillReport(monthStartDateTime,monthEndDateTime,tenantId,offset,limit); + return expenseBillReport; + + } } diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java index d64d36451..cd2a3b721 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/PaymentUpdateService.java @@ -90,7 +90,6 @@ public void process(HashMap record) { challan.setIsBillPaid(true); challan.setAuditDetails(auditDetails); ChallanRequest request = ChallanRequest.builder().requestInfo(requestInfo).challan(challan).build(); - log.info("CHALLAN ISBILLPAID:"+challanRequest.getChallan().getIsBillPaid() +" |AND PAID DATE: "+challanRequest.getChallan().getPaidDate()); producer.push(config.getUpdateChallanTopic(), request); }); } diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/UserService.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/UserService.java index 74531e838..9950f3710 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/UserService.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/service/UserService.java @@ -253,5 +253,11 @@ public UserDetailResponse getUserById(RequestInfo requestInfo, String tenantId, StringBuilder uri = new StringBuilder(userHost).append(userSearchEndpoint); return userCall(userSearchRequest, uri); } - + + public UserDetailResponse getUsers(UserSearchRequest userSearchRequest) + { + StringBuilder uri = new StringBuilder(userHost).append(userSearchEndpoint); + UserDetailResponse userDetailResponse = userCall(userSearchRequest, uri); + return userDetailResponse; + } } diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/util/NotificationUtil.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/util/NotificationUtil.java index 5b8d9ffdd..53424952e 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/util/NotificationUtil.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/util/NotificationUtil.java @@ -286,7 +286,7 @@ public HashMap getLocalizationMessage(RequestInfo requestInfo, S StringBuilder uri = new StringBuilder(); uri.append(config.getLocalizationHost()).append(config.getLocalizationContextPath()) .append(config.getLocalizationSearchEndpoint()).append("?").append("locale=").append(locale) - .append("&tenantId=").append("pb").append("&module=").append("mgramseva-common") + .append("&tenantId=").append(tenantId, 0, 2).append("&module=").append("mgramseva-common") .append("&codes=").append(code); Map request = new HashMap<>(); diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/web/controllers/ChallanController.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/web/controllers/ChallanController.java index d18fb102f..33471c13a 100644 --- a/municipal-services/echallan-services/src/main/java/org/egov/echallan/web/controllers/ChallanController.java +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/web/controllers/ChallanController.java @@ -20,19 +20,11 @@ import org.egov.echallan.service.ChallanService; import org.egov.echallan.service.SchedulerService; import org.egov.echallan.util.ResponseInfoFactory; -import org.egov.echallan.web.models.ChallanCollectionData; -import org.egov.echallan.web.models.ChallanCollectionDataResponse; -import org.egov.echallan.web.models.ExpenseDashboard; -import org.egov.echallan.web.models.ExpenseDashboardResponse; +import org.egov.echallan.web.models.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; @RestController @@ -171,5 +163,21 @@ public ResponseEntity updateCreateoPayment(@Valid @RequestBody return new ResponseEntity<>(response, HttpStatus.OK); } + @PostMapping("/_expenseBillReport") + public ResponseEntity expenseBillReport(@Valid @RequestBody RequestInfoWrapper requestInfoWrapper, + @RequestParam("monthstartDate") String monthstartDate, + @RequestParam("monthendDate") String monthendDate, + @RequestParam("tenantId") String tenantId, + @RequestParam("offset") Integer offset, + @RequestParam("limit") Integer limit) + { + List expenseBillReport=challanService.expenseBillReport(requestInfoWrapper.getRequestInfo(),monthstartDate,monthendDate,tenantId,offset,limit); + ExpenseBillReportResponse expenseBillReportResponse= + ExpenseBillReportResponse.builder().ExpenseBillReportData(expenseBillReport) + .responseInfo(responseInfoFactory.createResponseInfoFromRequestInfo(requestInfoWrapper.getRequestInfo(), + true)) + .build(); + return new ResponseEntity<>(expenseBillReportResponse,HttpStatus.OK); + } } diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/web/models/ExpenseBillReportData.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/web/models/ExpenseBillReportData.java new file mode 100644 index 000000000..321a451a9 --- /dev/null +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/web/models/ExpenseBillReportData.java @@ -0,0 +1,56 @@ +package org.egov.echallan.web.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.egov.echallan.model.Amount; +import org.hibernate.validator.constraints.SafeHtml; + +import java.util.List; + +@Builder +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +public class ExpenseBillReportData +{ + @JsonProperty("typeOfExpense") + private String typeOfExpense; + + @JsonProperty("vendorName") + private String vendorName; + + @JsonProperty("amount") + private Long amount; + + @JsonProperty("billDate") + private Long billDate; + + @JsonProperty("taxPeriodFrom") + private Long taxPeriodFrom; + + @JsonProperty("taxPeriodTo") + private Long taxPeriodTo; + + @JsonProperty("applicationStatus") + private String applicationStatus; + + @JsonProperty("paidDate") + private Long paidDate; + + @JsonProperty("filestoreid") + @SafeHtml + private String filestoreid; + + @JsonProperty("lastModifiedTime") + private Long lastModifiedTime; + + @JsonProperty("lastModifiedByUuid") + private String lastModifiedByUuid; + + @JsonProperty("lastModifiedBy") + private String lastModifiedBy; + + @JsonProperty("tenantId") + private String tenantId; +} diff --git a/municipal-services/echallan-services/src/main/java/org/egov/echallan/web/models/ExpenseBillReportResponse.java b/municipal-services/echallan-services/src/main/java/org/egov/echallan/web/models/ExpenseBillReportResponse.java new file mode 100644 index 000000000..0d1a90711 --- /dev/null +++ b/municipal-services/echallan-services/src/main/java/org/egov/echallan/web/models/ExpenseBillReportResponse.java @@ -0,0 +1,20 @@ +package org.egov.echallan.web.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; +import org.apache.coyote.RequestInfo; +import org.egov.common.contract.response.ResponseInfo; + +import java.util.List; + + +@Builder +public class ExpenseBillReportResponse { + + @JsonProperty("ExpenseBillReportData") + private List ExpenseBillReportData; + + @JsonProperty("responseInfo") + private ResponseInfo responseInfo = null; + +} diff --git a/municipal-services/echallan-services/src/main/resources/application.properties b/municipal-services/echallan-services/src/main/resources/application.properties index 22f798592..3f21f5ec6 100644 --- a/municipal-services/echallan-services/src/main/resources/application.properties +++ b/municipal-services/echallan-services/src/main/resources/application.properties @@ -49,7 +49,6 @@ spring.kafka.producer.buffer_memory_config=33554432 #persister configs persister.save.challan.topic=save-challan persister.update.challan.topic=update-challan -persister.update.new.challan.topic=update-new-challan persister.update.status.challan.topic=update-status-challan kafka.topics.filestore=PDF_GEN_CREATE kafka.topics.receipt.cancel.name=egov.collection.payment-cancel diff --git a/municipal-services/vendor/src/main/java/org/egov/vendor/repository/VendorRepository.java b/municipal-services/vendor/src/main/java/org/egov/vendor/repository/VendorRepository.java index 9570480ad..e3bc835e8 100644 --- a/municipal-services/vendor/src/main/java/org/egov/vendor/repository/VendorRepository.java +++ b/municipal-services/vendor/src/main/java/org/egov/vendor/repository/VendorRepository.java @@ -9,8 +9,10 @@ import org.egov.vendor.config.VendorConfiguration; import org.egov.vendor.producer.Producer; import org.egov.vendor.repository.querybuilder.VendorQueryBuilder; +import org.egov.vendor.repository.rowmapper.VendorReportRowMapper; import org.egov.vendor.repository.rowmapper.VendorRowMapper; import org.egov.vendor.web.model.Vendor; +import org.egov.vendor.web.model.VendorReportData; import org.egov.vendor.web.model.VendorRequest; import org.egov.vendor.web.model.VendorSearchCriteria; import org.springframework.beans.factory.annotation.Autowired; @@ -39,6 +41,9 @@ public class VendorRepository { @Autowired private VendorRowMapper vendorrowMapper; + @Autowired + private VendorReportRowMapper vendorReportRowMapper; + public void save(VendorRequest vendorRequest) { producer.push(configuration.getSaveTopic(), vendorRequest); } @@ -111,4 +116,39 @@ public int getExistingVenodrsCount(List ownerIdList, String tenantId) { } + public List getVendorReportData(Long monthStartDateTime, String tenantId, Integer offset, Integer limit) + { + StringBuilder vendor_report_query=new StringBuilder(vendorQueryBuilder.VENDOR_REPORT_QUERY); + + List preparedStatement=new ArrayList<>(); + preparedStatement.add(tenantId); + preparedStatement.add(monthStartDateTime); +// preparedStatement.add(monthEndDateTime); + + + Integer newlimit=configuration.getDefaultLimit(); + Integer newoffset= configuration.getDefaultOffset(); + + if(limit==null && offset==null) + newlimit=configuration.getMaxSearchLimit(); + if(limit!=null && limit<=configuration.getMaxSearchLimit()) + newlimit=limit; + if(limit!=null && limit>=configuration.getMaxSearchLimit()) + newlimit=configuration.getMaxSearchLimit(); + + if(offset!=null) + newoffset=offset; + + if (newlimit>0){ + vendor_report_query.append(" offset ? limit ? ;"); + preparedStatement.add(newoffset); + preparedStatement.add(newlimit); + } + + log.info("Query of vendor report : "+vendor_report_query.toString()+" prepared statement of vendor report "+ preparedStatement); + + List vendorReportDataList=jdbcTemplate.query(vendor_report_query.toString() , preparedStatement.toArray(), vendorReportRowMapper); + + return vendorReportDataList; + } } diff --git a/municipal-services/vendor/src/main/java/org/egov/vendor/repository/querybuilder/VendorQueryBuilder.java b/municipal-services/vendor/src/main/java/org/egov/vendor/repository/querybuilder/VendorQueryBuilder.java index 7c2396ad9..c30edea4a 100644 --- a/municipal-services/vendor/src/main/java/org/egov/vendor/repository/querybuilder/VendorQueryBuilder.java +++ b/municipal-services/vendor/src/main/java/org/egov/vendor/repository/querybuilder/VendorQueryBuilder.java @@ -12,6 +12,11 @@ @Component public class VendorQueryBuilder { + public static final String VENDOR_REPORT_QUERY = "select echallan.challanno,echallan.typeofexpense as type_of_expense," + + " vendor.name,eg_user.uuid as owner_uuid from eg_echallan echallan INNER JOIN eg_vendor vendor on " + + " echallan.vendor=vendor.id INNER JOIN eg_user on eg_user.uuid=vendor.owner_id where " + + " echallan.applicationstatus!='CANCELLED' and echallan.tenantid =? " + + " and echallan.taxperiodfrom >= ? order by echallan.challanno desc "; @Autowired private VendorConfiguration config; diff --git a/municipal-services/vendor/src/main/java/org/egov/vendor/repository/rowmapper/VendorReportRowMapper.java b/municipal-services/vendor/src/main/java/org/egov/vendor/repository/rowmapper/VendorReportRowMapper.java new file mode 100644 index 000000000..ccc815944 --- /dev/null +++ b/municipal-services/vendor/src/main/java/org/egov/vendor/repository/rowmapper/VendorReportRowMapper.java @@ -0,0 +1,95 @@ +package org.egov.vendor.repository.rowmapper; + +import com.fasterxml.jackson.databind.ObjectMapper; +import lombok.extern.slf4j.Slf4j; +import org.egov.vendor.service.UserService; +import org.egov.vendor.web.model.VendorReportData; +import org.egov.vendor.web.model.user.User; +import org.egov.vendor.web.model.user.UserDetailResponse; +import org.egov.vendor.web.model.user.UserSearchRequest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataAccessException; +import org.springframework.jdbc.core.ResultSetExtractor; +import org.springframework.stereotype.Component; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +@Component +@Slf4j +public class VendorReportRowMapper implements ResultSetExtractor> +{ + @Autowired + private ObjectMapper mapper; + @Autowired + private UserService userService; + + @Override + public List extractData(ResultSet resultSet) throws SQLException, DataAccessException { + List vendorReportDataList=new ArrayList<>(); + + while(resultSet.next()) + { + VendorReportData vendorReportData=new VendorReportData(); + vendorReportData.setVendor_name(resultSet.getString("name")); + vendorReportData.setBill_id(resultSet.getString("challanno")); + vendorReportData.setUuid(resultSet.getString("owner_uuid")); + vendorReportData.setType_of_expense(resultSet.getString("type_of_expense")); + vendorReportDataList.add(vendorReportData); + } + if(!vendorReportDataList.isEmpty()) + { + enrichVendorHolderDetails(vendorReportDataList); + } + return vendorReportDataList; + } + + private void enrichVendorHolderDetails(List vendorReportDataList) + { + Set lastModifiedByUuid= new HashSet<>(); + + for(VendorReportData vendorReportData:vendorReportDataList) + { + lastModifiedByUuid.add(vendorReportData.getUuid()); + } + + UserSearchRequest userSearchRequest=new UserSearchRequest(); + userSearchRequest.setUuid((new ArrayList<>(lastModifiedByUuid))); + + log.info(userSearchRequest.getUuid().toString()); + + UserDetailResponse userDetailResponse = userService.getUser(userSearchRequest); + + log.info(userDetailResponse.getUser().toString()); + + enrichConnectionHolderInfo(userDetailResponse, vendorReportDataList); + + } + + private void enrichConnectionHolderInfo(UserDetailResponse userDetailResponse, List vendorReportDataList) + { + List connectionHolderInfos = userDetailResponse.getUser(); + Map userIdToConnectionHolderMap = new HashMap<>(); + if(connectionHolderInfos.isEmpty()) + { + return; + } + connectionHolderInfos.forEach(user -> userIdToConnectionHolderMap.put(user.getUuid(), user)); + + log.info(userIdToConnectionHolderMap.toString()); + +// vendorReportDataList.forEach(vendorReportData-> vendorReportData.setMobile_no(userIdToConnectionHolderMap.get(vendorReportData.getUuid()).getMobileNumber())); + + vendorReportDataList.forEach(vendorReportData -> { + User connection = userIdToConnectionHolderMap.get(vendorReportData.getUuid()); + if (connection != null) { + vendorReportData.setMobile_no(connection.getMobileNumber()); + } else { + log.warn("User not found for UUID: " + vendorReportData.getUuid()); + } + }); + + } +} diff --git a/municipal-services/vendor/src/main/java/org/egov/vendor/service/UserService.java b/municipal-services/vendor/src/main/java/org/egov/vendor/service/UserService.java index d1ec6484c..ddf5d0400 100644 --- a/municipal-services/vendor/src/main/java/org/egov/vendor/service/UserService.java +++ b/municipal-services/vendor/src/main/java/org/egov/vendor/service/UserService.java @@ -610,4 +610,12 @@ private Boolean isUserValid(User user) { return Boolean.TRUE; } + + + public UserDetailResponse getUser(UserSearchRequest userSearchRequest) { + StringBuilder uri = new StringBuilder(config.getUserHost()) + .append(config.getUserSearchEndpoint()); + UserDetailResponse userDetailResponse = userCall(userSearchRequest, uri); + return userDetailResponse; + } } diff --git a/municipal-services/vendor/src/main/java/org/egov/vendor/service/VendorService.java b/municipal-services/vendor/src/main/java/org/egov/vendor/service/VendorService.java index 5bde74895..6276a7ddf 100644 --- a/municipal-services/vendor/src/main/java/org/egov/vendor/service/VendorService.java +++ b/municipal-services/vendor/src/main/java/org/egov/vendor/service/VendorService.java @@ -1,5 +1,9 @@ package org.egov.vendor.service; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; @@ -14,6 +18,7 @@ import org.egov.vendor.repository.VendorRepository; import org.egov.vendor.validator.VendorValidator; import org.egov.vendor.web.model.Vendor; +import org.egov.vendor.web.model.VendorReportData; import org.egov.vendor.web.model.VendorRequest; import org.egov.vendor.web.model.VendorSearchCriteria; import org.egov.vendor.web.model.user.User; @@ -30,9 +35,6 @@ @Slf4j public class VendorService { - @Autowired - private VendorRepository vendorRepository; - @Autowired private VendorValidator vendorValidator; @@ -64,7 +66,7 @@ public Vendor create(VendorRequest vendorRequest) { vendorValidator.validateCreate(vendorRequest); enrichmentService.enrichCreate(vendorRequest); - vendorRepository.save(vendorRequest); + repository.save(vendorRequest); return vendorRequest.getVendor(); } @@ -159,4 +161,19 @@ private List getVendorPlainSearch(@Valid VendorSearchCriteria criteria, return vendorList; } + public List vendorReport(String monthStartDate, String tenantId, Integer offset, Integer limit, RequestInfo requestInfo) + { + + DateTimeFormatter formatter=DateTimeFormatter.ofPattern("dd/MM/yyyy"); + LocalDate startDate= LocalDate.parse(monthStartDate,formatter); +// LocalDate endDate=LocalDate.parse(monthEndDate,formatter); + + Long monthStartDateTime= LocalDateTime.of(startDate.getYear(),startDate.getMonth(),startDate.getDayOfMonth(), + 0,0,0).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); +// Long monthEndDateTime=LocalDateTime.of(endDate, LocalTime.MAX).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); + + List vendorReportData=repository.getVendorReportData(monthStartDateTime,tenantId,offset,limit); + return vendorReportData; + + } } diff --git a/municipal-services/vendor/src/main/java/org/egov/vendor/web/controller/VendorController.java b/municipal-services/vendor/src/main/java/org/egov/vendor/web/controller/VendorController.java index 66971ebf7..2be2fa9f4 100644 --- a/municipal-services/vendor/src/main/java/org/egov/vendor/web/controller/VendorController.java +++ b/municipal-services/vendor/src/main/java/org/egov/vendor/web/controller/VendorController.java @@ -9,20 +9,11 @@ import org.egov.vendor.service.VendorService; import org.egov.vendor.util.ResponseInfoFactory; import org.egov.vendor.util.VendorUtil; -import org.egov.vendor.web.model.RequestInfoWrapper; -import org.egov.vendor.web.model.Vendor; -import org.egov.vendor.web.model.VendorRequest; -import org.egov.vendor.web.model.VendorResponse; -import org.egov.vendor.web.model.VendorSearchCriteria; +import org.egov.vendor.web.model.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; @RestController @@ -75,4 +66,19 @@ public ResponseEntity plainsearch(@Valid @RequestBody RequestInf .build(); return new ResponseEntity<>(response, HttpStatus.OK); } + + @RequestMapping(value="/_vendorReport" ,method = RequestMethod.POST) + public ResponseEntity vendorReport(@Valid @RequestBody RequestInfoWrapper requestInfoWrapper, + @RequestParam(value="monthStartDate" , required = true) String monthStartDate, + @RequestParam ("tenantId") String tenantId, + @RequestParam ("offset") Integer offset, + @RequestParam ("limit") Integer limit) + { + + List vendorReportData=vendorService.vendorReport(monthStartDate,tenantId,offset,limit,requestInfoWrapper.getRequestInfo()); + VendorReportResponse vendorReportResponse= VendorReportResponse.builder().VendorReportData(vendorReportData).responseInfo(responseInfoFactory.createResponseInfoFromRequestInfo(requestInfoWrapper.getRequestInfo(),true)).build(); + + return new ResponseEntity<>(vendorReportResponse,HttpStatus.OK); + } + } diff --git a/municipal-services/vendor/src/main/java/org/egov/vendor/web/model/VendorReportData.java b/municipal-services/vendor/src/main/java/org/egov/vendor/web/model/VendorReportData.java new file mode 100644 index 000000000..8126fb4f0 --- /dev/null +++ b/municipal-services/vendor/src/main/java/org/egov/vendor/web/model/VendorReportData.java @@ -0,0 +1,31 @@ +package org.egov.vendor.web.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.*; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class VendorReportData { + + @JsonProperty("tenantId") + private String tenantId; + + @JsonProperty("vendor_name") + private String vendor_name; + + @JsonProperty("mobile_no") + private String mobile_no; + + @JsonProperty("type_of_expense") + private String type_of_expense; + + @JsonProperty("bill_id") + private String bill_id; + + @JsonProperty("owner_uuid") + private String uuid; + +} diff --git a/municipal-services/vendor/src/main/java/org/egov/vendor/web/model/VendorReportResponse.java b/municipal-services/vendor/src/main/java/org/egov/vendor/web/model/VendorReportResponse.java new file mode 100644 index 000000000..021606a1a --- /dev/null +++ b/municipal-services/vendor/src/main/java/org/egov/vendor/web/model/VendorReportResponse.java @@ -0,0 +1,17 @@ +package org.egov.vendor.web.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Builder; +import org.egov.common.contract.response.ResponseInfo; + +import java.util.List; + +@Builder +public class VendorReportResponse { + + @JsonProperty("VendorReportData") + private List VendorReportData; + + @JsonProperty("requestInfo") + private ResponseInfo responseInfo = null; +} diff --git a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/config/WSCalculationConfiguration.java b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/config/WSCalculationConfiguration.java index d3956c667..005fa4286 100644 --- a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/config/WSCalculationConfiguration.java +++ b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/config/WSCalculationConfiguration.java @@ -246,5 +246,8 @@ public class WSCalculationConfiguration { @Value("${sms.bill.download.enabled}") private boolean isSmsForBillDownloadEnabled; + + @Value("${sms.exclude.tenant}") + private String smsExcludeTenant; } diff --git a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/consumer/DemandGenerationConsumer.java b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/consumer/DemandGenerationConsumer.java index 393cfe5e3..0aba61a11 100644 --- a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/consumer/DemandGenerationConsumer.java +++ b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/consumer/DemandGenerationConsumer.java @@ -331,7 +331,7 @@ private void generateDemandAndSendnotification(RequestInfo requestInfo, String t * + connectionNo ); continue; } */ try { - if(tenantId != "pb.testing") { + if(!tenantId.equals(config.getSmsExcludeTenant())) { generateDemandInBatch(calculationReq, masterMap, billingCycle, isSendMessage); } @@ -547,4 +547,4 @@ public void generateBulkDemandForULB(HashMap messageData) { } -} \ No newline at end of file +} diff --git a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/service/DemandService.java b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/service/DemandService.java index 6292bcfc4..da2a0a6e0 100644 --- a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/service/DemandService.java +++ b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/service/DemandService.java @@ -491,7 +491,7 @@ private String getShortenedUrl(String url) { private void sendSMSNotification(RequestInfo requestInfo, List smsRequests, String billCycle, String consumerCode, List demandDetails) { UserDetailResponse userDetailResponse = userService.getUserByRoleCodes(requestInfo, Arrays.asList("GP_ADMIN"), - "pb"); + requestInfo.getUserInfo().getTenantId().substring(0,2)); for (OwnerInfo ownerInfo : userDetailResponse.getUser()) { String localizationMessage = util.getLocalizationMessages(ownerInfo.getTenantId(), requestInfo); String messageString = util.getMessageTemplate(WSCalculationConstant.mGram_Consumer_NewBill, diff --git a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/util/NotificationUtil.java b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/util/NotificationUtil.java index c0c9cdbfd..35a2ec9be 100644 --- a/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/util/NotificationUtil.java +++ b/municipal-services/ws-calculator/src/main/java/org/egov/wscalculation/util/NotificationUtil.java @@ -208,7 +208,7 @@ public HashMap getLocalizationMessage(RequestInfo requestInfo, S StringBuilder uri = new StringBuilder(); uri.append(config.getLocalizationHost()).append(config.getLocalizationContextPath()) .append(config.getLocalizationSearchEndpoint()).append("?").append("locale=").append(locale) - .append("&tenantId=").append("pb").append("&module=").append("mgramseva-common") + .append("&tenantId=").append(tenantId,0,2).append("&module=").append("mgramseva-common") .append("&codes=").append(code); Map request = new HashMap<>(); diff --git a/municipal-services/ws-calculator/src/main/resources/application.properties b/municipal-services/ws-calculator/src/main/resources/application.properties index a7e8b3938..c1860ade8 100644 --- a/municipal-services/ws-calculator/src/main/resources/application.properties +++ b/municipal-services/ws-calculator/src/main/resources/application.properties @@ -144,3 +144,4 @@ egov.pspcl.vendor.number=9569761362 sms.demand.enabled: true sms.payment.link.enabled: true sms.bill.download.enabled: true +sms.exclude.tenant="pb.testing" diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/OnBoardService.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/OnBoardService.java index eec01dcf0..40d529509 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/OnBoardService.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/service/OnBoardService.java @@ -110,7 +110,7 @@ public HashMap process(MultipartFile file, RequestInfoWrapper req if (!StringUtils.isEmpty(tenantId)) { tenantId = tenantId.split("\\.")[0]; } else { - tenantId = "pb"; + throw new CustomException("ONBOARD_NOT_FOUND", "Invalid tenantid"); } user.setTenantId(tenantId); } else if (2 == address.getColumn()) { diff --git a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/util/NotificationUtil.java b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/util/NotificationUtil.java index 8357408bc..f41b72049 100644 --- a/municipal-services/ws-services/src/main/java/org/egov/waterconnection/util/NotificationUtil.java +++ b/municipal-services/ws-services/src/main/java/org/egov/waterconnection/util/NotificationUtil.java @@ -191,7 +191,7 @@ public HashMap getLocalizationMessage(RequestInfo requestInfo, S StringBuilder uri = new StringBuilder(); uri.append(config.getLocalizationHost()).append(config.getLocalizationContextPath()) .append(config.getLocalizationSearchEndpoint()).append("?").append("locale=").append(locale) - .append("&tenantId=").append("pb").append("&module=").append("mgramseva-common") + .append("&tenantId=").append(tenantId,0,2).append("&module=").append("mgramseva-common") .append("&codes=").append(code); Map request = new HashMap<>();