From b0b1dba4acad5252e3dae14913e09eac7685fc87 Mon Sep 17 00:00:00 2001 From: Pererinha Date: Thu, 5 Feb 2015 23:55:19 -0200 Subject: [PATCH] Edit Cash order telling driver to pay with pex card - other issues with instructing drivers to pay? #4661 --- include/library/Crunchbutton/Order.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/library/Crunchbutton/Order.php b/include/library/Crunchbutton/Order.php index 9be797e75..c8c4e4a46 100644 --- a/include/library/Crunchbutton/Order.php +++ b/include/library/Crunchbutton/Order.php @@ -2690,11 +2690,19 @@ class Crunchbutton_Order extends Crunchbutton_Order_Trackchange { return 'Do not pay the restaurant'; } } else { - $driver = c::user(); - if( $driver->id_admin && $driver->hasPexCard() ){ - return 'Pay the restaurant with PEX card'; + if( $this->pay_type == 'cash' ){ + $driver = c::user(); + if( $driver->id_admin && $driver->hasPexCard() ){ + return 'Pay restaurant with your own cash, not PEX'; + } else { + return 'Pay the restaurant with cash'; + } } else { - return 'Pay the restaurant'; + if( $driver->id_admin && $driver->hasPexCard() ){ + return 'Pay the restaurant with PEX card'; + } else { + return 'Pay the restaurant'; + } } } }