Fixing style errors.

This commit is contained in:
stickler-ci 2021-02-05 12:08:05 +00:00
parent 24b26b8980
commit 9bfb7a5cbd
8 changed files with 60 additions and 109 deletions

View File

@ -70,8 +70,7 @@ if ($fielvalue)
if ($user->socid) $socid = $user->socid; if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account&bank_account', '', '', $fieldtype); $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account&bank_account', '', '', $fieldtype);
} }
else else {
{
if ($user->socid) $socid = $user->socid; if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'banque'); $result = restrictedArea($user, 'banque');
} }
@ -243,15 +242,13 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', '
} }
} }
} }
else else {
{
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("NoRecordSelected"), null, 'errors'); setEventMessages($langs->trans("NoRecordSelected"), null, 'errors');
} }
} }
else else {
{
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorPleaseTypeBankTransactionReportName"), null, 'errors'); setEventMessages($langs->trans("ErrorPleaseTypeBankTransactionReportName"), null, 'errors');
@ -288,8 +285,7 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier)
{ {
$amount = price2num($_POST["addcredit"]); $amount = price2num($_POST["addcredit"]);
} }
else else {
{
$amount = - price2num($_POST["adddebit"]); $amount = - price2num($_POST["adddebit"]);
} }
@ -339,13 +335,11 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier)
header("Location: ".$_SERVER['PHP_SELF'].($id ? "?id=".$id : '')); header("Location: ".$_SERVER['PHP_SELF'].($id ? "?id=".$id : ''));
exit; exit;
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else {
{
$action = 'addline'; $action = 'addline';
} }
} }
@ -470,8 +464,7 @@ if ($id > 0 || !empty($ref))
} }
} }
} }
else else {
{
llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param); llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param);
} }
@ -676,8 +669,7 @@ if ($resql)
print $liste; print $liste;
if ($numr <= 0) print '<b>'.$langs->trans("None").'</b>'; if ($numr <= 0) print '<b>'.$langs->trans("None").'</b>';
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -794,13 +786,12 @@ if ($resql)
{ {
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier); $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier);
} }
else // If direct entries is not done using miscellaneous payments else // If direct entries is not done using miscellaneous payments
{ {
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier); $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier);
} }
} }
else else {
{
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1); $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1);
} }
} }
@ -1042,8 +1033,7 @@ if ($resql)
$balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount); $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount);
} }
// If sort is asc,asc,asc then total of previous date is balance of line before the next line to show // If sort is asc,asc,asc then total of previous date is balance of line before the next line to show
else else {
{
$balance = $objforbalance->previoustotal; $balance = $objforbalance->previoustotal;
} }
} }
@ -1130,8 +1120,7 @@ if ($resql)
$balance = price2num($balancebefore, 'MT'); // balance = balancebefore of previous line (sort is desc) $balance = price2num($balancebefore, 'MT'); // balance = balancebefore of previous line (sort is desc)
$balancebefore = price2num($balancebefore - ($sign * $objp->amount), 'MT'); $balancebefore = price2num($balancebefore - ($sign * $objp->amount), 'MT');
} }
else else {
{
$balancebefore = price2num($balance, 'MT'); // balancebefore = balance of previous line (sort is asc) $balancebefore = price2num($balance, 'MT'); // balancebefore = balance of previous line (sort is asc)
$balance = price2num($balance + ($sign * $objp->amount), 'MT'); $balance = price2num($balance + ($sign * $objp->amount), 'MT');
} }
@ -1143,8 +1132,7 @@ if ($resql)
$cachebankaccount[$objp->bankid] = $bankaccounttmp; $cachebankaccount[$objp->bankid] = $bankaccounttmp;
$bankaccount = $bankaccounttmp; $bankaccount = $bankaccounttmp;
} }
else else {
{
$bankaccount = $cachebankaccount[$objp->bankid]; $bankaccount = $cachebankaccount[$objp->bankid];
} }
@ -1280,8 +1268,7 @@ if ($resql)
print $bankstatic->getNomUrl(1, ''); print $bankstatic->getNomUrl(1, '');
print ')'; print ')';
} }
else else {
{
$bankstatic->id = $objp->bankid; $bankstatic->id = $objp->bankid;
$bankstatic->label = $objp->bankref; $bankstatic->label = $objp->bankref;
print ' ('.$langs->trans("TransferFrom").' '; print ' ('.$langs->trans("TransferFrom").' ';
@ -1307,11 +1294,10 @@ if ($resql)
elseif ($links[$key]['type'] == 'sc') elseif ($links[$key]['type'] == 'sc')
{ {
} }
elseif ($links[$key]['type'] == 'salary') elseif ($links[$key]['type'] == 'salary')
{ {
} }
else else {
{
// Show link with label $links[$key]['label'] // Show link with label $links[$key]['label']
if (!empty($objp->label) && !empty($links[$key]['label'])) print ' - '; if (!empty($objp->label) && !empty($links[$key]['label'])) print ' - ';
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">'; print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
@ -1321,8 +1307,7 @@ if ($resql)
if ($reg[1] == 'paiement') $reg[1] = 'Payment'; if ($reg[1] == 'paiement') $reg[1] = 'Payment';
print ' '.$langs->trans($reg[1]); print ' '.$langs->trans($reg[1]);
} }
else else {
{
print ' '.$links[$key]['label']; print ' '.$links[$key]['label'];
} }
print '</a>'; print '</a>';
@ -1400,8 +1385,7 @@ if ($resql)
$companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
print $companystatic->getNomUrl(1); print $companystatic->getNomUrl(1);
} }
else else {
{
print '&nbsp;'; print '&nbsp;';
} }
print '</td>'; print '</td>';
@ -1454,13 +1438,11 @@ if ($resql)
{ {
print '<td class="nowrap right">&nbsp;'.price($balancebefore).'</td>'; print '<td class="nowrap right">&nbsp;'.price($balancebefore).'</td>';
} }
else else {
{
print '<td class="error nowrap right">&nbsp;'.price($balancebefore).'</td>'; print '<td class="error nowrap right">&nbsp;'.price($balancebefore).'</td>';
} }
} }
else else {
{
print '<td class="right">-</td>'; print '<td class="right">-</td>';
} }
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
@ -1474,13 +1456,11 @@ if ($resql)
{ {
print '<td class="nowrap right">&nbsp;'.price($balance).'</td>'; print '<td class="nowrap right">&nbsp;'.price($balance).'</td>';
} }
else else {
{
print '<td class="error nowrap right">&nbsp;'.price($balance).'</td>'; print '<td class="error nowrap right">&nbsp;'.price($balance).'</td>';
} }
} }
else else {
{
print '<td class="right">-</td>'; print '<td class="right">-</td>';
} }
if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['nbfield']++;
@ -1527,16 +1507,14 @@ if ($resql)
print img_edit(); print img_edit();
print '</a>'; print '</a>';
} }
else else {
{
if ($user->rights->banque->modifier || $user->rights->banque->consolidate) if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{ {
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/compta/bank/line.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">'; print '<a class="editfielda" href="'.DOL_URL_ROOT.'/compta/bank/line.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_edit(); print img_edit();
print '</a>'; print '</a>';
} }
else else {
{
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/compta/bank/line.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">'; print '<a class="editfielda" href="'.DOL_URL_ROOT.'/compta/bank/line.php?save_lastsearch_values=1&amp;rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_view(); print img_view();
print '</a>'; print '</a>';
@ -1614,8 +1592,7 @@ if ($resql)
print '</form>'; print '</form>';
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }

View File

@ -243,7 +243,7 @@ if ($action == 'add' && empty($cancel))
} }
} }
if(empty($error)) { if (empty($error)) {
if (GETPOST('saveandnew', 'alpha')) { if (GETPOST('saveandnew', 'alpha')) {
setEventMessages($langs->trans("RecordSaved"), '', 'mesgs'); setEventMessages($langs->trans("RecordSaved"), '', 'mesgs');
header("Location: card.php?action=create&fk_project=" . urlencode($projectid) . "&accountid=" . urlencode($accountid) . '&paymenttype=' . urlencode(GETPOST('paymenttype', 'az09')) . '&datepday=' . GETPOST("datepday", 'int') . '&datepmonth=' . GETPOST("datepmonth", 'int') . '&datepyear=' . GETPOST("datepyear", 'int')); header("Location: card.php?action=create&fk_project=" . urlencode($projectid) . "&accountid=" . urlencode($accountid) . '&paymenttype=' . urlencode(GETPOST('paymenttype', 'az09')) . '&datepday=' . GETPOST("datepday", 'int') . '&datepmonth=' . GETPOST("datepmonth", 'int') . '&datepyear=' . GETPOST("datepyear", 'int'));
@ -253,7 +253,6 @@ if ($action == 'add' && empty($cancel))
exit; exit;
} }
} }
} }
$action = 'create'; $action = 'create';
@ -493,14 +492,14 @@ if ($action == 'create')
print '</td></tr>'; print '</td></tr>';
// Project // Project
if (!empty($conf->projet->enabled)) if (!empty($conf->projet->enabled))
{ {
$formproject = new FormProjets($db); $formproject = new FormProjets($db);
print '<tr><td>'.$langs->trans("Project").'</td><td>'; print '<tr><td>'.$langs->trans("Project").'</td><td>';
$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
print '</td></tr>'; print '</td></tr>';
} }
// Bank // Bank
if (!empty($conf->banque->enabled)) if (!empty($conf->banque->enabled))
@ -712,7 +711,6 @@ if ($id)
print '<tr><td>'.$langs->trans("DateEndPeriod")."</td><td>"; print '<tr><td>'.$langs->trans("DateEndPeriod")."</td><td>";
print $form->selectDate($object->dateep, 'dateep', 0, 0, 0, 'dateep', 1); print $form->selectDate($object->dateep, 'dateep', 0, 0, 0, 'dateep', 1);
print "</td></tr>"; print "</td></tr>";
} else { } else {
print "<tr>"; print "<tr>";
print '<td>' . $langs->trans("DateEndPeriod") . '</td><td>'; print '<td>' . $langs->trans("DateEndPeriod") . '</td><td>';

View File

@ -202,8 +202,7 @@ class PaymentSalary extends CommonObject
} }
} }
} }
else else {
{
$error++; $error++;
} }
} }
@ -218,8 +217,7 @@ class PaymentSalary extends CommonObject
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
@ -289,8 +287,7 @@ class PaymentSalary extends CommonObject
return 1; return 1;
} }
else else {
{
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
return -1; return -1;
} }
@ -361,8 +358,7 @@ class PaymentSalary extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
@ -417,8 +413,7 @@ class PaymentSalary extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
else else {
{
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
@ -468,8 +463,7 @@ class PaymentSalary extends CommonObject
$this->db->commit(); $this->db->commit();
return $object->id; return $object->id;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -584,8 +578,7 @@ class PaymentSalary extends CommonObject
} }
} }
} }
else else {
{
$this->error = $acc->error; $this->error = $acc->error;
$error++; $error++;
} }
@ -595,8 +588,7 @@ class PaymentSalary extends CommonObject
{ {
return 1; return 1;
} }
else else {
{
return -1; return -1;
} }
} }
@ -620,8 +612,7 @@ class PaymentSalary extends CommonObject
{ {
return 1; return 1;
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
return 0; return 0;
} }

View File

@ -187,8 +187,7 @@ class Salary extends CommonObject
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
@ -270,8 +269,7 @@ class Salary extends CommonObject
return 1; return 1;
} }
else else {
{
$this->error = "Error ".$this->db->lasterror(); $this->error = "Error ".$this->db->lasterror();
return -1; return -1;
} }
@ -388,7 +386,7 @@ class Salary extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -5; return -5;
} }
/* if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) /* if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0))
{ {
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account")); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
return -6; return -6;
@ -472,14 +470,12 @@ class Salary extends CommonObject
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
} }
else else {
{
$this->db->rollback(); $this->db->rollback();
return -2; return -2;
} }
} }
else else {
{
$this->error = $this->db->error(); $this->error = $this->db->error();
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
@ -503,8 +499,7 @@ class Salary extends CommonObject
{ {
return 1; return 1;
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
return -1; return -1;
} }
@ -611,8 +606,7 @@ class Salary extends CommonObject
$this->db->free($resql); $this->db->free($resql);
return $amount; return $amount;
} }
else else {
{
return -1; return -1;
} }
} }
@ -648,8 +642,7 @@ class Salary extends CommonObject
} }
$this->db->free($result); $this->db->free($result);
} }
else else {
{
dol_print_error($this->db); dol_print_error($this->db);
} }
} }

View File

@ -577,7 +577,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
} }
} }
// if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; // if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield';
// Amount // Amount
print '<td class="nowrap right">'.price($obj->amount).'</td>'; print '<td class="nowrap right">'.price($obj->amount).'</td>';

View File

@ -143,8 +143,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
header('Location: '.$loc); header('Location: '.$loc);
exit; exit;
} }
else else {
{
$db->rollback(); $db->rollback();
} }
} }
@ -285,8 +284,7 @@ if ($action == 'create')
{ {
print '<td class="left">'.dol_print_date($objp->dateep, 'day').'</td>'."\n"; print '<td class="left">'.dol_print_date($objp->dateep, 'day').'</td>'."\n";
} }
else else {
{
print "<td align=\"center\"><b>!!!</b></td>\n"; print "<td align=\"center\"><b>!!!</b></td>\n";
} }
@ -307,8 +305,7 @@ if ($action == 'create')
print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">'; print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'">'; print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'">';
} }
else else {
{
print '-'; print '-';
} }
print "</td>"; print "</td>";

View File

@ -68,8 +68,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->salaries-
header("Location: ".DOL_URL_ROOT."/salaries/payments.php"); header("Location: ".DOL_URL_ROOT."/salaries/payments.php");
exit; exit;
} }
else else {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$db->rollback(); $db->rollback();
} }
@ -244,8 +243,7 @@ if ($resql)
print "</table>\n"; print "</table>\n";
$db->free($resql); $db->free($resql);
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
@ -277,8 +275,7 @@ if ($action == '')
{ {
print '<a class="butActionDelete" href="card.php?id='.$_GET['id'].'&amp;action=delete">'.$langs->trans('Delete').'</a>'; print '<a class="butActionDelete" href="card.php?id='.$_GET['id'].'&amp;action=delete">'.$langs->trans('Delete').'</a>';
} }
else else {
{
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentSalaryPaid")).'">'.$langs->trans('Delete').'</a>'; print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentSalaryPaid")).'">'.$langs->trans('Delete').'</a>';
} }
} }

View File

@ -105,8 +105,7 @@ elseif ($mysoc->localtax2_assuj == "1")
$j = 2; $j = 2;
$numlt = 3; $numlt = 3;
} }
else else {
{
$j = 0; $j = 0;
$numlt = 0; $numlt = 0;
} }
@ -124,7 +123,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read))
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON (u.rowid = s.fk_user)"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON (u.rowid = s.fk_user)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ps.fk_typepaiement = pct.id"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ps.fk_typepaiement = pct.id";
$sql .= " WHERE s.entity IN (".getEntity('user').")"; $sql .= " WHERE s.entity IN (".getEntity('user').")";
/* if ($year > 0) /* if ($year > 0)
{ {
$sql .= " AND (s.datesp between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'"; $sql .= " AND (s.datesp between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
$sql .= " OR s.dateep between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."')"; $sql .= " OR s.dateep between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."')";
@ -208,8 +207,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read))
print "<br>"; print "<br>";
} }
else else {
{
dol_print_error($db); dol_print_error($db);
} }
} }