|
|
|
|
@ -12,18 +12,13 @@ class AcceptPlanRequests extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _AcceptPlanRequestsState extends State<AcceptPlanRequests> {
|
|
|
|
|
int advancePayable = 0;
|
|
|
|
|
int advance =0;
|
|
|
|
|
//int advance =0;
|
|
|
|
|
double amountToPayAfterDelivery = 0.0;
|
|
|
|
|
double totalFare = 0.0;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
// TODO: implement initState
|
|
|
|
|
super.initState();
|
|
|
|
|
advance = 150;
|
|
|
|
|
advancePayable = advance;
|
|
|
|
|
//totalFare = advance + double.parse(widget.order.quoted_amount)??0;
|
|
|
|
|
amountToPayAfterDelivery = totalFare - advancePayable;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -272,13 +267,10 @@ class _AcceptPlanRequestsState extends State<AcceptPlanRequests> {
|
|
|
|
|
),
|
|
|
|
|
_detailRow("Tanker Price",
|
|
|
|
|
"₹${AppSettings.formDouble(widget.order.quoted_amount) ?? ''}"),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: MediaQuery.of(context).size.height * .004,
|
|
|
|
|
),
|
|
|
|
|
_detailRow("Booking Charges", "₹ " + advance.toString()),
|
|
|
|
|
SizedBox(
|
|
|
|
|
/* SizedBox(
|
|
|
|
|
height: MediaQuery.of(context).size.height * .004,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
_detailRow("Total Amount", "₹ " + totalFare.toString()),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: MediaQuery.of(context).size.height * .004,
|
|
|
|
|
@ -296,7 +288,7 @@ class _AcceptPlanRequestsState extends State<AcceptPlanRequests> {
|
|
|
|
|
height: MediaQuery.of(context).size.height * .004,
|
|
|
|
|
),
|
|
|
|
|
_detailRow("Amount to Pay (After Delivery)",
|
|
|
|
|
'₹${AppSettings.formDouble(amountToPayAfterDelivery.toString()) ?? ''}'),
|
|
|
|
|
'₹${AppSettings.formDouble(amountToPayAfterDelivery.toString()) ?? ''}'),*/
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -330,7 +322,6 @@ class _AcceptPlanRequestsState extends State<AcceptPlanRequests> {
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (_) => EditPlanRequests(
|
|
|
|
|
order: widget.order,
|
|
|
|
|
advance: advance.toString(),
|
|
|
|
|
status: widget.status,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -425,12 +416,12 @@ class _AcceptPlanRequestsState extends State<AcceptPlanRequests> {
|
|
|
|
|
|
|
|
|
|
if (isOnline) {
|
|
|
|
|
var payload = new Map<String, dynamic>();
|
|
|
|
|
payload["supplierId"] = AppSettings.supplierId;
|
|
|
|
|
/*payload["supplierId"] = AppSettings.supplierId;
|
|
|
|
|
payload["amount"] = int.parse(widget.order.quoted_amount);
|
|
|
|
|
payload["delivery_charges"] = advance;
|
|
|
|
|
payload["delivery_charges"] = advance;*/
|
|
|
|
|
payload["action"] = 'accept';
|
|
|
|
|
|
|
|
|
|
bool status = await AppSettings.acceptOrderRequests(
|
|
|
|
|
bool status = await AppSettings.acceptPlanRequests(
|
|
|
|
|
payload, widget.order.dbId);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
@ -440,7 +431,7 @@ class _AcceptPlanRequestsState extends State<AcceptPlanRequests> {
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
Navigator.of(context,rootNavigator: true).pop();
|
|
|
|
|
AppSettings.longFailedToast("Accept of order request Failed");
|
|
|
|
|
AppSettings.longFailedToast("Accept of plan request Failed");
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
Navigator.of(context,rootNavigator: true).pop();
|
|
|
|
|
|