Merge branch 'master' of tzw/fcs into master

This commit is contained in:
2024-02-01 08:14:47 +06:30
committed by Gogs
9 changed files with 112 additions and 28 deletions

View File

@@ -340,12 +340,12 @@
"FCSshipment.create":"Create new shipment", "FCSshipment.create":"Create new shipment",
"FCSshipment.update":"Update shipment", "FCSshipment.update":"Update shipment",
"FCSshipment.ship.btn":"Ship this shipment", "FCSshipment.ship.btn":"Ship this shipment",
"FCSshipment.process.btn":"Processed this shipment",
"FCSshipment.arrive.btn":"Arrived this shipment",
"FCSshipment.invoiced.btn":"Invoiced this shipment",
"FCSshipment.ship.confirm":"Confirm ship?", "FCSshipment.ship.confirm":"Confirm ship?",
"FCSshipment.cancel.btn":"Cancel this shipment", "FCSshipment.cancel.btn":"Cancel this shipment",
"FCSshipment.cancel.confirm":"Cancel this shipment?", "FCSshipment.cancel.confirm":"Cancel this shipment?",
"FCSshipment.popupmenu.all":"All shipments",
"FCSshipment.popupmenu.active":"Active shipments",
"FCSshipment.popupmenu.shipped":"Shipped shipments",
"FCSshipment.carton":"Cartons", "FCSshipment.carton":"Cartons",
"FCSshipment.package":"Packages", "FCSshipment.package":"Packages",
"FCS Shipment End ================================================================":"", "FCS Shipment End ================================================================":"",

View File

@@ -338,7 +338,10 @@
"FCSshipment.cargo_manifest":"ကုန်ပစ္စည်းကိုဒေါင်းမည်", "FCSshipment.cargo_manifest":"ကုန်ပစ္စည်းကိုဒေါင်းမည်",
"FCSshipment.create":"တင်ပို့ခြင်းအသစ်ပြုလုပ်မည်", "FCSshipment.create":"တင်ပို့ခြင်းအသစ်ပြုလုပ်မည်",
"FCSshipment.update":"တင်ပို့ခြင်းပြုပြင်မည်", "FCSshipment.update":"တင်ပို့ခြင်းပြုပြင်မည်",
"FCSshipment.ship.btn":"Ship this shipment", "FCSshipment.ship.btn":"ပို့ဆောင်နေသည်",
"FCSshipment.process.btn":"လုပ်ဆောင်နေသည်",
"FCSshipment.arrive.btn":"ရောက်ရှိသည်",
"FCSshipment.invoiced.btn":"ပြေစာယူသည်",
"FCSshipment.ship.confirm":"Confirm ship?", "FCSshipment.ship.confirm":"Confirm ship?",
"FCSshipment.cancel.btn":"Cancel this shipment", "FCSshipment.cancel.btn":"Cancel this shipment",
"FCSshipment.cancel.confirm":"Cancel this shipment?", "FCSshipment.cancel.confirm":"Cancel this shipment?",

View File

@@ -20,7 +20,6 @@ const cartons_collection = "cartons";
const discounts_collection = "discounts"; const discounts_collection = "discounts";
const pickup_collection = "pickups"; const pickup_collection = "pickups";
// docs // docs
const setting_doc_id = "setting"; const setting_doc_id = "setting";
const rate_doc_id = "rate"; const rate_doc_id = "rate";
@@ -49,7 +48,12 @@ const message_type_shipment = "t_s";
// Fcs shipment status // Fcs shipment status
const fcs_shipment_confirmed_status = "confirmed"; const fcs_shipment_confirmed_status = "confirmed";
const fcs_shipment_shipped_status = "shipped"; const fcs_shipment_shipped_status = "shipped";
const fcs_shipment_pending_status = "pending";
const fcs_shipment_processing_status = "processing";
const fcs_shipment_arrived_status = "arrived";
const fcs_shipment_invoiced_status = "invoiced";
const fcs_shipment_delivered_status = "delivered"; const fcs_shipment_delivered_status = "delivered";
const fcs_shipment_canceled_status = "canceled";
// Package status // Package status
const package_received_status = "received"; const package_received_status = "received";
@@ -98,6 +102,10 @@ const mix_pickup = "Mix Pickup";
const carton_packed_status = "packed"; const carton_packed_status = "packed";
const carton_shipped_status = "shipped"; const carton_shipped_status = "shipped";
const carton_delivered_status = "delivered"; const carton_delivered_status = "delivered";
const carton_processing_status = "processing";
const carton_arrived_status = "arrived";
const carton_invoiced_status = "invoiced";
const carton_canceled_status = "canceled";
// shipment status // shipment status
const shipment_pending_status = "pending"; const shipment_pending_status = "pending";

View File

@@ -59,7 +59,6 @@ class FcsShipment {
'cutoff_date': cutoffDate?.toUtc().toIso8601String(), 'cutoff_date': cutoffDate?.toUtc().toIso8601String(),
'shipment_type': shipType, 'shipment_type': shipType,
'arrival_date': arrivalDate?.toUtc().toIso8601String(), 'arrival_date': arrivalDate?.toUtc().toIso8601String(),
'departure_date': departureDate?.toUtc().toIso8601String(),
'consignee': consignee, 'consignee': consignee,
'port': port, 'port': port,
'destination': destination, 'destination': destination,

View File

@@ -131,6 +131,27 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
callBack: _ship, callBack: _ship,
), ),
); );
final processBtn = Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: LocalButton(
textKey: "FCSshipment.process.btn",
callBack: _ship,
),
);
final arriveBtn = Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: LocalButton(
textKey: "FCSshipment.arrive.btn",
callBack: _ship,
),
);
final invoiceBtn = Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: LocalButton(
textKey: "FCSshipment.invoice.btn",
callBack: _ship,
),
);
final cancelBtn = Padding( final cancelBtn = Padding(
padding: const EdgeInsets.symmetric(horizontal: 30), padding: const EdgeInsets.symmetric(horizontal: 30),
@@ -189,13 +210,22 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
portBox, portBox,
destinationBox, destinationBox,
const SizedBox(height: 30), const SizedBox(height: 30),
_fcsShipment?.status == fcs_shipment_confirmed_status _fcsShipment?.status == fcs_shipment_pending_status
? shipBtn ? processBtn
: Container(), : Container(),
_fcsShipment?.status == fcs_shipment_confirmed_status _fcsShipment?.status == fcs_shipment_pending_status
? Container( ? Container(
padding: EdgeInsets.only(top: 3), child: cancelBtn) padding: EdgeInsets.only(top: 3), child: cancelBtn)
: Container(), : Container(),
_fcsShipment?.status == fcs_shipment_processing_status
? shipBtn
: Container(),
_fcsShipment?.status == fcs_shipment_shipped_status
? arriveBtn
: Container(),
_fcsShipment?.status == fcs_shipment_arrived_status
? invoiceBtn
: Container(),
SizedBox( SizedBox(
height: 20, height: 20,
) )

View File

@@ -9,7 +9,6 @@ import 'package:fcs/pagination/paginator_listview.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../domain/entities/fcs_shipment.dart'; import '../../domain/entities/fcs_shipment.dart';
import 'fcs_shipment_editor.dart'; import 'fcs_shipment_editor.dart';
import 'fcs_shipment_list_row.dart'; import 'fcs_shipment_list_row.dart';
@@ -45,17 +44,23 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
final popupMenu = LocalPopupMenuButton( final popupMenu = LocalPopupMenuButton(
popmenus: [ popmenus: [
LocalPopupMenu( LocalPopupMenu(
id: 0, id: 0, text: "All", selected: shipmentModel.selectedIndex == 0),
textKey: "FCSshipment.popupmenu.all",
selected: shipmentModel.selectedIndex == 0),
LocalPopupMenu( LocalPopupMenu(
id: 1, id: 1, text: "Pending", selected: shipmentModel.selectedIndex == 1),
textKey: "FCSshipment.popupmenu.active",
selected: shipmentModel.selectedIndex == 1),
LocalPopupMenu( LocalPopupMenu(
id: 2, id: 2,
textKey: "FCSshipment.popupmenu.shipped", text: "Processing",
selected: shipmentModel.selectedIndex == 2) selected: shipmentModel.selectedIndex == 2),
LocalPopupMenu(
id: 3, text: "Shipped", selected: shipmentModel.selectedIndex == 3),
LocalPopupMenu(
id: 4, text: "Arrived", selected: shipmentModel.selectedIndex == 4),
LocalPopupMenu(
id: 5,
text: "Invoiced",
selected: shipmentModel.selectedIndex == 5),
LocalPopupMenu(
id: 6, text: "Canceled", selected: shipmentModel.selectedIndex == 6)
], ],
popupMenuCallback: (p) { popupMenuCallback: (p) {
setState(() { setState(() {

View File

@@ -28,18 +28,48 @@ class FcsShipmentModel extends BaseModel {
Query col = FirebaseFirestore.instance.collection(path); Query col = FirebaseFirestore.instance.collection(path);
Query pageQuery = FirebaseFirestore.instance.collection(path); Query pageQuery = FirebaseFirestore.instance.collection(path);
// pending status
if (index == 1) { if (index == 1) {
col = col.where("status", isEqualTo: fcs_shipment_confirmed_status); col = col.where("status", isEqualTo: fcs_shipment_pending_status);
pageQuery = pageQuery =
pageQuery.where("status", isEqualTo: fcs_shipment_confirmed_status); pageQuery.where("status", isEqualTo: fcs_shipment_pending_status);
} }
// processing status
if (index == 2) { if (index == 2) {
col = col.where("status", isEqualTo: fcs_shipment_processing_status);
pageQuery =
pageQuery.where("status", isEqualTo: fcs_shipment_processing_status);
}
// shipped status
if (index == 3) {
col = col.where("status", isEqualTo: fcs_shipment_shipped_status); col = col.where("status", isEqualTo: fcs_shipment_shipped_status);
pageQuery = pageQuery =
pageQuery.where("status", isEqualTo: fcs_shipment_shipped_status); pageQuery.where("status", isEqualTo: fcs_shipment_shipped_status);
} }
// arrived status
if (index == 4) {
col = col.where("status", isEqualTo: fcs_shipment_arrived_status);
pageQuery =
pageQuery.where("status", isEqualTo: fcs_shipment_arrived_status);
}
// invoiced status
if (index == 5) {
col = col.where("status", isEqualTo: fcs_shipment_invoiced_status);
pageQuery =
pageQuery.where("status", isEqualTo: fcs_shipment_invoiced_status);
}
// canceled status
if (index == 6) {
col = col.where("status", isEqualTo: fcs_shipment_canceled_status);
pageQuery =
pageQuery.where("status", isEqualTo: fcs_shipment_canceled_status);
}
pageQuery = pageQuery.orderBy("shipment_number", descending: true); pageQuery = pageQuery.orderBy("shipment_number", descending: true);
fcsShipments?.close(); fcsShipments?.close();

View File

@@ -71,18 +71,18 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
height: 30, height: 30,
decoration: new BoxDecoration( decoration: new BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: Colors.white, //color: Colors.white,
), ),
child: Stack( child: Stack(
fit: StackFit.expand, alignment: Alignment.center,
children: <Widget>[ children: <Widget>[
Icon( Icon(
widget.buttonIcon ?? Icons.filter_list, widget.buttonIcon ?? Icons.filter_list,
color: widget.buttonColor, color: Colors.white,
), ),
hightlight hightlight
? Positioned( ? Positioned(
bottom: 0, bottom: 15,
right: 0, right: 0,
child: Container( child: Container(
width: 10, width: 10,
@@ -102,8 +102,15 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
value: choice, value: choice,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
LocalText(context, choice.textKey ?? "", choice.text != null
color: choice.enabled ? primaryColor : Colors.grey), ? Text(choice.text!,
style: TextStyle(
fontSize: 14,
color:
choice.enabled ? primaryColor : Colors.grey))
: LocalText(context, choice.textKey ?? "",
color: choice.enabled ? primaryColor : Colors.grey,
fontSize: 14),
SizedBox( SizedBox(
width: 10, width: 10,
), ),

View File

@@ -1,12 +1,14 @@
class LocalPopupMenu { class LocalPopupMenu {
int id; int id;
String? textKey; String? textKey;
String? text;
bool selected; bool selected;
bool highlight; bool highlight;
bool enabled; bool enabled;
LocalPopupMenu( LocalPopupMenu(
{required this.id, {required this.id,
this.textKey, this.textKey,
this.text,
this.selected = false, this.selected = false,
this.highlight = false, this.highlight = false,
this.enabled = true}); this.enabled = true});