latest code of transporter
parent
409a9f6d87
commit
87e0f7608f
|
@ -9,95 +9,124 @@ ViewFreightBillResModel viewFreightBillResModelFromJson(String str) => ViewFreig
|
|||
String viewFreightBillResModelToJson(ViewFreightBillResModel data) => json.encode(data.toJson());
|
||||
|
||||
class ViewFreightBillResModel {
|
||||
final List<List<FreightBill>>? content;
|
||||
final Pageable? pageable;
|
||||
final bool? last;
|
||||
final int? totalElements;
|
||||
final int? totalPages;
|
||||
final int? size;
|
||||
final int? number;
|
||||
final Sort? sort;
|
||||
final bool? first;
|
||||
final int? numberOfElements;
|
||||
final bool? empty;
|
||||
List<List<FreightBill>>? content;
|
||||
Pageable? pageable;
|
||||
int? totalPages;
|
||||
int? totalElements;
|
||||
bool? last;
|
||||
int? size;
|
||||
int? number;
|
||||
Sort? sort;
|
||||
int? numberOfElements;
|
||||
bool? first;
|
||||
bool? empty;
|
||||
|
||||
ViewFreightBillResModel({
|
||||
this.content,
|
||||
this.pageable,
|
||||
this.last,
|
||||
this.totalElements,
|
||||
this.totalPages,
|
||||
this.totalElements,
|
||||
this.last,
|
||||
this.size,
|
||||
this.number,
|
||||
this.sort,
|
||||
this.first,
|
||||
this.numberOfElements,
|
||||
this.first,
|
||||
this.empty,
|
||||
});
|
||||
|
||||
ViewFreightBillResModel copyWith({
|
||||
List<List<FreightBill>>? content,
|
||||
Pageable? pageable,
|
||||
int? totalPages,
|
||||
int? totalElements,
|
||||
bool? last,
|
||||
int? size,
|
||||
int? number,
|
||||
Sort? sort,
|
||||
int? numberOfElements,
|
||||
bool? first,
|
||||
bool? empty,
|
||||
}) =>
|
||||
ViewFreightBillResModel(
|
||||
content: content ?? this.content,
|
||||
pageable: pageable ?? this.pageable,
|
||||
totalPages: totalPages ?? this.totalPages,
|
||||
totalElements: totalElements ?? this.totalElements,
|
||||
last: last ?? this.last,
|
||||
size: size ?? this.size,
|
||||
number: number ?? this.number,
|
||||
sort: sort ?? this.sort,
|
||||
numberOfElements: numberOfElements ?? this.numberOfElements,
|
||||
first: first ?? this.first,
|
||||
empty: empty ?? this.empty,
|
||||
);
|
||||
|
||||
factory ViewFreightBillResModel.fromJson(Map<String, dynamic> json) => ViewFreightBillResModel(
|
||||
content: json["content"] == null ? [] : List<List<FreightBill>>.from(json["content"]!.map((x) => List<FreightBill>.from(x.map((x) => FreightBill.fromJson(x))))),
|
||||
pageable: json["pageable"] == null ? null : Pageable.fromJson(json["pageable"]),
|
||||
last: json["last"],
|
||||
totalElements: json["totalElements"],
|
||||
totalPages: json["totalPages"],
|
||||
totalElements: json["totalElements"],
|
||||
last: json["last"],
|
||||
size: json["size"],
|
||||
number: json["number"],
|
||||
sort: json["sort"] == null ? null : Sort.fromJson(json["sort"]),
|
||||
first: json["first"],
|
||||
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(),
|
||||
"last": last,
|
||||
"totalElements": totalElements,
|
||||
"totalPages": totalPages,
|
||||
"totalElements": totalElements,
|
||||
"last": last,
|
||||
"size": size,
|
||||
"number": number,
|
||||
"sort": sort?.toJson(),
|
||||
"first": first,
|
||||
"numberOfElements": numberOfElements,
|
||||
"first": first,
|
||||
"empty": empty,
|
||||
};
|
||||
}
|
||||
|
||||
class FreightBill {
|
||||
final int? freightbillId;
|
||||
final String? freightbillCode;
|
||||
final String? status;
|
||||
final DateTime? statusDate;
|
||||
final String? plantCode;
|
||||
final String? materialCode;
|
||||
final String? fromLocation;
|
||||
final int? billingQty;
|
||||
final dynamic uom;
|
||||
final double? freightAmount;
|
||||
final double? cgst;
|
||||
final double? sgst;
|
||||
final int? igst;
|
||||
final double? totalGst;
|
||||
final double? shipmentNetAmount;
|
||||
final DateTime? createdOn;
|
||||
final dynamic trasnporterInvoiceNo;
|
||||
final dynamic trasnporterInvoiceNoDate;
|
||||
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;
|
||||
int? freightbillId;
|
||||
String? freightbillCode;
|
||||
String? status;
|
||||
DateTime? statusDate;
|
||||
String? plantCode;
|
||||
String? plantDesc;
|
||||
String? materialCode;
|
||||
String? materialDescription;
|
||||
String? fromLocation;
|
||||
dynamic billingNetQty;
|
||||
dynamic uom;
|
||||
double? shipmentGrossCost;
|
||||
double? cgst;
|
||||
double? sgst;
|
||||
int? igst;
|
||||
double? totalGst;
|
||||
double? shipmentNetCost;
|
||||
DateTime? createdOn;
|
||||
dynamic transporterInvoiceNo;
|
||||
dynamic transporterInvoiceNoDate;
|
||||
dynamic utr1No;
|
||||
dynamic utr2No;
|
||||
dynamic utr3No;
|
||||
dynamic utr4No;
|
||||
dynamic utr5No;
|
||||
dynamic utr1PaymentAmount;
|
||||
dynamic utr2PaymentAmount;
|
||||
dynamic utr3PaymentAmount;
|
||||
dynamic utr4PaymentAmount;
|
||||
dynamic utr5PaymentAmount;
|
||||
dynamic utr1Date;
|
||||
dynamic utr2Date;
|
||||
dynamic utr3Date;
|
||||
dynamic utr4Date;
|
||||
dynamic utr5Date;
|
||||
|
||||
FreightBill({
|
||||
this.freightbillId,
|
||||
|
@ -105,19 +134,21 @@ class FreightBill {
|
|||
this.status,
|
||||
this.statusDate,
|
||||
this.plantCode,
|
||||
this.plantDesc,
|
||||
this.materialCode,
|
||||
this.materialDescription,
|
||||
this.fromLocation,
|
||||
this.billingQty,
|
||||
this.billingNetQty,
|
||||
this.uom,
|
||||
this.freightAmount,
|
||||
this.shipmentGrossCost,
|
||||
this.cgst,
|
||||
this.sgst,
|
||||
this.igst,
|
||||
this.totalGst,
|
||||
this.shipmentNetAmount,
|
||||
this.shipmentNetCost,
|
||||
this.createdOn,
|
||||
this.trasnporterInvoiceNo,
|
||||
this.trasnporterInvoiceNoDate,
|
||||
this.transporterInvoiceNo,
|
||||
this.transporterInvoiceNoDate,
|
||||
this.utr1No,
|
||||
this.utr2No,
|
||||
this.utr3No,
|
||||
|
@ -135,25 +166,102 @@ class FreightBill {
|
|||
this.utr5Date,
|
||||
});
|
||||
|
||||
FreightBill copyWith({
|
||||
int? freightbillId,
|
||||
String? freightbillCode,
|
||||
String? status,
|
||||
DateTime? statusDate,
|
||||
String? plantCode,
|
||||
String? plantDesc,
|
||||
String? materialCode,
|
||||
String? materialDescription,
|
||||
String? fromLocation,
|
||||
dynamic billingNetQty,
|
||||
dynamic uom,
|
||||
double? shipmentGrossCost,
|
||||
double? cgst,
|
||||
double? sgst,
|
||||
int? igst,
|
||||
double? totalGst,
|
||||
double? shipmentNetCost,
|
||||
DateTime? createdOn,
|
||||
dynamic transporterInvoiceNo,
|
||||
dynamic transporterInvoiceNoDate,
|
||||
dynamic utr1No,
|
||||
dynamic utr2No,
|
||||
dynamic utr3No,
|
||||
dynamic utr4No,
|
||||
dynamic utr5No,
|
||||
dynamic utr1PaymentAmount,
|
||||
dynamic utr2PaymentAmount,
|
||||
dynamic utr3PaymentAmount,
|
||||
dynamic utr4PaymentAmount,
|
||||
dynamic utr5PaymentAmount,
|
||||
dynamic utr1Date,
|
||||
dynamic utr2Date,
|
||||
dynamic utr3Date,
|
||||
dynamic utr4Date,
|
||||
dynamic utr5Date,
|
||||
}) =>
|
||||
FreightBill(
|
||||
freightbillId: freightbillId ?? this.freightbillId,
|
||||
freightbillCode: freightbillCode ?? this.freightbillCode,
|
||||
status: status ?? this.status,
|
||||
statusDate: statusDate ?? this.statusDate,
|
||||
plantCode: plantCode ?? this.plantCode,
|
||||
plantDesc: plantDesc ?? this.plantDesc,
|
||||
materialCode: materialCode ?? this.materialCode,
|
||||
materialDescription: materialDescription ?? this.materialDescription,
|
||||
fromLocation: fromLocation ?? this.fromLocation,
|
||||
billingNetQty: billingNetQty ?? this.billingNetQty,
|
||||
uom: uom ?? this.uom,
|
||||
shipmentGrossCost: shipmentGrossCost ?? this.shipmentGrossCost,
|
||||
cgst: cgst ?? this.cgst,
|
||||
sgst: sgst ?? this.sgst,
|
||||
igst: igst ?? this.igst,
|
||||
totalGst: totalGst ?? this.totalGst,
|
||||
shipmentNetCost: shipmentNetCost ?? this.shipmentNetCost,
|
||||
createdOn: createdOn ?? this.createdOn,
|
||||
transporterInvoiceNo: transporterInvoiceNo ?? this.transporterInvoiceNo,
|
||||
transporterInvoiceNoDate: transporterInvoiceNoDate ?? this.transporterInvoiceNoDate,
|
||||
utr1No: utr1No ?? this.utr1No,
|
||||
utr2No: utr2No ?? this.utr2No,
|
||||
utr3No: utr3No ?? this.utr3No,
|
||||
utr4No: utr4No ?? this.utr4No,
|
||||
utr5No: utr5No ?? this.utr5No,
|
||||
utr1PaymentAmount: utr1PaymentAmount ?? this.utr1PaymentAmount,
|
||||
utr2PaymentAmount: utr2PaymentAmount ?? this.utr2PaymentAmount,
|
||||
utr3PaymentAmount: utr3PaymentAmount ?? this.utr3PaymentAmount,
|
||||
utr4PaymentAmount: utr4PaymentAmount ?? this.utr4PaymentAmount,
|
||||
utr5PaymentAmount: utr5PaymentAmount ?? this.utr5PaymentAmount,
|
||||
utr1Date: utr1Date ?? this.utr1Date,
|
||||
utr2Date: utr2Date ?? this.utr2Date,
|
||||
utr3Date: utr3Date ?? this.utr3Date,
|
||||
utr4Date: utr4Date ?? this.utr4Date,
|
||||
utr5Date: utr5Date ?? this.utr5Date,
|
||||
);
|
||||
|
||||
factory FreightBill.fromJson(Map<String, dynamic> json) => FreightBill(
|
||||
freightbillId: json["freightbill_id"],
|
||||
freightbillCode: json["freightbill_code"],
|
||||
status: json["status"],
|
||||
statusDate: json["status_date"] == null ? null : DateTime.parse(json["status_date"]),
|
||||
plantCode: json["plant_code"],
|
||||
plantDesc: json["plant_desc"],
|
||||
materialCode: json["material_code"],
|
||||
materialDescription: json["material_description"],
|
||||
fromLocation: json["from_location"],
|
||||
billingQty: json["billing_qty"],
|
||||
billingNetQty: json["billing_net_qty"],
|
||||
uom: json["uom"],
|
||||
freightAmount: json["freight_amount"]?.toDouble(),
|
||||
shipmentGrossCost: json["shipment_gross_cost"]?.toDouble(),
|
||||
cgst: json["cgst"]?.toDouble(),
|
||||
sgst: json["sgst"]?.toDouble(),
|
||||
igst: json["igst"],
|
||||
totalGst: json["total_gst"]?.toDouble(),
|
||||
shipmentNetAmount: json["shipment_net_amount"]?.toDouble(),
|
||||
shipmentNetCost: json["shipment_net_cost"]?.toDouble(),
|
||||
createdOn: json["created_on"] == null ? null : DateTime.parse(json["created_on"]),
|
||||
trasnporterInvoiceNo: json["trasnporter_invoice_no"],
|
||||
trasnporterInvoiceNoDate: json["trasnporter_invoice_no_date"],
|
||||
transporterInvoiceNo: json["transporter_invoice_no"],
|
||||
transporterInvoiceNoDate: json["transporter_invoice_no_date"],
|
||||
utr1No: json["utr1_no"],
|
||||
utr2No: json["utr2_no"],
|
||||
utr3No: json["utr3_no"],
|
||||
|
@ -177,19 +285,21 @@ class FreightBill {
|
|||
"status": status,
|
||||
"status_date": "${statusDate!.year.toString().padLeft(4, '0')}-${statusDate!.month.toString().padLeft(2, '0')}-${statusDate!.day.toString().padLeft(2, '0')}",
|
||||
"plant_code": plantCode,
|
||||
"plant_desc": plantDesc,
|
||||
"material_code": materialCode,
|
||||
"material_description": materialDescription,
|
||||
"from_location": fromLocation,
|
||||
"billing_qty": billingQty,
|
||||
"billing_net_qty": billingNetQty,
|
||||
"uom": uom,
|
||||
"freight_amount": freightAmount,
|
||||
"shipment_gross_cost": shipmentGrossCost,
|
||||
"cgst": cgst,
|
||||
"sgst": sgst,
|
||||
"igst": igst,
|
||||
"total_gst": totalGst,
|
||||
"shipment_net_amount": shipmentNetAmount,
|
||||
"shipment_net_cost": shipmentNetCost,
|
||||
"created_on": createdOn?.toIso8601String(),
|
||||
"trasnporter_invoice_no": trasnporterInvoiceNo,
|
||||
"trasnporter_invoice_no_date": trasnporterInvoiceNoDate,
|
||||
"transporter_invoice_no": transporterInvoiceNo,
|
||||
"transporter_invoice_no_date": transporterInvoiceNoDate,
|
||||
"utr1_no": utr1No,
|
||||
"utr2_no": utr2No,
|
||||
"utr3_no": utr3No,
|
||||
|
@ -209,61 +319,89 @@ class FreightBill {
|
|||
}
|
||||
|
||||
class Pageable {
|
||||
final Sort? sort;
|
||||
final int? offset;
|
||||
final int? pageSize;
|
||||
final int? pageNumber;
|
||||
final bool? unpaged;
|
||||
final bool? paged;
|
||||
Sort? sort;
|
||||
int? pageNumber;
|
||||
int? pageSize;
|
||||
int? offset;
|
||||
bool? paged;
|
||||
bool? unpaged;
|
||||
|
||||
Pageable({
|
||||
this.sort,
|
||||
this.offset,
|
||||
this.pageSize,
|
||||
this.pageNumber,
|
||||
this.unpaged,
|
||||
this.pageSize,
|
||||
this.offset,
|
||||
this.paged,
|
||||
this.unpaged,
|
||||
});
|
||||
|
||||
Pageable copyWith({
|
||||
Sort? sort,
|
||||
int? pageNumber,
|
||||
int? pageSize,
|
||||
int? offset,
|
||||
bool? paged,
|
||||
bool? unpaged,
|
||||
}) =>
|
||||
Pageable(
|
||||
sort: sort ?? this.sort,
|
||||
pageNumber: pageNumber ?? this.pageNumber,
|
||||
pageSize: pageSize ?? this.pageSize,
|
||||
offset: offset ?? this.offset,
|
||||
paged: paged ?? this.paged,
|
||||
unpaged: unpaged ?? this.unpaged,
|
||||
);
|
||||
|
||||
factory Pageable.fromJson(Map<String, dynamic> json) => Pageable(
|
||||
sort: json["sort"] == null ? null : Sort.fromJson(json["sort"]),
|
||||
offset: json["offset"],
|
||||
pageSize: json["pageSize"],
|
||||
pageNumber: json["pageNumber"],
|
||||
unpaged: json["unpaged"],
|
||||
pageSize: json["pageSize"],
|
||||
offset: json["offset"],
|
||||
paged: json["paged"],
|
||||
unpaged: json["unpaged"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"sort": sort?.toJson(),
|
||||
"offset": offset,
|
||||
"pageSize": pageSize,
|
||||
"pageNumber": pageNumber,
|
||||
"unpaged": unpaged,
|
||||
"pageSize": pageSize,
|
||||
"offset": offset,
|
||||
"paged": paged,
|
||||
"unpaged": unpaged,
|
||||
};
|
||||
}
|
||||
|
||||
class Sort {
|
||||
final bool? empty;
|
||||
final bool? sorted;
|
||||
final bool? unsorted;
|
||||
bool? sorted;
|
||||
bool? empty;
|
||||
bool? unsorted;
|
||||
|
||||
Sort({
|
||||
this.empty,
|
||||
this.sorted,
|
||||
this.empty,
|
||||
this.unsorted,
|
||||
});
|
||||
|
||||
Sort copyWith({
|
||||
bool? sorted,
|
||||
bool? empty,
|
||||
bool? unsorted,
|
||||
}) =>
|
||||
Sort(
|
||||
sorted: sorted ?? this.sorted,
|
||||
empty: empty ?? this.empty,
|
||||
unsorted: unsorted ?? this.unsorted,
|
||||
);
|
||||
|
||||
factory Sort.fromJson(Map<String, dynamic> json) => Sort(
|
||||
empty: json["empty"],
|
||||
sorted: json["sorted"],
|
||||
empty: json["empty"],
|
||||
unsorted: json["unsorted"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"empty": empty,
|
||||
"sorted": sorted,
|
||||
"empty": empty,
|
||||
"unsorted": unsorted,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import '../../../../../../../components/common/common_btn.dart';
|
|||
import '../../../../../../../components/common/custom_drop_down.dart';
|
||||
import '../../../../../../../components/common/data_cell.dart';
|
||||
import '../../../../../../../components/styles/app_strings.dart';
|
||||
import '../../../../widgets/custom_pagination.dart';
|
||||
import '../../view_model/transport_controller.dart';
|
||||
import '../../widgets/common_card.dart';
|
||||
import '../../widgets/freightbill_dialog.dart';
|
||||
|
@ -368,6 +369,8 @@ class GenerateFrightBill extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
|
@ -416,9 +419,10 @@ class GenerateFrightBill extends StatelessWidget {
|
|||
),
|
||||
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,
|
||||
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),
|
||||
|
@ -520,16 +524,19 @@ class GenerateFrightBill extends StatelessWidget {
|
|||
),
|
||||
// editableCell(index, "0${index + 1}"),
|
||||
editableCell(index, stoppage.grnNo ?? ""),
|
||||
editableCell(index, stoppage.plantCode ?? ""),
|
||||
editableCell(
|
||||
index, stoppage.plantCode ?? ""),
|
||||
editableCell(
|
||||
index, stoppage.materialCode ?? ""),
|
||||
editableCell(
|
||||
index,
|
||||
DateFormat('yyyy-MM-dd').format(
|
||||
stoppage.grnDate ?? DateTime.now())),
|
||||
stoppage.grnDate ??
|
||||
DateTime.now())),
|
||||
editableCell(
|
||||
index, stoppage.fromLocation ?? ""),
|
||||
editableCell(index, stoppage.vehicleNo ?? ""),
|
||||
editableCell(
|
||||
index, stoppage.vehicleNo ?? ""),
|
||||
editableCell(index, stoppage.lrNo ?? ""),
|
||||
editableCell(
|
||||
index,
|
||||
|
@ -537,15 +544,17 @@ class GenerateFrightBill extends StatelessWidget {
|
|||
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, "-"),
|
||||
editableCell(index,
|
||||
stoppage.freightRate?.toString() ?? ""),
|
||||
editableCell(index,
|
||||
stoppage.shipmentCost?.toString() ?? ""),
|
||||
editableCell(
|
||||
index,
|
||||
stoppage.shipmentCost?.toString() ??
|
||||
""),
|
||||
],
|
||||
);
|
||||
}),
|
||||
|
@ -559,6 +568,13 @@ class GenerateFrightBill extends StatelessWidget {
|
|||
],
|
||||
);
|
||||
}),
|
||||
CustomPagination(
|
||||
currentPage: controller.currentPage.value,
|
||||
totalPages: controller.totalPages.value,
|
||||
onPageChanged: (int page) {
|
||||
controller.onPageChanged(page);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:get/get.dart';
|
|||
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:shayog/feature/presentation/widgets/custom_pagination.dart';
|
||||
import 'package:sizer/sizer.dart';
|
||||
import 'package:vph_web_date_picker/vph_web_date_picker.dart';
|
||||
import '../../../../../../../components/common/data_cell.dart';
|
||||
|
@ -519,9 +520,17 @@ class PendingGeneration extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
);
|
||||
}),
|
||||
CustomPagination(
|
||||
currentPage: controller.currentPage.value,
|
||||
totalPages: controller.totalPages.value,
|
||||
onPageChanged: (int page) {
|
||||
controller.onPageChanged(page);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.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:shayog/feature/presentation/widgets/custom_pagination.dart';
|
||||
import 'package:sizer/sizer.dart';
|
||||
import 'package:vph_web_date_picker/vph_web_date_picker.dart';
|
||||
import '../../../../../../../components/common/data_cell.dart';
|
||||
|
@ -11,11 +9,8 @@ import '../../../../../../../components/styles/app_colors.dart';
|
|||
import '../../../../../../../components/styles/app_strings.dart';
|
||||
import '../../../../../../components/common/common_button.dart';
|
||||
import '../../../../../../components/common/custom_drop_down.dart';
|
||||
import '../../../../widgets/custom_pagination.dart';
|
||||
import '../../../../widgets/text_view.dart';
|
||||
import '../../view_model/transport_controller.dart';
|
||||
import '../../widgets/common_card.dart';
|
||||
import '../../widgets/freightbill_dialog.dart';
|
||||
|
||||
class ViewFreightBill extends StatelessWidget {
|
||||
ViewFreightBill({super.key});
|
||||
|
@ -57,8 +52,6 @@ class ViewFreightBill extends StatelessWidget {
|
|||
selected.plantCode ?? "";
|
||||
controller.showPlantErrorViewFreight.value =
|
||||
false;
|
||||
print(
|
||||
"selectPlant${controller.selectPlant.value}");
|
||||
}
|
||||
},
|
||||
hintText: "Select Plant",
|
||||
|
@ -294,19 +287,6 @@ class ViewFreightBill extends StatelessWidget {
|
|||
width: 100,
|
||||
text: AppStrings.submit,
|
||||
clickAction: () {
|
||||
// if (controller.showPlantErrorFreight
|
||||
// .value ||
|
||||
// controller.showProductErrorFreight
|
||||
// .value ||
|
||||
// controller.showTransactionErrorFreight
|
||||
// .value
|
||||
// ) {
|
||||
// print(
|
||||
// 'controller.showProductError.value ${controller
|
||||
// .showProductError.value}');
|
||||
// } else {
|
||||
// controller.postData();
|
||||
// }
|
||||
controller
|
||||
.handleFilterSubmitViewFreightBill();
|
||||
},
|
||||
|
@ -323,7 +303,6 @@ class ViewFreightBill extends StatelessWidget {
|
|||
),
|
||||
)
|
||||
: SizedBox.shrink()),
|
||||
|
||||
Obx(() {
|
||||
if (controller.freightViewLoader.value) {
|
||||
return SizedBox(
|
||||
|
@ -347,7 +326,6 @@ class ViewFreightBill extends StatelessWidget {
|
|||
if (controller.freightBillData.isEmpty ||
|
||||
controller.freightBillData == []) {
|
||||
return SizedBox(
|
||||
|
||||
height: controller.isFilterVisibleViewFreight.value
|
||||
? MediaQuery.sizeOf(context).height * 0.4
|
||||
: MediaQuery.sizeOf(context).height * 0.6,
|
||||
|
@ -460,14 +438,12 @@ class ViewFreightBill extends StatelessWidget {
|
|||
|
||||
controller.freightBillCode.value =
|
||||
freightBill.freightbillCode ?? "";
|
||||
print(
|
||||
'freightBill.trasnporterInvoiceNo ${freightBill.trasnporterInvoiceNo}');
|
||||
return DataRow(
|
||||
cells: [
|
||||
editableCell(
|
||||
index, "${freightBill.plantCode}"),
|
||||
index, "${freightBill.plantCode}-${freightBill.plantDesc}"),
|
||||
editableCell(
|
||||
index, "${freightBill.materialCode}"),
|
||||
index, "${freightBill.materialCode}-${freightBill.materialDescription}"),
|
||||
editableCell(
|
||||
index,
|
||||
freightBill.freightbillCode ?? "-",
|
||||
|
@ -484,15 +460,15 @@ class ViewFreightBill extends StatelessWidget {
|
|||
editableCell(
|
||||
index, "${freightBill.createdOn ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.trasnporterInvoiceNo ?? "-"}"),
|
||||
"${freightBill.transporterInvoiceNo ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.trasnporterInvoiceNoDate ?? "-"}"),
|
||||
"${freightBill.transporterInvoiceNoDate ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.billingQty ?? "-"}"),
|
||||
"${freightBill.billingNetQty ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.uom ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.freightAmount ?? "-"}"),
|
||||
"${freightBill.shipmentGrossCost ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.cgst ?? "-"}"),
|
||||
editableCell(
|
||||
|
@ -504,21 +480,21 @@ class ViewFreightBill extends StatelessWidget {
|
|||
editableCell(
|
||||
index, "${freightBill.totalGst ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.freightAmount ?? "-"}"),
|
||||
"${freightBill.shipmentNetCost ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.trasnporterInvoiceNoDate ?? "-"}"),
|
||||
"${freightBill.transporterInvoiceNoDate ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.status ?? "-"}"),
|
||||
index, freightBill.status ?? "-"),
|
||||
editableCell(
|
||||
index, "${freightBill.totalGst ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.trasnporterInvoiceNoDate ?? "-"}"),
|
||||
"${freightBill.transporterInvoiceNoDate ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.utr5No ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.utr1Date ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.freightAmount ?? "-"}"),
|
||||
"${freightBill.shipmentNetCost ?? "-"}"),
|
||||
editableCell(
|
||||
index, "${freightBill.utr1No ?? "-"}"),
|
||||
editableCell(
|
||||
|
@ -558,13 +534,6 @@ class ViewFreightBill extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
// CustomPagination(
|
||||
// currentPage: controller.currentPage.value,
|
||||
// totalPages: controller.totalPages.value,
|
||||
// onPageChanged: (int page) {
|
||||
// controller.onPageChanged(page);
|
||||
// },
|
||||
// ),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
@ -612,8 +581,7 @@ class ViewFreightBill extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
Expanded(
|
||||
child: contr.grnListDialog == null ||
|
||||
contr.grnListDialog.isEmpty
|
||||
child: contr.grnListDialog.isEmpty
|
||||
? Center(child: Text('No data available.'))
|
||||
: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
@ -706,12 +674,20 @@ class ViewFreightBill extends StatelessWidget {
|
|||
),
|
||||
editableCell(index,
|
||||
"${freightBill.grnDate ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.fromLocation ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.vehicleNo ?? "-"}"),
|
||||
editableCell(index,
|
||||
"${freightBill.transporterCode ?? "-"}"),
|
||||
editableCell(
|
||||
index,
|
||||
freightBill
|
||||
.fromLocation ??
|
||||
"-"),
|
||||
editableCell(
|
||||
index,
|
||||
freightBill.vehicleNo ??
|
||||
"-"),
|
||||
editableCell(
|
||||
index,
|
||||
freightBill
|
||||
.transporterCode ??
|
||||
"-"),
|
||||
editableCell(index,
|
||||
"${freightBill.lrDate ?? "-"}"),
|
||||
editableCell(index,
|
||||
|
@ -763,3 +739,5 @@ class ViewFreightBill extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ 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});
|
||||
|
||||
|
@ -57,7 +58,7 @@ class _TransportViewState extends State<TransportView> {
|
|||
() => InkWell(
|
||||
onTap: () {
|
||||
ctrl.selectedIndex.value = index;
|
||||
ctrl.selectedUser.value =0;
|
||||
ctrl.selectedUser.value = 0;
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
@ -164,97 +165,99 @@ class _TransportViewState extends State<TransportView> {
|
|||
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)),
|
||||
],
|
||||
),
|
||||
),
|
||||
(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)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
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);
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
//###################### 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);
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
|
||||
//###########################################################################################################
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -284,7 +287,8 @@ class _TransportViewState extends State<TransportView> {
|
|||
PlatformFile file = result.files.first;
|
||||
|
||||
// Validate file size (optional)
|
||||
if (file.size > 10 * 1024 * 1024) { // 10MB limit
|
||||
if (file.size > 10 * 1024 * 1024) {
|
||||
// 10MB limit
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('File size must be less than 10MB'),
|
||||
|
@ -316,14 +320,6 @@ class _TransportViewState extends State<TransportView> {
|
|||
}
|
||||
}
|
||||
|
||||
_commonText(String title) {
|
||||
return Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 13, color: Colors.black, fontWeight: FontWeight.w900),
|
||||
);
|
||||
}
|
||||
|
||||
_dashboardView() {
|
||||
return RawScrollbar(
|
||||
child: Column(
|
||||
|
@ -350,8 +346,10 @@ class _TransportViewState extends State<TransportView> {
|
|||
ctrl.selectedUser.value = index;
|
||||
ctrl.refreshApis();
|
||||
ctrl.isFilterVisibleViewFreight.value = false;
|
||||
ctrl.isFilterVisiblePendingGeneration.value = false;
|
||||
ctrl.isFilterVisibleGenerateFreight.value = false;
|
||||
ctrl.isFilterVisiblePendingGeneration.value =
|
||||
false;
|
||||
ctrl.isFilterVisibleGenerateFreight.value =
|
||||
false;
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 10, top: 10),
|
||||
|
|
|
@ -24,3 +24,4 @@ class MyApp extends StatelessWidget {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue