From 1f2d275ef2f8cc72dbca5d4aa0687ee1c22b15e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Jan 2018 17:21:56 +0100 Subject: [PATCH] Fix conditions of some fields --- htdocs/comm/propal/list.php | 4 +- htdocs/expedition/list.php | 4 +- htdocs/projet/list.php | 2 +- htdocs/projet/tasks/time.php | 2 +- htdocs/public/payment/newpayment.php | 72 +++++++++++++++++----------- 5 files changed, 49 insertions(+), 35 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 8796da505cd..f12577fbc5f 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -141,7 +141,7 @@ $checkedtypetiers=0; $arrayfields=array( 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), 'p.ref_client'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1), - 'pr.ref'=>array('label'=>$langs->trans("Project"), 'checked'=>1, 'enabled'=>$conf->projet->enabled), + 'pr.ref'=>array('label'=>$langs->trans("Project"), 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled)?0:1)), 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1), 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), @@ -191,7 +191,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_sale=''; $search_ref=''; $search_refcustomer=''; - $search_refproject=''; + $search_refproject=''; $search_societe=''; $search_montant_ht=''; $search_montant_vat=''; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index ff4e056e928..d8e9925c08f 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -99,8 +99,8 @@ $arrayfields=array( 'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), - 'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>$conf->livraison_bon->enabled), - 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>$conf->livraison_bon->enabled), + 'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>(empty($conf->livraison_bon->enabled)?0:1)), + 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>(empty($conf->livraison_bon->enabled)?0:1)), 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) ); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 254955a4b27..6b3613a7b0a 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -119,7 +119,7 @@ if (empty($user->socid)) $fieldstosearchall["p.note_private"]="NotePrivate"; $arrayfields=array( 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), 'p.title'=>array('label'=>$langs->trans("Label"), 'checked'=>1), - 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>$conf->societe->enabled), + 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>(empty($conf->societe->enabled)?0:1)), 'commercial'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0), 'p.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100), 'p.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101), diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 278f09a1b9e..45018d79742 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -619,7 +619,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) $arrayfields['author']=array('label'=>$langs->trans("By"), 'checked'=>1); $arrayfields['t.note']=array('label'=>$langs->trans("Note"), 'checked'=>1); $arrayfields['t.task_duration']=array('label'=>$langs->trans("Duration"), 'checked'=>1); - $arrayfields['value']=array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>$conf->salaries->enabled); + $arrayfields['value'] =array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>(empty($conf->salaries->enabled)?0:1)); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 473461bd62c..be303f987ed 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -847,21 +847,28 @@ if ($source == 'invoice') // Amount print ''.$langs->trans("Amount"); - if (empty($amount)) print ' ('.$langs->trans("ToComplete").')'; + if (empty($amount) && empty($object->paye)) print ' ('.$langs->trans("ToComplete").')'; print ''; - if (empty($amount) || ! is_numeric($amount)) + if (empty($object->paye)) { - print ''; - print ''; + if (empty($amount) || ! is_numeric($amount)) + { + print ''; + print ''; + } + else { + print ''.price($amount).''; + print ''; + print ''; + } + // Currency + print ' '.$langs->trans("Currency".$currency).''; + print ''; } - else { - print ''.price($amount).''; - print ''; - print ''; + else + { + print price($object->total_ttc, 1, $langs); } - // Currency - print ' '.$langs->trans("Currency".$currency).''; - print ''; print ''."\n"; // Tag @@ -1290,31 +1297,38 @@ if ($action != 'dopayment') { if ($found && ! $error) // We are in a management option and no error { - // Buttons for all payments registration methods - - if (! empty($conf->paybox->enabled)) + if ($source == 'invoice' && $object->paye) { - // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of paybox - print '
'; + print '

'.$langs->trans("InvoicePaid"); } - - if (! empty($conf->stripe->enabled)) + else { - // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of stripe - print '
'; - } + // Buttons for all payments registration methods - if (! empty($conf->paypal->enabled)) - { - if (empty($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY)) $conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY='integral'; - - if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'integral') + if (! empty($conf->paybox->enabled)) { - print '
'; + // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of paybox + print '
'; } - if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'paypalonly') + + if (! empty($conf->stripe->enabled)) { - print '
'; + // If STRIPE_PICTO_FOR_PAYMENT is 'cb' we show a picto of a crdit card instead of stripe + print '
'; + } + + if (! empty($conf->paypal->enabled)) + { + if (empty($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY)) $conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY='integral'; + + if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'integral') + { + print '
'; + } + if ($conf->global->PAYPAL_API_INTEGRAL_OR_PAYPALONLY == 'paypalonly') + { + print '
'; + } } } }