diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php
index 9fc4668d900..53f09bb4786 100644
--- a/htdocs/eventorganization/class/conferenceorbooth.class.php
+++ b/htdocs/eventorganization/class/conferenceorbooth.class.php
@@ -190,6 +190,8 @@ class ConferenceOrBooth extends ActionComm
/**
* Set Percentage from status
+ *
+ * @return void
*/
public function setPercentageFromStatus()
{
diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php
index 105d2afe148..8bd2bd2dac1 100755
--- a/htdocs/salaries/card.php
+++ b/htdocs/salaries/card.php
@@ -195,7 +195,6 @@ if ($action == 'add' && empty($cancel)) {
}
if (!$error) {
-
$ret = $object->create($user);
if ($ret < 0) $error++;
if (!empty($auto_create_paiement) && !$error) {
@@ -257,18 +256,15 @@ if ($action == 'confirm_delete') {
$db->begin();
$ret = $object->delete($user);
- if ($ret > 0)
- {
+ if ($ret > 0) {
$db->commit();
header("Location: ".DOL_URL_ROOT.'/salaries/list.php');
exit;
- }
- else {
+ } else {
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
}
- }
- else {
+ } else {
setEventMessages($langs->trans('DisabledBecausePayments'), null, 'errors');
}
}
@@ -280,8 +276,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->salaries->write)
if (empty($amount)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors');
$action = 'edit';
- }
- elseif (!is_numeric($amount)) {
+ } elseif (!is_numeric($amount)) {
setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentities("Amount")), null, 'errors');
$action = 'create';
} else {
@@ -307,15 +302,13 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->salaries-
$object->fetch($id);
- if ($object->id > 0)
- {
+ if ($object->id > 0) {
$object->paye = 0;
$object->id = $object->ref = null;
if (GETPOST('clone_label', 'alphanohtml')) {
$object->label = GETPOST('clone_label', 'alphanohtml');
- }
- else {
+ } else {
$object->label = $langs->trans("CopyOf").' '.$object->label;
}
@@ -325,25 +318,20 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->salaries-
if ($newdatestart) $object->datesp = $newdatestart;
if ($newdateend) $object->dateep = $newdateend;
- //if ($object->check()) {
$id = $object->create($user);
- if ($id > 0)
- {
+ if ($id > 0) {
$db->commit();
$db->close();
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
- }
- else {
+ } else {
$id = $originalId;
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
}
- //}
- }
- else {
+ } else {
$db->rollback();
dol_print_error($db, $object->error);
}
@@ -712,8 +700,9 @@ if ($id) {
print '
';
print '';
if ($action == 'editbankaccount') {
@@ -892,8 +881,7 @@ if ($id) {
if (!empty($user->rights->salaries->delete) && empty($totalpaye)) {
print '';
- }
- else {
+ } else {
print '';
}
}
diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php
index d3c34a763b9..e428880485e 100644
--- a/htdocs/salaries/list.php
+++ b/htdocs/salaries/list.php
@@ -453,10 +453,10 @@ print ''."\n";
// --------------------------------------------------------------------
print ' | ';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder);
- print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname", "", $param, "", $sortfield, $sortorder);
+print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "s.label", "", $param, 'class="left"', $sortfield, $sortorder);
- print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "s.datesp,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
- print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "s.dateep,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
+print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "s.datesp,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
+print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "s.dateep,s.rowid", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'class="left"', $sortfield, $sortorder);
if (!empty($conf->banque->enabled)) {
print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
@@ -645,7 +645,6 @@ print ''."\n";
print ''."\n";
-
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php
index 1b5924ba7c4..df762b1db85 100644
--- a/htdocs/salaries/paiement_salary.php
+++ b/htdocs/salaries/paiement_salary.php
@@ -60,18 +60,18 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
if (!(GETPOST("paiementtype", 'int') > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")), null, 'errors');
$error++;
- $action = 'create';
+ $action = 'create';
}
if ($datepaye == '') {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors');
$error++;
- $action = 'create';
+ $action = 'create';
+ }
+ if (!empty($conf->banque->enabled) && !(GETPOST("accountid", 'int') > 0)) {
+ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors');
+ $error++;
+ $action = 'create';
}
- if (!empty($conf->banque->enabled) && !(GETPOST("accountid", 'int') > 0)) {
- setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors');
- $error++;
- $action = 'create';
- }
if (!$error) {
$paymentid = 0;
@@ -84,52 +84,52 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
}
}
- if (count($amounts) <= 0) {
- $error++;
- setEventMessages($langs->trans("ErrorNoPaymentDefined"), null, 'errors');
- $action = 'create';
- }
+ if (count($amounts) <= 0) {
+ $error++;
+ setEventMessages($langs->trans("ErrorNoPaymentDefined"), null, 'errors');
+ $action = 'create';
+ }
- if (!$error) {
- $db->begin();
+ if (!$error) {
+ $db->begin();
- // Create a line of payments
- $paiement = new PaymentSalary($db);
- $paiement->chid = $chid;
- $paiement->datepaye = $datepaye;
- $paiement->amounts = $amounts; // Tableau de montant
- $paiement->paiementtype = GETPOST("paiementtype", 'alphanohtml');
- $paiement->num_payment = GETPOST("num_payment", 'alphanohtml');
- $paiement->note = GETPOST("note", 'none');
- $paiement->note_private = GETPOST("note", 'none');
+ // Create a line of payments
+ $paiement = new PaymentSalary($db);
+ $paiement->chid = $chid;
+ $paiement->datepaye = $datepaye;
+ $paiement->amounts = $amounts; // Tableau de montant
+ $paiement->paiementtype = GETPOST("paiementtype", 'alphanohtml');
+ $paiement->num_payment = GETPOST("num_payment", 'alphanohtml');
+ $paiement->note = GETPOST("note", 'none');
+ $paiement->note_private = GETPOST("note", 'none');
- if (!$error) {
- $paymentid = $paiement->create($user, (GETPOST('closepaidsalary') == 'on' ? 1 : 0));
- if ($paymentid < 0) {
- $error++;
- setEventMessages($paiement->error, null, 'errors');
- $action = 'create';
- }
- }
+ if (!$error) {
+ $paymentid = $paiement->create($user, (GETPOST('closepaidsalary') == 'on' ? 1 : 0));
+ if ($paymentid < 0) {
+ $error++;
+ setEventMessages($paiement->error, null, 'errors');
+ $action = 'create';
+ }
+ }
- if (!$error) {
- $result = $paiement->addPaymentToBank($user, 'payment_salary', '(SalaryPayment)', GETPOST('accountid', 'int'), '', '');
- if (!($result > 0)) {
- $error++;
- setEventMessages($paiement->error, null, 'errors');
- $action = 'create';
- }
- }
+ if (!$error) {
+ $result = $paiement->addPaymentToBank($user, 'payment_salary', '(SalaryPayment)', GETPOST('accountid', 'int'), '', '');
+ if (!($result > 0)) {
+ $error++;
+ setEventMessages($paiement->error, null, 'errors');
+ $action = 'create';
+ }
+ }
- if (!$error) {
- $db->commit();
- $loc = DOL_URL_ROOT.'/salaries/card.php?id='.$chid;
- header('Location: '.$loc);
- exit;
- } else {
- $db->rollback();
- }
- }
+ if (!$error) {
+ $db->commit();
+ $loc = DOL_URL_ROOT.'/salaries/card.php?id='.$chid;
+ header('Location: '.$loc);
+ exit;
+ } else {
+ $db->rollback();
+ }
+ }
}
}
@@ -147,8 +147,8 @@ $form = new Form($db);
if ($action == 'create') {
$salary = new Salary($db);
$salary->fetch($chid);
- $salary->accountid = $salary->fk_account ? $salary->fk_account : $salary->accountid;
- $salary->paiementtype = $salary->mode_reglement_id ? $salary->mode_reglement_id : $salary->paiementtype;
+ $salary->accountid = $salary->fk_account ? $salary->fk_account : $salary->accountid;
+ $salary->paiementtype = $salary->mode_reglement_id ? $salary->mode_reglement_id : $salary->paiementtype;
$total = $salary->amount;
if (!empty($conf->use_javascript_ajax)) {
@@ -231,7 +231,7 @@ if ($action == 'create') {
dol_fiche_end();
/*
- * Autres charges impayees
+ * Autres charges impayees
*/
$num = 1;
$i = 0;
diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php
index d3b8da70a39..6c2371e079e 100644
--- a/htdocs/salaries/payment_salary/card.php
+++ b/htdocs/salaries/payment_salary/card.php
@@ -61,9 +61,9 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->salaries-
$result = $object->delete($user);
if ($result > 0) {
- $db->commit();
- header("Location: ".DOL_URL_ROOT."/salaries/payments.php");
- exit;
+ $db->commit();
+ header("Location: ".DOL_URL_ROOT."/salaries/payments.php");
+ exit;
} else {
setEventMessages($object->error, $object->errors, 'errors');
$db->rollback();
@@ -90,7 +90,8 @@ $head[$h][1] = $langs->trans("SalaryPayment");
$hselected = $h;
$h++;
-/*$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/info.php?id='.$id;
+/*
+$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/info.php?id='.$id;
$head[$h][1] = $langs->trans("Info");
$h++;
*/