diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index faab333890b..8321b28ef04 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -24,15 +24,15 @@ */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; -require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancysystem.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancysystem.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; $error = 0; // Load translation files required by the page -$langs->loadLangs(array("bills","accountancy")); +$langs->loadLangs(array("bills", "accountancy")); $mesg = ''; $action = GETPOST('action', 'aZ09'); @@ -55,24 +55,24 @@ $object = new AccountingAccount($db); if (GETPOST('cancel', 'alpha')) { - $urltogo=$backtopage?$backtopage:dol_buildpath('/accountancy/admin/account.php', 1); + $urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1); header("Location: ".$urltogo); exit; } if ($action == 'add' && $user->rights->accounting->chartofaccount) { - if (! $cancel) { - $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS; + if (!$cancel) { + $sql = 'SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.$conf->global->CHARTOFACCOUNTS; - dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); + dol_syslog('accountancy/admin/card.php:: $sql='.$sql); $result = $db->query($sql); $obj = $db->fetch_object($result); // Clean code // To manage zero or not at the end of the accounting account - if($conf->global->ACCOUNTING_MANAGE_ZERO == 1) + if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1) { $account_number = GETPOST('account_number', 'string'); } @@ -116,28 +116,28 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; } - if (! $error) + if (!$error) { setEventMessages("RecordCreatedSuccessfully", null, 'mesgs'); - $urltogo=$backtopage?$backtopage:dol_buildpath('/accountancy/admin/account.php', 1); + $urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1); header("Location: ".$urltogo); exit; } } } elseif ($action == 'edit' && $user->rights->accounting->chartofaccount) { - if (! $cancel) { + if (!$cancel) { $result = $object->fetch($id); - $sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS; + $sql = 'SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.$conf->global->CHARTOFACCOUNTS; - dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); + dol_syslog('accountancy/admin/card.php:: $sql='.$sql); $result2 = $db->query($sql); $obj = $db->fetch_object($result2); // Clean code // To manage zero or not at the end of the accounting account - if($conf->global->ACCOUNTING_MANAGE_ZERO == 1) + if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1) { $account_number = GETPOST('account_number', 'string'); } @@ -166,21 +166,21 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount) $result = $object->update($user); if ($result > 0) { - $urltogo=$backtopage?$backtopage:($_SERVER["PHP_SELF"]."?id=".$id); - header("Location: " . $urltogo); + $urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"]."?id=".$id); + header("Location: ".$urltogo); exit(); } else { $mesg = $object->error; } } else { - $urltogo=$backtopage?$backtopage:($_SERVER["PHP_SELF"]."?id=".$id); - header("Location: " . $urltogo); + $urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"]."?id=".$id); + header("Location: ".$urltogo); exit(); } } elseif ($action == 'delete' && $user->rights->accounting->chartofaccount) { $result = $object->fetch($id); - if (! empty($object->id)) { + if (!empty($object->id)) { $result = $object->delete($user); if ($result > 0) { @@ -205,7 +205,7 @@ $formaccounting = new FormAccounting($db); $accountsystem = new AccountancySystem($db); $accountsystem->fetch($conf->global->CHARTOFACCOUNTS); -$title = $langs->trans('AccountAccounting') ." - ". $langs->trans('Card'); +$title = $langs->trans('AccountAccounting')." - ".$langs->trans('Card'); $helpurl = ''; llxheader('', $title, $helpurl); @@ -214,8 +214,8 @@ llxheader('', $title, $helpurl); if ($action == 'create') { print load_fiche_titre($langs->trans('NewAccountingAccount')); - print '
'; @@ -285,24 +285,24 @@ elseif ($id > 0 || $ref) { { dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr'); - print ''; } else { // View mode - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = ''.$langs->trans("BackToList").''; dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), -1, 'billr'); @@ -351,27 +351,27 @@ elseif ($id > 0 || $ref) { print '| ' . $langs->trans("Label") . ' | '; - print '' . $object->label . ' | |
| '.$langs->trans("Label").' | '; + print ''.$object->label.' | |
| ' . $langs->trans("Accountparent") . ' | '; - print '' . $accp->account_number . ' - ' . $accp->label . ' | |
| '.$langs->trans("Accountparent").' | '; + print ''.$accp->account_number.' - '.$accp->label.' | |
| ".$langs->trans("AccountingCategory")." | ".$object->account_category_label." | "; // Chart of accounts type - print '|
| ' . $langs->trans("Pcgtype") . ' | '; - print '' . $object->pcg_type . ' | |
| '.$langs->trans("Pcgtype").' | '; + print ''.$object->pcg_type.' | |
| ' . $langs->trans("Pcgsubtype") . ' | '; - print '' . $object->pcg_subtype . ' | |
| '.$langs->trans("Pcgsubtype").' | '; + print ''.$object->pcg_subtype.' | |