@@ -315,16 +315,25 @@ |
||
315 | 315 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
316 | 316 | if (empty($reshook)) { |
317 | 317 | if (empty($object->date_trans)) { |
318 | - if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->send); |
|
319 | - else print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->send); |
|
318 | + if ($object->type == 'bank-transfer') { |
|
319 | + print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->send); |
|
320 | + } else { |
|
321 | + print dolGetButtonAction($langs->trans("SetToStatusSent"), '', 'default', 'card.php?action=settransmitted&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->send); |
|
322 | + } |
|
320 | 323 | } |
321 | 324 | if (!empty($object->date_trans) && empty($object->date_credit)) { |
322 | - if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("ClassDebited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->debit); |
|
323 | - else print dolGetButtonAction($langs->trans("ClassCredited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->credit); |
|
325 | + if ($object->type == 'bank-transfer') { |
|
326 | + print dolGetButtonAction($langs->trans("ClassDebited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->debit); |
|
327 | + } else { |
|
328 | + print dolGetButtonAction($langs->trans("ClassCredited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->credit); |
|
329 | + } |
|
324 | 330 | } |
325 | 331 | |
326 | - if ($object->type == 'bank-transfer') print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->create); |
|
327 | - else print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->creer); |
|
332 | + if ($object->type == 'bank-transfer') { |
|
333 | + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->paymentbybanktransfer->create); |
|
334 | + } else { |
|
335 | + print dolGetButtonAction($langs->trans("Delete"), '', 'delete', 'card.php?action=delete&token='.newToken().'&id='.$object->id, '', $user->rights->prelevement->bons->creer); |
|
336 | + } |
|
328 | 337 | } |
329 | 338 | print '</div>'; |
330 | 339 | } |
@@ -343,7 +343,7 @@ |
||
343 | 343 | $sql .= ", ".MAIN_DB_PREFIX."societe as s"; |
344 | 344 | $sql .= " WHERE pl.fk_prelevement_bons = ".((int) $id); |
345 | 345 | $sql .= " AND pl.fk_prelevement_bons = pb.rowid"; |
346 | - $sql .= " AND pb.entity = ".((int) $conf->entity); // No sharing of entity here |
|
346 | + $sql .= " AND pb.entity = ".((int) $conf->entity); // No sharing of entity here |
|
347 | 347 | $sql .= " AND pl.fk_soc = s.rowid"; |
348 | 348 | if ($socid) { |
349 | 349 | $sql .= " AND s.rowid = ".((int) $socid); |
@@ -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; |
@@ -154,7 +154,7 @@ |
||
154 | 154 | $maxphptoshow = $maxfilesizearray['maxphptoshow']; |
155 | 155 | $maxphptoshowparam = $maxfilesizearray['maxphptoshowparam']; |
156 | 156 | if ($maxmin > 0) { |
157 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
157 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
158 | 158 | } |
159 | 159 | $out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"'; |
160 | 160 | $out .= ((!empty($conf->global->MAIN_DISABLE_MULTIPLE_FILEUPLOAD) || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple'); |
@@ -315,14 +315,14 @@ discard block |
||
315 | 315 | $importcsv = new ImportCsv($db, 'massstocklist'); |
316 | 316 | //print $importcsv->separator; |
317 | 317 | |
318 | - $nblinesrecord = $importcsv->import_get_nb_of_lines($fullpath)-1; |
|
318 | + $nblinesrecord = $importcsv->import_get_nb_of_lines($fullpath) - 1; |
|
319 | 319 | $importcsv->import_open_file($fullpath); |
320 | 320 | $labelsrecord = $importcsv->import_read_record(); |
321 | 321 | |
322 | 322 | if ($nblinesrecord < 1) { |
323 | 323 | setEventMessages($langs->trans("BadNumberOfLinesMustHaveAtLeastOneLinePlusTitle"), null, 'errors'); |
324 | 324 | } else { |
325 | - $i=0; |
|
325 | + $i = 0; |
|
326 | 326 | $data = array(); |
327 | 327 | $productstatic = new Product($db); |
328 | 328 | $warehousestatics = new Entrepot($db); |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | $maxfilesizearray = getMaxFileSizeArray(); |
485 | 485 | $maxmin = $maxfilesizearray['maxmin']; |
486 | 486 | if ($maxmin > 0) { |
487 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
487 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
488 | 488 | } |
489 | 489 | print '<input type="file" name="userfile" size="20" maxlength="80"> '; |
490 | 490 | $out = (empty($conf->global->MAIN_UPLOAD_DOC) ? ' disabled' : ''); |
@@ -101,7 +101,7 @@ |
||
101 | 101 | /** |
102 | 102 | * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. |
103 | 103 | */ |
104 | - public $fields=array( |
|
104 | + public $fields = array( |
|
105 | 105 | 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), |
106 | 106 | 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'index'=>1, 'searchall'=>1, 'validate'=>'1', 'comment'=>"Reference of object"), |
107 | 107 | 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>"Help text", 'showoncombobox'=>'2', 'validate'=>'1',), |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $search_date_endday = GETPOST('search_date_endday', 'int'); |
59 | 59 | $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); |
60 | 60 | $search_date_endyear = GETPOST('search_date_endyear', 'int'); |
61 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
61 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
62 | 62 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
63 | 63 | $search_date_limit_startday = GETPOST('search_date_limit_startday', 'int'); |
64 | 64 | $search_date_limit_startmonth = GETPOST('search_date_limit_startmonth', 'int'); |
@@ -727,7 +727,9 @@ |
||
727 | 727 | print $bankstatic->getNomUrl(1); |
728 | 728 | } |
729 | 729 | print '</td>'; |
730 | - if (!$i) $totalarray['nbfield']++; |
|
730 | + if (!$i) { |
|
731 | + $totalarray['nbfield']++; |
|
732 | + } |
|
731 | 733 | } |
732 | 734 | |
733 | 735 | // Amount |