View Invoice Drop Down Filer done
commit
160ee58aeb
|
@ -259,18 +259,6 @@
|
|||
"packageUri": "lib/",
|
||||
"languageVersion": "3.1"
|
||||
},
|
||||
{
|
||||
"name": "syncfusion_flutter_core",
|
||||
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_core-28.2.4",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.3"
|
||||
},
|
||||
{
|
||||
"name": "syncfusion_flutter_datepicker",
|
||||
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_datepicker-28.2.4",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.3"
|
||||
},
|
||||
{
|
||||
"name": "table_calendar",
|
||||
"rootUri": "file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/table_calendar-3.2.0",
|
||||
|
@ -344,7 +332,7 @@
|
|||
"languageVersion": "3.6"
|
||||
}
|
||||
],
|
||||
"generated": "2025-02-05T20:46:55.606574Z",
|
||||
"generated": "2025-02-06T19:17:10.303508Z",
|
||||
"generator": "pub",
|
||||
"generatorVersion": "3.6.1",
|
||||
"flutterRoot": "file:///C:/src/flutter/flutter",
|
||||
|
|
|
@ -154,14 +154,6 @@ string_scanner
|
|||
3.1
|
||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/string_scanner-1.3.0/
|
||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/string_scanner-1.3.0/lib/
|
||||
syncfusion_flutter_core
|
||||
3.3
|
||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_core-28.2.4/
|
||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_core-28.2.4/lib/
|
||||
syncfusion_flutter_datepicker
|
||||
3.3
|
||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_datepicker-28.2.4/
|
||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_datepicker-28.2.4/lib/
|
||||
table_calendar
|
||||
3.0
|
||||
file:///C:/Users/Admin/AppData/Local/Pub/Cache/hosted/pub.dev/table_calendar-3.2.0/
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<option name="brand" value="DOCOMO" />
|
||||
<option name="codename" value="F01L" />
|
||||
<option name="id" value="F01L" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="FUJITSU" />
|
||||
<option name="name" value="F-01L" />
|
||||
<option name="screenDensity" value="360" />
|
||||
|
@ -19,6 +20,7 @@
|
|||
<option name="brand" value="OPPO" />
|
||||
<option name="codename" value="OP573DL1" />
|
||||
<option name="id" value="OP573DL1" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="OPPO" />
|
||||
<option name="name" value="CPH2557" />
|
||||
<option name="screenDensity" value="480" />
|
||||
|
@ -30,6 +32,7 @@
|
|||
<option name="brand" value="DOCOMO" />
|
||||
<option name="codename" value="SH-01L" />
|
||||
<option name="id" value="SH-01L" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="SHARP" />
|
||||
<option name="name" value="AQUOS sense2 SH-01L" />
|
||||
<option name="screenDensity" value="480" />
|
||||
|
@ -40,7 +43,9 @@
|
|||
<option name="api" value="34" />
|
||||
<option name="brand" value="Lenovo" />
|
||||
<option name="codename" value="TB370FU" />
|
||||
<option name="formFactor" value="Tablet" />
|
||||
<option name="id" value="TB370FU" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Lenovo" />
|
||||
<option name="name" value="Tab P12" />
|
||||
<option name="screenDensity" value="340" />
|
||||
|
@ -52,6 +57,7 @@
|
|||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="a51" />
|
||||
<option name="id" value="a51" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy A51" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -63,17 +69,31 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="akita" />
|
||||
<option name="id" value="akita" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 8a" />
|
||||
<option name="screenDensity" value="420" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2400" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="motorola" />
|
||||
<option name="codename" value="arcfox" />
|
||||
<option name="id" value="arcfox" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Motorola" />
|
||||
<option name="name" value="razr plus 2024" />
|
||||
<option name="screenDensity" value="360" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="1272" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="33" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="b0q" />
|
||||
<option name="id" value="b0q" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy S22 Ultra" />
|
||||
<option name="screenDensity" value="600" />
|
||||
|
@ -85,6 +105,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="bluejay" />
|
||||
<option name="id" value="bluejay" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 6a" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -96,6 +117,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="caiman" />
|
||||
<option name="id" value="caiman" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 9 Pro" />
|
||||
<option name="screenDensity" value="360" />
|
||||
|
@ -106,7 +128,9 @@
|
|||
<option name="api" value="34" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="comet" />
|
||||
<option name="default" value="true" />
|
||||
<option name="id" value="comet" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 9 Pro Fold" />
|
||||
<option name="screenDensity" value="390" />
|
||||
|
@ -118,6 +142,7 @@
|
|||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="crownqlteue" />
|
||||
<option name="id" value="crownqlteue" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy Note9" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -129,6 +154,7 @@
|
|||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="dm2q" />
|
||||
<option name="id" value="dm2q" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="S23 Plus" />
|
||||
<option name="screenDensity" value="450" />
|
||||
|
@ -140,6 +166,7 @@
|
|||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="dm3q" />
|
||||
<option name="id" value="dm3q" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy S23 Ultra" />
|
||||
<option name="screenDensity" value="600" />
|
||||
|
@ -150,7 +177,9 @@
|
|||
<option name="api" value="34" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="e1q" />
|
||||
<option name="default" value="true" />
|
||||
<option name="id" value="e1q" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy S24" />
|
||||
<option name="screenDensity" value="480" />
|
||||
|
@ -162,6 +191,7 @@
|
|||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="e3q" />
|
||||
<option name="id" value="e3q" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy S24 Ultra" />
|
||||
<option name="screenDensity" value="450" />
|
||||
|
@ -173,6 +203,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="eos" />
|
||||
<option name="id" value="eos" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Eos" />
|
||||
<option name="screenDensity" value="320" />
|
||||
|
@ -184,6 +215,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="felix" />
|
||||
<option name="id" value="felix" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel Fold" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -195,6 +227,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="felix" />
|
||||
<option name="id" value="felix" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel Fold" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -206,6 +239,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="felix_camera" />
|
||||
<option name="id" value="felix_camera" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel Fold (Camera-enabled)" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -217,17 +251,32 @@
|
|||
<option name="brand" value="motorola" />
|
||||
<option name="codename" value="fogona" />
|
||||
<option name="id" value="fogona" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Motorola" />
|
||||
<option name="name" value="moto g play - 2024" />
|
||||
<option name="screenDensity" value="280" />
|
||||
<option name="screenX" value="720" />
|
||||
<option name="screenY" value="1600" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="34" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="g0q" />
|
||||
<option name="id" value="g0q" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="SM-S906U1" />
|
||||
<option name="screenDensity" value="450" />
|
||||
<option name="screenX" value="1080" />
|
||||
<option name="screenY" value="2340" />
|
||||
</PersistentDeviceSelectionData>
|
||||
<PersistentDeviceSelectionData>
|
||||
<option name="api" value="33" />
|
||||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="gts8uwifi" />
|
||||
<option name="formFactor" value="Tablet" />
|
||||
<option name="id" value="gts8uwifi" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy Tab S8 Ultra" />
|
||||
<option name="screenDensity" value="320" />
|
||||
|
@ -239,6 +288,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="husky" />
|
||||
<option name="id" value="husky" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 8 Pro" />
|
||||
<option name="screenDensity" value="390" />
|
||||
|
@ -250,6 +300,7 @@
|
|||
<option name="brand" value="motorola" />
|
||||
<option name="codename" value="java" />
|
||||
<option name="id" value="java" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Motorola" />
|
||||
<option name="name" value="G20" />
|
||||
<option name="screenDensity" value="280" />
|
||||
|
@ -261,6 +312,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="komodo" />
|
||||
<option name="id" value="komodo" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 9 Pro XL" />
|
||||
<option name="screenDensity" value="360" />
|
||||
|
@ -272,6 +324,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="lynx" />
|
||||
<option name="id" value="lynx" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 7a" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -283,6 +336,7 @@
|
|||
<option name="brand" value="motorola" />
|
||||
<option name="codename" value="maui" />
|
||||
<option name="id" value="maui" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Motorola" />
|
||||
<option name="name" value="moto g play - 2023" />
|
||||
<option name="screenDensity" value="280" />
|
||||
|
@ -294,6 +348,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="oriole" />
|
||||
<option name="id" value="oriole" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 6" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -305,6 +360,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="panther" />
|
||||
<option name="id" value="panther" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 7" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -316,6 +372,7 @@
|
|||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="q5q" />
|
||||
<option name="id" value="q5q" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy Z Fold5" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -327,6 +384,7 @@
|
|||
<option name="brand" value="samsung" />
|
||||
<option name="codename" value="q6q" />
|
||||
<option name="id" value="q6q" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Samsung" />
|
||||
<option name="name" value="Galaxy Z Fold6" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -337,7 +395,9 @@
|
|||
<option name="api" value="30" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="r11" />
|
||||
<option name="formFactor" value="Wear OS" />
|
||||
<option name="id" value="r11" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel Watch" />
|
||||
<option name="screenDensity" value="320" />
|
||||
|
@ -350,6 +410,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="redfin" />
|
||||
<option name="id" value="redfin" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 5" />
|
||||
<option name="screenDensity" value="440" />
|
||||
|
@ -361,6 +422,7 @@
|
|||
<option name="brand" value="google" />
|
||||
<option name="codename" value="shiba" />
|
||||
<option name="id" value="shiba" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 8" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
@ -371,7 +433,9 @@
|
|||
<option name="api" value="33" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="tangorpro" />
|
||||
<option name="formFactor" value="Tablet" />
|
||||
<option name="id" value="tangorpro" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel Tablet" />
|
||||
<option name="screenDensity" value="320" />
|
||||
|
@ -382,7 +446,9 @@
|
|||
<option name="api" value="34" />
|
||||
<option name="brand" value="google" />
|
||||
<option name="codename" value="tokay" />
|
||||
<option name="default" value="true" />
|
||||
<option name="id" value="tokay" />
|
||||
<option name="labId" value="google" />
|
||||
<option name="manufacturer" value="Google" />
|
||||
<option name="name" value="Pixel 9" />
|
||||
<option name="screenDensity" value="420" />
|
||||
|
|
|
@ -25,5 +25,10 @@ public final class GeneratedPluginRegistrant {
|
|||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error registering plugin flutter_plugin_android_lifecycle, io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin", e);
|
||||
}
|
||||
try {
|
||||
flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,10 +12,17 @@
|
|||
@import file_picker;
|
||||
#endif
|
||||
|
||||
#if __has_include(<path_provider_foundation/PathProviderPlugin.h>)
|
||||
#import <path_provider_foundation/PathProviderPlugin.h>
|
||||
#else
|
||||
@import path_provider_foundation;
|
||||
#endif
|
||||
|
||||
@implementation GeneratedPluginRegistrant
|
||||
|
||||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
|
||||
[FilePickerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FilePickerPlugin"]];
|
||||
[PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -55,7 +55,7 @@ class AppStrings {
|
|||
static const String totalGst = "Total GST";
|
||||
static const String cCN = "CCN No.";
|
||||
static const String cCNDate = "CCN Date";
|
||||
static const String miroStatus = "Miro Status";
|
||||
static const String miroStatus = "Micro Status";
|
||||
static const String gstHold = "GST Hold";
|
||||
static const String gstRelease = "If GST release this invoice"
|
||||
" than required GST Payment Due & UTN Number";
|
||||
|
@ -85,7 +85,9 @@ class AppStrings {
|
|||
static const String cancelledInvoice = "Cancelled Invoice";
|
||||
static const String ccnView = "CCN View";
|
||||
static const String transporterInbound = "Transporter Inbound Transaction";
|
||||
static const String billdayConfiguration = "Bill day Configuration";
|
||||
static const String bufferdayConfiguration = "Buffer day Configuration";
|
||||
static const String close = "Close";
|
||||
static const String billDayConfiguration = "Bill Day Configuration";
|
||||
static const String bufferDayConfiguration = "Buffer Day Configuration";
|
||||
static const String ccnConfiguration = "CCN Configuration";
|
||||
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ class ConfigurationScreenController extends GetxController{
|
|||
var selectedState = 0.obs;
|
||||
RxBool isSelected = false.obs;
|
||||
RxList userTabs = <CommonModel>[
|
||||
CommonModel(title: AppStrings.billdayConfiguration),
|
||||
CommonModel(title: AppStrings.bufferdayConfiguration),
|
||||
CommonModel(title: AppStrings.billDayConfiguration),
|
||||
CommonModel(title: AppStrings.bufferDayConfiguration),
|
||||
CommonModel(title: AppStrings.ccnConfiguration),
|
||||
].obs;
|
||||
var selectedInvoice = '41896424644'.obs; // Default value
|
||||
|
|
|
@ -22,7 +22,7 @@ class FreightBillCtrl extends GetxController{
|
|||
}
|
||||
var items = ['Admin', 'Sub Admin',
|
||||
'Internal Audit', 'Raw material','MIS User'].obs;
|
||||
var status = ['STO','In-Bound'];
|
||||
var status = ['STO','INBOUND'];
|
||||
RxList tabs = <CommonModel>[
|
||||
CommonModel(
|
||||
title: "User\nManagement",
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:shayog/components/common/common_button.dart';
|
||||
import 'package:shayog/components/styles/textStyles.dart';
|
||||
import 'package:shayog/feature/presentation/widgets/text_view.dart';
|
||||
import '../../../../../../components/common/common_btn.dart';
|
||||
import '../../../../../../components/common/custom_drop_down.dart';
|
||||
|
@ -22,7 +21,114 @@ class AddInternalUser extends StatelessWidget {
|
|||
padding: EdgeInsets.all(16),
|
||||
color: AppColors.clrF2,
|
||||
child: allData(),
|
||||
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Expanded(child: Container(
|
||||
// padding: EdgeInsets.only(right: 16),
|
||||
// height: 150,
|
||||
// color: Colors.pink,
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// TextView(
|
||||
// text: AppStrings.firstName,
|
||||
// isRequired: true,
|
||||
// ),
|
||||
// InputField(
|
||||
// errorTxtColor: controller.errorTextColor,
|
||||
// validator: Validations.checkValidations,
|
||||
// controller: controller.nameCtrl,
|
||||
// title: AppStrings.enterFirstName,
|
||||
// ),
|
||||
// TextView(
|
||||
// text: AppStrings.userType,
|
||||
// ),
|
||||
//
|
||||
// CustomDropdown(
|
||||
// initialValue: controller.userTypeList[1],
|
||||
// backClr: AppColors.clrD9,
|
||||
// borderClr: AppColors.clrGrey,
|
||||
// items: controller.userTypeList,
|
||||
// itemLabel: (item) => item,
|
||||
// onSelected: (selected) {
|
||||
// if (selected != null) {
|
||||
// controller.selectedValue.value = selected;
|
||||
// }
|
||||
// },
|
||||
// hintText: 'Select User Type',
|
||||
// ),
|
||||
// ],
|
||||
// ),)),
|
||||
// Expanded(child: Container(
|
||||
// padding: EdgeInsets.only(right: 16),
|
||||
// height: 150,
|
||||
// color: Colors.green,
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// TextView(
|
||||
// text: AppStrings.lastName,
|
||||
// isRequired: true,
|
||||
// ),
|
||||
// InputField(
|
||||
// errorTxtColor: controller.errorTextColor,
|
||||
// validator: Validations.checkValidations,
|
||||
// controller: controller.lastNCtrl,
|
||||
// title: AppStrings.enterLastName,
|
||||
// ),
|
||||
// TextView(
|
||||
// text: AppStrings.status,
|
||||
// ),
|
||||
//
|
||||
// CustomDropdown(
|
||||
// initialValue: controller.status[0],
|
||||
// backClr: AppColors.clrD9,
|
||||
// borderClr: AppColors.clrGrey,
|
||||
// items: controller.status,
|
||||
// itemLabel: (item) => item,
|
||||
// onSelected: (selected) {
|
||||
// if (selected != null) {
|
||||
// controller.selectedStatus.value = selected;
|
||||
// }
|
||||
// },
|
||||
// hintText: 'Active'),
|
||||
// ],
|
||||
// ),)),
|
||||
// Expanded(child: Container(
|
||||
// height: 150,
|
||||
// color: Colors.yellow,
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// TextView(
|
||||
// text: AppStrings.employeeCode,
|
||||
// isRequired: true,
|
||||
// ),
|
||||
// InputField(
|
||||
// errorTxtColor: controller.errorTextColor,
|
||||
// validator: Validations.checkValidations,
|
||||
// controller: controller.employeeCodeCtrl,
|
||||
// title: AppStrings.enterEmployeeCode,
|
||||
// ),
|
||||
// TextView(
|
||||
// text: AppStrings.emailAddress,
|
||||
// isRequired: true,
|
||||
// ),
|
||||
// //SizedBox(height: 8),
|
||||
// InputField(
|
||||
// errorTxtColor: controller.errorTextColor,
|
||||
// validator: Validations.checkEmailValidations,
|
||||
// controller: controller.emailCtrl,
|
||||
// title: AppStrings.enterEmailAddress,
|
||||
// ),
|
||||
//
|
||||
// ],
|
||||
// ),)),
|
||||
// ],
|
||||
// ),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -31,7 +137,7 @@ class AddInternalUser extends StatelessWidget {
|
|||
children: [
|
||||
Form(
|
||||
key: controller.formKey,
|
||||
//autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
@ -93,7 +199,6 @@ class AddInternalUser extends StatelessWidget {
|
|||
)),
|
||||
],
|
||||
),
|
||||
SizedBox(height:8 ),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
|
@ -104,7 +209,6 @@ class AddInternalUser extends StatelessWidget {
|
|||
TextView(
|
||||
text: AppStrings.userType,
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
CustomDropdown(
|
||||
initialValue: controller.userTypeList[1],
|
||||
backClr: AppColors.clrD9,
|
||||
|
@ -118,15 +222,6 @@ class AddInternalUser extends StatelessWidget {
|
|||
},
|
||||
hintText: 'Select User Type',
|
||||
),
|
||||
Obx(() => controller.validateAdduser.value == true ?
|
||||
TextView(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
text: "Required",
|
||||
style: 10.txtTransparent,
|
||||
|
||||
) :
|
||||
SizedBox.shrink(
|
||||
))
|
||||
],
|
||||
)),
|
||||
SizedBox(width: 16),
|
||||
|
@ -138,10 +233,8 @@ class AddInternalUser extends StatelessWidget {
|
|||
TextView(
|
||||
text: AppStrings.status,
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
CustomDropdown(
|
||||
//initialValue: controller.status[0],
|
||||
initialValue: "Active",
|
||||
initialValue: controller.status[0],
|
||||
backClr: AppColors.clrD9,
|
||||
borderClr: AppColors.clrGrey,
|
||||
items: controller.status,
|
||||
|
@ -152,16 +245,6 @@ class AddInternalUser extends StatelessWidget {
|
|||
}
|
||||
},
|
||||
hintText: 'Active'),
|
||||
Obx(() => controller.validateAdduser.value == true ?
|
||||
TextView(
|
||||
margin: EdgeInsets.only(top: 4),
|
||||
text: "Required",
|
||||
style: 10.txtTransparent,
|
||||
|
||||
) :
|
||||
SizedBox.shrink(
|
||||
))
|
||||
|
||||
],
|
||||
)),
|
||||
SizedBox(width: 16),
|
||||
|
@ -227,7 +310,26 @@ class AddInternalUser extends StatelessWidget {
|
|||
clickAction: () {
|
||||
controller.createUser();
|
||||
}
|
||||
|
||||
// if(controller.formKey.currentState!.validate()){
|
||||
// controller.createUser();
|
||||
// } else {
|
||||
// controller.validatePlants.value == true;
|
||||
//
|
||||
// }
|
||||
// if (controller.formKey.currentState
|
||||
// ?.validate() ??
|
||||
// false) {
|
||||
// ScaffoldMessenger.of(context)
|
||||
// .showSnackBar(
|
||||
// SnackBar(
|
||||
// content: Text(
|
||||
// 'Form submitted successfully!')),
|
||||
// );
|
||||
// controller.createUser();
|
||||
// } else {
|
||||
// controller.showE.value = true;
|
||||
// }
|
||||
// }
|
||||
)
|
||||
: CommonButton(
|
||||
height: 30,
|
||||
|
|
|
@ -11,7 +11,7 @@ import '../../../../../components/styles/app_strings.dart';
|
|||
import '../../transporter/widgets/common_card.dart';
|
||||
|
||||
class InternalUserRoleMapping extends StatefulWidget {
|
||||
const InternalUserRoleMapping({super.key});
|
||||
InternalUserRoleMapping({super.key});
|
||||
|
||||
@override
|
||||
State<InternalUserRoleMapping> createState() => _InternalUserRoleMappingState();
|
||||
|
@ -19,7 +19,35 @@ class InternalUserRoleMapping extends StatefulWidget {
|
|||
|
||||
class _InternalUserRoleMappingState extends State<InternalUserRoleMapping> {
|
||||
final ctrl = Get.put(DashboardCtrl());
|
||||
String? selectedEmail;
|
||||
|
||||
// Error message
|
||||
String? errorText;
|
||||
|
||||
// List of emails for the dropdown
|
||||
final List<String> emails = ['email1@example.com', 'email2@example.com', 'email3@example.com'];
|
||||
|
||||
// Function for when the email is selected
|
||||
void onEmailSelected(String? email) {
|
||||
setState(() {
|
||||
selectedEmail = email;
|
||||
});
|
||||
}
|
||||
void onSaveClick() {
|
||||
// Validate that an email is selected
|
||||
if (selectedEmail == null || selectedEmail!.isEmpty) {
|
||||
setState(() {
|
||||
errorText = "Please select an email."; // Set the error message
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
errorText = null; // Clear the error message if selection is valid
|
||||
});
|
||||
|
||||
// Perform your save action (e.g., API call, navigation, etc.)
|
||||
print('Email Selected: $selectedEmail');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -35,7 +63,23 @@ class _InternalUserRoleMappingState extends State<InternalUserRoleMapping> {
|
|||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
// CustomDropdown<String>(
|
||||
// backClr: AppColors.clrD9,
|
||||
// borderClr: AppColors.clrGrey,
|
||||
// items: emails,
|
||||
// itemLabel: (item) => item,
|
||||
// onSelected: onEmailSelected,
|
||||
// hintText: "Select Email",
|
||||
// ),
|
||||
// // Error message for the dropdown if no value is selected
|
||||
// if (errorText != null)
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(top: 8.0),
|
||||
// child: Text(
|
||||
// errorText!,
|
||||
// style: TextStyle(color: Colors.red, fontSize: 12),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Container(
|
||||
color: AppColors.clrF2,
|
||||
|
@ -62,22 +106,21 @@ class _InternalUserRoleMappingState extends State<InternalUserRoleMapping> {
|
|||
onSelected: (selected) {
|
||||
if (selected != null) {
|
||||
ctrl.selectedEmpCode.value = selected;
|
||||
|
||||
ctrl.validateRoleMapCode.value = false;
|
||||
}
|
||||
},
|
||||
hintText: "Select Employee Code",
|
||||
),
|
||||
SizedBox(height: 5),
|
||||
ctrl.validateRoleEmail.value == true ? TextView(
|
||||
ctrl.validateRoleMapCode.value == true ? TextView(
|
||||
text: "Required",
|
||||
style: 10.txtTransparent,
|
||||
style: 10.txtSBoldRed,
|
||||
|
||||
) : TextView(
|
||||
text: "ABC",
|
||||
style: 10.txtTransparent,
|
||||
|
||||
),
|
||||
|
||||
],
|
||||
)),
|
||||
SizedBox(width: 16),
|
||||
|
@ -141,12 +184,12 @@ class _InternalUserRoleMappingState extends State<InternalUserRoleMapping> {
|
|||
width: 100,
|
||||
text: AppStrings.submit,
|
||||
clickAction: () {
|
||||
if(ctrl.selectedEmail.value == "Select Email" ){
|
||||
if(ctrl.selectedEmail.value == "Select Email" ||ctrl.selectedEmpCode.value == "Select Employee Code" ){
|
||||
ctrl.validateRoleEmail.value = true;
|
||||
|
||||
ctrl.validateRoleMapCode.value = true;
|
||||
} else{
|
||||
ctrl.validateRoleEmail.value = false;
|
||||
|
||||
ctrl.validateRoleMapCode.value = false;
|
||||
ctrl.getRoleMappingData();
|
||||
|
||||
}
|
||||
|
|
|
@ -181,7 +181,6 @@ class ManageUser extends StatelessWidget {
|
|||
text: AppStrings.cancel,
|
||||
clickAction: () {
|
||||
controller.isSelected.value = false;
|
||||
controller.clearUserData();
|
||||
},
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
|
@ -220,7 +219,7 @@ class ManageUser extends StatelessWidget {
|
|||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 16, top: 16),
|
||||
height: MediaQuery.of(context).size.height * 0.4,
|
||||
height: MediaQuery.of(context).size.height * 0.6,
|
||||
child: RawScrollbar(
|
||||
thumbColor: AppColors.clrD9,
|
||||
radius: Radius.circular(2),
|
||||
|
|
|
@ -52,16 +52,15 @@ class UserPlantMapping extends StatelessWidget {
|
|||
hintText: 'Select Employee Code',
|
||||
),
|
||||
SizedBox(height: 5),
|
||||
ctrl.validatePlantEmail.value == true ? TextView(
|
||||
ctrl.validatePlantCode.value == true ? TextView(
|
||||
text: "Required",
|
||||
style: 10.txtTransparent,
|
||||
style: 10.txtSBoldRed,
|
||||
|
||||
) : TextView(
|
||||
text: "ABC",
|
||||
style: 10.txtTransparent,
|
||||
|
||||
),
|
||||
|
||||
],
|
||||
)),
|
||||
|
||||
|
@ -130,18 +129,20 @@ class UserPlantMapping extends StatelessWidget {
|
|||
text: AppStrings.submit,
|
||||
clickAction: () {
|
||||
|
||||
if(ctrl.selectPlantEmail.value == "Select Email"){
|
||||
if(ctrl.selectPlantEmail.value == "Select Email" ||ctrl.selectedCode.value == "Select Employee Code" ){
|
||||
ctrl.validatePlantEmail.value = true;
|
||||
|
||||
ctrl.validatePlantCode.value = true;
|
||||
} else{
|
||||
ctrl.validatePlantEmail.value = false;
|
||||
|
||||
ctrl.validatePlantCode.value = false;
|
||||
ctrl.getPlantMapping();
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// clickAction: () {
|
||||
// ctrl.checkPlants();
|
||||
// },
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -186,9 +187,9 @@ class UserPlantMapping extends StatelessWidget {
|
|||
value ?? false);
|
||||
},
|
||||
activeColor: AppColors.primaryClr,
|
||||
|
||||
// Custom color when selected
|
||||
checkColor: Colors.white,
|
||||
|
||||
// Custom color for check mark
|
||||
materialTapTargetSize: MaterialTapTargetSize
|
||||
.shrinkWrap,
|
||||
),
|
||||
|
|
|
@ -20,7 +20,9 @@ class UserScreen extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.only(bottom: 16),
|
||||
margin: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
|
@ -41,10 +43,12 @@ class UserScreen extends StatelessWidget {
|
|||
ctrl.selectedUser.value = index;
|
||||
ctrl.clearPrefillData();
|
||||
ctrl.isSelected.value = false;
|
||||
|
||||
ctrl.validateRoleMapCode.value = false;
|
||||
ctrl.validateRoleEmail.value = false;
|
||||
ctrl.validatePlantEmail.value = false;
|
||||
|
||||
ctrl.validatePlantCode.value = false;
|
||||
ctrl.validateUserStatus.value = false;
|
||||
ctrl.validateUserType.value = false;
|
||||
|
||||
if (ctrl.selectedUser.value == 0) {
|
||||
|
||||
|
@ -150,6 +154,8 @@ class UserScreen extends StatelessWidget {
|
|||
}),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,16 @@ class UserType extends StatelessWidget {
|
|||
controller: controller.userTypeCtrl,
|
||||
title: "Enter User Type",
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
controller.validateUserType.value == true ? TextView(
|
||||
text: "Required",
|
||||
style: 10.txtSBoldRed,
|
||||
|
||||
) : TextView(
|
||||
text: "ABC",
|
||||
style: 10.txtTransparent,
|
||||
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
|
@ -73,7 +82,16 @@ class UserType extends StatelessWidget {
|
|||
}
|
||||
},
|
||||
hintText: 'Select Status'),
|
||||
SizedBox(height: 8),
|
||||
controller.validateUserType.value == true ? TextView(
|
||||
text: "Required",
|
||||
style: 10.txtSBoldRed,
|
||||
|
||||
) : TextView(
|
||||
text: "ABC",
|
||||
style: 10.txtTransparent,
|
||||
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
|
@ -105,8 +123,15 @@ class UserType extends StatelessWidget {
|
|||
|
||||
|
||||
clickAction: () {
|
||||
if(controller.userTypeCtrl.text.isEmpty ||controller.selectStatus.value == "Select Status" ){
|
||||
controller.validateUserStatus.value = true;
|
||||
controller.validateUserType.value = true;
|
||||
} else{
|
||||
controller.validateUserStatus.value = false;
|
||||
controller.validateUserType.value = false;
|
||||
controller.createUserType();
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
),
|
||||
|
@ -244,6 +269,116 @@ class UserType extends StatelessWidget {
|
|||
],
|
||||
);
|
||||
}
|
||||
data(){
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextView(text:
|
||||
"Add User Type",isRequired: true,
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
InputField(
|
||||
controller: controller.userTypeCtrl,
|
||||
title: "Enter User Type",
|
||||
),
|
||||
|
||||
controller.validateUserType.value == true ? TextView(
|
||||
text: "Required",
|
||||
style: 10.txtSBoldRed,
|
||||
|
||||
) : TextView(
|
||||
text: "ABC",
|
||||
style: 10.txtTransparent,
|
||||
|
||||
),
|
||||
],
|
||||
)),
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextView(
|
||||
text:
|
||||
"Status Type",isRequired: true,
|
||||
),
|
||||
|
||||
CustomDropdown(
|
||||
initialValue: controller.selectStatus.value,
|
||||
backClr: AppColors.clrD9,
|
||||
borderClr: AppColors.clrGrey,
|
||||
items: controller.userTypeStatus,
|
||||
itemLabel: (item) => item,
|
||||
onSelected: (selected) {
|
||||
if (selected != null) {
|
||||
controller.selectStatus.value = selected;
|
||||
}
|
||||
},
|
||||
hintText: 'Select Status'),
|
||||
|
||||
controller.validateUserType.value == true ? TextView(
|
||||
text: "Required",
|
||||
style: 10.txtSBoldRed,
|
||||
|
||||
) : TextView(
|
||||
text: "ABC",
|
||||
style: 10.txtTransparent,
|
||||
|
||||
),
|
||||
],
|
||||
)),
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
//flex: 2,
|
||||
child: Column(
|
||||
children: [
|
||||
TextView(text:
|
||||
"",
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
CommonBtn(
|
||||
bkClr: Colors.white,
|
||||
text: AppStrings.cancel,
|
||||
clickAction: () {},
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
CommonButton(
|
||||
isLoading: controller.userTypeLoading,
|
||||
height: 28,
|
||||
borderRadius: 4,
|
||||
width: 100,
|
||||
text: AppStrings.submit,
|
||||
|
||||
|
||||
clickAction: () {
|
||||
if(controller.userTypeCtrl.text.isEmpty ||controller.selectStatus.value == "Select Status" ){
|
||||
controller.validateUserStatus.value = true;
|
||||
controller.validateUserType.value = true;
|
||||
} else{
|
||||
controller.validateUserStatus.value = false;
|
||||
controller.validateUserType.value = false;
|
||||
controller.createUserType();
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@ class DashboardCtrl extends GetxController {
|
|||
}
|
||||
|
||||
String? validateDropdown(String? value) {
|
||||
print('data');
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Please select an item';
|
||||
}
|
||||
|
@ -94,7 +93,7 @@ class DashboardCtrl extends GetxController {
|
|||
@override
|
||||
void onInit() {
|
||||
getManageUser();
|
||||
getPlantEmailCode();
|
||||
getDropDownData();
|
||||
getEmailCodeOfRoleMapping();
|
||||
userTypeDetails();
|
||||
super.onInit();
|
||||
|
@ -135,7 +134,7 @@ var userEmail =[].obs;
|
|||
|
||||
Map<String, String> requestBody = {
|
||||
"userName": selectUser.value == "Select User Name" ? "" : selectUser.value,
|
||||
"userTypeName": selectType.value == "Select UserType" ? "" : selectType.value,
|
||||
"userTypeName": selectUser.value == "Select User Name" ? "" : selectUser.value,
|
||||
"Email": selectEmail.value == "Select Email" ?"": selectEmail.value,
|
||||
"EmployeeTransCode":
|
||||
selectCode.value == "Select Employee Code" ? "" : selectCode.value,
|
||||
|
@ -168,14 +167,7 @@ var userEmail =[].obs;
|
|||
userLoading.value = false;
|
||||
}
|
||||
}
|
||||
clearUserData(){
|
||||
selectUser.value = "Select User Name";
|
||||
selectEmail.value = "Select Email";
|
||||
selectCode.value = "Select Employee Code";
|
||||
selectType.value = "Select UserType";
|
||||
selectedStatus.value = "Select Status";
|
||||
getManageUser();
|
||||
}
|
||||
|
||||
void nextPage() {
|
||||
if (currentPage.value < totalPages.value) {
|
||||
currentPage.value++;
|
||||
|
@ -233,15 +225,14 @@ clearUserData(){
|
|||
var status = ['Active', 'In-Active'];
|
||||
var selectedStatus = 'Select Status'.obs;
|
||||
var selectedValue = 'Select User Type'.obs;
|
||||
|
||||
var isValidate = false.obs;
|
||||
Color errorTextColor = Colors.red;
|
||||
|
||||
void createUser() {
|
||||
if (formKey.currentState!.validate()) {
|
||||
validateAdduser.value = false;
|
||||
addInternalUser();
|
||||
} else {
|
||||
validateAdduser.value = true;
|
||||
isValidate.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -272,8 +263,6 @@ clearUserData(){
|
|||
onclick: () {
|
||||
Get.back();
|
||||
getManageUser();
|
||||
getEmailCodeOfRoleMapping();
|
||||
getPlantEmailCode();
|
||||
clearPrefillData();
|
||||
selectedUser.value = 0;
|
||||
});
|
||||
|
@ -380,7 +369,7 @@ clearUserData(){
|
|||
var employeeCode = [].obs;
|
||||
var userEmails = [].obs;
|
||||
|
||||
getPlantEmailCode() async {
|
||||
getDropDownData() async {
|
||||
try {
|
||||
dropDownLoader.value = true;
|
||||
|
||||
|
@ -404,7 +393,18 @@ clearUserData(){
|
|||
selectPlantCode.value.isEmpty;
|
||||
}
|
||||
|
||||
|
||||
checkPlants() {
|
||||
if (selectPlantEmail.value == "Select Email" ||
|
||||
selectPlantCode.value == "Select Employee Code") {
|
||||
CommonDialog.showDialog(
|
||||
message: "Select all mandatory fields",
|
||||
onclick: () {
|
||||
Get.back();
|
||||
});
|
||||
} else {
|
||||
getPlantMapping();
|
||||
}
|
||||
}
|
||||
|
||||
clearRoleMapping() {
|
||||
selectedEmail.value.isEmpty;
|
||||
|
@ -435,7 +435,7 @@ clearUserData(){
|
|||
var fetchEmailsNCodesLoading = false.obs;
|
||||
var statusMessage = "".obs;
|
||||
|
||||
// roleMappingEmailCode
|
||||
// rolemapping
|
||||
getRoleMappingData() async {
|
||||
try {
|
||||
fetchEmailsNCodesLoading.value = true;
|
||||
|
@ -443,14 +443,13 @@ clearUserData(){
|
|||
"email": selectedEmail.value,
|
||||
"employeeTransCode": selectedEmpCode.value,
|
||||
};
|
||||
var response = await PostRequests.fetchEmailsAndEmpCodes(requestBody,statusMessage.value);
|
||||
var response = await PostRequests.fetchEmailsAndEmpCodes(requestBody);
|
||||
if (response != null) {
|
||||
roleMappingData.value = response.data!;
|
||||
showRolesSection.value = true;
|
||||
|
||||
statusMessage.value = response.status.toString();
|
||||
} else {
|
||||
|
||||
//print("cdg");
|
||||
print("cdg");
|
||||
// AppAlerts.alert(message: "sxjs");
|
||||
}
|
||||
} finally {
|
||||
|
@ -579,10 +578,11 @@ clearUserData(){
|
|||
}
|
||||
|
||||
RxBool validateRoleEmail = false.obs;
|
||||
|
||||
RxBool validateRoleMapCode = false.obs;
|
||||
RxBool validatePlantEmail = false.obs;
|
||||
RxBool validateAdduser = false.obs;
|
||||
|
||||
RxBool validatePlantCode = false.obs;
|
||||
RxBool validateUserStatus = false.obs;
|
||||
RxBool validateUserType = false.obs;
|
||||
|
||||
searchEmpCode(String enterValue) {
|
||||
print('-----typing ---- ${enterValue}');
|
||||
|
@ -606,6 +606,26 @@ clearUserData(){
|
|||
}
|
||||
RxString? validateEmail;
|
||||
|
||||
// Error message
|
||||
RxString? showErrorText;
|
||||
void onEmailSelected(dynamic email) {
|
||||
|
||||
selectedEmail.value = email;
|
||||
|
||||
}
|
||||
void onSaveClick() {
|
||||
// Validate that an email is selected
|
||||
if (selectedEmail.value.isEmpty) {
|
||||
|
||||
errorText.value = "Required"; // Set the error message
|
||||
|
||||
} else {
|
||||
|
||||
errorText.value = ""; // Clear the error message if selection is valid
|
||||
|
||||
|
||||
// Perform your save action (e.g., API call, navigation, etc.)
|
||||
print('Email Selected: $selectedEmail');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:get/get.dart';
|
|||
import 'package:shayog/components/styles/app_strings.dart';
|
||||
import 'package:shayog/components/styles/textStyles.dart';
|
||||
import 'package:shayog/feature/presentation/screens/transporter/view/transport_view.dart';
|
||||
import 'package:shayog/feature/presentation/screens/transporter/view_model/transport_controller.dart';
|
||||
import '../../../../components/styles/app_colors.dart';
|
||||
import '../../widgets/text_view.dart';
|
||||
import '../admin/configuration_management/configuration_screen.dart';
|
||||
|
@ -76,7 +77,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem<int>(
|
||||
|
||||
value: 0,
|
||||
height: 30,
|
||||
onTap: () {
|
||||
|
@ -102,7 +102,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||
];
|
||||
},
|
||||
),
|
||||
|
||||
SizedBox(width: 8),
|
||||
],
|
||||
),
|
||||
|
@ -155,8 +154,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|||
ctrl.tabs[index].title ?? "",
|
||||
textAlign: TextAlign.center,
|
||||
style: 10.txtBoldWhite,
|
||||
|
||||
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
//
|
||||
// final getInvoiceResponse = getInvoiceResponseFromJson(jsonString);
|
||||
|
||||
import 'package:meta/meta.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
GetInvoiceResponse getInvoiceResponseFromJson(String str) => GetInvoiceResponse.fromJson(json.decode(str));
|
||||
|
@ -12,8 +13,8 @@ class GetInvoiceResponse {
|
|||
final List<List<GetInvoiceContent>> content;
|
||||
final Pageable pageable;
|
||||
final bool last;
|
||||
final int totalElements;
|
||||
final int totalPages;
|
||||
final int totalElements;
|
||||
final int size;
|
||||
final int number;
|
||||
final Sort sort;
|
||||
|
@ -25,8 +26,8 @@ class GetInvoiceResponse {
|
|||
required this.content,
|
||||
required this.pageable,
|
||||
required this.last,
|
||||
required this.totalElements,
|
||||
required this.totalPages,
|
||||
required this.totalElements,
|
||||
required this.size,
|
||||
required this.number,
|
||||
required this.sort,
|
||||
|
@ -39,8 +40,8 @@ class GetInvoiceResponse {
|
|||
content: List<List<GetInvoiceContent>>.from(json["content"].map((x) => List<GetInvoiceContent>.from(x.map((x) => GetInvoiceContent.fromJson(x))))),
|
||||
pageable: Pageable.fromJson(json["pageable"]),
|
||||
last: json["last"],
|
||||
totalElements: json["totalElements"],
|
||||
totalPages: json["totalPages"],
|
||||
totalElements: json["totalElements"],
|
||||
size: json["size"],
|
||||
number: json["number"],
|
||||
sort: Sort.fromJson(json["sort"]),
|
||||
|
@ -53,8 +54,8 @@ class GetInvoiceResponse {
|
|||
"content": List<dynamic>.from(content.map((x) => List<dynamic>.from(x.map((x) => x.toJson())))),
|
||||
"pageable": pageable.toJson(),
|
||||
"last": last,
|
||||
"totalElements": totalElements,
|
||||
"totalPages": totalPages,
|
||||
"totalElements": totalElements,
|
||||
"size": size,
|
||||
"number": number,
|
||||
"sort": sort.toJson(),
|
||||
|
@ -68,8 +69,14 @@ class GetInvoiceContent {
|
|||
final int invoiceId;
|
||||
final String freightbillCode;
|
||||
final String sapReferenceno;
|
||||
final double shipmentCost;
|
||||
final int shipmentCost;
|
||||
final DateTime shipmentCostDate;
|
||||
final int statusId;
|
||||
final String status;
|
||||
final String plantCode;
|
||||
final String plantDesc;
|
||||
final String materialCode;
|
||||
final String materialDescription;
|
||||
final DateTime createdOn;
|
||||
|
||||
GetInvoiceContent({
|
||||
|
@ -78,6 +85,12 @@ class GetInvoiceContent {
|
|||
required this.sapReferenceno,
|
||||
required this.shipmentCost,
|
||||
required this.shipmentCostDate,
|
||||
required this.statusId,
|
||||
required this.status,
|
||||
required this.plantCode,
|
||||
required this.plantDesc,
|
||||
required this.materialCode,
|
||||
required this.materialDescription,
|
||||
required this.createdOn,
|
||||
});
|
||||
|
||||
|
@ -85,8 +98,16 @@ class GetInvoiceContent {
|
|||
invoiceId: json["invoice_id"],
|
||||
freightbillCode: json["freightbill_code"],
|
||||
sapReferenceno: json["sap_referenceno"],
|
||||
shipmentCost: json["shipment_cost"]?.toDouble(),
|
||||
// shipmentCost: json["shipment_cost"],
|
||||
shipmentCost: (json["shipment_cost"] as num).toInt(),
|
||||
|
||||
shipmentCostDate: DateTime.parse(json["shipment_cost_date"]),
|
||||
statusId: json["status_id"],
|
||||
status: json["status"],
|
||||
plantCode: json["plant_code"],
|
||||
plantDesc: json["plant_desc"],
|
||||
materialCode: json["material_code"],
|
||||
materialDescription: json["material_description"],
|
||||
createdOn: DateTime.parse(json["created_on"]),
|
||||
);
|
||||
|
||||
|
@ -96,6 +117,12 @@ class GetInvoiceContent {
|
|||
"sap_referenceno": sapReferenceno,
|
||||
"shipment_cost": shipmentCost,
|
||||
"shipment_cost_date": "${shipmentCostDate.year.toString().padLeft(4, '0')}-${shipmentCostDate.month.toString().padLeft(2, '0')}-${shipmentCostDate.day.toString().padLeft(2, '0')}",
|
||||
"status_id": statusId,
|
||||
"status": status,
|
||||
"plant_code": plantCode,
|
||||
"plant_desc": plantDesc,
|
||||
"material_code": materialCode,
|
||||
"material_description": materialDescription,
|
||||
"created_on": createdOn.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,337 @@
|
|||
// To parse this JSON data, do
|
||||
//
|
||||
// final paymentResModel = paymentResModelFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
PaymentResModel paymentResModelFromJson(String str) => PaymentResModel.fromJson(json.decode(str));
|
||||
|
||||
String paymentResModelToJson(PaymentResModel data) => json.encode(data.toJson());
|
||||
|
||||
class PaymentResModel {
|
||||
final List<List<Payment>>? content;
|
||||
final Pageable? pageable;
|
||||
final int? totalPages;
|
||||
final int? totalElements;
|
||||
final bool? last;
|
||||
final int? size;
|
||||
final int? number;
|
||||
final Sort? sort;
|
||||
final int? numberOfElements;
|
||||
final bool? first;
|
||||
final bool? empty;
|
||||
|
||||
PaymentResModel({
|
||||
this.content,
|
||||
this.pageable,
|
||||
this.totalPages,
|
||||
this.totalElements,
|
||||
this.last,
|
||||
this.size,
|
||||
this.number,
|
||||
this.sort,
|
||||
this.numberOfElements,
|
||||
this.first,
|
||||
this.empty,
|
||||
});
|
||||
|
||||
factory PaymentResModel.fromJson(Map<String, dynamic> json) => PaymentResModel(
|
||||
content: json["content"] == null ? [] : List<List<Payment>>.from(json["content"]!.map((x) => List<Payment>.from(x.map((x) => Payment.fromJson(x))))),
|
||||
pageable: json["pageable"] == null ? null : Pageable.fromJson(json["pageable"]),
|
||||
totalPages: json["totalPages"],
|
||||
totalElements: json["totalElements"],
|
||||
last: json["last"],
|
||||
size: json["size"],
|
||||
number: json["number"],
|
||||
sort: json["sort"] == null ? null : Sort.fromJson(json["sort"]),
|
||||
numberOfElements: json["numberOfElements"],
|
||||
first: json["first"],
|
||||
empty: json["empty"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"content": content == null ? [] : List<dynamic>.from(content!.map((x) => List<dynamic>.from(x.map((x) => x.toJson())))),
|
||||
"pageable": pageable?.toJson(),
|
||||
"totalPages": totalPages,
|
||||
"totalElements": totalElements,
|
||||
"last": last,
|
||||
"size": size,
|
||||
"number": number,
|
||||
"sort": sort?.toJson(),
|
||||
"numberOfElements": numberOfElements,
|
||||
"first": first,
|
||||
"empty": empty,
|
||||
};
|
||||
}
|
||||
|
||||
class Payment {
|
||||
final int? plantId;
|
||||
final String? plantCode;
|
||||
final String? plantDesc;
|
||||
final int? materialId;
|
||||
final String? materialCode;
|
||||
final dynamic uom;
|
||||
final double? shipmentNetQty;
|
||||
final double? shipmentNetCost;
|
||||
final int? igstAmount;
|
||||
final double? sgstAmount;
|
||||
final double? cgstAmount;
|
||||
final double? totalGst;
|
||||
final double? shipmentGrossCost;
|
||||
final int? invoiceId;
|
||||
final dynamic transporterInvoiceNo;
|
||||
final dynamic transporterInvoiceNoDate;
|
||||
final int? freightbillId;
|
||||
final String? freightbillCode;
|
||||
final double? shipmentCost;
|
||||
final DateTime? shipmentCostDate;
|
||||
final double? gstAmount;
|
||||
final dynamic paymentAmount;
|
||||
final dynamic paymentDate;
|
||||
final dynamic paymentCaseno;
|
||||
final String? miroDocument;
|
||||
final DateTime? miroDocumentDate;
|
||||
final String? sapReferenceno;
|
||||
final dynamic utr1No;
|
||||
final dynamic utr2No;
|
||||
final dynamic utr3No;
|
||||
final dynamic utr4No;
|
||||
final dynamic utr5No;
|
||||
final dynamic utr1PaymentAmount;
|
||||
final dynamic utr2PaymentAmount;
|
||||
final dynamic utr3PaymentAmount;
|
||||
final dynamic utr4PaymentAmount;
|
||||
final dynamic utr5PaymentAmount;
|
||||
final dynamic utr1Date;
|
||||
final dynamic utr2Date;
|
||||
final dynamic utr3Date;
|
||||
final dynamic utr4Date;
|
||||
final dynamic utr5Date;
|
||||
final dynamic singedDocLink;
|
||||
final dynamic signedDocUploadedOn;
|
||||
final dynamic signedDocUploadedBy;
|
||||
final String? status;
|
||||
final int? statusId;
|
||||
final int? createdBy;
|
||||
final int? lastUpdatedBy;
|
||||
final DateTime? lastUpdatedOn;
|
||||
|
||||
Payment({
|
||||
this.plantId,
|
||||
this.plantCode,
|
||||
this.plantDesc,
|
||||
this.materialId,
|
||||
this.materialCode,
|
||||
this.uom,
|
||||
this.shipmentNetQty,
|
||||
this.shipmentNetCost,
|
||||
this.igstAmount,
|
||||
this.sgstAmount,
|
||||
this.cgstAmount,
|
||||
this.totalGst,
|
||||
this.shipmentGrossCost,
|
||||
this.invoiceId,
|
||||
this.transporterInvoiceNo,
|
||||
this.transporterInvoiceNoDate,
|
||||
this.freightbillId,
|
||||
this.freightbillCode,
|
||||
this.shipmentCost,
|
||||
this.shipmentCostDate,
|
||||
this.gstAmount,
|
||||
this.paymentAmount,
|
||||
this.paymentDate,
|
||||
this.paymentCaseno,
|
||||
this.miroDocument,
|
||||
this.miroDocumentDate,
|
||||
this.sapReferenceno,
|
||||
this.utr1No,
|
||||
this.utr2No,
|
||||
this.utr3No,
|
||||
this.utr4No,
|
||||
this.utr5No,
|
||||
this.utr1PaymentAmount,
|
||||
this.utr2PaymentAmount,
|
||||
this.utr3PaymentAmount,
|
||||
this.utr4PaymentAmount,
|
||||
this.utr5PaymentAmount,
|
||||
this.utr1Date,
|
||||
this.utr2Date,
|
||||
this.utr3Date,
|
||||
this.utr4Date,
|
||||
this.utr5Date,
|
||||
this.singedDocLink,
|
||||
this.signedDocUploadedOn,
|
||||
this.signedDocUploadedBy,
|
||||
this.status,
|
||||
this.statusId,
|
||||
this.createdBy,
|
||||
this.lastUpdatedBy,
|
||||
this.lastUpdatedOn,
|
||||
});
|
||||
|
||||
factory Payment.fromJson(Map<String, dynamic> json) => Payment(
|
||||
plantId: json["plant_id"],
|
||||
plantCode: json["plant_code"],
|
||||
plantDesc: json["plant_desc"],
|
||||
materialId: json["material_id"],
|
||||
materialCode: json["material_code"],
|
||||
uom: json["uom"],
|
||||
shipmentNetQty: json["shipment_net_qty"]?.toDouble(),
|
||||
shipmentNetCost: json["shipment_net_cost"]?.toDouble(),
|
||||
igstAmount: json["igst_amount"],
|
||||
sgstAmount: json["sgst_amount"]?.toDouble(),
|
||||
cgstAmount: json["cgst_amount"]?.toDouble(),
|
||||
totalGst: json["total_gst"]?.toDouble(),
|
||||
shipmentGrossCost: json["shipment_gross_cost"]?.toDouble(),
|
||||
invoiceId: json["invoice_id"],
|
||||
transporterInvoiceNo: json["transporter_invoice_no"],
|
||||
transporterInvoiceNoDate: json["transporter_invoice_no_date"],
|
||||
freightbillId: json["freightbill_id"],
|
||||
freightbillCode: json["freightbill_code"],
|
||||
shipmentCost: json["shipment_cost"]?.toDouble(),
|
||||
shipmentCostDate: json["shipment_cost_date"] == null ? null : DateTime.parse(json["shipment_cost_date"]),
|
||||
gstAmount: json["gst_amount"]?.toDouble(),
|
||||
paymentAmount: json["payment_amount"],
|
||||
paymentDate: json["payment_date"],
|
||||
paymentCaseno: json["payment_caseno"],
|
||||
miroDocument: json["miro_document"],
|
||||
miroDocumentDate: json["miro_document_date"] == null ? null : DateTime.parse(json["miro_document_date"]),
|
||||
sapReferenceno: json["sap_referenceno"],
|
||||
utr1No: json["utr1_no"],
|
||||
utr2No: json["utr2_no"],
|
||||
utr3No: json["utr3_no"],
|
||||
utr4No: json["utr4_no"],
|
||||
utr5No: json["utr5_no"],
|
||||
utr1PaymentAmount: json["utr1_payment_amount"],
|
||||
utr2PaymentAmount: json["utr2_payment_amount"],
|
||||
utr3PaymentAmount: json["utr3_payment_amount"],
|
||||
utr4PaymentAmount: json["utr4_payment_amount"],
|
||||
utr5PaymentAmount: json["utr5_payment_amount"],
|
||||
utr1Date: json["utr1_date"],
|
||||
utr2Date: json["utr2_date"],
|
||||
utr3Date: json["utr3_date"],
|
||||
utr4Date: json["utr4_date"],
|
||||
utr5Date: json["utr5_date"],
|
||||
singedDocLink: json["singed_doc_link"],
|
||||
signedDocUploadedOn: json["signed_doc_uploaded_on"],
|
||||
signedDocUploadedBy: json["signed_doc_uploaded_by"],
|
||||
status: json["status"],
|
||||
statusId: json["status_id"],
|
||||
createdBy: json["created_by"],
|
||||
lastUpdatedBy: json["last_updated_by"],
|
||||
lastUpdatedOn: json["last_updated_on"] == null ? null : DateTime.parse(json["last_updated_on"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"plant_id": plantId,
|
||||
"plant_code": plantCode,
|
||||
"plant_desc": plantDesc,
|
||||
"material_id": materialId,
|
||||
"material_code": materialCode,
|
||||
"uom": uom,
|
||||
"shipment_net_qty": shipmentNetQty,
|
||||
"shipment_net_cost": shipmentNetCost,
|
||||
"igst_amount": igstAmount,
|
||||
"sgst_amount": sgstAmount,
|
||||
"cgst_amount": cgstAmount,
|
||||
"total_gst": totalGst,
|
||||
"shipment_gross_cost": shipmentGrossCost,
|
||||
"invoice_id": invoiceId,
|
||||
"transporter_invoice_no": transporterInvoiceNo,
|
||||
"transporter_invoice_no_date": transporterInvoiceNoDate,
|
||||
"freightbill_id": freightbillId,
|
||||
"freightbill_code": freightbillCode,
|
||||
"shipment_cost": shipmentCost,
|
||||
"shipment_cost_date": "${shipmentCostDate!.year.toString().padLeft(4, '0')}-${shipmentCostDate!.month.toString().padLeft(2, '0')}-${shipmentCostDate!.day.toString().padLeft(2, '0')}",
|
||||
"gst_amount": gstAmount,
|
||||
"payment_amount": paymentAmount,
|
||||
"payment_date": paymentDate,
|
||||
"payment_caseno": paymentCaseno,
|
||||
"miro_document": miroDocument,
|
||||
"miro_document_date": "${miroDocumentDate!.year.toString().padLeft(4, '0')}-${miroDocumentDate!.month.toString().padLeft(2, '0')}-${miroDocumentDate!.day.toString().padLeft(2, '0')}",
|
||||
"sap_referenceno": sapReferenceno,
|
||||
"utr1_no": utr1No,
|
||||
"utr2_no": utr2No,
|
||||
"utr3_no": utr3No,
|
||||
"utr4_no": utr4No,
|
||||
"utr5_no": utr5No,
|
||||
"utr1_payment_amount": utr1PaymentAmount,
|
||||
"utr2_payment_amount": utr2PaymentAmount,
|
||||
"utr3_payment_amount": utr3PaymentAmount,
|
||||
"utr4_payment_amount": utr4PaymentAmount,
|
||||
"utr5_payment_amount": utr5PaymentAmount,
|
||||
"utr1_date": utr1Date,
|
||||
"utr2_date": utr2Date,
|
||||
"utr3_date": utr3Date,
|
||||
"utr4_date": utr4Date,
|
||||
"utr5_date": utr5Date,
|
||||
"singed_doc_link": singedDocLink,
|
||||
"signed_doc_uploaded_on": signedDocUploadedOn,
|
||||
"signed_doc_uploaded_by": signedDocUploadedBy,
|
||||
"status": status,
|
||||
"status_id": statusId,
|
||||
"created_by": createdBy,
|
||||
"last_updated_by": lastUpdatedBy,
|
||||
"last_updated_on": lastUpdatedOn?.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
||||
class Pageable {
|
||||
final Sort? sort;
|
||||
final int? pageNumber;
|
||||
final int? pageSize;
|
||||
final int? offset;
|
||||
final bool? paged;
|
||||
final bool? unpaged;
|
||||
|
||||
Pageable({
|
||||
this.sort,
|
||||
this.pageNumber,
|
||||
this.pageSize,
|
||||
this.offset,
|
||||
this.paged,
|
||||
this.unpaged,
|
||||
});
|
||||
|
||||
factory Pageable.fromJson(Map<String, dynamic> json) => Pageable(
|
||||
sort: json["sort"] == null ? null : Sort.fromJson(json["sort"]),
|
||||
pageNumber: json["pageNumber"],
|
||||
pageSize: json["pageSize"],
|
||||
offset: json["offset"],
|
||||
paged: json["paged"],
|
||||
unpaged: json["unpaged"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"sort": sort?.toJson(),
|
||||
"pageNumber": pageNumber,
|
||||
"pageSize": pageSize,
|
||||
"offset": offset,
|
||||
"paged": paged,
|
||||
"unpaged": unpaged,
|
||||
};
|
||||
}
|
||||
|
||||
class Sort {
|
||||
final bool? sorted;
|
||||
final bool? empty;
|
||||
final bool? unsorted;
|
||||
|
||||
Sort({
|
||||
this.sorted,
|
||||
this.empty,
|
||||
this.unsorted,
|
||||
});
|
||||
|
||||
factory Sort.fromJson(Map<String, dynamic> json) => Sort(
|
||||
sorted: json["sorted"],
|
||||
empty: json["empty"],
|
||||
unsorted: json["unsorted"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"sorted": sorted,
|
||||
"empty": empty,
|
||||
"unsorted": unsorted,
|
||||
};
|
||||
}
|
|
@ -0,0 +1,175 @@
|
|||
// To parse this JSON data, do
|
||||
//
|
||||
// final subFreightViewDialogModel = subFreightViewDialogModelFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
SubFreightViewDialogModel subFreightViewDialogModelFromJson(String str) => SubFreightViewDialogModel.fromJson(json.decode(str));
|
||||
|
||||
String subFreightViewDialogModelToJson(SubFreightViewDialogModel data) => json.encode(data.toJson());
|
||||
|
||||
class SubFreightViewDialogModel {
|
||||
List<Grn>? grn;
|
||||
String? freightBillCode;
|
||||
DateTime? freightBillDate;
|
||||
|
||||
SubFreightViewDialogModel({
|
||||
this.grn,
|
||||
this.freightBillCode,
|
||||
this.freightBillDate,
|
||||
});
|
||||
|
||||
SubFreightViewDialogModel copyWith({
|
||||
List<Grn>? grn,
|
||||
String? freightBillCode,
|
||||
DateTime? freightBillDate,
|
||||
}) =>
|
||||
SubFreightViewDialogModel(
|
||||
grn: grn ?? this.grn,
|
||||
freightBillCode: freightBillCode ?? this.freightBillCode,
|
||||
freightBillDate: freightBillDate ?? this.freightBillDate,
|
||||
);
|
||||
|
||||
factory SubFreightViewDialogModel.fromJson(Map<String, dynamic> json) => SubFreightViewDialogModel(
|
||||
grn: json["grn"] == null ? [] : List<Grn>.from(json["grn"]!.map((x) => Grn.fromJson(x))),
|
||||
freightBillCode: json["freightBillCode"],
|
||||
freightBillDate: json["freightBillDate"] == null ? null : DateTime.parse(json["freightBillDate"]),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"grn": grn == null ? [] : List<dynamic>.from(grn!.map((x) => x.toJson())),
|
||||
"freightBillCode": freightBillCode,
|
||||
"freightBillDate": freightBillDate?.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
||||
class Grn {
|
||||
int? grnId;
|
||||
String? grnNo;
|
||||
DateTime? grnDate;
|
||||
String? plantCode;
|
||||
String? materialCode;
|
||||
String? transporterCode;
|
||||
String? transporterName;
|
||||
String? fromLocation;
|
||||
String? vehicleNo;
|
||||
String? vehicleType;
|
||||
double? shipmentCost;
|
||||
String? lrNo;
|
||||
DateTime? lrDate;
|
||||
double? dispQty;
|
||||
double? netQty;
|
||||
double? billingQty;
|
||||
int? freightRate;
|
||||
String? plantDesc;
|
||||
String? materialDescription;
|
||||
|
||||
Grn({
|
||||
this.grnId,
|
||||
this.grnNo,
|
||||
this.grnDate,
|
||||
this.plantCode,
|
||||
this.materialCode,
|
||||
this.transporterCode,
|
||||
this.transporterName,
|
||||
this.fromLocation,
|
||||
this.vehicleNo,
|
||||
this.vehicleType,
|
||||
this.shipmentCost,
|
||||
this.lrNo,
|
||||
this.lrDate,
|
||||
this.dispQty,
|
||||
this.netQty,
|
||||
this.billingQty,
|
||||
this.freightRate,
|
||||
this.plantDesc,
|
||||
this.materialDescription,
|
||||
});
|
||||
|
||||
Grn copyWith({
|
||||
int? grnId,
|
||||
String? grnNo,
|
||||
DateTime? grnDate,
|
||||
String? plantCode,
|
||||
String? materialCode,
|
||||
String? transporterCode,
|
||||
String? transporterName,
|
||||
String? fromLocation,
|
||||
String? vehicleNo,
|
||||
String? vehicleType,
|
||||
double? shipmentCost,
|
||||
String? lrNo,
|
||||
DateTime? lrDate,
|
||||
double? dispQty,
|
||||
double? netQty,
|
||||
double? billingQty,
|
||||
int? freightRate,
|
||||
String? plantDesc,
|
||||
String? materialDescription,
|
||||
}) =>
|
||||
Grn(
|
||||
grnId: grnId ?? this.grnId,
|
||||
grnNo: grnNo ?? this.grnNo,
|
||||
grnDate: grnDate ?? this.grnDate,
|
||||
plantCode: plantCode ?? this.plantCode,
|
||||
materialCode: materialCode ?? this.materialCode,
|
||||
transporterCode: transporterCode ?? this.transporterCode,
|
||||
transporterName: transporterName ?? this.transporterName,
|
||||
fromLocation: fromLocation ?? this.fromLocation,
|
||||
vehicleNo: vehicleNo ?? this.vehicleNo,
|
||||
vehicleType: vehicleType ?? this.vehicleType,
|
||||
shipmentCost: shipmentCost ?? this.shipmentCost,
|
||||
lrNo: lrNo ?? this.lrNo,
|
||||
lrDate: lrDate ?? this.lrDate,
|
||||
dispQty: dispQty ?? this.dispQty,
|
||||
netQty: netQty ?? this.netQty,
|
||||
billingQty: billingQty ?? this.billingQty,
|
||||
freightRate: freightRate ?? this.freightRate,
|
||||
plantDesc: plantDesc ?? this.plantDesc,
|
||||
materialDescription: materialDescription ?? this.materialDescription,
|
||||
);
|
||||
|
||||
factory Grn.fromJson(Map<String, dynamic> json) => Grn(
|
||||
grnId: json["grn_id"],
|
||||
grnNo: json["grn_no"],
|
||||
grnDate: json["grn_date"] == null ? null : DateTime.parse(json["grn_date"]),
|
||||
plantCode: json["plant_code"],
|
||||
materialCode: json["material_code"],
|
||||
transporterCode: json["transporter_code"],
|
||||
transporterName: json["transporter_name"],
|
||||
fromLocation: json["from_location"],
|
||||
vehicleNo: json["vehicle_no"],
|
||||
vehicleType: json["vehicle_type"],
|
||||
shipmentCost: json["shipment_cost"]?.toDouble(),
|
||||
lrNo: json["lr_no"],
|
||||
lrDate: json["lr_date"] == null ? null : DateTime.parse(json["lr_date"]),
|
||||
dispQty: json["disp_qty"]?.toDouble(),
|
||||
netQty: json["net_qty"]?.toDouble(),
|
||||
billingQty: json["billing_qty"]?.toDouble(),
|
||||
freightRate: json["freight_rate"],
|
||||
plantDesc: json["plant_desc"],
|
||||
materialDescription: json["material_description"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"grn_id": grnId,
|
||||
"grn_no": grnNo,
|
||||
"grn_date": "${grnDate!.year.toString().padLeft(4, '0')}-${grnDate!.month.toString().padLeft(2, '0')}-${grnDate!.day.toString().padLeft(2, '0')}",
|
||||
"plant_code": plantCode,
|
||||
"material_code": materialCode,
|
||||
"transporter_code": transporterCode,
|
||||
"transporter_name": transporterName,
|
||||
"from_location": fromLocation,
|
||||
"vehicle_no": vehicleNo,
|
||||
"vehicle_type": vehicleType,
|
||||
"shipment_cost": shipmentCost,
|
||||
"lr_no": lrNo,
|
||||
"lr_date": "${lrDate!.year.toString().padLeft(4, '0')}-${lrDate!.month.toString().padLeft(2, '0')}-${lrDate!.day.toString().padLeft(2, '0')}",
|
||||
"disp_qty": dispQty,
|
||||
"net_qty": netQty,
|
||||
"billing_qty": billingQty,
|
||||
"freight_rate": freightRate,
|
||||
"plant_desc": plantDesc,
|
||||
"material_description": materialDescription,
|
||||
};
|
||||
}
|
|
@ -0,0 +1,323 @@
|
|||
// import 'package:flutter/material.dart';
|
||||
// import 'package:get/get.dart';
|
||||
// import 'package:shayog/components/common/input_field.dart';
|
||||
// import 'package:shayog/components/styles/textStyles.dart';
|
||||
//
|
||||
// import 'package:shayog/feature/presentation/screens/transporter/view/ctrl/invoice_management_controller.dart';
|
||||
// import 'package:shayog/feature/presentation/screens/transporter/view/payment_ctrl.dart';
|
||||
// import '../../../../../../components/common/common_btn.dart';
|
||||
// import '../../../../../../components/common/common_button.dart';
|
||||
// import '../../../../../../components/common/custom_drop_down.dart';
|
||||
// import '../../../../../../components/common/data_cell.dart';
|
||||
// import '../../../../../../components/styles/app_colors.dart';
|
||||
// import '../../../../../../components/styles/app_strings.dart';
|
||||
// import '../../widgets/text_view.dart';
|
||||
//
|
||||
//
|
||||
// class PaymentView extends StatelessWidget {
|
||||
// const PaymentView({super.key});
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// final controller = Get.put(InvoiceManagementController());
|
||||
// final paymentCtrl = Get.put(PaymentViewCtrl());
|
||||
// return Padding(
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
// child: Column(
|
||||
// children: [
|
||||
// Obx(
|
||||
// () => controller.isPaymentFilter.value
|
||||
// ? Container(
|
||||
// padding: const EdgeInsets.only(
|
||||
// left: 16.0, top: 8, right: 16, bottom: 16),
|
||||
// color: AppColors.clrF2,
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// TextView(text: "Plant"),
|
||||
// SizedBox(height: 8),
|
||||
// CustomDropdown(
|
||||
// backClr: AppColors.clrD9,
|
||||
// borderClr: AppColors.clrGrey,
|
||||
// items: paymentCtrl.plant,
|
||||
// itemLabel: (item) =>
|
||||
// "${item.plantCode}-${item.plantDesc}",
|
||||
// onSelected: (selected) {
|
||||
// paymentCtrl.selectedPlant.value =
|
||||
// selected?.plantCode ?? "";
|
||||
// },
|
||||
// hintText: paymentCtrl.selectedPlant.value,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(width: 16),
|
||||
// Expanded(
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// TextView(text: "Freight Bill No."),
|
||||
// SizedBox(height: 8),
|
||||
// CustomDropdown<String>(
|
||||
// backClr: AppColors.clrD9,
|
||||
// borderClr: AppColors.clrGrey,
|
||||
// items: paymentCtrl.freightBill,
|
||||
// itemLabel: (item) =>
|
||||
// "${paymentCtrl.freightBill}",
|
||||
// onSelected: (selected) {
|
||||
// paymentCtrl.selectedFreightBill.value =
|
||||
// selected.toString();
|
||||
// },
|
||||
// hintText:
|
||||
// paymentCtrl.selectedFreightBill.value,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(width: 16),
|
||||
// Expanded(
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// TextView(text: "Product"),
|
||||
// SizedBox(height: 8),
|
||||
// CustomDropdown<dynamic>(
|
||||
// width: 250,
|
||||
// backClr: AppColors.clrD9,
|
||||
// borderClr: AppColors.clrGrey,
|
||||
// items: paymentCtrl.product,
|
||||
// itemLabel: (item) =>
|
||||
// "${item.materialCode}-${item.materialDescription}",
|
||||
// onSelected: (selected) {
|
||||
// paymentCtrl.selectedPlant.value =
|
||||
// selected.materialCode;
|
||||
// },
|
||||
// hintText: paymentCtrl.selectedPlant.value,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// SizedBox(height: 12),
|
||||
// Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// TextView(text: "Freight Invoice Date"),
|
||||
// SizedBox(height: 8),
|
||||
// InputField(
|
||||
// title: "Select Invoice Freight Date",
|
||||
// ),
|
||||
// // CustomDropdown(
|
||||
// // backClr: AppColors.clrD9,
|
||||
// // borderClr: AppColors.clrGrey,
|
||||
// // items: paymentCtrl.plant,
|
||||
// // itemLabel: (item) =>
|
||||
// // "${item.plantCode}-${item.plantDesc}",
|
||||
// // onSelected: (selected) {
|
||||
// // paymentCtrl.selectedPlant.value =
|
||||
// // selected?.plantCode ?? "";
|
||||
// // },
|
||||
// // hintText: paymentCtrl.selectedPlant.value,
|
||||
// // ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(width: 16),
|
||||
// Expanded(child: Container()),
|
||||
// SizedBox(width: 16),
|
||||
// Expanded(
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// TextView(
|
||||
// text: "Freight Bill No.",
|
||||
// style: 12.txtTransparent),
|
||||
// SizedBox(height: 8),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.end,
|
||||
// children: [
|
||||
// CommonBtn(
|
||||
// height: 25,
|
||||
// width: 100,
|
||||
// bkClr: Colors.white,
|
||||
// text: AppStrings.cancel,
|
||||
// style: 12.txtSBoldBlue,
|
||||
// clickAction: () {},
|
||||
// ),
|
||||
// SizedBox(width: 16),
|
||||
// CommonButton(
|
||||
// isLoading: paymentCtrl.isPayment,
|
||||
// borderRadius: 4,
|
||||
// height: 25,
|
||||
// width: 100,
|
||||
// text: AppStrings.submit,
|
||||
// textStyle: 12.txtSBoldWhite,
|
||||
// clickAction: () {
|
||||
// paymentCtrl.getPayments();
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// )
|
||||
// : SizedBox(),
|
||||
// ),
|
||||
// Container(
|
||||
// margin: EdgeInsets.only(bottom: 16, top: 8),
|
||||
// // height: MediaQuery.of(context).size.height * 0.4,
|
||||
// decoration:
|
||||
// BoxDecoration(border: Border.all(color: AppColors.clrGrey)),
|
||||
// child: RawScrollbar(
|
||||
// thumbColor: AppColors.clrD9,
|
||||
// radius: Radius.circular(2),
|
||||
// trackVisibility: true,
|
||||
// thumbVisibility: true,
|
||||
// thickness: 14,
|
||||
// controller: paymentCtrl.verticalScrollController,
|
||||
// child: SingleChildScrollView(
|
||||
// controller: paymentCtrl.verticalScrollController,
|
||||
// child: RawScrollbar(
|
||||
// thumbColor: AppColors.clrD9,
|
||||
// radius: Radius.circular(2),
|
||||
// thickness: 14,
|
||||
// trackVisibility: true,
|
||||
// thumbVisibility: true,
|
||||
// controller: paymentCtrl.horizontalScrollController,
|
||||
// child: SingleChildScrollView(
|
||||
// scrollDirection: Axis.horizontal,
|
||||
// controller: paymentCtrl.horizontalScrollController,
|
||||
// child: Container(
|
||||
// margin: EdgeInsets.only(bottom: 24, right: 24),
|
||||
// child: DataTable(
|
||||
// dataRowHeight: 28,
|
||||
// headingRowHeight: 40,
|
||||
// headingRowColor:
|
||||
// WidgetStateProperty.all(AppColors.clrF2),
|
||||
// border: TableBorder(
|
||||
// horizontalInside:
|
||||
// BorderSide(color: AppColors.clrGrey),
|
||||
// verticalInside: BorderSide(color: AppColors.clrGrey),
|
||||
// bottom: BorderSide(color: AppColors.clrGrey),
|
||||
// left: BorderSide(color: AppColors.clrGrey),
|
||||
// right: BorderSide(color: AppColors.clrGrey),
|
||||
// top: BorderSide(color: AppColors.clrGrey),
|
||||
// ),
|
||||
// columns: [
|
||||
// dataColumn(AppStrings.plant),
|
||||
// dataColumn(AppStrings.productName,),
|
||||
// dataColumn(AppStrings.freightBillNo),
|
||||
// dataColumn(AppStrings.freightBillDate),
|
||||
// dataColumn(AppStrings.billingQty),
|
||||
// dataColumn(AppStrings.uom),
|
||||
// dataColumn(AppStrings.freightAmount),
|
||||
// dataColumn(AppStrings.cGST),
|
||||
// dataColumn(AppStrings.sGST),
|
||||
// dataColumn(AppStrings.iGST),
|
||||
// dataColumn(AppStrings.totalGst),
|
||||
// dataColumn(AppStrings.totalInvoiceAmt),
|
||||
// dataColumn(AppStrings.paidAmt),
|
||||
// dataColumn(AppStrings.gstHold),
|
||||
// dataColumn('${AppStrings.utrNo}1'),
|
||||
// dataColumn('${AppStrings.utrDate}1'),
|
||||
// dataColumn('${AppStrings.utrAmt}1'),
|
||||
// dataColumn('${AppStrings.utrNo}2'),
|
||||
// dataColumn('${AppStrings.utrDate}2'),
|
||||
// dataColumn('${AppStrings.utrAmt}2'),
|
||||
// dataColumn('${AppStrings.utrNo}3'),
|
||||
// dataColumn('${AppStrings.utrDate}3'),
|
||||
// dataColumn('${AppStrings.utrAmt}3'),
|
||||
// dataColumn('${AppStrings.utrNo}4'),
|
||||
// dataColumn('${AppStrings.utrDate}4'),
|
||||
// dataColumn('${AppStrings.utrAmt}4'),
|
||||
// dataColumn('${AppStrings.utrNo}5'),
|
||||
// dataColumn('${AppStrings.utrDate}5'),
|
||||
// dataColumn('${AppStrings.utrAmt}5'),
|
||||
//
|
||||
// ],
|
||||
// rows: List<DataRow>.generate(
|
||||
// paymentCtrl.payments.length, (index) {
|
||||
// final stoppage = paymentCtrl.payments[index];
|
||||
//
|
||||
// return DataRow(
|
||||
// // selected: stoppage.isSelected,
|
||||
// cells: [
|
||||
// editableCell(index,
|
||||
// "${stoppage.plantCode}-${stoppage.plantDesc}"),
|
||||
// editableCell(index, "${stoppage.materialCode}"),
|
||||
// editableCell(
|
||||
// index, "${stoppage.freightbillCode}"),
|
||||
// editableCell(index, "${stoppage.lastUpdatedOn}"),
|
||||
// editableCell(index, "${stoppage.shipmentNetQty}"),
|
||||
// editableCell(index, "TON"),
|
||||
// editableCell(
|
||||
// index, "${stoppage.shipmentNetCost}"),
|
||||
// editableCell(index, "${stoppage.cgstAmount}"),
|
||||
// editableCell(index, "${stoppage.sgstAmount}"),
|
||||
// editableCell(index, "${stoppage.igstAmount}"),
|
||||
// editableCell(index, "${stoppage.totalGst}"),
|
||||
// editableCell(
|
||||
// index, "${stoppage.shipmentGrossCost}"),
|
||||
// editableCell(index, "-"),
|
||||
// // editableCell(index,
|
||||
// // "${stoppage.utr1PaymentAmount + stoppage.utr2PaymentAmount +
|
||||
// // stoppage.utr3PaymentAmount + stoppage.utr4PaymentAmount +
|
||||
// // stoppage.utr5PaymentAmount}"),
|
||||
// editableCell(index, "${stoppage.gstAmount}"),
|
||||
// editableCell(
|
||||
// index, stoppage.utr1No ?? "-"),
|
||||
// editableCell(index, stoppage.utr1Date ?? "-"),
|
||||
// editableCell(index, stoppage.utr1PaymentAmount ?? "-"),
|
||||
//
|
||||
// editableCell(
|
||||
// index, stoppage.utr2No ?? "-"),
|
||||
// editableCell(index, stoppage.utr2Date ?? "-"),
|
||||
// editableCell(index, stoppage.utr2PaymentAmount ?? "-"),
|
||||
// editableCell(
|
||||
// index, stoppage.utr3No ?? "-"),
|
||||
// editableCell(index, stoppage.utr3Date ?? "-"),
|
||||
// editableCell(index, stoppage.utr3PaymentAmount ?? "-"),
|
||||
// editableCell(
|
||||
// index, stoppage.utr4No ?? "-"),
|
||||
// editableCell(index, stoppage.utr4Date ?? "-"),
|
||||
// editableCell(index, stoppage.utr4PaymentAmount ?? "-"),
|
||||
// editableCell(
|
||||
// index, stoppage.utr5No ?? "-"),
|
||||
// editableCell(index, stoppage.utr5Date ?? "-"),
|
||||
// editableCell(index, stoppage.utr5PaymentAmount ?? "-"),
|
||||
// ],
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
|
@ -1,9 +1,13 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../../../components/common/common_model.dart';
|
||||
import '../../../../../../components/styles/app_strings.dart';
|
||||
import '../../../../../../services/network/get_requests.dart';
|
||||
import '../../../../../../services/network/post_request.dart';
|
||||
import '../../model/freightbill_res_model.dart';
|
||||
import '../../model/get_invoice_response.dart';
|
||||
import '../../model/view_freight_bill_res_model.dart';
|
||||
|
||||
class InvoiceManagementController extends GetxController{
|
||||
var selectedState = 0.obs;
|
||||
|
@ -20,10 +24,39 @@ class InvoiceManagementController extends GetxController{
|
|||
var pageSize = 2.obs;
|
||||
var sortField = "grn_date".obs;
|
||||
var sortDirection = "desc".obs;
|
||||
var isLoading = false.obs;
|
||||
var product = <Prodect>[].obs;
|
||||
var plant = <Plant>[].obs;
|
||||
var freightBill = <String>[].obs;
|
||||
var fromLocation = [].obs;
|
||||
final fromTextFieldKey = GlobalKey();
|
||||
TextEditingController fromController = TextEditingController();
|
||||
DateTime fromSelectedDate = DateTime.now(); // Initialize with a default value
|
||||
RxBool dateCheck = false.obs;
|
||||
String getFormattedDate(DateTime date) {
|
||||
return "${date.day.toString().padLeft(2, '0')}-${date.month.toString().padLeft(2, '0')}-${date.year}";
|
||||
}
|
||||
RxBool showTransactionErrorViewFreight = false.obs;
|
||||
var selectFreightBillValidate = ''.obs;
|
||||
// RxString selectPlantViewFreight = ''.obs;
|
||||
// var selectProductViewFreight = ''.obs;
|
||||
// RxBool showPlantErrorViewFreight = false.obs;
|
||||
// RxBool showProductErrorViewFreight = false.obs;
|
||||
var freightViewLoader = false.obs;
|
||||
var freightBillData = <FreightBill>[].obs;
|
||||
void toggleContainer() {
|
||||
isSelected.value = true;
|
||||
print("isSelected.value..${isSelected.value}");
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
getInvoiceView();
|
||||
getFreightBills();
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
|
||||
getInvoiceView() async {
|
||||
try {
|
||||
invoiceViewLoader.value = true;
|
||||
|
@ -34,7 +67,8 @@ class InvoiceManagementController extends GetxController{
|
|||
"invFromDate":"",
|
||||
"invToDate":"",
|
||||
"freightFromDate":"",
|
||||
"freightToDate":""
|
||||
"freightToDate":"",
|
||||
"status":""
|
||||
};
|
||||
|
||||
var response = await PostRequests.getInvoice(requestBody);
|
||||
|
@ -45,6 +79,7 @@ class InvoiceManagementController extends GetxController{
|
|||
// print("response from${getInvoiceData[0].freightbillCode.runtimeType} view freight bill ${freightBillData[0].plantCode.runtimeType} and ${freightBillData[0].materialCode.runtimeType} and}");
|
||||
totalPages.value = response.totalPages ?? 0;
|
||||
totalElements.value = response.totalElements ?? 0;
|
||||
print('res from invoice ${response.toString()}');
|
||||
}
|
||||
} finally {
|
||||
invoiceViewLoader.value = false;
|
||||
|
@ -59,5 +94,105 @@ class InvoiceManagementController extends GetxController{
|
|||
}
|
||||
// viewFreightView(page: 0);
|
||||
}
|
||||
RxBool showPlantErrorFreight = false.obs;
|
||||
RxBool showProductErrorFreight = false.obs;
|
||||
RxString selectPlantFreight = ''.obs;
|
||||
getFreightBills() async {
|
||||
try {
|
||||
isLoading.value = true;
|
||||
|
||||
var response = await GetRequests.getFreightBill();
|
||||
if (response != null) {
|
||||
plant.assignAll(response.plant ?? []);
|
||||
product.assignAll(response.prodect ?? []);
|
||||
freightBill.assignAll(response.freightBill ?? []);
|
||||
fromLocation.assignAll(response.fromLocation ?? []);
|
||||
}
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
// void clearFiltersViewFreight() {
|
||||
// selectPlantViewFreight.value = '';
|
||||
// selectProductViewFreight.value = '';
|
||||
// selectFreightBillValidate.value = '';
|
||||
// fromController.clear();
|
||||
// showPlantErrorViewFreight.value = false;
|
||||
// showProductErrorViewFreight.value = false;
|
||||
// showTransactionErrorViewFreight.value = false;
|
||||
// }
|
||||
// void handleFilterSubmitViewFreightBill() {
|
||||
// print('submit call');
|
||||
// validateFieldsViewFreightBill();
|
||||
// if (selectPlantViewFreight.value.isEmpty ||
|
||||
// selectProductViewFreight.value.isEmpty
|
||||
// // ||
|
||||
// // selectTransactionTypeViewFreight.value.isEmpty
|
||||
// ) {
|
||||
// print('submit call 22');
|
||||
// } else {
|
||||
// print('submit call 1');
|
||||
// displayFilteredDataFromViewFreight();
|
||||
// }
|
||||
// }
|
||||
// void validateFieldsViewFreightBill() {
|
||||
// showPlantErrorViewFreight.value = selectPlantViewFreight.value.isEmpty;
|
||||
// showTransactionErrorViewFreight.value =
|
||||
// selectFreightBillValidate.value.isEmpty;
|
||||
// showProductErrorViewFreight.value = selectProductViewFreight.value.isEmpty;
|
||||
// }
|
||||
//
|
||||
// void displayFilteredDataFromViewFreight() async {
|
||||
// try {
|
||||
// freightViewLoader.value = true;
|
||||
// Map<String, String> requestBody = {
|
||||
// "plant": selectPlantViewFreight.value,
|
||||
// "productNane": selectProductViewFreight.value,
|
||||
// "freightBillNo": selectFreightBillValidate.value,
|
||||
// "transactionType": "",
|
||||
// "fromLocation": "",
|
||||
// "grnFromDate": "",
|
||||
// "grnToDate": "",
|
||||
// };
|
||||
//
|
||||
// var response = await PostRequests.viewFreightBill(requestBody);
|
||||
//
|
||||
// if (response != null) {
|
||||
// List<FreightBill> flattenedContent =
|
||||
// response.content!.expand((list) => list).toList();
|
||||
//
|
||||
// List<FreightBill> filteredData = flattenedContent.where((item) {
|
||||
// // Plant filter
|
||||
// bool plantMatch = selectPlantViewFreight.value.isEmpty ||
|
||||
// item.plantCode.toString().toLowerCase() ==
|
||||
// selectPlantViewFreight.value.toLowerCase();
|
||||
//
|
||||
// // Product filter
|
||||
// bool productMatch = selectProductViewFreight.value.isEmpty ||
|
||||
// item.materialCode.toString().toLowerCase() ==
|
||||
// selectProductViewFreight.value.toLowerCase();
|
||||
//
|
||||
// // Freight bill filter
|
||||
// bool freightBillMatch = selectFreightBillValidate.value.isEmpty ||
|
||||
// item.freightbillCode.toString().toLowerCase() ==
|
||||
// selectFreightBillValidate.value.toLowerCase();
|
||||
//
|
||||
//
|
||||
// return plantMatch && productMatch && freightBillMatch;
|
||||
// }).toList();
|
||||
// freightBillData.assignAll(filteredData);
|
||||
//
|
||||
// // Update pagination values
|
||||
// totalPages.value = response.totalPages ?? 0;
|
||||
// totalElements.value = response.totalElements ?? 0;
|
||||
// } else {
|
||||
// freightBillData.clear();
|
||||
// }
|
||||
// } catch (e) {
|
||||
// freightBillData.clear();
|
||||
// } finally {
|
||||
// freightViewLoader.value = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
|
@ -7,7 +7,6 @@ import 'package:shayog/components/styles/textStyles.dart';
|
|||
import 'package:shayog/feature/presentation/widgets/text_view.dart';
|
||||
import 'package:shayog/services/model/generate_freight_model.dart';
|
||||
import 'package:sizer/sizer.dart';
|
||||
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
|
||||
import 'package:vph_web_date_picker/vph_web_date_picker.dart';
|
||||
import '../../../../../../../components/common/common_btn.dart';
|
||||
import '../../../../../../../components/common/custom_drop_down.dart';
|
||||
|
@ -17,26 +16,16 @@ import '../../view_model/transport_controller.dart';
|
|||
import '../../widgets/common_card.dart';
|
||||
import '../../widgets/freightbill_dialog.dart';
|
||||
|
||||
class GenerateFrightBill extends StatefulWidget {
|
||||
class GenerateFrightBill extends StatelessWidget {
|
||||
GenerateFrightBill({super.key});
|
||||
|
||||
@override
|
||||
State<GenerateFrightBill> createState() => _GenerateFrightBillState();
|
||||
}
|
||||
|
||||
class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
||||
final controller = Get.put(TransportController());
|
||||
|
||||
final TextEditingController _dateController = TextEditingController();
|
||||
DateTime? _startDate;
|
||||
DateTime? _endDate;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Obx(
|
||||
() => controller.isFilterVisibleGenerateFreight.value
|
||||
Obx(() => controller.isFilterVisibleGenerateFreight.value
|
||||
? Column(
|
||||
children: [
|
||||
Container(
|
||||
|
@ -67,8 +56,8 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
if (selected != null) {
|
||||
controller.selectPlantFreight.value =
|
||||
selected.plantCode ?? "";
|
||||
controller.showPlantErrorFreight
|
||||
.value = false;
|
||||
controller.showPlantErrorFreight.value =
|
||||
false;
|
||||
}
|
||||
},
|
||||
hintText: "Select Plant",
|
||||
|
@ -105,8 +94,8 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
"${item.materialCode}-${item.materialDescription}",
|
||||
onSelected: (selected) {
|
||||
if (selected != null) {
|
||||
controller.selectProductFreight
|
||||
.value = selected.materialCode;
|
||||
controller.selectProductFreight.value =
|
||||
selected.materialCode;
|
||||
controller.showProductErrorFreight
|
||||
.value = false;
|
||||
}
|
||||
|
@ -142,8 +131,7 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
itemLabel: (item) => item,
|
||||
onSelected: (selected) {
|
||||
if (selected != null) {
|
||||
controller
|
||||
.selectTransactionTypeFreight
|
||||
controller.selectTransactionTypeFreight
|
||||
.value = selected;
|
||||
controller.showTransactionErrorFreight
|
||||
.value = false;
|
||||
|
@ -156,8 +144,7 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
? Text(
|
||||
'Required',
|
||||
style: TextStyle(
|
||||
color: Colors.red,
|
||||
fontSize: 12),
|
||||
color: Colors.red, fontSize: 12),
|
||||
)
|
||||
: Text('')),
|
||||
],
|
||||
|
@ -167,14 +154,13 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 0.0, left: 0, right: 8),
|
||||
top: 16.0, left: 0, right: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextView(text: "MRN Date Range"),
|
||||
Container(
|
||||
|
@ -182,9 +168,28 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
height: 35,
|
||||
child: TextFormField(
|
||||
key: controller.fromTextFieldKey,
|
||||
controller: _dateController,
|
||||
controller: controller.fromController,
|
||||
onTap: () async {
|
||||
await _showDateRangePicker(context);
|
||||
final pickedDate =
|
||||
await showWebDatePicker(
|
||||
width: 20.w,
|
||||
context: controller.fromTextFieldKey
|
||||
.currentContext!,
|
||||
initialDate:
|
||||
controller.fromSelectedDate,
|
||||
firstDate: DateTime(2000),
|
||||
lastDate: DateTime.now(),
|
||||
);
|
||||
|
||||
if (pickedDate != null) {
|
||||
controller.fromSelectedDate =
|
||||
pickedDate;
|
||||
String formattedDate = controller
|
||||
.getFormattedDate(pickedDate);
|
||||
controller.fromController.text =
|
||||
formattedDate;
|
||||
controller.dateCheck.value = true;
|
||||
}
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
fillColor: AppColors.clrD9,
|
||||
|
@ -192,8 +197,7 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
hintText: 'Select MRN Date Range',
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 12,
|
||||
overflow:
|
||||
TextOverflow.ellipsis),
|
||||
overflow: TextOverflow.ellipsis),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(2.0),
|
||||
|
@ -218,12 +222,11 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
borderSide: BorderSide(
|
||||
color: AppColors.clrGrey),
|
||||
),
|
||||
suffixIcon: controller
|
||||
.dateCheck.value
|
||||
suffixIcon: controller.dateCheck.value
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
controller.dateCheck
|
||||
.value = false;
|
||||
controller.dateCheck.value =
|
||||
false;
|
||||
controller.fromController
|
||||
.clear();
|
||||
controller
|
||||
|
@ -248,8 +251,7 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextView(text: "From Location"),
|
||||
SizedBox(height: 8),
|
||||
|
@ -282,14 +284,13 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
CommonBtn(
|
||||
bkClr: Colors.white,
|
||||
text: AppStrings.cancel,
|
||||
clickAction: () =>
|
||||
controller.clearFiltersGenerateFreightBill(),
|
||||
clickAction: () => controller
|
||||
.clearFiltersGenerateFreightBill(),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
CommonButton(
|
||||
|
@ -301,8 +302,8 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
// // controller.postData();
|
||||
// controller.handleFilterSubmit();
|
||||
// },
|
||||
clickAction: () =>
|
||||
controller.handleFilterSubmitGenerateFreight(),
|
||||
clickAction: () => controller
|
||||
.handleFilterSubmitGenerateFreight(),
|
||||
),
|
||||
// CommonButton(
|
||||
// borderRadius: 4,
|
||||
|
@ -336,12 +337,11 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
),
|
||||
],
|
||||
)
|
||||
: SizedBox.shrink()
|
||||
),
|
||||
: SizedBox.shrink()),
|
||||
Obx(() {
|
||||
if (controller.isLoading.value) {
|
||||
return SizedBox(
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
height: MediaQuery.sizeOf(context).height * 0.6,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
|
@ -351,30 +351,23 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
|
||||
if (controller.errorMessage.isNotEmpty) {
|
||||
return SizedBox(
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
height: MediaQuery.sizeOf(context).height * 0.6,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
child: Center(child: Text(controller.errorMessage.value)));
|
||||
}
|
||||
|
||||
if (controller.grnDetails.isEmpty) {
|
||||
return SizedBox(
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
height: controller.isFilterVisibleGenerateFreight.value
|
||||
? MediaQuery.sizeOf(context).height * 0.4
|
||||
: MediaQuery.sizeOf(context).height * 0.64,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
|
||||
child: Center(
|
||||
child: Text('No data available.'),
|
||||
),
|
||||
);
|
||||
}
|
||||
return
|
||||
// controller.isFilterVisibleGenerateFreight.value == true
|
||||
// ? SizedBox(
|
||||
// height: MediaQuery.sizeOf(context).height /3,
|
||||
// width: MediaQuery.sizeOf(context).width,
|
||||
//
|
||||
// child: Center(child: Text('No data available.')))
|
||||
// :
|
||||
Column(
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
|
@ -404,8 +397,8 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
});
|
||||
} else {
|
||||
CommonAlertDialog.showDialog(
|
||||
message:
|
||||
"Are you sure want to\nsave this?",
|
||||
dismissable: false,
|
||||
message: "Are you sure want to\nsave this?",
|
||||
positiveText: "Save",
|
||||
negativeText: "Cancel",
|
||||
positiveBtCallback: () {
|
||||
|
@ -413,24 +406,40 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
controller.addFreightBill();
|
||||
showFreightBill(context);
|
||||
},
|
||||
negativeBtCallback: () {});
|
||||
negativeBtCallback: () {
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
Scrollbar(
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 16, top: 16),
|
||||
height: controller.isFilterVisibleGenerateFreight.value == true
|
||||
? MediaQuery.of(context).size.height * 0.3
|
||||
: MediaQuery.of(context).size.height * 0.64,
|
||||
child: RawScrollbar(
|
||||
thumbColor: AppColors.clrD9,
|
||||
radius: Radius.circular(2),
|
||||
trackVisibility: true,
|
||||
thumbVisibility: true,
|
||||
thickness: 14,
|
||||
controller: controller.verticalScrollController,
|
||||
child: SingleChildScrollView(
|
||||
controller: controller.verticalScrollController,
|
||||
child: Scrollbar(
|
||||
child: RawScrollbar(
|
||||
thumbColor: AppColors.clrD9,
|
||||
radius: Radius.circular(2),
|
||||
thickness: 14,
|
||||
trackVisibility: true,
|
||||
thumbVisibility: true,
|
||||
controller: controller.horizontalScrollController,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
controller: controller.horizontalScrollController,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 24, right: 24),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Colors.grey.shade400,
|
||||
|
@ -482,7 +491,7 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
dataColumn(AppStrings.dispQty),
|
||||
dataColumn(AppStrings.netQty),
|
||||
dataColumn(AppStrings.billingQty),
|
||||
dataColumn(AppStrings.vom),
|
||||
dataColumn(AppStrings.uom),
|
||||
dataColumn(AppStrings.freightRate),
|
||||
dataColumn(AppStrings.freightAmount),
|
||||
],
|
||||
|
@ -503,54 +512,40 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
index, value ?? false);
|
||||
},
|
||||
activeColor: AppColors.primaryClr,
|
||||
// Custom color when selected
|
||||
checkColor: Colors.white,
|
||||
// Custom color for check mark
|
||||
materialTapTargetSize:
|
||||
MaterialTapTargetSize
|
||||
.shrinkWrap, // Avoids large tap area
|
||||
MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
),
|
||||
),
|
||||
// editableCell(index, "0${index + 1}"),
|
||||
editableCell(index, stoppage.grnNo ?? ""),
|
||||
editableCell(
|
||||
index, stoppage.plantCode ?? ""),
|
||||
editableCell(index, stoppage.plantCode ?? ""),
|
||||
editableCell(
|
||||
index, stoppage.materialCode ?? ""),
|
||||
editableCell(
|
||||
index,
|
||||
DateFormat('dd/MM/yyyy').format(
|
||||
stoppage.grnDate ??
|
||||
DateTime.now())),
|
||||
DateFormat('yyyy-MM-dd').format(
|
||||
stoppage.grnDate ?? DateTime.now())),
|
||||
editableCell(
|
||||
index, stoppage.fromLocation ?? ""),
|
||||
editableCell(
|
||||
index, stoppage.vehicleNo ?? ""),
|
||||
editableCell(index, stoppage.vehicleNo ?? ""),
|
||||
editableCell(index, stoppage.lrNo ?? ""),
|
||||
editableCell(
|
||||
index,
|
||||
DateFormat('dd/MM/yyyy').format(
|
||||
stoppage.lrDate ??
|
||||
DateTime.now())),
|
||||
DateFormat('yyyy-MM-dd').format(
|
||||
stoppage.lrDate ?? DateTime.now())),
|
||||
editableCell(index,
|
||||
stoppage.dispQty?.toString() ?? ""),
|
||||
editableCell(
|
||||
index, stoppage.netQty?.toString() ?? ""),
|
||||
editableCell(index,
|
||||
stoppage.netQty?.toString() ?? ""),
|
||||
editableCell(
|
||||
index,
|
||||
stoppage.billingQty?.toString() ??
|
||||
""),
|
||||
editableCell(
|
||||
index,
|
||||
stoppage.freightRate?.toString() ??
|
||||
""),
|
||||
editableCell(
|
||||
index,
|
||||
stoppage.shipmentCost?.toString() ??
|
||||
""),
|
||||
stoppage.billingQty?.toString() ?? ""),
|
||||
editableCell(index, "-"),
|
||||
editableCell(index,
|
||||
stoppage.statusId?.toString() ?? ""),
|
||||
stoppage.freightRate?.toString() ?? ""),
|
||||
editableCell(index,
|
||||
stoppage.shipmentCost?.toString() ?? ""),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
@ -560,88 +555,11 @@ class _GenerateFrightBillState extends State<GenerateFrightBill> {
|
|||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _showDateRangePicker(BuildContext context) async {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
height: 500, // Adjust the height as needed
|
||||
child: Column(
|
||||
children: [
|
||||
// Display two date pickers horizontally
|
||||
Row(
|
||||
children: [
|
||||
// First Date Picker
|
||||
Expanded(
|
||||
child: SfDateRangePicker(
|
||||
view: DateRangePickerView.month,
|
||||
selectionMode: DateRangePickerSelectionMode.range,
|
||||
onSelectionChanged: (args) {
|
||||
// Handle the date selection from the first calendar
|
||||
if (args.value is PickerDateRange) {
|
||||
setState(() {
|
||||
_startDate = args.value.startDate;
|
||||
_endDate = args.value.endDate;
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
// Second Date Picker
|
||||
Expanded(
|
||||
child: SfDateRangePicker(
|
||||
view: DateRangePickerView.month,
|
||||
selectionMode: DateRangePickerSelectionMode.range,
|
||||
onSelectionChanged: (args) {
|
||||
// Handle the date selection from the first calendar
|
||||
if (args.value is PickerDateRange) {
|
||||
setState(() {
|
||||
_startDate = args.value.startDate;
|
||||
_endDate = args.value.endDate;
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
if (_startDate != null && _endDate != null) {
|
||||
String formattedRange =
|
||||
"${_formatDate(_startDate!)} - ${_formatDate(_endDate!)}";
|
||||
_dateController.text = formattedRange;
|
||||
}
|
||||
// You can extract the selected date range here
|
||||
// Close the bottom sheet after selection
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text('Done'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
String _formatDate(DateTime date) {
|
||||
// Format the date as per your requirement
|
||||
return "${date.month.toString().padLeft(2, '0')}/${date.day.toString().padLeft(2, '0')}/${date.year}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,13 +3,18 @@ import 'dart:io';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:sizer/sizer.dart';
|
||||
import 'package:vph_web_date_picker/vph_web_date_picker.dart';
|
||||
|
||||
import '../../../../../../components/common/common_btn.dart';
|
||||
import '../../../../../../components/common/common_button.dart';
|
||||
import '../../../../../../components/common/custom_drop_down.dart';
|
||||
import '../../../../../../components/common/data_cell.dart';
|
||||
import '../../../../../../components/common/input_field.dart';
|
||||
import '../../../../../../components/styles/app_colors.dart';
|
||||
import '../../../../../../components/styles/app_images.dart';
|
||||
import '../../../../../../components/styles/app_strings.dart';
|
||||
import '../../../../widgets/text_view.dart';
|
||||
import '../ctrl/invoice_management_controller.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
@ -93,7 +98,7 @@ class _TransportViewState extends State<InvoiceManagement> {
|
|||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: ctrl.toggleContainer,
|
||||
onTap:(){ctrl.toggleContainer;} ,
|
||||
child: Image.asset(AppImages.filter,
|
||||
height: 12, width: 12)),
|
||||
Padding(
|
||||
|
@ -115,7 +120,7 @@ class _TransportViewState extends State<InvoiceManagement> {
|
|||
Obx(
|
||||
() => ctrl.isSelected.value
|
||||
? Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: EdgeInsets.all(8),
|
||||
color: AppColors.clrF2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
@ -128,162 +133,194 @@ class _TransportViewState extends State<InvoiceManagement> {
|
|||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_commonText(
|
||||
"Invoice No.",
|
||||
),
|
||||
TextView(text: "Plant", isRequired: true),
|
||||
SizedBox(height: 8),
|
||||
InputField(
|
||||
title: "Select Invoice No. ",
|
||||
CustomDropdown(
|
||||
backClr: AppColors.clrD9,
|
||||
borderClr: AppColors.clrGrey,
|
||||
items: ctrl.plant,
|
||||
|
||||
itemLabel: (item) =>
|
||||
"${item.plantCode} - ${item.plantDesc}",
|
||||
onSelected: (selected) {
|
||||
if (selected != null) {
|
||||
ctrl.selectPlantFreight.value =
|
||||
selected.plantCode ?? "";
|
||||
ctrl.showPlantErrorFreight.value =
|
||||
false;
|
||||
}
|
||||
},
|
||||
hintText: "Select Plant",
|
||||
),
|
||||
// Obx(
|
||||
// () => Container(
|
||||
// padding: EdgeInsets.only(left: 8),
|
||||
// height: 35,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius:
|
||||
// BorderRadius.circular(4.0),
|
||||
// color: AppColors.clrD9,
|
||||
// border: Border.all(
|
||||
// color: AppColors.clrGrey)),
|
||||
// child: DropdownButton<String>(
|
||||
// icon: Icon(
|
||||
// Icons
|
||||
// .keyboard_arrow_down_outlined,
|
||||
// size: 20,
|
||||
// color: AppColors.darkGrey),
|
||||
//
|
||||
// isExpanded: true,
|
||||
// underline: SizedBox(),
|
||||
//
|
||||
// value: ctrl
|
||||
// .selectedInvoice.value,
|
||||
// // Use the selected value
|
||||
// onChanged: (String? newValue) {
|
||||
// if (newValue != null) {
|
||||
// ctrl.selectedInvoice.value =
|
||||
// newValue; // Update the selected value
|
||||
// }
|
||||
// },
|
||||
// items: ctrl.invoiceNoItems
|
||||
// .map((String value) {
|
||||
// return DropdownMenuItem<String>(
|
||||
// value: value.toString(),
|
||||
// child: Text(
|
||||
// value,
|
||||
// style: TextStyle(
|
||||
// fontSize: 12,
|
||||
// color:
|
||||
// AppColors.darkGrey),
|
||||
// ),
|
||||
// );
|
||||
// }).toList(),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
Obx(() =>
|
||||
ctrl.showPlantErrorFreight.value
|
||||
? Text(
|
||||
'Required',
|
||||
style: TextStyle(
|
||||
color: Colors.red,
|
||||
fontSize: 12),
|
||||
)
|
||||
: Text('')),
|
||||
],
|
||||
)),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_commonText(
|
||||
"Invoice date",
|
||||
TextView(text: "Freight Bill Date"),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
height: 35,
|
||||
child: TextFormField(
|
||||
key: ctrl.fromTextFieldKey,
|
||||
controller: ctrl.fromController,
|
||||
onTap: () async {
|
||||
final pickedDate =
|
||||
await showWebDatePicker(
|
||||
width: 20.w,
|
||||
context: ctrl
|
||||
.fromTextFieldKey.currentContext!,
|
||||
initialDate:
|
||||
ctrl.fromSelectedDate,
|
||||
firstDate: DateTime(2000),
|
||||
lastDate: DateTime.now(),
|
||||
);
|
||||
|
||||
if (pickedDate != null) {
|
||||
ctrl.fromSelectedDate =
|
||||
pickedDate;
|
||||
String formattedDate = ctrl
|
||||
.getFormattedDate(pickedDate);
|
||||
ctrl.fromController.text =
|
||||
formattedDate;
|
||||
ctrl.dateCheck.value = true;
|
||||
}
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
fillColor: AppColors.clrD9,
|
||||
filled: true,
|
||||
hintText: 'Select Freight Bill Date ',
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 12,
|
||||
overflow: TextOverflow.ellipsis),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(2.0),
|
||||
borderSide:
|
||||
BorderSide(color: AppColors.black),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(2.0),
|
||||
borderSide: BorderSide(
|
||||
color: AppColors.clrGrey),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(2.0),
|
||||
borderSide: BorderSide(
|
||||
color: AppColors.clrGrey),
|
||||
),
|
||||
disabledBorder: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(2.0),
|
||||
borderSide: BorderSide(
|
||||
color: AppColors.clrGrey),
|
||||
),
|
||||
suffixIcon: ctrl.dateCheck.value
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
ctrl.dateCheck.value =
|
||||
false;
|
||||
ctrl.fromController
|
||||
.clear();
|
||||
ctrl.fromSelectedDate =
|
||||
DateTime.now();
|
||||
},
|
||||
child: Icon(Icons.close,
|
||||
size: 1.2.w),
|
||||
)
|
||||
: null,
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 12.0, vertical: 0.0),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
InputField(
|
||||
title: "Select Invoice Date",
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_commonText(
|
||||
"Freight Bill No.",
|
||||
),
|
||||
TextView(
|
||||
text: "Freight Bill No.", isRequired: true),
|
||||
SizedBox(height: 8),
|
||||
InputField(
|
||||
title: "Select Freight Bill No. ",
|
||||
CustomDropdown<String>(
|
||||
backClr: AppColors.clrD9,
|
||||
borderClr: AppColors.clrGrey,
|
||||
items: ctrl.freightBill,
|
||||
itemLabel: (item) => item,
|
||||
onSelected: (selected) {
|
||||
if (selected != null) {
|
||||
ctrl.selectFreightBillValidate.value =
|
||||
selected;
|
||||
ctrl.showTransactionErrorViewFreight
|
||||
.value = false;
|
||||
}
|
||||
},
|
||||
hintText: "Select Freight Bill No.",
|
||||
),
|
||||
// Obx(
|
||||
// () => Container(
|
||||
// padding: EdgeInsets.only(left: 8),
|
||||
// height: 35,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius:
|
||||
// BorderRadius.circular(4.0),
|
||||
// color: AppColors.clrD9,
|
||||
// border: Border.all(
|
||||
// color: AppColors.clrGrey)),
|
||||
// child: DropdownButton<String>(
|
||||
// icon: Icon(
|
||||
// Icons
|
||||
// .keyboard_arrow_down_outlined,
|
||||
// size: 20,
|
||||
// color: AppColors.darkGrey),
|
||||
//
|
||||
// isExpanded: true,
|
||||
// underline: SizedBox(),
|
||||
//
|
||||
// value: ctrl
|
||||
// .selectedFreightNo.value,
|
||||
// // Use the selected value
|
||||
// onChanged: (String? newValue) {
|
||||
// if (newValue != null) {
|
||||
// ctrl
|
||||
// .selectedFreightNo.value =
|
||||
// newValue; // Update the selected value
|
||||
// }
|
||||
// },
|
||||
// items: ctrl.getInvoiceNoItems
|
||||
// .map((String value) {
|
||||
// return DropdownMenuItem<String>(
|
||||
// value: value.toString(),
|
||||
// child: Text(
|
||||
// value,
|
||||
// style: TextStyle(
|
||||
// fontSize: 12,
|
||||
// color:
|
||||
// AppColors.darkGrey),
|
||||
// ),
|
||||
// );
|
||||
// }).toList(),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)),
|
||||
Obx(() => ctrl
|
||||
.showTransactionErrorViewFreight.value
|
||||
? Text(
|
||||
'Required',
|
||||
style: TextStyle(
|
||||
color: Colors.red, fontSize: 12),
|
||||
)
|
||||
: Text('')),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 16.0, left: 0, right: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
),
|
||||
],
|
||||
),
|
||||
// Padding(
|
||||
// padding:
|
||||
// const EdgeInsets.only(top: 16.0, left: 0, right: 8),
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// _commonText(
|
||||
// "Freight Bill Date",
|
||||
// ),
|
||||
// SizedBox(height: 8),
|
||||
// InputField(
|
||||
// title: "Select Bill Date",
|
||||
// ),
|
||||
// ],
|
||||
// )),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
Expanded(
|
||||
//flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_commonText(
|
||||
"Freight Bill Date",
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
InputField(
|
||||
title: "Select Bill Date",
|
||||
),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
TextView(
|
||||
text: "",
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
|
@ -301,6 +338,8 @@ class _TransportViewState extends State<InvoiceManagement> {
|
|||
),
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
|
@ -310,11 +349,11 @@ class _TransportViewState extends State<InvoiceManagement> {
|
|||
case 0:
|
||||
return _tableView();
|
||||
case 1:
|
||||
return _tableView();
|
||||
return Center(child: Text('No Data Found'),);
|
||||
case 2:
|
||||
return _tableView();
|
||||
return Center(child: Text('No Data Found'),);
|
||||
default:
|
||||
return _tableView();
|
||||
return Center(child: Text('No Data Found'),);
|
||||
}
|
||||
}),
|
||||
],
|
||||
|
@ -322,7 +361,9 @@ class _TransportViewState extends State<InvoiceManagement> {
|
|||
}
|
||||
|
||||
_tableView() {
|
||||
return Column(
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
children: [
|
||||
Scrollbar(
|
||||
thumbVisibility: true,
|
||||
|
@ -360,12 +401,12 @@ class _TransportViewState extends State<InvoiceManagement> {
|
|||
dataColumn("Freight Bill No."),
|
||||
//dataColumn(AppStrings.getInvoiceDate),
|
||||
dataColumn("Freight Bill date"),
|
||||
dataColumn("Invoice No."),
|
||||
dataColumn("Invoice Date"),
|
||||
dataColumn("Invoice Amount"),
|
||||
dataColumn("GST Amount"),
|
||||
dataColumn("Status"),
|
||||
dataColumn("Freight Bill Amount"),
|
||||
dataColumn("CCN Amount"),
|
||||
dataColumn("View CCN"),
|
||||
dataColumn("Product Type"),
|
||||
dataColumn("Plant Code/Plant Desc."),
|
||||
dataColumn("View Invoice"),
|
||||
dataColumn("Add Signature"),
|
||||
],
|
||||
|
@ -374,25 +415,21 @@ class _TransportViewState extends State<InvoiceManagement> {
|
|||
final getInvoice = ctrl.getInvoiceData[index];
|
||||
return DataRow(
|
||||
cells: [
|
||||
editableCell(index, "${getInvoice.invoiceId}"),
|
||||
editableCell(index, "${getInvoice.sapReferenceno}"),
|
||||
editableCell(index, getInvoice.freightbillCode),
|
||||
editableCell(
|
||||
index,
|
||||
DateFormat("dd MMMM yyyy").format(
|
||||
DateTime.parse('${getInvoice.createdOn}'))),
|
||||
editableCell(
|
||||
index, "${getInvoice.sapReferenceno ?? "-"}"),
|
||||
index, "-"),
|
||||
editableCell(index, getInvoice.status.toUpperCase()),
|
||||
editableCell(
|
||||
index,
|
||||
DateFormat("d MMMM yyyy").format(DateTime.parse(
|
||||
'${getInvoice.shipmentCostDate}'))),
|
||||
editableCell(
|
||||
index, "${getInvoice.shipmentCost ?? "-"}"),
|
||||
index, (getInvoice.shipmentCost.toString() ?? "-")),
|
||||
editableCell(index,"-"),
|
||||
editableCell(index, "-"),
|
||||
editableCell(index, "-", isLink: true),
|
||||
editableCell(index, "-"),
|
||||
editableCell(index, "-", isLink: true),
|
||||
editableCell(index, "${getInvoice.plantCode} - ${getInvoice.plantDesc}",),
|
||||
editableCell(index, "View Invoice",isLink: true),
|
||||
DataCell(
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
@ -475,6 +512,7 @@ class _TransportViewState extends State<InvoiceManagement> {
|
|||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import 'package:intl/intl.dart';
|
|||
import 'package:shayog/components/styles/textStyles.dart';
|
||||
import 'package:shayog/feature/presentation/screens/transporter/view_model/transport_controller.dart';
|
||||
import 'package:sizer/sizer.dart';
|
||||
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
|
||||
import 'package:vph_web_date_picker/vph_web_date_picker.dart';
|
||||
import '../../../../../../../components/common/data_cell.dart';
|
||||
import '../../../../../../../components/styles/app_colors.dart';
|
||||
|
@ -16,22 +15,12 @@ import '../../../../widgets/text_view.dart';
|
|||
import '../../widgets/common_card.dart';
|
||||
import '../../widgets/freightbill_dialog.dart';
|
||||
|
||||
class PendingGeneration extends StatefulWidget {
|
||||
class PendingGeneration extends StatelessWidget {
|
||||
PendingGeneration({super.key});
|
||||
|
||||
@override
|
||||
State<PendingGeneration> createState() => _PendingGenerationState();
|
||||
}
|
||||
|
||||
class _PendingGenerationState extends State<PendingGeneration> {
|
||||
final ScrollController horizontalScrollController = ScrollController();
|
||||
|
||||
final ScrollController verticalScrollController = ScrollController();
|
||||
|
||||
final controller = Get.put(TransportController());
|
||||
final TextEditingController _dateController = TextEditingController();
|
||||
DateTime? _startDate;
|
||||
DateTime? _endDate;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -171,14 +160,45 @@ class _PendingGenerationState extends State<PendingGeneration> {
|
|||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextView(text: "MRN Date Range"),
|
||||
// SizedBox(height: 8),
|
||||
// CustomDropdown<String>(
|
||||
// borderClr: AppColors.clrGrey,
|
||||
// items: controller.date,
|
||||
// itemLabel: (item) => item,
|
||||
// onSelected: (selected) {
|
||||
// if (selected != null) {
|
||||
// controller.selectPlant.value = selected;
|
||||
// }
|
||||
// },
|
||||
// hintText: "Select MRN Date Range",
|
||||
// ),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8),
|
||||
height: 35,
|
||||
child: TextFormField(
|
||||
key: controller.fromTextFieldKey,
|
||||
controller: _dateController,
|
||||
controller: controller.fromController,
|
||||
onTap: () async {
|
||||
await _showDateRangePicker(context);
|
||||
final pickedDate =
|
||||
await showWebDatePicker(
|
||||
width: 20.w,
|
||||
context: controller
|
||||
.fromTextFieldKey.currentContext!,
|
||||
initialDate:
|
||||
controller.fromSelectedDate,
|
||||
firstDate: DateTime(2000),
|
||||
lastDate: DateTime.now(),
|
||||
);
|
||||
|
||||
if (pickedDate != null) {
|
||||
controller.fromSelectedDate =
|
||||
pickedDate;
|
||||
String formattedDate = controller
|
||||
.getFormattedDate(pickedDate);
|
||||
controller.fromController.text =
|
||||
formattedDate;
|
||||
controller.dateCheck.value = true;
|
||||
}
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
fillColor: AppColors.clrD9,
|
||||
|
@ -236,29 +256,30 @@ class _PendingGenerationState extends State<PendingGeneration> {
|
|||
),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextView(text: "From Location"),
|
||||
SizedBox(height: 8),
|
||||
CustomDropdown<dynamic>(
|
||||
backClr: AppColors.clrD9,
|
||||
borderClr: AppColors.clrGrey,
|
||||
items: controller.fromLocation,
|
||||
itemLabel: (item) => item,
|
||||
onSelected: (selected) {
|
||||
if (selected != null) {
|
||||
controller.selectLocation.value =
|
||||
selected;
|
||||
}
|
||||
},
|
||||
hintText: "Select From Location",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Expanded(
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// TextView(text: "From Location"),
|
||||
// SizedBox(height: 8),
|
||||
// CustomDropdown<dynamic>(
|
||||
// backClr: AppColors.clrD9,
|
||||
// borderClr: AppColors.clrGrey,
|
||||
// items: controller.fromLocation,
|
||||
// itemLabel: (item) => item,
|
||||
// onSelected: (selected) {
|
||||
// if (selected != null) {
|
||||
// controller.selectLocation.value =
|
||||
// selected;
|
||||
// }
|
||||
// },
|
||||
// hintText: "Select From Location",
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
Expanded(child: SizedBox.shrink()),
|
||||
SizedBox(
|
||||
width: 16,
|
||||
),
|
||||
|
@ -317,7 +338,7 @@ class _PendingGenerationState extends State<PendingGeneration> {
|
|||
Obx(() {
|
||||
if (controller.grnPendingLoader.value) {
|
||||
return SizedBox(
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
height: MediaQuery.sizeOf(context).height * 0.6,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
|
@ -328,14 +349,16 @@ class _PendingGenerationState extends State<PendingGeneration> {
|
|||
|
||||
if (controller.errorMessage.isNotEmpty) {
|
||||
return SizedBox(
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
height: MediaQuery.sizeOf(context).height * 0.6,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
child: Center(child: Text(controller.errorMessage.value)));
|
||||
}
|
||||
|
||||
if (controller.grnPendingData.isEmpty) {
|
||||
return SizedBox(
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
height: controller.isFilterVisiblePendingGeneration.value
|
||||
? MediaQuery.sizeOf(context).height * 0.4
|
||||
: MediaQuery.sizeOf(context).height * 0.6,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
child: Center(
|
||||
child: Text(
|
||||
|
@ -347,18 +370,33 @@ class _PendingGenerationState extends State<PendingGeneration> {
|
|||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Scrollbar(
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 16, top: 16),
|
||||
height:
|
||||
controller.isFilterVisiblePendingGeneration.value == true
|
||||
? MediaQuery.of(context).size.height * 0.3
|
||||
: MediaQuery.of(context).size.height * 0.64,
|
||||
child: RawScrollbar(
|
||||
thumbColor: AppColors.clrD9,
|
||||
radius: Radius.circular(2),
|
||||
trackVisibility: true,
|
||||
thumbVisibility: true,
|
||||
thickness: 14,
|
||||
controller: controller.verticalScrollController,
|
||||
child: SingleChildScrollView(
|
||||
controller: controller.verticalScrollController,
|
||||
child: Scrollbar(
|
||||
child: RawScrollbar(
|
||||
thumbColor: AppColors.clrD9,
|
||||
radius: Radius.circular(2),
|
||||
thickness: 14,
|
||||
trackVisibility: true,
|
||||
thumbVisibility: true,
|
||||
controller: controller.horizontalScrollController,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
controller: controller.horizontalScrollController,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 24, right: 24),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Colors.grey.shade400,
|
||||
|
@ -381,21 +419,21 @@ class _PendingGenerationState extends State<PendingGeneration> {
|
|||
top: BorderSide(color: AppColors.clrGrey),
|
||||
),
|
||||
columns: [
|
||||
DataColumn(
|
||||
label: Transform.scale(
|
||||
scale: 0.80,
|
||||
child: Checkbox(
|
||||
value: controller.selectAllField.value,
|
||||
onChanged: (value) {
|
||||
controller.selectAll(value ?? false);
|
||||
},
|
||||
activeColor: AppColors.primaryClr,
|
||||
checkColor: Colors.white,
|
||||
materialTapTargetSize:
|
||||
MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
),
|
||||
),
|
||||
// DataColumn(
|
||||
// label: Transform.scale(
|
||||
// scale: 0.80,
|
||||
// child: Checkbox(
|
||||
// value: controller.selectAllField.value,
|
||||
// onChanged: (value) {
|
||||
// controller.selectAll(value ?? false);
|
||||
// },
|
||||
// activeColor: AppColors.primaryClr,
|
||||
// checkColor: Colors.white,
|
||||
// materialTapTargetSize:
|
||||
// MaterialTapTargetSize.shrinkWrap,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// dataColumn(AppStrings.srNo),
|
||||
dataColumn(AppStrings.viewGrnDetails),
|
||||
dataColumn(AppStrings.plantName),
|
||||
|
@ -421,22 +459,22 @@ class _PendingGenerationState extends State<PendingGeneration> {
|
|||
return DataRow(
|
||||
selected: stoppage.isSelected,
|
||||
cells: [
|
||||
DataCell(
|
||||
Transform.scale(
|
||||
scale: 0.80,
|
||||
child: Checkbox(
|
||||
value: stoppage.isSelected,
|
||||
onChanged: (value) {
|
||||
controller.toggleSelection(
|
||||
index, value ?? false);
|
||||
},
|
||||
activeColor: AppColors.primaryClr,
|
||||
checkColor: Colors.white,
|
||||
materialTapTargetSize:
|
||||
MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
),
|
||||
),
|
||||
// DataCell(
|
||||
// Transform.scale(
|
||||
// scale: 0.80,
|
||||
// child: Checkbox(
|
||||
// value: stoppage.isSelected,
|
||||
// onChanged: (value) {
|
||||
// controller.toggleSelection(
|
||||
// index, value ?? false);
|
||||
// },
|
||||
// activeColor: AppColors.primaryClr,
|
||||
// checkColor: Colors.white,
|
||||
// materialTapTargetSize:
|
||||
// MaterialTapTargetSize.shrinkWrap,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// editableCell(index, "0${index + 1}"),
|
||||
editableCell(index, stoppage.grnNo ?? ""),
|
||||
editableCell(index, stoppage.plantCode ?? ""),
|
||||
|
@ -455,8 +493,8 @@ class _PendingGenerationState extends State<PendingGeneration> {
|
|||
index,
|
||||
DateFormat('yyyy-MM-dd').format(
|
||||
stoppage.lrDate ?? DateTime.now())),
|
||||
editableCell(
|
||||
index, stoppage.dispQty?.toString() ?? ""),
|
||||
editableCell(index,
|
||||
stoppage.dispQty?.toString() ?? ""),
|
||||
editableCell(
|
||||
index, stoppage.netQty?.toString() ?? ""),
|
||||
editableCell(index,
|
||||
|
@ -469,7 +507,7 @@ class _PendingGenerationState extends State<PendingGeneration> {
|
|||
stoppage.shipmentCost?.toString() ?? ""),
|
||||
editableCell(
|
||||
index,
|
||||
stoppage.remark?.toString() ??
|
||||
stoppage.remark ??
|
||||
"Shipment Quantity Mismatch"),
|
||||
],
|
||||
);
|
||||
|
@ -480,85 +518,11 @@ class _PendingGenerationState extends State<PendingGeneration> {
|
|||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _showDateRangePicker(BuildContext context) async {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
height: 500, // Adjust the height as needed
|
||||
child: Column(
|
||||
children: [
|
||||
// Display two date pickers horizontally
|
||||
Row(
|
||||
children: [
|
||||
// First Date Picker
|
||||
Expanded(
|
||||
child: SfDateRangePicker(
|
||||
view: DateRangePickerView.month,
|
||||
selectionMode: DateRangePickerSelectionMode.range,
|
||||
onSelectionChanged: (args) {
|
||||
// Handle the date selection from the first calendar
|
||||
if (args.value is PickerDateRange) {
|
||||
setState(() {
|
||||
_startDate = args.value.startDate;
|
||||
_endDate = args.value.endDate;
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
// Second Date Picker
|
||||
Expanded(
|
||||
child: SfDateRangePicker(
|
||||
view: DateRangePickerView.month,
|
||||
selectionMode: DateRangePickerSelectionMode.range,
|
||||
onSelectionChanged: (args) {
|
||||
// Handle the date selection from the first calendar
|
||||
if (args.value is PickerDateRange) {
|
||||
setState(() {
|
||||
_startDate = args.value.startDate;
|
||||
_endDate = args.value.endDate;
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
if (_startDate != null && _endDate != null) {
|
||||
String formattedRange =
|
||||
"${_formatDate(_startDate!)} - ${_formatDate(_endDate!)}";
|
||||
_dateController.text = formattedRange;
|
||||
}
|
||||
// You can extract the selected date range here
|
||||
// Close the bottom sheet after selection
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text('Done'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
String _formatDate(DateTime date) {
|
||||
// Format the date as per your requirement
|
||||
return "${date.month.toString().padLeft(2, '0')}/${date.day.toString().padLeft(2, '0')}/${date.year}";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shayog/components/common/common_btn.dart';
|
||||
import 'package:shayog/components/styles/textStyles.dart';
|
||||
import 'package:shayog/feature/presentation/screens/transporter/model/sub_freight_view_dialog_model.dart';
|
||||
import 'package:shayog/feature/presentation/screens/transporter/model/view_freight_bill_res_model.dart';
|
||||
import 'package:sizer/sizer.dart';
|
||||
import 'package:vph_web_date_picker/vph_web_date_picker.dart';
|
||||
|
@ -75,6 +75,41 @@ class ViewFreightBill extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextView(
|
||||
text: "Freight Bill No.", isRequired: true),
|
||||
SizedBox(height: 8),
|
||||
CustomDropdown<String>(
|
||||
backClr: AppColors.clrD9,
|
||||
borderClr: AppColors.clrGrey,
|
||||
items: controller.freightBill,
|
||||
itemLabel: (item) => item,
|
||||
onSelected: (selected) {
|
||||
if (selected != null) {
|
||||
controller.selectFreightBillValidate.value =
|
||||
selected;
|
||||
controller.showTransactionErrorViewFreight
|
||||
.value = false;
|
||||
}
|
||||
},
|
||||
hintText: "Select Freight Bill No.",
|
||||
),
|
||||
Obx(() => controller
|
||||
.showTransactionErrorViewFreight.value
|
||||
? Text(
|
||||
'Required',
|
||||
style: TextStyle(
|
||||
color: Colors.red, fontSize: 12),
|
||||
)
|
||||
: Text('')),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
@ -112,43 +147,6 @@ class ViewFreightBill extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextView(
|
||||
text: "Transaction Type", isRequired: true),
|
||||
SizedBox(height: 8),
|
||||
CustomDropdown<String>(
|
||||
backClr: AppColors.clrD9,
|
||||
borderClr: AppColors.clrGrey,
|
||||
items: controller.transactionType,
|
||||
itemLabel: (item) => item,
|
||||
onSelected: (selected) {
|
||||
if (selected != null) {
|
||||
controller.selectTransactionTypeViewFreight
|
||||
.value = selected;
|
||||
controller.showTransactionErrorViewFreight
|
||||
.value = false;
|
||||
print(
|
||||
"selectTransactionType${controller.selectTransactionType.value}");
|
||||
}
|
||||
},
|
||||
hintText: "Select Transaction Type",
|
||||
),
|
||||
Obx(() => controller
|
||||
.showTransactionErrorViewFreight.value
|
||||
? Text(
|
||||
'Required',
|
||||
style: TextStyle(
|
||||
color: Colors.red, fontSize: 12),
|
||||
)
|
||||
: Text('')),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
|
@ -325,52 +323,11 @@ class ViewFreightBill extends StatelessWidget {
|
|||
),
|
||||
)
|
||||
: SizedBox.shrink()),
|
||||
// Container(
|
||||
// padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
// margin: EdgeInsets.only(top: 16),
|
||||
// height: 45,
|
||||
// color: AppColors.primaryClr,
|
||||
// child: Row(
|
||||
// children: [
|
||||
// TextView(text: AppStrings.viewGrnDetails, style: 14.txtBoldWhite),
|
||||
// Spacer(),
|
||||
// CommonBtn(
|
||||
// width: 150,
|
||||
// bkClr: AppColors.white,
|
||||
// borderClr: AppColors.primaryClr,
|
||||
// style: 12.txtBoldBlue,
|
||||
// text: "Generate Freight Bill",
|
||||
//
|
||||
// clickAction: () {
|
||||
// bool hasSelectedRows = controller.grnDetails
|
||||
// .any((element) => element.isSelected);
|
||||
// if (!hasSelectedRows) {
|
||||
// showPopup(
|
||||
// context: context,
|
||||
// onClick: () {
|
||||
// Get.back();
|
||||
// });
|
||||
// } else {
|
||||
// CommonAlertDialog.showDialog(
|
||||
// message: "Are you sure want to\nsave this?",
|
||||
// positiveText: "Save",
|
||||
// negativeText: "Cancel",
|
||||
// positiveBtCallback: () {
|
||||
// Get.back();
|
||||
// controller.addFreightBill();
|
||||
//
|
||||
// showFreightBill(context);
|
||||
// },
|
||||
// negativeBtCallback: () {});
|
||||
// }
|
||||
// }),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Obx(() {
|
||||
if (controller.freightViewLoader.value) {
|
||||
return SizedBox(
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
height: MediaQuery.sizeOf(context).height * 0.6,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
|
@ -382,34 +339,56 @@ class ViewFreightBill extends StatelessWidget {
|
|||
|
||||
if (controller.errorMessage.isNotEmpty) {
|
||||
return SizedBox(
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
height: MediaQuery.sizeOf(context).height * 0.6,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
child: Center(child: Text(controller.errorMessage.value)));
|
||||
}
|
||||
|
||||
if (controller.freightBillData.isEmpty) {
|
||||
if (controller.freightBillData.isEmpty ||
|
||||
controller.freightBillData == []) {
|
||||
return SizedBox(
|
||||
height: MediaQuery.sizeOf(context).height,
|
||||
|
||||
height: controller.isFilterVisibleViewFreight.value
|
||||
? MediaQuery.sizeOf(context).height * 0.4
|
||||
: MediaQuery.sizeOf(context).height * 0.6,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'No data available.',
|
||||
)));
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Scrollbar(
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 16, top: 16),
|
||||
height: controller.isFilterVisibleViewFreight.value == true
|
||||
? MediaQuery.of(context).size.height * 0.4
|
||||
: MediaQuery.of(context).size.height * 0.64,
|
||||
child: RawScrollbar(
|
||||
thumbColor: AppColors.clrD9,
|
||||
radius: Radius.circular(2),
|
||||
trackVisibility: true,
|
||||
thumbVisibility: true,
|
||||
controller: verticalScrollController,
|
||||
thickness: 14,
|
||||
controller: controller.verticalScrollController,
|
||||
child: SingleChildScrollView(
|
||||
controller: verticalScrollController,
|
||||
child: Scrollbar(
|
||||
controller: controller.verticalScrollController,
|
||||
child: RawScrollbar(
|
||||
thumbColor: AppColors.clrD9,
|
||||
radius: Radius.circular(2),
|
||||
thickness: 14,
|
||||
trackVisibility: true,
|
||||
thumbVisibility: true,
|
||||
controller: horizontalScrollController,
|
||||
controller: controller.horizontalScrollController,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
controller: horizontalScrollController,
|
||||
controller: controller.horizontalScrollController,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 24, right: 24),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Colors.grey.shade400,
|
||||
|
@ -478,17 +457,28 @@ class ViewFreightBill extends StatelessWidget {
|
|||
controller.freightBillData.length, (index) {
|
||||
final freightBill =
|
||||
controller.freightBillData[index];
|
||||
|
||||
controller.freightBillCode.value =
|
||||
freightBill.freightbillCode ?? "";
|
||||
print(
|
||||
'freightBill.trasnporterInvoiceNo ${freightBill.trasnporterInvoiceNo}');
|
||||
return DataRow(
|
||||
cells: [
|
||||
editableCell(index, "${freightBill.plantCode}"),
|
||||
editableCell(index, "${freightBill.status}"),
|
||||
editableCell(
|
||||
index, "${freightBill.plantCode}"),
|
||||
editableCell(
|
||||
index, "${freightBill.materialCode}"),
|
||||
editableCell(
|
||||
index,
|
||||
freightBill.freightbillCode ?? "-",
|
||||
isLink: true,
|
||||
onTap: () {
|
||||
showFreightBillDetailsDialog(
|
||||
context, freightBill);
|
||||
onTap: () async {
|
||||
print(
|
||||
'Freight Bill Code: ${freightBill.freightbillCode}');
|
||||
controller.freightBillCode.value =
|
||||
freightBill.freightbillCode ?? "";
|
||||
await controller.getSubFreightBillsView();
|
||||
showFreightBillDetailsDialog(context);
|
||||
},
|
||||
),
|
||||
editableCell(
|
||||
|
@ -497,8 +487,8 @@ class ViewFreightBill extends StatelessWidget {
|
|||
"${freightBill.trasnporterInvoiceNo ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.trasnporterInvoiceNoDate ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.billingQty ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.billingQty ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.uom ?? "-"}"),
|
||||
editableCell(index,
|
||||
|
@ -575,208 +565,44 @@ class ViewFreightBill extends StatelessWidget {
|
|||
// controller.onPageChanged(page);
|
||||
// },
|
||||
// ),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
// Obx(() {
|
||||
// if (controller.freightViewLoader.value) {
|
||||
// return Center(
|
||||
// child: CircularProgressIndicator(
|
||||
// color: AppColors.primaryClr,
|
||||
// ),
|
||||
// );
|
||||
// } else {
|
||||
// return Column(
|
||||
// children: [
|
||||
// Scrollbar(
|
||||
// thumbVisibility: true,
|
||||
// controller: verticalScrollController,
|
||||
// child: SingleChildScrollView(
|
||||
// controller: verticalScrollController,
|
||||
// child: Scrollbar(
|
||||
// thumbVisibility: true,
|
||||
// controller: horizontalScrollController,
|
||||
// child: SingleChildScrollView(
|
||||
// scrollDirection: Axis.horizontal,
|
||||
// controller: horizontalScrollController,
|
||||
// child: Container(
|
||||
// decoration: BoxDecoration(
|
||||
// border: Border.all(
|
||||
// color: Colors.grey.shade400,
|
||||
// width: 1.0,
|
||||
// ),
|
||||
// ),
|
||||
// child: DataTable(
|
||||
// dataRowHeight: 28,
|
||||
// headingRowHeight: 38,
|
||||
// headingRowColor:
|
||||
// WidgetStateProperty.all(AppColors.clrF2),
|
||||
// border: TableBorder(
|
||||
// horizontalInside:
|
||||
// BorderSide(color: AppColors.clrGrey),
|
||||
// verticalInside:
|
||||
// BorderSide(color: AppColors.clrGrey),
|
||||
// bottom: BorderSide(color: AppColors.clrGrey),
|
||||
// left: BorderSide(color: AppColors.clrGrey),
|
||||
// right: BorderSide(color: AppColors.clrGrey),
|
||||
// top: BorderSide(color: AppColors.clrGrey),
|
||||
// ),
|
||||
// columns: [
|
||||
//
|
||||
// dataColumn(AppStrings.plant),
|
||||
// dataColumn(
|
||||
// AppStrings.productName,
|
||||
// onSort: (_, __) =>
|
||||
// controller.changeSort(
|
||||
// AppStrings.productName.toLowerCase()),
|
||||
// ),
|
||||
// dataColumn(AppStrings.freightBillNo),
|
||||
// dataColumn(AppStrings.freightBillDate),
|
||||
// dataColumn(AppStrings.freightInvoice),
|
||||
// dataColumn(AppStrings.freightInvoiceDate),
|
||||
// dataColumn(AppStrings.billingQty),
|
||||
// dataColumn(AppStrings.uom),
|
||||
// dataColumn(AppStrings.freightAmount),
|
||||
// dataColumn(AppStrings.cGST),
|
||||
// dataColumn(AppStrings.sGST),
|
||||
// dataColumn(AppStrings.iGST),
|
||||
// dataColumn(AppStrings.totalGst),
|
||||
// dataColumn(AppStrings.totalInvoiceAmt),
|
||||
// dataColumn(AppStrings.cCN),
|
||||
// dataColumn(AppStrings.cCNDate),
|
||||
// dataColumn(AppStrings.miroStatus),
|
||||
// dataColumn(AppStrings.gstHold),
|
||||
// dataColumn(AppStrings.gstRelease),
|
||||
// dataColumn(AppStrings.utrNo),
|
||||
// dataColumn(AppStrings.utrDate),
|
||||
// dataColumn(AppStrings.amount),
|
||||
// dataColumn("${AppStrings.utrNo} 1"),
|
||||
// dataColumn(AppStrings.utrDate),
|
||||
// dataColumn("${AppStrings.amount} 1"),
|
||||
// dataColumn("${AppStrings.utrNo} 2"),
|
||||
// dataColumn(AppStrings.utrDate),
|
||||
// dataColumn("${AppStrings.amount} 2"),
|
||||
// dataColumn("${AppStrings.utrNo} 3"),
|
||||
// dataColumn(AppStrings.utrDate),
|
||||
// dataColumn("${AppStrings.amount} 3"),
|
||||
// dataColumn("${AppStrings.utrNo} 4"),
|
||||
// dataColumn(AppStrings.utrDate),
|
||||
// dataColumn("${AppStrings.amount} 4"),
|
||||
// dataColumn("${AppStrings.utrNo} 5"),
|
||||
// dataColumn(AppStrings.utrDate),
|
||||
// dataColumn("${AppStrings.amount} 5"),
|
||||
// ],
|
||||
// rows: List<DataRow>.generate(
|
||||
// controller.freightBillData.length, (index) {
|
||||
// final freightBill =
|
||||
// controller.freightBillData[index];
|
||||
// return DataRow(
|
||||
// cells: [
|
||||
//
|
||||
// editableCell(
|
||||
// index, "${freightBill.plantCode}"),
|
||||
// editableCell(index, "${freightBill.status}"),
|
||||
// editableCell(
|
||||
// index,
|
||||
// "${freightBill.freightbillId}",
|
||||
// isLink: true,
|
||||
// onTap: () {
|
||||
// showFreightBillDetailsDialog(
|
||||
// context, freightBill);
|
||||
// },
|
||||
// ),
|
||||
// editableCell(
|
||||
// index, "${freightBill.utr1Date}"),
|
||||
// editableCell(index,
|
||||
// "${freightBill.trasnporterInvoiceNo}"),
|
||||
// editableCell(index,
|
||||
// "${freightBill
|
||||
// .trasnporterInvoiceNoDate}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.billingQty}"),
|
||||
// editableCell(index, "${freightBill.uom}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.freightAmount}"),
|
||||
// editableCell(index, "${freightBill.cgst}"),
|
||||
// editableCell(index, "${freightBill.sgst}"),
|
||||
// editableCell(index, "${freightBill.igst}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.totalGst}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.totalGst}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.freightAmount}"),
|
||||
// editableCell(index,
|
||||
// "${freightBill
|
||||
// .trasnporterInvoiceNoDate}"),
|
||||
// editableCell(index, "${freightBill.status}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.totalGst}"),
|
||||
// editableCell(index,
|
||||
// "${freightBill
|
||||
// .trasnporterInvoiceNoDate}"),
|
||||
// editableCell(index, "${freightBill.utr5No}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.utr1Date}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.freightAmount}"),
|
||||
// editableCell(index, "${freightBill.utr1No}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.utr1Date}"),
|
||||
// editableCell(index,
|
||||
// "${freightBill.utr1PaymentAmount}"),
|
||||
// editableCell(index, "${freightBill.utr2No}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.utr2Date}"),
|
||||
// editableCell(index,
|
||||
// "${freightBill.utr2PaymentAmount}"),
|
||||
// editableCell(index, "${freightBill.utr3No}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.utr3Date}"),
|
||||
// editableCell(index,
|
||||
// "${freightBill.utr3PaymentAmount}"),
|
||||
// editableCell(index, "${freightBill.utr4No}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.utr4Date}"),
|
||||
// editableCell(index,
|
||||
// "${freightBill.utr4PaymentAmount}"),
|
||||
// editableCell(index, "${freightBill.utr5No}"),
|
||||
// editableCell(
|
||||
// index, "${freightBill.utr5Date}"),
|
||||
// editableCell(index,
|
||||
// "${freightBill.utr5PaymentAmount}"),
|
||||
// ],
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// // CustomPagination(
|
||||
// // currentPage: controller.currentPage.value,
|
||||
// // totalPages: controller.totalPages.value,
|
||||
// // onPageChanged: (int page) {
|
||||
// // controller.onPageChanged(page);
|
||||
// // },
|
||||
// // ),
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
// }),
|
||||
CustomPagination(
|
||||
currentPage: controller.currentPage.value,
|
||||
totalPages: controller.totalPages.value,
|
||||
onPageChanged: (int page) {
|
||||
controller.onPageChanged(page);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
void showFreightBillDetailsDialog(
|
||||
BuildContext context, FreightBill freightBill) {
|
||||
void showFreightBillDetailsDialog(BuildContext context) {
|
||||
final TransportController contr = Get.put(TransportController());
|
||||
final ScrollController horizontalScrollController = ScrollController();
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
return Dialog(
|
||||
backgroundColor: Colors.white,
|
||||
title: Text(
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: MediaQuery.of(context).size.height * 0.6,
|
||||
maxWidth: MediaQuery.of(context).size.width * 0.9,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Text(
|
||||
"TRANSPORTER NAME",
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
|
@ -784,111 +610,125 @@ class ViewFreightBill extends StatelessWidget {
|
|||
fontSize: 24,
|
||||
),
|
||||
),
|
||||
content: Column(
|
||||
),
|
||||
Expanded(
|
||||
child: contr.grnListDialog == null ||
|
||||
contr.grnListDialog.isEmpty
|
||||
? Center(child: Text('No data available.'))
|
||||
: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("${AppStrings.freightBill} ${freightBill.freightbillId}"),
|
||||
Text("${AppStrings.freightDate} ${freightBill.statusDate}"),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"${AppStrings.freightBill} ${contr.dialogCode ?? "-"}"),
|
||||
Text(
|
||||
"${AppStrings.freightDate} ${contr.dialogDate ?? "-"}"),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
Scrollbar(
|
||||
thumbVisibility: true,
|
||||
controller: verticalScrollController,
|
||||
child: SingleChildScrollView(
|
||||
controller: verticalScrollController,
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Scrollbar(
|
||||
thumbVisibility: true,
|
||||
controller: horizontalScrollController,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
controller: horizontalScrollController,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Colors.grey.shade400,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: DataTable(
|
||||
dataRowHeight: 28,
|
||||
headingRowHeight: 38,
|
||||
dataRowHeight: 40,
|
||||
headingRowHeight: 40,
|
||||
headingRowColor:
|
||||
WidgetStateProperty.all(AppColors.clrF2),
|
||||
MaterialStateProperty.all(
|
||||
AppColors.clrF2),
|
||||
border: TableBorder(
|
||||
horizontalInside:
|
||||
BorderSide(color: AppColors.clrGrey),
|
||||
verticalInside:
|
||||
BorderSide(color: AppColors.clrGrey),
|
||||
bottom: BorderSide(color: AppColors.clrGrey),
|
||||
left: BorderSide(color: AppColors.clrGrey),
|
||||
right: BorderSide(color: AppColors.clrGrey),
|
||||
top: BorderSide(color: AppColors.clrGrey),
|
||||
horizontalInside: BorderSide(
|
||||
color: AppColors.clrGrey),
|
||||
verticalInside: BorderSide(
|
||||
color: AppColors.clrGrey),
|
||||
bottom: BorderSide(
|
||||
color: AppColors.clrGrey),
|
||||
left: BorderSide(
|
||||
color: AppColors.clrGrey),
|
||||
right: BorderSide(
|
||||
color: AppColors.clrGrey),
|
||||
top: BorderSide(
|
||||
color: AppColors.clrGrey),
|
||||
),
|
||||
columns: [
|
||||
dataColumn(AppStrings.mrnNo),
|
||||
dataColumn(
|
||||
AppStrings.viewGrnDetails),
|
||||
dataColumn(
|
||||
AppStrings.plantName,
|
||||
onSort: (_, __) => controller.changeSort(
|
||||
AppStrings.productName.toLowerCase()),
|
||||
onSort: (_, __) =>
|
||||
controller.changeSort(
|
||||
AppStrings.productName
|
||||
.toLowerCase()),
|
||||
),
|
||||
dataColumn(AppStrings.product),
|
||||
dataColumn(AppStrings.date),
|
||||
dataColumn(AppStrings.fromLocDesc),
|
||||
dataColumn(AppStrings.vehicleNo),
|
||||
dataColumn(AppStrings.transporterLrNo),
|
||||
dataColumn(AppStrings.transporterLrNoDate),
|
||||
dataColumn(
|
||||
AppStrings.transporterLrNo),
|
||||
dataColumn(
|
||||
AppStrings.transporterLrNoDate),
|
||||
dataColumn(AppStrings.dispQty),
|
||||
dataColumn(AppStrings.netQty),
|
||||
dataColumn(AppStrings.billingQty),
|
||||
dataColumn(AppStrings.uom),
|
||||
dataColumn(AppStrings.freightBill),
|
||||
dataColumn(AppStrings.freightAmount),
|
||||
dataColumn(AppStrings.freightRate),
|
||||
dataColumn(
|
||||
AppStrings.freightAmount),
|
||||
],
|
||||
rows: List<DataRow>.generate(
|
||||
controller.freightBillData.length, (index) {
|
||||
contr.grnListDialog.length,
|
||||
(index) {
|
||||
final freightBill =
|
||||
controller.freightBillData[index];
|
||||
contr.grnListDialog[index];
|
||||
return DataRow(
|
||||
cells: [
|
||||
editableCell(index, "${freightBill.plantCode}"),
|
||||
editableCell(
|
||||
index, "${freightBill.materialCode}"),
|
||||
editableCell(index,
|
||||
"${freightBill.grnNo}"),
|
||||
editableCell(index,
|
||||
"${freightBill.plantCode} - ${freightBill.plantDesc}"),
|
||||
editableCell(
|
||||
index,
|
||||
"${freightBill.freightbillId}",
|
||||
isLink: true,
|
||||
onTap: () {
|
||||
showFreightBillDetailsDialog(
|
||||
context, freightBill);
|
||||
},
|
||||
"${freightBill.materialCode} - ${freightBill.materialDescription}",
|
||||
),
|
||||
editableCell(
|
||||
index, "${freightBill.utr1Date ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.trasnporterInvoiceNo ?? "-"}"),
|
||||
"${freightBill.grnDate ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.trasnporterInvoiceNoDate ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.billingQty ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.uom ?? "-"}"),
|
||||
"${freightBill.fromLocation ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.freightAmount ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.cgst ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.sgst ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.igst ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.totalGst ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.totalGst ?? "-"}"),
|
||||
"${freightBill.vehicleNo ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.transporterCode ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.lrDate ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.dispQty ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.netQty ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.billingQty ?? "-"}"),
|
||||
editableCell(index, "-"),
|
||||
editableCell(index,
|
||||
"${freightBill.freightRate ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.shipmentCost ?? "-"}"),
|
||||
],
|
||||
);
|
||||
}),
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -897,15 +737,27 @@ class ViewFreightBill extends StatelessWidget {
|
|||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 16.0, bottom: 16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
CommonBtn(
|
||||
bkClr: Colors.white,
|
||||
text: AppStrings.back,
|
||||
text: AppStrings.close,
|
||||
clickAction: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shayog/components/common/custom_drop_down.dart';
|
||||
import 'package:shayog/components/common/data_cell.dart';
|
||||
import 'package:shayog/components/styles/textStyles.dart';
|
||||
import 'package:shayog/feature/presentation/screens/transporter/view/sub_views/invoice_management_screen.dart';
|
||||
import 'package:shayog/feature/presentation/screens/transporter/view/sub_views/report_screen.dart';
|
||||
|
@ -16,6 +20,8 @@ import 'sub_views/generate_fright_bill.dart';
|
|||
import 'sub_views/pending_generation.dart';
|
||||
import 'sub_views/view_freight_bill.dart';
|
||||
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
class TransportView extends StatefulWidget {
|
||||
const TransportView({super.key});
|
||||
|
||||
|
@ -24,12 +30,16 @@ class TransportView extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _TransportViewState extends State<TransportView> {
|
||||
final ctrl = Get.put(TransportController());
|
||||
// final ctrl = Get.put(TransportController());
|
||||
final ctrl = Get.put(TransportController(), permanent: true);
|
||||
final ScrollController horizontalScrollController = ScrollController();
|
||||
final ScrollController verticalScrollController = ScrollController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView(
|
||||
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
@ -47,6 +57,7 @@ class _TransportViewState extends State<TransportView> {
|
|||
() => InkWell(
|
||||
onTap: () {
|
||||
ctrl.selectedIndex.value = index;
|
||||
ctrl.selectedUser.value =0;
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
@ -104,8 +115,218 @@ class _TransportViewState extends State<TransportView> {
|
|||
);
|
||||
}
|
||||
|
||||
_dashboardView() {
|
||||
_tableView() {
|
||||
return Column(
|
||||
children: [
|
||||
Scrollbar(
|
||||
thumbVisibility: true,
|
||||
controller: verticalScrollController,
|
||||
child: SingleChildScrollView(
|
||||
controller: verticalScrollController,
|
||||
child: Scrollbar(
|
||||
thumbVisibility: true,
|
||||
controller: horizontalScrollController,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
controller: horizontalScrollController,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Colors.grey.shade400,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child: DataTable(
|
||||
dataRowHeight: 40,
|
||||
headingRowHeight: 40,
|
||||
headingRowColor: WidgetStateProperty.all(AppColors.clrF2),
|
||||
border: TableBorder(
|
||||
horizontalInside: BorderSide(color: AppColors.clrGrey),
|
||||
verticalInside: BorderSide(color: AppColors.clrGrey),
|
||||
bottom: BorderSide(color: AppColors.clrGrey),
|
||||
left: BorderSide(color: AppColors.clrGrey),
|
||||
right: BorderSide(color: AppColors.clrGrey),
|
||||
top: BorderSide(color: AppColors.clrGrey),
|
||||
),
|
||||
columns: [
|
||||
dataColumn("Refrence No."),
|
||||
//dataColumn(AppStrings.productName, onSort: (_, __) => ctrl.changeSort(AppStrings.productName.toLowerCase())),
|
||||
dataColumn("Freight Bill No."),
|
||||
//dataColumn(AppStrings.getInvoiceDate),
|
||||
dataColumn("Freight Bill date"),
|
||||
dataColumn("Invoice No."),
|
||||
dataColumn("Invoice Date"),
|
||||
dataColumn("Invoice Amount"),
|
||||
dataColumn("CCN Amount"),
|
||||
dataColumn("View CCN"),
|
||||
dataColumn("Product Type"),
|
||||
dataColumn("View Invoice"),
|
||||
dataColumn("Add Signature"),
|
||||
],
|
||||
rows: List<DataRow>.generate(ctrl.getInvoiceData.length,
|
||||
(index) {
|
||||
final getInvoice = ctrl.getInvoiceData[index];
|
||||
return DataRow(
|
||||
cells: [
|
||||
editableCell(index, "${getInvoice.invoiceId}"),
|
||||
editableCell(index, getInvoice.freightbillCode),
|
||||
editableCell(
|
||||
index,
|
||||
DateFormat("dd MMMM yyyy").format(
|
||||
DateTime.parse('${getInvoice.createdOn}'))),
|
||||
editableCell(
|
||||
index, "${getInvoice.sapReferenceno ?? "-"}"),
|
||||
editableCell(
|
||||
index,
|
||||
DateFormat("d MMMM yyyy").format(DateTime.parse(
|
||||
'${getInvoice.shipmentCostDate}'))),
|
||||
editableCell(
|
||||
index, "${getInvoice.shipmentCost ?? "-"}"),
|
||||
editableCell(index,"${getInvoice.statusId?? "-"}"),
|
||||
editableCell(index, getInvoice.materialCode?? "-"),
|
||||
editableCell(index, getInvoice.materialDescription, isLink: true),
|
||||
editableCell(index,getInvoice. status?? "-"),
|
||||
editableCell(index, getInvoice.plantCode?? "-", isLink: true),
|
||||
DataCell(
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.blue),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () { },
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.download,
|
||||
size: 16, color: Colors.blue),
|
||||
SizedBox(width: 4),
|
||||
Text('Download',
|
||||
style: TextStyle(
|
||||
color: Colors.blue,
|
||||
fontSize: 12)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Container(
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.blue),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () => handleFileUpload(index),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.upload,
|
||||
size: 16, color: Colors.blue),
|
||||
SizedBox(width: 4),
|
||||
Text('Upload',
|
||||
style: TextStyle(
|
||||
color: Colors.blue,
|
||||
fontSize: 12)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
//###################### This Function is used to close or cut uploaded File in Local #######################
|
||||
// if (uploadedFiles.containsKey(index))
|
||||
// IconButton(
|
||||
// icon: Icon(Icons.close, size: 16, color: Colors.red),
|
||||
// onPressed: () {
|
||||
// setState(() {
|
||||
// uploadedFiles.remove(index);
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
|
||||
//###########################################################################################################
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// CustomPagination(
|
||||
// currentPage: controller.currentPage.value,
|
||||
// totalPages: controller.totalPages.value,
|
||||
// onPageChanged: (int page) {
|
||||
// controller.onPageChanged(page);
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> handleFileUpload(int index) async {
|
||||
try {
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
||||
type: FileType.custom,
|
||||
allowedExtensions: ['pdf', 'doc', 'docx', 'xlsx', 'xls'],
|
||||
allowMultiple: false,
|
||||
);
|
||||
|
||||
if (result != null) {
|
||||
PlatformFile file = result.files.first;
|
||||
|
||||
// Validate file size (optional)
|
||||
if (file.size > 10 * 1024 * 1024) { // 10MB limit
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('File size must be less than 10MB'),
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
);
|
||||
return;
|
||||
}
|
||||
final appDir = await getApplicationDocumentsDirectory();
|
||||
final String filePath = '${appDir.path}/${file.name}';
|
||||
File(file.path!).copy(filePath);
|
||||
setState(() {
|
||||
//uploadedFiles[index] = file.name;
|
||||
});
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('File uploaded: ${file.name}'),
|
||||
backgroundColor: Colors.green,
|
||||
),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('Error uploading file: ${e.toString()}'),
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_commonText(String title) {
|
||||
return Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 13, color: Colors.black, fontWeight: FontWeight.w900),
|
||||
);
|
||||
}
|
||||
|
||||
_dashboardView() {
|
||||
return RawScrollbar(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
|
@ -127,6 +348,10 @@ class _TransportViewState extends State<TransportView> {
|
|||
() => InkWell(
|
||||
onTap: () {
|
||||
ctrl.selectedUser.value = index;
|
||||
ctrl.refreshApis();
|
||||
ctrl.isFilterVisibleViewFreight.value = false;
|
||||
ctrl.isFilterVisiblePendingGeneration.value = false;
|
||||
ctrl.isFilterVisibleGenerateFreight.value = false;
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 10, top: 10),
|
||||
|
@ -154,9 +379,16 @@ class _TransportViewState extends State<TransportView> {
|
|||
itemCount: 3,
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ctrl.refreshApis();
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
InkWell(
|
||||
child: Image.asset(AppImages.refresh,
|
||||
height: 16, width: 16)),
|
||||
height: 16, width: 16),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
|
@ -164,22 +396,23 @@ class _TransportViewState extends State<TransportView> {
|
|||
style: 12.txtBoldWhite,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
],
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
if (ctrl.selectedUser.value == 0) {
|
||||
ctrl.toggleFilter();
|
||||
}
|
||||
else if(ctrl.selectedUser.value == 1){
|
||||
} else if (ctrl.selectedUser.value == 1) {
|
||||
ctrl.toggleViewFreight();
|
||||
}
|
||||
|
||||
else if(ctrl.selectedUser.value == 2){
|
||||
} else if (ctrl.selectedUser.value == 2) {
|
||||
ctrl.togglePending();
|
||||
}
|
||||
},
|
||||
child:
|
||||
Image.asset(AppImages.filter, height: 16, width: 16),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(AppImages.filter,
|
||||
height: 16, width: 16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: TextView(
|
||||
|
@ -188,9 +421,10 @@ class _TransportViewState extends State<TransportView> {
|
|||
),
|
||||
),
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Obx(() {
|
||||
switch (ctrl.selectedUser.value) {
|
||||
case 0:
|
||||
|
@ -207,6 +441,7 @@ class _TransportViewState extends State<TransportView> {
|
|||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'dart:convert';
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:shayog/components/styles/app_images.dart';
|
||||
import 'package:shayog/feature/presentation/screens/transporter/model/sub_freight_view_dialog_model.dart';
|
||||
import 'package:shayog/services/network/get_requests.dart';
|
||||
import '../../../../../../components/common/common_model.dart';
|
||||
import '../../../../../../components/styles/app_strings.dart';
|
||||
|
@ -10,6 +11,7 @@ import '../../../../../../components/styles/app_strings.dart';
|
|||
import '../../../../../../services/model/generate_freight_model.dart';
|
||||
import '../../../../../../services/network/post_request.dart';
|
||||
import '../model/freightbill_res_model.dart';
|
||||
import '../model/get_invoice_response.dart';
|
||||
import '../model/grn_panding_res_model.dart';
|
||||
import '../model/view_freight_bill_res_model.dart';
|
||||
|
||||
|
@ -18,12 +20,17 @@ class TransportController extends GetxController {
|
|||
final ScrollController verticalScrollController = ScrollController();
|
||||
var selectedIndex = 0.obs;
|
||||
var selectedUser = 0.obs;
|
||||
var getInvoiceData = <GetInvoiceContent>[].obs;
|
||||
var invoiceViewLoader = false.obs;
|
||||
|
||||
// for generate freight
|
||||
RxString selectPlant = ''.obs;
|
||||
var selectProduct = ''.obs;
|
||||
var selectLocation = ''.obs;
|
||||
var selectTransactionType = ''.obs;
|
||||
var dialogCode = ''.obs;
|
||||
var dialogDate = DateTime.now().obs;
|
||||
RxList<Grn> grnListDialog = <Grn>[].obs;
|
||||
|
||||
// for generate freight bill
|
||||
RxString selectPlantFreight = ''.obs;
|
||||
|
@ -42,16 +49,17 @@ class TransportController extends GetxController {
|
|||
RxString selectPlantViewFreight = ''.obs;
|
||||
var selectProductViewFreight = ''.obs;
|
||||
var selectLocationViewFreight = ''.obs;
|
||||
var selectTransactionTypeViewFreight = ''.obs;
|
||||
var selectedItem = false.obs;
|
||||
var grnDetails = <Content>[].obs;
|
||||
var product = <Prodect>[].obs;
|
||||
var plant = <Plant>[].obs;
|
||||
var freightBill = [].obs;
|
||||
var freightBill = <String>[].obs;
|
||||
var selectFreightBillValidate = ''.obs;
|
||||
var fromLocation = [].obs;
|
||||
var grnList = [].obs;
|
||||
RxBool showE = false.obs;
|
||||
RxBool selectAllField = false.obs;
|
||||
RxString freightBillCode = "".obs;
|
||||
|
||||
void toggleSelection(int index, bool? value) {
|
||||
grnDetails[index].isSelected = value!;
|
||||
|
@ -91,6 +99,11 @@ class TransportController extends GetxController {
|
|||
}
|
||||
}
|
||||
|
||||
void navigateToInvoiceTab() {
|
||||
selectedUser.value = 1;
|
||||
refreshApis();
|
||||
}
|
||||
|
||||
void selectAll(bool value) {
|
||||
for (var item in grnDetails) {
|
||||
item.isSelected = value;
|
||||
|
@ -125,8 +138,8 @@ class TransportController extends GetxController {
|
|||
|
||||
void validateFieldsViewFreightBill() {
|
||||
showPlantErrorViewFreight.value = selectPlantViewFreight.value.isEmpty;
|
||||
// showTransactionErrorViewFreight.value =
|
||||
// selectTransactionTypeViewFreight.value.isEmpty;
|
||||
showTransactionErrorViewFreight.value =
|
||||
selectFreightBillValidate.value.isEmpty;
|
||||
showProductErrorViewFreight.value = selectProductViewFreight.value.isEmpty;
|
||||
}
|
||||
|
||||
|
@ -139,12 +152,46 @@ class TransportController extends GetxController {
|
|||
|
||||
@override
|
||||
void onInit() {
|
||||
refreshApis();
|
||||
getInvoiceView();
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
refreshApis() {
|
||||
getFreightBills();
|
||||
viewFreightView();
|
||||
grnPending();
|
||||
getSubFreightBillsView();
|
||||
postData();
|
||||
}
|
||||
|
||||
super.onInit();
|
||||
|
||||
getInvoiceView() async {
|
||||
try {
|
||||
invoiceViewLoader.value = true;
|
||||
|
||||
Map<String, String> requestBody = {
|
||||
"invoice_id":"",
|
||||
"freightBillNo":"",
|
||||
"invFromDate":"",
|
||||
"invToDate":"",
|
||||
"freightFromDate":"",
|
||||
"freightToDate":""
|
||||
};
|
||||
|
||||
var response = await PostRequests.getInvoice(requestBody);
|
||||
if (response != null) {
|
||||
List<GetInvoiceContent> flattenedContent =
|
||||
response.content!.expand((list) => list).toList();
|
||||
getInvoiceData.assignAll(flattenedContent);
|
||||
// print("response from${getInvoiceData[0].freightbillCode.runtimeType} view freight bill ${freightBillData[0].plantCode.runtimeType} and ${freightBillData[0].materialCode.runtimeType} and}");
|
||||
totalPages.value = response.totalPages ?? 0;
|
||||
totalElements.value = response.totalElements ?? 0;
|
||||
print('res from invoice ${response.toString()}');
|
||||
}
|
||||
} finally {
|
||||
invoiceViewLoader.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
var transactionType = ['STO', 'INBOUND'];
|
||||
|
@ -299,7 +346,6 @@ class TransportController extends GetxController {
|
|||
showPlantError.value = false;
|
||||
showProductError.value = false;
|
||||
showTransactionError.value = false;
|
||||
postData();
|
||||
}
|
||||
|
||||
void clearFiltersPendingGeneration() {
|
||||
|
@ -310,18 +356,16 @@ class TransportController extends GetxController {
|
|||
showPlantErrorPending.value = false;
|
||||
showProductErrorPending.value = false;
|
||||
showTransactionErrorPending.value = false;
|
||||
postData();
|
||||
}
|
||||
|
||||
void clearFiltersViewFreight() {
|
||||
selectPlantViewFreight.value = '';
|
||||
selectProductViewFreight.value = '';
|
||||
// selectTransactionTypeViewFreight.value = '';
|
||||
selectFreightBillValidate.value = '';
|
||||
fromController.clear();
|
||||
showPlantErrorViewFreight.value = false;
|
||||
showProductErrorViewFreight.value = false;
|
||||
showTransactionErrorViewFreight.value = false;
|
||||
postData();
|
||||
}
|
||||
|
||||
getFreightBills() async {
|
||||
|
@ -330,7 +374,6 @@ class TransportController extends GetxController {
|
|||
|
||||
var response = await GetRequests.getFreightBill();
|
||||
if (response != null) {
|
||||
print("gtyfhg");
|
||||
plant.assignAll(response.plant ?? []);
|
||||
product.assignAll(response.prodect ?? []);
|
||||
freightBill.assignAll(response.freightBill ?? []);
|
||||
|
@ -341,6 +384,29 @@ class TransportController extends GetxController {
|
|||
}
|
||||
}
|
||||
|
||||
getSubFreightBillsView() async {
|
||||
try {
|
||||
isLoading.value = true;
|
||||
print('Getting details for freight bill: ${freightBillCode.value}');
|
||||
|
||||
var response =
|
||||
await GetRequests.subViewFreightDialog(freightBillCode.value);
|
||||
if (response != null) {
|
||||
dialogCode.value = response.freightBillCode ?? "";
|
||||
dialogDate.value = response.freightBillDate ?? DateTime.now();
|
||||
grnListDialog.assignAll(response.grn ?? []);
|
||||
print(
|
||||
'Response received with ${dialogCode.value} and ${dialogDate.value} ${grnListDialog.length ?? 0} GRN items');
|
||||
} else {
|
||||
print('No response received from subViewFreightDialog');
|
||||
}
|
||||
} catch (e) {
|
||||
print('Error in getSubFreightBillsView: $e');
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
final fromTextFieldKey = GlobalKey();
|
||||
TextEditingController fromController = TextEditingController();
|
||||
DateTime fromSelectedDate = DateTime.now(); // Initialize with a default value
|
||||
|
@ -442,7 +508,8 @@ class TransportController extends GetxController {
|
|||
List<FreightBill> flattenedContent =
|
||||
response.content!.expand((list) => list).toList();
|
||||
freightBillData.assignAll(flattenedContent);
|
||||
print("response from${freightBillData[0].freightbillCode.runtimeType} view freight bill ${freightBillData[0].plantCode.runtimeType} and ${freightBillData[0].materialCode.runtimeType} and}");
|
||||
print(
|
||||
"response from${freightBillData[0].freightbillCode.runtimeType} view freight bill ${freightBillData[0].plantCode.runtimeType} and ${freightBillData[0].materialCode.runtimeType} and}");
|
||||
totalPages.value = response.totalPages ?? 0;
|
||||
totalElements.value = response.totalElements ?? 0;
|
||||
}
|
||||
|
@ -477,13 +544,12 @@ class TransportController extends GetxController {
|
|||
sortField.value = field;
|
||||
sortDirection.value = "desc";
|
||||
}
|
||||
// viewFreightView(page: 0);
|
||||
|
||||
}
|
||||
|
||||
var grnPendingData = <GrnPending>[].obs;
|
||||
|
||||
grnPending() async {
|
||||
print('get pending');
|
||||
try {
|
||||
grnPendingLoader.value = true;
|
||||
|
||||
|
@ -511,186 +577,74 @@ class TransportController extends GetxController {
|
|||
}
|
||||
}
|
||||
|
||||
// void displayFilteredDataFromViewFreight() async {
|
||||
// try {
|
||||
// isLoading.value = true;
|
||||
// Map<String, String> requestBody = {
|
||||
// "plant": selectPlantViewFreight.value,
|
||||
// "productNane": selectProductViewFreight.value,
|
||||
// "freightBillNo": "",
|
||||
// "transactionType": "",
|
||||
// "fromLocation": "",
|
||||
// "grnFromDate": "",
|
||||
// "grnToDate": "",
|
||||
// };
|
||||
// print('submit call 444');
|
||||
// print('Request Body: ${jsonEncode(requestBody)}');
|
||||
//
|
||||
// print(
|
||||
// "pending Data 122 ${selectPlantViewFreight.value} and ${selectProductViewFreight.value}freightBillData: }");
|
||||
//
|
||||
// var response = await PostRequests.viewFreightBill(requestBody);
|
||||
//
|
||||
// if (response != null) {
|
||||
// List<FreightBill> flattenedContent =
|
||||
// response.content!.expand((list) => list).toList();
|
||||
// print(
|
||||
// "pending Data 1 ${selectPlantViewFreight.value} and ${selectProductViewFreight.value}freightBillData: and ${flattenedContent.length}");
|
||||
//
|
||||
// List<FreightBill> filteredData = flattenedContent.where((item) {
|
||||
// return (selectPlantViewFreight.value.isEmpty ||
|
||||
// item.plantCode == selectPlantViewFreight.value) &&
|
||||
// (selectProductViewFreight.value.isEmpty ||
|
||||
// item.materialCode == selectProductViewFreight.value
|
||||
// // &&
|
||||
// // (selectTransactionTypeViewFreight.value.isEmpty ||
|
||||
// // item.codeValue ==
|
||||
// // selectTransactionTypeViewFreight.value.toUpperCase()
|
||||
// );
|
||||
// }).toList();
|
||||
//
|
||||
// print(
|
||||
// "pending Data ${selectPlantViewFreight.value} and ${selectProductViewFreight.value}freightBillData: ${filteredData.length} and ${flattenedContent.length}");
|
||||
//
|
||||
// freightBillData.assignAll(filteredData);
|
||||
//
|
||||
// print(
|
||||
// "✅ pending Data:freightBillData ${filteredData.length} items displayed pending.");
|
||||
// } else {
|
||||
// print("❌ No response from API.");
|
||||
// }
|
||||
// } finally {
|
||||
// isLoading.value = false;
|
||||
// }
|
||||
// }
|
||||
// void displayFilteredDataFromViewFreight() async {
|
||||
// try {
|
||||
// isLoading.value = true;
|
||||
// Map<String, String> requestBody = {
|
||||
//
|
||||
// "plant":selectPlantViewFreight.value.toString(),
|
||||
// "productNane": selectProductViewFreight.value.toString(),
|
||||
// "freightBillNo": "",
|
||||
// "transactionType": "",
|
||||
// "fromLocation": "",
|
||||
// "grnFromDate": "",
|
||||
// "grnToDate": ""
|
||||
// };
|
||||
//
|
||||
// print('Request Body: ${jsonEncode(requestBody)}');
|
||||
//
|
||||
// var response = await PostRequests.viewFreightBill(requestBody);
|
||||
//
|
||||
//
|
||||
//
|
||||
// List<FreightBill> flattenedContent = response!.content!.expand((list) => list).toList();
|
||||
// print("Flattened content length: ${flattenedContent.length}");
|
||||
//
|
||||
// if (flattenedContent.isEmpty) {
|
||||
// print("No matching records found");
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// // List<FreightBill> filteredData = flattenedContent.where((item) {
|
||||
// // bool plantMatch = selectPlantViewFreight.value.isEmpty ||
|
||||
// // item.plantCode?.trim() == selectPlantViewFreight.value.trim();
|
||||
// // bool productMatch = selectProductViewFreight.value.isEmpty ||
|
||||
// // item.materialCode?.trim() == selectProductViewFreight.value.trim();
|
||||
// //
|
||||
// // return plantMatch && productMatch;
|
||||
// // }).toList();
|
||||
// List<FreightBill> filteredData = flattenedContent.where((item) {
|
||||
// // Print raw item data first
|
||||
// print("Checking item: ${jsonEncode(item.toJson())}");
|
||||
//
|
||||
// // Print values being compared
|
||||
// print("Comparing: Plant '${item.plantCode}' with '${selectPlantViewFreight.value}'");
|
||||
// print("Comparing: Product '${item.materialCode}' with '${selectProductViewFreight.value}'");
|
||||
//
|
||||
// bool plantMatch = selectPlantViewFreight.value.isEmpty ||
|
||||
// item.plantCode?.trim() == selectPlantViewFreight.value.trim();
|
||||
// print("Plant match result: $plantMatch");
|
||||
//
|
||||
// bool productMatch = selectProductViewFreight.value.isEmpty ||
|
||||
// item.materialCode?.trim() == selectProductViewFreight.value.trim();
|
||||
// print("Product match result: $productMatch");
|
||||
//
|
||||
// final result = plantMatch && productMatch;
|
||||
// print("Final match result: $result");
|
||||
// print("------------------------");
|
||||
//
|
||||
// return result;
|
||||
// }).toList();
|
||||
//
|
||||
// // Print final results
|
||||
// print("Total items after filtering: ${filteredData.length}");
|
||||
// if (filteredData.isNotEmpty) {
|
||||
// print("First matched item: ${jsonEncode(filteredData.first.toJson())}");
|
||||
// }
|
||||
// freightBillData.assignAll(filteredData);
|
||||
// print("Filtered Data: ${filteredData.length} items");
|
||||
//
|
||||
// } catch (e) {
|
||||
// print("Error in displayFilteredDataFromViewFreight: $e");
|
||||
//
|
||||
// } finally {
|
||||
// isLoading.value = false;
|
||||
// }
|
||||
// }
|
||||
void displayFilteredDataFromViewFreight() async {
|
||||
try {
|
||||
freightViewLoader.value = true;
|
||||
Map<String, String> requestBody = {
|
||||
"plant": selectPlantViewFreight.value,
|
||||
"productNane": selectProductViewFreight.value,
|
||||
"freightBillNo": "",
|
||||
"freightBillNo": selectFreightBillValidate.value,
|
||||
"transactionType": "",
|
||||
"fromLocation": "",
|
||||
"grnFromDate": "",
|
||||
"grnToDate": "",
|
||||
};
|
||||
|
||||
// Debug log for request
|
||||
print("Filter request with Plant: ${selectPlantViewFreight.value}, Product: ${selectProductViewFreight.value}");
|
||||
print("Filter request - Plant: ${selectPlantViewFreight.value}, "
|
||||
"Product: ${selectProductViewFreight.value}, "
|
||||
"Freight Bill: ${selectFreightBillValidate.value}");
|
||||
|
||||
var response = await PostRequests.viewFreightBill(requestBody);
|
||||
|
||||
if (response != null) {
|
||||
List<FreightBill> flattenedContent =
|
||||
response.content!.expand((list) => list).toList();
|
||||
|
||||
print("Total records before filtering: ${flattenedContent.length}");
|
||||
|
||||
// If first item exists, log its types for debugging
|
||||
// Log sample data for debugging if available
|
||||
if (flattenedContent.isNotEmpty) {
|
||||
print("Sample data types - Plant: ${flattenedContent[0].plantCode.runtimeType}, "
|
||||
"Material: ${flattenedContent[0].materialCode.runtimeType}");
|
||||
print("Sample data - Plant: ${flattenedContent[0].plantCode}, "
|
||||
"Material: ${flattenedContent[0].materialCode}, "
|
||||
"Freight Bill: ${flattenedContent[0].freightbillCode}");
|
||||
}
|
||||
|
||||
List<FreightBill> filteredData = flattenedContent.where((item) {
|
||||
// Plant filter
|
||||
bool plantMatch = selectPlantViewFreight.value.isEmpty ||
|
||||
item.plantCode == selectPlantViewFreight.value;
|
||||
item.plantCode.toString().toLowerCase() ==
|
||||
selectPlantViewFreight.value.toLowerCase();
|
||||
|
||||
// Product filter
|
||||
bool productMatch = selectProductViewFreight.value.isEmpty ||
|
||||
item.materialCode == selectProductViewFreight.value;
|
||||
item.materialCode.toString().toLowerCase() ==
|
||||
selectProductViewFreight.value.toLowerCase();
|
||||
|
||||
// Debug log for matching
|
||||
print("Checking - Plant: ${item.plantCode} matches: $plantMatch, "
|
||||
"Product: ${item.materialCode} matches: $productMatch");
|
||||
// Freight bill filter
|
||||
bool freightBillMatch = selectFreightBillValidate.value.isEmpty ||
|
||||
item.freightbillCode.toString().toLowerCase() ==
|
||||
selectFreightBillValidate.value.toLowerCase();
|
||||
|
||||
return plantMatch && productMatch;
|
||||
// Debug logging for filter matches
|
||||
print("Filter matches for item ${item.freightbillCode}:"
|
||||
"\nPlant Match: $plantMatch (${item.plantCode} vs ${selectPlantViewFreight.value})"
|
||||
"\nProduct Match: $productMatch (${item.materialCode} vs ${selectProductViewFreight.value})"
|
||||
"\nFreight Bill Match: $freightBillMatch (${item.freightbillCode} vs ${selectFreightBillValidate.value})");
|
||||
|
||||
return plantMatch && productMatch && freightBillMatch;
|
||||
}).toList();
|
||||
|
||||
print("Filtered records count: ${filteredData.length}");
|
||||
|
||||
freightBillData.assignAll(filteredData);
|
||||
|
||||
// Update pagination if available
|
||||
// Update pagination values
|
||||
totalPages.value = response.totalPages ?? 0;
|
||||
totalElements.value = response.totalElements ?? 0;
|
||||
|
||||
print("✅ Freight bill data filtered: ${filteredData.length} items displayed");
|
||||
print("✅ Freight bill data filtered successfully");
|
||||
} else {
|
||||
print("❌ No response from API.");
|
||||
print("❌ No response received from API");
|
||||
freightBillData.clear();
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -698,9 +652,9 @@ class TransportController extends GetxController {
|
|||
freightBillData.clear();
|
||||
} finally {
|
||||
freightViewLoader.value = false;
|
||||
print('data');
|
||||
}
|
||||
}
|
||||
|
||||
void displayFilteredDataFromPending() async {
|
||||
try {
|
||||
isLoading.value = true;
|
||||
|
|
|
@ -6,42 +6,38 @@ import '../../../../../../components/common/data_cell.dart';
|
|||
import '../../../../../../components/styles/app_colors.dart';
|
||||
import '../../../../../../components/styles/app_strings.dart';
|
||||
import '../view_model/transport_controller.dart';
|
||||
|
||||
class CommonDialog {
|
||||
static showDialog({
|
||||
|
||||
required String message,
|
||||
|
||||
required VoidCallback onclick,
|
||||
|
||||
}) {
|
||||
Get.dialog(
|
||||
Dialog(
|
||||
backgroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
child: DialogContent(onClick: onclick,
|
||||
child: DialogContent(
|
||||
onClick: onclick,
|
||||
message: message,
|
||||
|
||||
|
||||
),
|
||||
),
|
||||
barrierDismissible: true
|
||||
);
|
||||
barrierDismissible: true);
|
||||
}
|
||||
}
|
||||
|
||||
class DialogContent extends StatelessWidget {
|
||||
DialogContent({super.key, this.message, required this.onClick});
|
||||
|
||||
String? message;
|
||||
VoidCallback onClick;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
width: 120,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min
|
||||
,
|
||||
|
||||
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
message ?? "Please Select GRN Details",
|
||||
|
@ -65,16 +61,18 @@ String? message;
|
|||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColors.primaryClr,
|
||||
fontWeight: FontWeight.bold),)
|
||||
|
||||
|
||||
fontWeight: FontWeight.bold),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void showPopup({ required BuildContext context, String? message,required VoidCallback onClick}) {
|
||||
void showPopup(
|
||||
{required BuildContext context,
|
||||
String? message,
|
||||
required VoidCallback onClick}) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
|
@ -88,10 +86,7 @@ void showPopup({ required BuildContext context, String? message,required VoidCal
|
|||
padding: EdgeInsets.all(16),
|
||||
width: 120,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min
|
||||
,
|
||||
|
||||
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
message ?? "Please Select GRN Details",
|
||||
|
@ -115,9 +110,8 @@ void showPopup({ required BuildContext context, String? message,required VoidCal
|
|||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColors.primaryClr,
|
||||
fontWeight: FontWeight.bold),)
|
||||
|
||||
|
||||
fontWeight: FontWeight.bold),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -129,12 +123,14 @@ void showPopup({ required BuildContext context, String? message,required VoidCal
|
|||
void showFreightBill(BuildContext context) {
|
||||
final controller = Get.put(TransportController());
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
|
||||
backgroundColor: AppColors.primaryClr,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(0.0), // Border radius here
|
||||
borderRadius: BorderRadius.circular(0.0),
|
||||
),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
content: Column(
|
||||
|
@ -195,8 +191,8 @@ void showFreightBill(BuildContext context) {
|
|||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Obx(() =>
|
||||
Text(
|
||||
child: Obx(
|
||||
() => Text(
|
||||
"Freight Bill No: ${controller.freightBillNo.value}",
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
|
@ -207,7 +203,10 @@ void showFreightBill(BuildContext context) {
|
|||
),
|
||||
Obx(() {
|
||||
if (controller.grnListLoader.value) {
|
||||
return Center(child: CircularProgressIndicator(color: AppColors.primaryClr,));
|
||||
return Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: AppColors.primaryClr,
|
||||
));
|
||||
}
|
||||
|
||||
if (controller.errorMessage.isNotEmpty) {
|
||||
|
@ -233,16 +232,18 @@ void showFreightBill(BuildContext context) {
|
|||
child: DataTable(
|
||||
dataRowHeight: 28,
|
||||
headingRowHeight: 38,
|
||||
headingRowColor: WidgetStateProperty.all(AppColors.clrF2),
|
||||
headingRowColor:
|
||||
WidgetStateProperty.all(AppColors.clrF2),
|
||||
border: TableBorder(
|
||||
horizontalInside: BorderSide(color: AppColors.clrGrey),
|
||||
verticalInside: BorderSide(color: AppColors.clrGrey),
|
||||
horizontalInside:
|
||||
BorderSide(color: AppColors.clrGrey),
|
||||
verticalInside:
|
||||
BorderSide(color: AppColors.clrGrey),
|
||||
bottom: BorderSide(color: AppColors.clrGrey),
|
||||
left: BorderSide(color: AppColors.clrGrey),
|
||||
right: BorderSide(color: AppColors.clrGrey),
|
||||
top: BorderSide(color: AppColors.clrGrey),
|
||||
),
|
||||
|
||||
columns: [
|
||||
dataColumn(AppStrings.srNo),
|
||||
dataColumn(AppStrings.mrnNo),
|
||||
|
@ -277,16 +278,10 @@ void showFreightBill(BuildContext context) {
|
|||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ class ApiUrls {
|
|||
static const addFreightBill =
|
||||
'bill/grndetails?page=0&size=20&sort=grn_date,desc';
|
||||
static const getFreightBills = 'bill/dropdown';
|
||||
static const getAllPayments = "http://46.28.44.130:9092/invoice/getPayments";
|
||||
static const generateFreightBill =
|
||||
'http://46.28.44.130:9092/bill/addFreightBill';
|
||||
static const createUser = 'http://46.28.44.130:9093/api/users/createUser';
|
||||
|
@ -34,6 +35,7 @@ class ApiUrls {
|
|||
"http://46.28.44.130:9093/api/user-types/usertypedetails?page=0&size=15&sort=last_updated_on,desc";
|
||||
static const grnPendingDetails =
|
||||
"http://46.28.44.130:9092/bill/grndetailsPanding?page=0&size=20&sort=grn_date,desc";
|
||||
static const viewSubDetailsOfViewFreightBill = "http://46.28.44.130:9092/bill/grndetailsByFreightBill?freightBillCode=";
|
||||
static const getInvoiceDetails = "http://46.28.44.130:9092/invoice/getInvoice";
|
||||
}
|
||||
// class ApiUrls {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:shayog/feature/presentation/screens/admin/user_management/model/get_internal_user_model.dart';
|
||||
import 'package:shayog/feature/presentation/screens/transporter/model/get_invoice_response.dart';
|
||||
import 'package:shayog/feature/presentation/screens/transporter/model/sub_freight_view_dialog_model.dart';
|
||||
import 'package:shayog/services/network/remote_services.dart';
|
||||
|
||||
import '../../feature/presentation/screens/admin/user_management/model/dropdown_res_model.dart';
|
||||
|
@ -37,4 +37,17 @@ class GetRequests {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static Future<SubFreightViewDialogModel?> subViewFreightDialog(
|
||||
String freightBillCode) async {
|
||||
var apiResponse = await RemoteService.simpleGet9090(
|
||||
'${ApiUrls.viewSubDetailsOfViewFreightBill}$freightBillCode');
|
||||
if (apiResponse != null) {
|
||||
print('valuess ${apiResponse.response}');
|
||||
return subFreightViewDialogModelFromJson(apiResponse.response!);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -153,26 +153,17 @@ class PostRequests {
|
|||
}
|
||||
}
|
||||
|
||||
// static Future<FetchInternalUserModel?> fetchEmailsAndEmpCodes(
|
||||
// Map<String, String> requestBody) async {
|
||||
// var apiResponse = await RemoteService.postUser(
|
||||
// requestBody, ApiUrls.fetchEmailsAndEmpCode);
|
||||
// if (apiResponse != null) {
|
||||
// return fetchInternalUserModelFromJson(apiResponse.response!);
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
static Future<FetchInternalUserModel?> fetchEmailsAndEmpCodes(
|
||||
Map<String, String> requestBody,String message) async {
|
||||
var apiResponse = await RemoteService.postMethod(
|
||||
requestBody, ApiUrls.fetchEmailsAndEmpCode,message);
|
||||
Map<String, String> requestBody) async {
|
||||
var apiResponse = await RemoteService.postUser(
|
||||
requestBody, ApiUrls.fetchEmailsAndEmpCode);
|
||||
if (apiResponse != null) {
|
||||
return fetchInternalUserModelFromJson(apiResponse.response!);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static Future<SelectAssignRoleModel?> selectAssignRole(
|
||||
Map<String, dynamic> requestBody) async {
|
||||
var apiResponse =
|
||||
|
@ -220,6 +211,7 @@ class PostRequests {
|
|||
Map<String, String> requestBody) async {
|
||||
var apiResponse =
|
||||
await RemoteService.postUser(requestBody, ApiUrls.getInvoiceDetails);
|
||||
print('response data from invoice ${apiResponse.toString()}');
|
||||
if (apiResponse != null) {
|
||||
return getInvoiceResponseFromJson(apiResponse.response!);
|
||||
} else {
|
||||
|
|
|
@ -250,9 +250,9 @@ class RemoteService {
|
|||
var body = json.encode(requestBody);
|
||||
final response =
|
||||
await http.post(Uri.parse(endUrl), headers: getHeaders(), body: body);
|
||||
print('${response.body}response');
|
||||
print('response data${response.body}');
|
||||
print(endUrl);
|
||||
print('${response.statusCode}response');
|
||||
print('statusCode ${response.statusCode}');
|
||||
var responseCode = response.statusCode;
|
||||
|
||||
if (Helpers.isResponseSuccessful(responseCode)) {
|
||||
|
@ -286,33 +286,6 @@ class RemoteService {
|
|||
try {
|
||||
final map = jsonDecode(response.body) as Map<String, dynamic>;
|
||||
// AppAlerts.alert(message: '${map['message']}');
|
||||
throw map['message'];
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
static Future<CommonResModel?> postMethod(
|
||||
Map<String, dynamic> requestBody, String endUrl,String message) async {
|
||||
var body = json.encode(requestBody);
|
||||
final response =
|
||||
await http.post(Uri.parse(endUrl), headers: getHeaders(), body: body);
|
||||
print('${response.body}response');
|
||||
print(endUrl);
|
||||
print('${response.statusCode}response');
|
||||
var responseCode = response.statusCode;
|
||||
|
||||
if (Helpers.isResponseSuccessful(responseCode)) {
|
||||
return CommonResModel(statusCode: responseCode, response: response.body);
|
||||
} else {
|
||||
print(response.body);
|
||||
|
||||
try {
|
||||
final map = jsonDecode(response.body) as Map<String, dynamic>;
|
||||
message = '${map['message']}';
|
||||
print("message?????${message}");
|
||||
|
||||
|
||||
throw map['message'];
|
||||
} catch (e) {
|
||||
return null;
|
||||
|
|
|
@ -6,7 +6,9 @@ import FlutterMacOS
|
|||
import Foundation
|
||||
|
||||
import file_picker
|
||||
import path_provider_foundation
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
}
|
||||
|
|
16
pubspec.lock
16
pubspec.lock
|
@ -333,22 +333,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
syncfusion_flutter_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: syncfusion_flutter_core
|
||||
sha256: "3c1876b0a245de23de3b17a19e3106fed57d88f4fd2c8dc9bc1976705b1c31d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "28.2.4"
|
||||
syncfusion_flutter_datepicker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: syncfusion_flutter_datepicker
|
||||
sha256: "889b716d9de344852f651ecdcc726b6eeb9e326d95c1bb54df95631a5d7ead68"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "28.2.4"
|
||||
table_calendar:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
@ -40,12 +40,10 @@ dependencies:
|
|||
intl: ^0.20.1
|
||||
vph_web_date_picker: ^0.0.6
|
||||
table_calendar: ^3.2.0
|
||||
syncfusion_flutter_datepicker: ^28.2.4
|
||||
file_picker: ^8.3.1
|
||||
path_provider: ^2.1.5
|
||||
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
|
Loading…
Reference in New Issue