diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 54bae759647..e77d10d9ee7 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -261,6 +261,24 @@ if ($action == 'setforcedate') } } +if ($action == 'set_FAC_AUTO_FILLJS') +{ + $freetext = GETPOST('FAC_AUTO_FILLJS'); // No alpha here, we want exact string + + $res = dolibarr_set_const($db, "FAC_AUTO_FILLJS",$freetext,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } +} + /* * View @@ -765,6 +783,20 @@ print '\n"; print ''; +// Add js auto fill amount on paiement form +$var=! $var; +print '
'; + print ''; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 5e7658d25b0..953348dbb49 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Christophe Combelles| '.$langs->trans('Ref').' | '; print ''.$langs->trans('RefSupplier').' | '; @@ -370,8 +381,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''.price($objp->total_ttc - $objp->am).' | '; print ''; $namef = 'amount_'.$objp->facid; + if(!empty($conf->global->FAC_AUTO_FILLJS)) + print img_picto("Auto fill",'1rightarrow_selected', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($objp->total_ttc - $objp->am)."'"); // TODO ADD lang print ''; - print " |