From 9899a026302a211837f36fbe2f09cbe92a1374f9 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 20 Jan 2018 20:11:30 +0100 Subject: [PATCH] Display alert if order total is under order min amount --- htdocs/commande/card.php | 6 +++++- htdocs/fourn/commande/card.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 2d4d138f61a..1c236eda1dd 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2388,8 +2388,12 @@ if ($action == 'create' && $user->rights->commande->creer) } // Total HT + $alert = ''; + if($object->total_ht < $object->thirdparty->order_min_amount) { + $alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount)); + } print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . ''; + print '' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . $alert . ''; // Total VAT print '' . $langs->trans('AmountVAT') . '' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . ''; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 617039f25da..81ea1a0f951 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2052,8 +2052,12 @@ elseif (! empty($object->id)) } // Total + $alert = ''; + if($object->total_ht < $object->thirdparty->supplier_order_min_amount) { + $alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->supplier_order_min_amount)); + } print ''.$langs->trans("AmountHT").''; - print ''.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).''; + print ''.price($object->total_ht,'',$langs,1,-1,-1,$conf->currency).$alert.''; print ''; // Total VAT