Uniformize code
This commit is contained in:
parent
3520c94641
commit
9321272838
@ -655,8 +655,7 @@ else
|
|||||||
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"b.amount", "",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("LineRecord"),$_SERVER["PHP_SELF"],"b.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Payment"),$_SERVER["PHP_SELF"],"p.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Payment"),$_SERVER["PHP_SELF"],"p.rowid", "",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i=1;
|
$i=1;
|
||||||
$var=false;
|
$var=false;
|
||||||
@ -699,18 +698,12 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if ($object->statut == 0)
|
if ($object->statut == 0)
|
||||||
{
|
{
|
||||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&lineid='.$objp->rowid.'">'.img_delete().'</a></td>';
|
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&lineid='.$objp->rowid.'">'.img_delete().'</a>';
|
||||||
}
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reject_check&lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"),'disable').'</a></td>';
|
||||||
else
|
|
||||||
{
|
|
||||||
if($objp->statut == 0)
|
|
||||||
{
|
|
||||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reject_check&lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"),'disable').'</a></td>';
|
|
||||||
}
|
}
|
||||||
else if($objp->statut == 2) {
|
else if($objp->statut == 2) {
|
||||||
print '<td align="right">'.img_picto($langs->trans('CheckRejected'),'statut8').'</a></td>';
|
print '<td align="right">'.img_picto($langs->trans('CheckRejected'),'statut8').'</a></td>';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -673,7 +673,7 @@ class RemiseCheque extends CommonObject
|
|||||||
global $db, $user;
|
global $db, $user;
|
||||||
|
|
||||||
$payment = new Paiement($db);
|
$payment = new Paiement($db);
|
||||||
$payment->fetch(0,$bank_id);
|
$payment->fetch(0,0,$bank_id);
|
||||||
|
|
||||||
$bankaccount = $payment->fk_account;
|
$bankaccount = $payment->fk_account;
|
||||||
|
|
||||||
@ -688,10 +688,11 @@ class RemiseCheque extends CommonObject
|
|||||||
$rejectedPayment = new Paiement($db);
|
$rejectedPayment = new Paiement($db);
|
||||||
$rejectedPayment->amounts = array();
|
$rejectedPayment->amounts = array();
|
||||||
$rejectedPayment->datepaye = $rejection_date;
|
$rejectedPayment->datepaye = $rejection_date;
|
||||||
$rejectedPayment->paiementid = 7; // type of payment: check
|
$rejectedPayment->paiementid = dol_getIdFromCode($this->db, 'CHQ', 'c_paiement');
|
||||||
$rejectedPayment->num_paiement = $payment->numero;
|
$rejectedPayment->num_paiement = $payment->numero;
|
||||||
|
|
||||||
while($obj = $db->fetch_object($resql)) {
|
while($obj = $db->fetch_object($resql))
|
||||||
|
{
|
||||||
$invoice = new Facture($db);
|
$invoice = new Facture($db);
|
||||||
$invoice->fetch($obj->fk_facture);
|
$invoice->fetch($obj->fk_facture);
|
||||||
$invoice->set_unpaid($user);
|
$invoice->set_unpaid($user);
|
||||||
|
|||||||
@ -79,10 +79,11 @@ class Paiement extends CommonObject
|
|||||||
* Load payment from database
|
* Load payment from database
|
||||||
*
|
*
|
||||||
* @param int $id Id of payment to get
|
* @param int $id Id of payment to get
|
||||||
|
* @param string $ref Ref of payment to get (currently ref = id but this may change in future)
|
||||||
* @param int $fk_bank Id of bank line associated to payment
|
* @param int $fk_bank Id of bank line associated to payment
|
||||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id, $fk_bank='')
|
function fetch($id, $ref='', $fk_bank='')
|
||||||
{
|
{
|
||||||
$sql = 'SELECT p.rowid, p.datep as dp, p.amount, p.statut, p.fk_bank,';
|
$sql = 'SELECT p.rowid, p.datep as dp, p.amount, p.statut, p.fk_bank,';
|
||||||
$sql.= ' c.code as type_code, c.libelle as type_libelle,';
|
$sql.= ' c.code as type_code, c.libelle as type_libelle,';
|
||||||
@ -91,10 +92,12 @@ class Paiement extends CommonObject
|
|||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement as p';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_paiement as c, '.MAIN_DB_PREFIX.'paiement as p';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid ';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid ';
|
||||||
$sql.= ' WHERE p.fk_paiement = c.id';
|
$sql.= ' WHERE p.fk_paiement = c.id';
|
||||||
if ($fk_bank)
|
if ($id > 0)
|
||||||
$sql.= ' AND p.fk_bank = '.$fk_bank;
|
|
||||||
else
|
|
||||||
$sql.= ' AND p.rowid = '.$id;
|
$sql.= ' AND p.rowid = '.$id;
|
||||||
|
else if ($ref)
|
||||||
|
$sql.= ' AND p.rowid = '.$ref;
|
||||||
|
else if ($fk_bank)
|
||||||
|
$sql.= ' AND p.fk_bank = '.$fk_bank;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user