diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 0ce0c8b7168..ea3d73a607d 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -20,6 +20,14 @@ * $Source$ * */ + +/*! + \file htdocs/compta/bank/categ.php + \ingroup compta + \brief Page ajout de catégories banaires + \version $Revision$ +*/ + require("./pre.inc.php"); $user->getrights('compta'); @@ -29,33 +37,34 @@ if (!$user->admin && !$user->rights->compta->bank) llxHeader(); -if ($action == 'add') + +/* + * Actions ajout catégorie + */ +if ($_POST["action"] == 'add') { - if ($credit > 0) - { - $amount = $credit ; - } - else - { - $amount = - $debit ; - } - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_categ (label) VALUES ('$label')"; - $result = $db->query($sql); - - if (!$result) - { - print $db->error(); - print "
$sql"; + if ($_POST["label"]) { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_categ (label) VALUES ('".$_POST["label"]."')"; + $result = $db->query($sql); + + if (!$result) + { + dolibarr_print_error($db); + } } } -print_titre("Catégories"); + +/* + * Affichage liste des catégories + */ + +print_titre($langs->trans("Categories")); print '