From 427695d8692ae5e724165caae4b4168e23407071 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 17 Jun 2016 17:26:49 +0200 Subject: [PATCH] FIX : New conf must be in payments tab --- htdocs/admin/facture.php | 32 ------------------------------ htdocs/admin/payment.php | 43 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 20d2ade591c..bae4b0abd88 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -280,24 +280,6 @@ if ($action == 'set_INVOICE_AUTO_FILLJS') } } -if ($action == 'set_FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS') -{ - $freetext = GETPOST('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS'); // No alpha here, we want exact string - - $res = dolibarr_set_const($db, "FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$freetext,'chaine',0,'',$conf->entity); - - if (! $res > 0) $error++; - - if (! $error) - { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { - setEventMessages($langs->trans("Error"), null, 'errors'); - } -} - /* * View @@ -782,20 +764,6 @@ print '\n"; print ''; -// Add js auto fill amount on paiement form -$var=! $var; -print '
'; -print ''; -print ''; -print ''; -print $langs->trans("PaymentOnDifferentThirdBills"); -print ''; -print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS,1); -print ''; -print ''; -print "\n"; -print '
'; - $var=! $var; print '
'; print ''; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index fa99e2c202b..8ce904aad7c 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -69,7 +69,23 @@ if ($action == 'setmod') dolibarr_set_const($db, "PAYMENT_ADDON",$value,'chaine',0,'',$conf->entity); } +if ($action == 'set_FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS') +{ + $freetext = GETPOST('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS'); // No alpha here, we want exact string + $res = dolibarr_set_const($db, "FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$freetext,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} /* * View @@ -215,6 +231,33 @@ foreach ($dirmodels as $reldir) print ''; +print "
"; + +print load_fiche_titre($langs->trans("OtherOptions"),'',''); + +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +// Allow payments on different thirdparties bills but same parent company +$var=! $var; +print ''; +print ''; +print ''; +print '\n"; +print ''; + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; +print $langs->trans("PaymentOnDifferentThirdBills"); +print ''; +print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS,1); +print ''; +print ''; +print "
'; + dol_fiche_end();