@@ -394,7 +394,7 @@ |
||
394 | 394 | print '<tr class="oddeven" height="24">'; |
395 | 395 | print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.'</a></td>'; |
396 | 396 | print '<td class="right">'.$val['nb'].'</td>'; |
397 | - print '<td class="right opacitylow" style="'.((!isset($val['nb_diff']) || $val['nb_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['nb_diff']) ? round($val['nb_diff']): "0").'%</td>'; |
|
397 | + print '<td class="right opacitylow" style="'.((!isset($val['nb_diff']) || $val['nb_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['nb_diff']) ? round($val['nb_diff']) : "0").'%</td>'; |
|
398 | 398 | print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>'; |
399 | 399 | print '<td class="right opacitylow" style="'.((!isset($val['total_diff']) || $val['total_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['total_diff']) ? round($val['total_diff']) : "0").'%</td>'; |
400 | 400 | print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>'; |
@@ -66,26 +66,26 @@ |
||
66 | 66 | $rep = new stdClass(); |
67 | 67 | $rep->response_status = 0; |
68 | 68 | $rep->data = null; |
69 | -$rep->error = '';//@todo deprecated use error_message instead |
|
69 | +$rep->error = ''; //@todo deprecated use error_message instead |
|
70 | 70 | $rep->errorMessage = ''; |
71 | 71 | |
72 | 72 | |
73 | 73 | if (empty($fk_expense) || $fk_expense < 0) { |
74 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_expense, 'fk_expense'); |
|
74 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_expense, 'fk_expense'); |
|
75 | 75 | } elseif (empty($fk_c_exp_tax_cat) || $fk_c_exp_tax_cat < 0) { |
76 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_c_exp_tax_cat, 'fk_c_exp_tax_cat'); |
|
76 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_c_exp_tax_cat, 'fk_c_exp_tax_cat'); |
|
77 | 77 | |
78 | 78 | $rep->response_status = 'error'; |
79 | 79 | } else { |
80 | 80 | // @see ndfp.class.php:3576 (method: compute_total_km) |
81 | 81 | $expense = new ExpenseReport($db); |
82 | 82 | if ($expense->fetch($fk_expense) <= 0) { |
83 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
83 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
84 | 84 | $rep->response_status = 'error'; |
85 | 85 | } else { |
86 | 86 | $userauthor = new User($db); |
87 | 87 | if ($userauthor->fetch($expense->fk_user_author) <= 0) { |
88 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
88 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
89 | 89 | $rep->response_status = 'error'; |
90 | 90 | } else { |
91 | 91 | $expense = new ExpenseReport($db); |
@@ -77,8 +77,12 @@ |
||
77 | 77 | //if ($user->socid > 0) $socid = $user->socid; |
78 | 78 | //$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
79 | 79 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
80 | -if (empty($conf->intracommreport->enabled)) accessforbidden(); |
|
81 | -if (!$permissiontoread) accessforbidden(); |
|
80 | +if (empty($conf->intracommreport->enabled)) { |
|
81 | + accessforbidden(); |
|
82 | +} |
|
83 | +if (!$permissiontoread) { |
|
84 | + accessforbidden(); |
|
85 | +} |
|
82 | 86 | |
83 | 87 | |
84 | 88 |
@@ -118,7 +118,7 @@ |
||
118 | 118 | if ($action == 'add' && $permissiontoadd) { |
119 | 119 | $object->label = trim($label); |
120 | 120 | $object->type = trim($exporttype); |
121 | - $object->type_declaration = $type_declaration; |
|
121 | + $object->type_declaration = $type_declaration; |
|
122 | 122 | //$object->subscription = (int) $subscription; |
123 | 123 | |
124 | 124 | // Fill array 'array_options' with data from add form |
@@ -615,7 +615,7 @@ |
||
615 | 615 | |
616 | 616 | $ref = dol_sanitizeFileName($newref); |
617 | 617 | $pdf_path = $dir_output."/".$ref.".pdf"; |
618 | - if (!dol_is_file($pdf_path)||(is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0 && !$arraydefaultmessage->joinfiles)) { |
|
618 | + if (!dol_is_file($pdf_path) || (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0 && !$arraydefaultmessage->joinfiles)) { |
|
619 | 619 | // We can't add PDF as it is not generated yet. |
620 | 620 | $filepdf = ''; |
621 | 621 | } else { |
@@ -214,8 +214,8 @@ |
||
214 | 214 | // Total debit-credit |
215 | 215 | print '<tr class="liste_total"><td><b>'.$langs->trans("Total")."</b></td>"; |
216 | 216 | for ($annee = $year_start; $annee <= $year_end; $annee++) { |
217 | - print '<td class="right nowraponall"><b>'. (isset($totsorties[$annee]) ? price($totsorties[$annee]) : '') .'</b></td>'; |
|
218 | - print '<td class="right nowraponall"><b>'. (isset($totentrees[$annee]) ? price($totentrees[$annee]) : '') .'</b></td>'; |
|
217 | + print '<td class="right nowraponall"><b>'.(isset($totsorties[$annee]) ? price($totsorties[$annee]) : '').'</b></td>'; |
|
218 | + print '<td class="right nowraponall"><b>'.(isset($totentrees[$annee]) ? price($totentrees[$annee]) : '').'</b></td>'; |
|
219 | 219 | } |
220 | 220 | print "</tr>\n"; |
221 | 221 |
@@ -76,13 +76,13 @@ |
||
76 | 76 | * Boolean that indicates whether the product is available for sale '1' or not '0' |
77 | 77 | * @var int |
78 | 78 | */ |
79 | - public $product_tosell=0; |
|
79 | + public $product_tosell = 0; |
|
80 | 80 | |
81 | 81 | /** |
82 | 82 | * Boolean that indicates whether the product is available for purchase '1' or not '0' |
83 | 83 | * @var int |
84 | 84 | */ |
85 | - public $product_tobuy=0; |
|
85 | + public $product_tobuy = 0; |
|
86 | 86 | |
87 | 87 | /** |
88 | 88 | * Product description |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
66 | 66 | $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
67 | 67 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
68 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
68 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
69 | 69 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
70 | 70 | |
71 | 71 | // Load variable for pagination |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $permissiontoread = $user->hasRight('accounting', 'read'); |
154 | 154 | $permissiontodelete = $user->hasRight('accounting', 'delete'); |
155 | 155 | $uploaddir = $conf->expensereport->dir_output; |
156 | - include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; |
|
156 | + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 |
@@ -314,7 +314,9 @@ |
||
314 | 314 | } |
315 | 315 | // Now loop on each link of record in bank (code similar to bankentries_list.php) |
316 | 316 | foreach ($links as $key => $val) { |
317 | - if ($links[$key]['type'] == 'user' && !$is_sc) continue; |
|
317 | + if ($links[$key]['type'] == 'user' && !$is_sc) { |
|
318 | + continue; |
|
319 | + } |
|
318 | 320 | if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) { |
319 | 321 | // So we excluded 'company' and 'user' here. We want only payment lines |
320 | 322 |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu4 ON bu4.fk_bank = b.rowid AND bu4.type='payment_supplier'"; |
139 | 139 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc on bu1.url_id=soc.rowid"; |
140 | 140 | if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { |
141 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = soc.rowid AND spe.entity = " . ((int) $conf->entity); |
|
141 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = soc.rowid AND spe.entity = ".((int) $conf->entity); |
|
142 | 142 | } |
143 | 143 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid"; |
144 | 144 | $sql .= " WHERE ba.fk_accountancy_journal=".((int) $id_journal); |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | // Line into bank account |
612 | 612 | foreach ($tabbq[$key] as $k => $mt) { |
613 | 613 | if ($mt) { |
614 | - $accountingaccount->fetch(null, $k, true); // $k is accounting bank account. TODO We should use a cache here to avoid this fetch |
|
614 | + $accountingaccount->fetch(null, $k, true); // $k is accounting bank account. TODO We should use a cache here to avoid this fetch |
|
615 | 615 | $account_label = $accountingaccount->label; |
616 | 616 | |
617 | 617 | $reflabel = ''; |
@@ -727,43 +727,43 @@ discard block |
||
727 | 727 | } elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution |
728 | 728 | $bookkeeping->subledger_account = ''; |
729 | 729 | $bookkeeping->subledger_label = ''; |
730 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
730 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
731 | 731 | $bookkeeping->numero_compte = $k; |
732 | 732 | $bookkeeping->label_compte = $accountingaccount->label; |
733 | 733 | } elseif ($tabtype[$key] == 'payment_vat') { |
734 | 734 | $bookkeeping->subledger_account = ''; |
735 | 735 | $bookkeeping->subledger_label = ''; |
736 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
736 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
737 | 737 | $bookkeeping->numero_compte = $k; |
738 | 738 | $bookkeeping->label_compte = $accountingaccount->label; |
739 | 739 | } elseif ($tabtype[$key] == 'payment_donation') { |
740 | 740 | $bookkeeping->subledger_account = ''; |
741 | 741 | $bookkeeping->subledger_label = ''; |
742 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
742 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
743 | 743 | $bookkeeping->numero_compte = $k; |
744 | 744 | $bookkeeping->label_compte = $accountingaccount->label; |
745 | 745 | } elseif ($tabtype[$key] == 'member') { |
746 | 746 | $bookkeeping->subledger_account = ''; |
747 | 747 | $bookkeeping->subledger_label = ''; |
748 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
748 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
749 | 749 | $bookkeeping->numero_compte = $k; |
750 | 750 | $bookkeeping->label_compte = $accountingaccount->label; |
751 | 751 | } elseif ($tabtype[$key] == 'payment_loan') { |
752 | 752 | $bookkeeping->subledger_account = ''; |
753 | 753 | $bookkeeping->subledger_label = ''; |
754 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
754 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
755 | 755 | $bookkeeping->numero_compte = $k; |
756 | 756 | $bookkeeping->label_compte = $accountingaccount->label; |
757 | 757 | } elseif ($tabtype[$key] == 'payment_various') { |
758 | 758 | $bookkeeping->subledger_account = $k; |
759 | 759 | $bookkeeping->subledger_label = $tabcompany[$key]['name']; |
760 | - $accountingaccount->fetch(null, $tabpay[$key]["account_various"], true); // TODO Use a cache |
|
760 | + $accountingaccount->fetch(null, $tabpay[$key]["account_various"], true); // TODO Use a cache |
|
761 | 761 | $bookkeeping->numero_compte = $tabpay[$key]["account_various"]; |
762 | 762 | $bookkeeping->label_compte = $accountingaccount->label; |
763 | 763 | } elseif ($tabtype[$key] == 'banktransfert') { |
764 | 764 | $bookkeeping->subledger_account = ''; |
765 | 765 | $bookkeeping->subledger_label = ''; |
766 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
766 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
767 | 767 | $bookkeeping->numero_compte = $k; |
768 | 768 | $bookkeeping->label_compte = $accountingaccount->label; |
769 | 769 | } else { |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | } |
795 | 795 | } else { |
796 | 796 | if ($lettering && getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) { |
797 | - require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; |
|
797 | + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; |
|
798 | 798 | $lettering_static = new Lettering($db); |
799 | 799 | $nb_lettering = $lettering_static->bookkeepingLetteringAll(array($bookkeeping->id)); |
800 | 800 | } |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | |
1191 | 1191 | // Label operation |
1192 | 1192 | print '<td>'; |
1193 | - print $reflabel; // This is already html escaped content |
|
1193 | + print $reflabel; // This is already html escaped content |
|
1194 | 1194 | print "</td>"; |
1195 | 1195 | |
1196 | 1196 | print '<td class="center">'.$val["type_payment"]."</td>"; |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | } |
1282 | 1282 | } |
1283 | 1283 | print '<td class="maxwidth300" title="'.dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)).'">'; |
1284 | - print $accounttoshow; // This is a HTML string |
|
1284 | + print $accounttoshow; // This is a HTML string |
|
1285 | 1285 | print "</td>"; |
1286 | 1286 | |
1287 | 1287 | // Subledger account |
@@ -1310,7 +1310,7 @@ discard block |
||
1310 | 1310 | } |
1311 | 1311 | } |
1312 | 1312 | print '<td class="maxwidth300">'; |
1313 | - print $accounttoshowsubledger; // This is a html string |
|
1313 | + print $accounttoshowsubledger; // This is a html string |
|
1314 | 1314 | print "</td>"; |
1315 | 1315 | |
1316 | 1316 | print "<td>".$reflabel."</td>"; |
@@ -113,7 +113,7 @@ |
||
113 | 113 | $maxfilesizearray = getMaxFileSizeArray(); |
114 | 114 | $maxmin = $maxfilesizearray['maxmin']; |
115 | 115 | if ($maxmin > 0) { |
116 | - $s .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
116 | + $s .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
117 | 117 | } |
118 | 118 | $s .= '<input type="file" name="username" class="flat">'; |
119 | 119 | return $s; |