Clean code

This commit is contained in:
Laurent Destailleur 2019-11-02 01:30:51 +01:00
parent a14aab5eb1
commit 8c90c80107
5 changed files with 4 additions and 10 deletions

View File

@ -633,7 +633,6 @@ class PaymentDonation extends CommonObject
$result='';
if (empty($this->ref)) $this->ref=$this->lib;
$label = $langs->trans("ShowPayment").': '.$this->ref;
if (!empty($this->id))

View File

@ -1506,7 +1506,7 @@ if ($action == 'create')
print '<tr>';
print '<td>'.$langs->trans("ModePaiement").'</td>';
print '<td>';
$form->select_types_paiements(2, 'fk_c_paiement');
$form->select_types_paiements('', 'fk_c_paiement');
print '</td>';
print '</tr>';
}
@ -1832,7 +1832,7 @@ else
{
print '<tr>';
print '<td>'.$langs->trans("ModePaiement").'</td>';
print '<td>'.$object->libelle_paiement.'</td>';
print '<td>'.$object->fk_c_paiement.'</td>';
print '</tr>';
}

View File

@ -511,7 +511,7 @@ class ExpenseReport extends CommonObject
$sql.= " d.fk_user_author, d.fk_user_modif, d.fk_user_validator,";
$sql.= " d.fk_user_valid, d.fk_user_approve,";
$sql.= " d.fk_statut as status, d.fk_c_paiement, d.paid,";
$sql.= " dp.libelle as libelle_paiement, dp.code as code_paiement"; // INNER JOIN paiement
$sql.= " dp.libelle as label_payment, dp.code as code_paiement"; // INNER JOIN paiement
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as dp ON d.fk_c_paiement = dp.id";
if ($ref) $sql.= " WHERE d.ref = '".$this->db->escape($ref)."'";
@ -567,15 +567,13 @@ class ExpenseReport extends CommonObject
$this->fk_c_paiement = $obj->fk_c_paiement;
$this->paid = $obj->paid;
if ($this->fk_statut==5 || $this->fk_statut==6)
if ($this->fk_statut == self::STATUS_APPROVED || $this->fk_statut == self::STATUS_CLOSED)
{
$user_valid = new User($this->db);
if ($this->fk_user_valid > 0) $user_valid->fetch($this->fk_user_valid);
$this->user_valid_infos = dolGetFirstLastname($user_valid->firstname, $user_valid->lastname);
}
$this->libelle_statut = $obj->libelle_statut;
$this->libelle_paiement = $obj->libelle_paiement;
$this->code_statut = $obj->code_statut;
$this->code_paiement = $obj->code_paiement;

View File

@ -221,7 +221,6 @@ if ($result)
print '<td class="right">'.price($obj->total_ttc).'</td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->dm), 'day').'</td>';
print '<td class="right">';
//print $obj->libelle;
print $expensereportstatic->LibStatut($obj->fk_status, 3);
print '</td>';
print '</tr>';

View File

@ -545,8 +545,6 @@ class PaymentLoan extends CommonObject
$result='';
if (empty($this->ref)) $this->ref=$this->lib;
if (!empty($this->id))
{
$link = '<a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$this->id.'">';