Browse Source

Debug accountancy

Laurent Destailleur 7 years ago
parent
commit
b14cb7a97f

+ 0 - 1
htdocs/accountancy/admin/categories_list.php

@@ -655,7 +655,6 @@ if ($id)
             if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
             {
             	$valuetoshow=$langs->trans("Label");
-               	if ($id != 25) $valuetoshow.="*";
             }
             if ($fieldlist[$field]=='country')         { $valuetoshow=$langs->trans("Country"); }
             if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }

+ 10 - 13
htdocs/accountancy/admin/fiscalyear.php

@@ -106,8 +106,17 @@ if ($result)
 
 	$i = 0;
 
+	if (! empty($user->rights->accounting->fiscalyear))
+	{
+		$addbutton = '<a class="butAction" href="fiscalyear_card.php?action=create">' . $langs->trans("NewFiscalYear") . '</a>';
+	}
+	else
+	{
+		$addbutton = '<a class="butActionRefused" href="#">' . $langs->trans("NewFiscalYear") . '</a>';
+	}
+
 	$title = $langs->trans('AccountingPeriods');
-	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 1);
+	print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $addbutton, '', $limit, 1);
 
 	// Load attribute_label
 	print '<table class="noborder" width="100%">';
@@ -143,17 +152,5 @@ if ($result)
 }
 
 
-// Buttons
-print '<div class="tabsAction">';
-if (! empty($user->rights->accounting->fiscalyear))
-{
-    print '<a class="butAction" href="fiscalyear_card.php?action=create">' . $langs->trans("NewFiscalYear") . '</a>';
-}
-else
-{
-    print '<a class="butActionRefused" href="#">' . $langs->trans("NewFiscalYear") . '</a>';
-}
-print '</div>';
-
 llxFooter();
 $db->close();

+ 1 - 1
htdocs/core/class/fiscalyear.class.php

@@ -145,7 +145,7 @@ class Fiscalyear extends CommonObject
 		$sql .= " SET label = '".$this->db->escape($this->label)."'";
 		$sql .= ", date_start = '".$this->db->idate($this->date_start)."'";
 		$sql .= ", date_end = ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : "null");
-		$sql .= ", statut = '".$this->db->escape($this->statut)."'";
+		$sql .= ", statut = '".$this->db->escape($this->statut?$this->statut:0)."'";
 		$sql .= ", datec = " . ($this->datec != '' ? "'".$this->db->idate($this->datec)."'" : 'null');
 		$sql .= ", fk_user_modif = " . $user->id;
 		$sql .= " WHERE rowid = ".$this->id;