update processing

This commit is contained in:
Thinzar Win
2020-12-02 20:55:00 +06:30
parent 8e73ba2d8b
commit 42bb217c2c
26 changed files with 589 additions and 250 deletions

View File

@@ -3,6 +3,7 @@ class CargoType {
String name;
double rate;
double weight;
bool isChecked;
double get calAmount => (calRate ?? 0) * (calWeight ?? 0);
@@ -19,13 +20,15 @@ class CargoType {
calRate: map['cal_rate']?.toDouble() ?? 0,
);
}
CargoType(
{this.id,
this.name,
this.rate,
this.weight,
this.calWeight,
this.calRate});
CargoType({
this.id,
this.name,
this.rate,
this.weight,
this.calWeight,
this.calRate,
this.isChecked = false,
});
Map<String, dynamic> toMap() {
return {

View File

@@ -1,3 +1,5 @@
import 'dart:io';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:fcs/domain/vo/delivery_address.dart';
import 'package:fcs/domain/vo/shipment_status.dart';
@@ -36,42 +38,47 @@ class Package {
DateTime arrivedDate;
DeliveryAddress deliveryAddress;
//for packages in processing
List<File> photoFiles;
int get amount => rate != null && weight != null ? rate * weight : 0;
String get packageNumber =>
shipmentNumber + "-" + receiverNumber + " #" + boxNumber;
double get price => rate.toDouble() * weight;
Package(
{this.id,
this.trackingID,
this.userID,
this.userName,
this.fcsID,
this.phoneNumber,
this.shipmentNumber,
this.senderFCSID,
this.senderName,
this.receiverFCSID,
this.receiverName,
this.receiverNumber,
this.receiverAddress,
this.boxNumber,
this.rate,
this.weight,
this.packageType,
this.pickUpID,
this.remark,
this.status,
this.arrivedDate,
this.cargoDesc,
this.market,
this.shipmentHistory,
this.currentStatusDate,
this.photoUrls,
this.desc,
this.deliveryAddress,
this.isChecked = false});
Package({
this.id,
this.trackingID,
this.userID,
this.userName,
this.fcsID,
this.phoneNumber,
this.shipmentNumber,
this.senderFCSID,
this.senderName,
this.receiverFCSID,
this.receiverName,
this.receiverNumber,
this.receiverAddress,
this.boxNumber,
this.rate,
this.weight,
this.packageType,
this.pickUpID,
this.remark,
this.status,
this.arrivedDate,
this.cargoDesc,
this.market,
this.shipmentHistory,
this.currentStatusDate,
this.photoUrls,
this.desc,
this.deliveryAddress,
this.isChecked = false,
this.photoFiles,
});
factory Package.fromMap(Map<String, dynamic> map, String docID) {
var _currentStatusDate = (map['status_date'] as Timestamp);