Fixing style errors.
This commit is contained in:
parent
c1cd13aee3
commit
694f65082f
@ -143,8 +143,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
|
||||
header('Location: '.$loc);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -285,8 +284,7 @@ if ($action == 'create')
|
||||
{
|
||||
print '<td class="left">'.dol_print_date($objp->datev, 'day').'</td>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print "<td align=\"center\"><b>!!!</b></td>\n";
|
||||
}
|
||||
|
||||
@ -308,8 +306,7 @@ if ($action == 'create')
|
||||
print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
|
||||
print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '-';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
@ -68,8 +68,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->char
|
||||
header("Location: ".DOL_URL_ROOT."/compta/tva/payments.php?mode=tvaonly");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
@ -262,7 +261,7 @@ if ($resql)
|
||||
print $tva->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
// Type
|
||||
/* print '<td>';
|
||||
/* print '<td>';
|
||||
print $tva->type_label;4
|
||||
print "</td>\n";*/
|
||||
// Label
|
||||
@ -287,8 +286,7 @@ if ($resql)
|
||||
print "</table>\n";
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -320,8 +318,7 @@ if ($action == '')
|
||||
{
|
||||
print '<a class="butActionDelete" href="card.php?id='.$_GET['id'].'&action=delete">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("CantRemovePaymentVATPaid")).'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
if (!$error)
|
||||
{
|
||||
$ret = $object->create($user);
|
||||
if($ret < 0) $error++;
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
// Auto create payment
|
||||
if (!empty($auto_create_payment) && !$error)
|
||||
@ -195,7 +195,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$paymentid = $paiement->create($user, (int)GETPOST('closepaidtva'));
|
||||
$paymentid = $paiement->create($user, (int) GETPOST('closepaidtva'));
|
||||
if ($paymentid < 0)
|
||||
{
|
||||
$error++;
|
||||
@ -218,12 +218,11 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
if(empty($error)) {
|
||||
if (empty($error)) {
|
||||
header("Location: card.php?id=" . $object->id);
|
||||
exit;
|
||||
}
|
||||
@ -257,21 +256,18 @@ if ($action == 'confirm_delete' && $confirm == 'yes')
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/tva/list.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$object->error = $accountline->error;
|
||||
$db->rollback();
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
setEventMessages($langs->trans('DisabledBecausePayments'), null, 'errors');
|
||||
}
|
||||
}
|
||||
@ -290,8 +286,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->tax->charges->cre
|
||||
setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentities("Amount")), null, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$object->amount = price2num($amount);
|
||||
@ -340,8 +335,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$id = $originalId;
|
||||
$db->rollback();
|
||||
|
||||
@ -349,8 +343,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char
|
||||
}
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$db->rollback();
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
@ -405,8 +398,8 @@ if ($action == 'create')
|
||||
}
|
||||
});';
|
||||
|
||||
if($_REQUEST['action'] === 'add') { // form has been send but there is at least one error
|
||||
if(empty($auto_create_payment)) {
|
||||
if ($_REQUEST['action'] === 'add') { // form has been send but there is at least one error
|
||||
if (empty($auto_create_payment)) {
|
||||
print '$("#label_fk_account").removeClass("fieldrequired");
|
||||
$("#label_type_payment").removeClass("fieldrequired");
|
||||
$(".hide_if_no_auto_create_payment").hide();';
|
||||
@ -727,8 +720,7 @@ if ($id)
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<tr class="oddeven"><td><span class="opacitymedium">'.$langs->trans("None").'</span></td>';
|
||||
print '<td></td><td></td><td></td><td></td>';
|
||||
print '</tr>';
|
||||
@ -748,8 +740,7 @@ if ($id)
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -816,8 +807,7 @@ if ($id)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.(dol_escape_htmltag($langs->trans("DisabledBecausePayments"))).'">'.$langs->trans("Delete").'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,8 +201,7 @@ class PaymentVAT extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -217,8 +216,7 @@ class PaymentVAT extends CommonObject
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
@ -288,8 +286,7 @@ class PaymentVAT extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -360,8 +357,7 @@ class PaymentVAT extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -416,8 +412,7 @@ class PaymentVAT extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -467,8 +462,7 @@ class PaymentVAT extends CommonObject
|
||||
$this->db->commit();
|
||||
return $object->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -582,8 +576,7 @@ class PaymentVAT extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $acc->error;
|
||||
$error++;
|
||||
}
|
||||
@ -593,8 +586,7 @@ class PaymentVAT extends CommonObject
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -618,8 +610,7 @@ class PaymentVAT extends CommonObject
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -164,14 +164,12 @@ class Tva extends CommonObject
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
@ -236,8 +234,7 @@ class Tva extends CommonObject
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -337,8 +334,7 @@ class Tva extends CommonObject
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -448,14 +444,12 @@ class Tva extends CommonObject
|
||||
$this->db->free($result);
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->free($result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -489,14 +483,12 @@ class Tva extends CommonObject
|
||||
$this->db->free($result);
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->free($result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -532,14 +524,12 @@ class Tva extends CommonObject
|
||||
$this->db->free($result);
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->free($result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
@ -657,8 +647,7 @@ class Tva extends CommonObject
|
||||
{
|
||||
$this->update_fk_bank($bank_line_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $acc->error;
|
||||
$ok = 0;
|
||||
}
|
||||
@ -677,20 +666,17 @@ class Tva extends CommonObject
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
@ -714,8 +700,7 @@ class Tva extends CommonObject
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
@ -797,8 +782,7 @@ class Tva extends CommonObject
|
||||
$this->db->free($resql);
|
||||
return $amount;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -844,8 +828,7 @@ class Tva extends CommonObject
|
||||
|
||||
$this->db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,8 +60,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
if (empty($q))
|
||||
{
|
||||
if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); }
|
||||
else
|
||||
{
|
||||
else {
|
||||
if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter
|
||||
$date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm');
|
||||
$date_end = dol_time_plus_duree($date_start, 3, 'm') - 1;
|
||||
@ -85,8 +84,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); }
|
||||
if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); }
|
||||
if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); }
|
||||
@ -179,8 +177,7 @@ function pt($db, $sql, $date)
|
||||
$previousmode = '';
|
||||
$previousmonth = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$previousmode = $obj->mode;
|
||||
$previousmonth = $obj->dm;
|
||||
}
|
||||
@ -373,8 +370,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc
|
||||
//'link' =>$expensereport->getNomUrl(1)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id];
|
||||
//$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id];
|
||||
//$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id];
|
||||
|
||||
@ -397,7 +397,7 @@ while ($i < min($num, $limit)) {
|
||||
if (!empty($arrayfields['t.status']['checked'])) {
|
||||
print '<td class="nowrap right">' . $tva_static->LibStatut($obj->paye, 5, $obj->alreadypayed) . '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
if(!empty($arrayfields['t.amount']['checked'])) $totalarray['pos'][$totalarray['nbfield']] = '';
|
||||
if (!empty($arrayfields['t.amount']['checked'])) $totalarray['pos'][$totalarray['nbfield']] = '';
|
||||
}
|
||||
|
||||
// Buttons
|
||||
|
||||
@ -95,8 +95,7 @@ if ($mode != 'tvaonly')
|
||||
$center = ($year ? '<a href="list.php?year='.($year - 1).$param.'">'.img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a> ".$langs->trans("Year").' '.$year.' <a href="list.php?year='.($year + 1).$param.'">'.img_next($langs->trans("Next"), 'class="valignbottom"')."</a>" : "");
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit);
|
||||
}
|
||||
|
||||
@ -224,8 +223,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
print '<td class="liste_total right">'.price($totalpaye)."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '</table>';
|
||||
@ -303,8 +301,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
print "</table>";
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
@ -326,8 +323,7 @@ elseif ($mysoc->localtax2_assuj == "1")
|
||||
$j = 2;
|
||||
$numlt = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
$j = 0;
|
||||
$numlt = 0;
|
||||
}
|
||||
@ -404,8 +400,7 @@ while ($j < $numlt)
|
||||
print "</table>";
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
@ -488,8 +483,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read))
|
||||
|
||||
print "<br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user