Clean code
This commit is contained in:
parent
f405505e0f
commit
cce4ebdb8c
@ -1127,9 +1127,10 @@ class Paiement extends CommonObject
|
||||
* @param string $option Sur quoi pointe le lien
|
||||
* @param string $mode 'withlistofinvoices'=Include list of invoices into tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param string $morecss Add more CSS
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
public function getNomUrl($withpicto = 0, $option = '', $mode = 'withlistofinvoices', $notooltip = 0)
|
||||
public function getNomUrl($withpicto = 0, $option = '', $mode = 'withlistofinvoices', $notooltip = 0, $morecss = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
||||
@ -256,6 +256,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
|
||||
'pstatusbuy'=>$x_paye[$my_coll_thirdpartyid]['pstatusbuy'][$id],
|
||||
|
||||
'payment_id'=>$x_coll[$my_coll_thirdpartyid]['payment_id'][$id],
|
||||
'payment_ref'=>$x_coll[$my_coll_thirdpartyid]['payment_ref'][$id],
|
||||
'payment_amount'=>$x_coll[$my_coll_thirdpartyid]['payment_amount'][$id],
|
||||
'ftotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['ftotal_ttc'][$id],
|
||||
'dtotal_ttc'=>$x_coll[$my_coll_thirdpartyid]['dtotal_ttc'][$id],
|
||||
@ -303,6 +304,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
|
||||
'pstatusbuy' =>$x_paye[$my_paye_thirdpartyid]['pstatusbuy'][$id],
|
||||
|
||||
'payment_id' =>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id],
|
||||
'payment_ref' =>$x_paye[$my_paye_thirdpartyid]['payment_ref'][$id],
|
||||
'payment_amount' =>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id],
|
||||
'ftotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]),
|
||||
'dtotal_ttc' =>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]),
|
||||
@ -344,6 +346,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
|
||||
'pstatusbuy'=>$x_paye[$my_paye_thirdpartyid]['pstatusbuy'][$id],
|
||||
|
||||
'payment_id'=>$x_paye[$my_paye_thirdpartyid]['payment_id'][$id],
|
||||
'payment_ref'=>$x_paye[$my_paye_thirdpartyid]['payment_ref'][$id],
|
||||
'payment_amount'=>$x_paye[$my_paye_thirdpartyid]['payment_amount'][$id],
|
||||
'ftotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['ftotal_ttc'][$id]),
|
||||
'dtotal_ttc'=>price2num($x_paye[$my_paye_thirdpartyid]['dtotal_ttc'][$id]),
|
||||
@ -510,6 +513,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
|
||||
//print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
|
||||
if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
|
||||
$payment_static->id = $fields['payment_id'];
|
||||
$payment_static->ref = $fields['payment_ref'];
|
||||
print $payment_static->getNomUrl(2, '', '', 0).' ';
|
||||
}
|
||||
if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice')
|
||||
@ -698,6 +702,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
|
||||
print '<td class="nowrap right">';
|
||||
if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
|
||||
$paymentfourn_static->id = $fields['payment_id'];
|
||||
$paymentfourn_static->ref = $fields['payment_ref'];
|
||||
print $paymentfourn_static->getNomUrl(2, '', '', 0);
|
||||
}
|
||||
|
||||
|
||||
@ -546,6 +546,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
|
||||
//print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
|
||||
if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
|
||||
$payment_static->id = $fields['payment_id'];
|
||||
$payment_static->ref = $fields['payment_ref'];
|
||||
print $payment_static->getNomUrl(2, '', '', 0).' ';
|
||||
}
|
||||
if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice')
|
||||
@ -779,6 +780,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) {
|
||||
print '<td class="nowrap right">';
|
||||
if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
|
||||
$paymentfourn_static->id = $fields['payment_id'];
|
||||
$paymentfourn_static->ref = $fields['payment_ref'];
|
||||
print $paymentfourn_static->getNomUrl(2, '', '', 0).' ';
|
||||
}
|
||||
|
||||
|
||||
@ -149,7 +149,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
$sql .= " s.code_compta as company_customer_accounting_code, s.code_compta_fournisseur as company_supplier_accounting_code,";
|
||||
$sql .= " s.status as company_status, s.tva_intra as company_tva_intra,";
|
||||
$sql .= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype, p.tosell as pstatus, p.tobuy as pstatusbuy,";
|
||||
$sql .= " 0 as payment_id, 0 as payment_amount";
|
||||
$sql .= " 0 as payment_id, '' as payment_ref, 0 as payment_amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."societe as s,";
|
||||
$sql .= " ".MAIN_DB_PREFIX.$invoicedettable." as d";
|
||||
@ -195,7 +195,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
$sql .= " s.status as company_status, s.tva_intra as company_tva_intra,";
|
||||
$sql .= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype, p.tosell as pstatus, p.tobuy as pstatusbuy,";
|
||||
$sql .= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount,";
|
||||
$sql .= " pa.datep as datep";
|
||||
$sql .= " pa.datep as datep, pa.ref as payment_ref";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||
$sql .= " ".MAIN_DB_PREFIX.$paymentfacturetable." as pf,";
|
||||
$sql .= " ".MAIN_DB_PREFIX.$paymenttable." as pa,";
|
||||
@ -334,7 +334,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
$sql .= " s.code_compta as company_customer_accounting_code, s.code_compta_fournisseur as company_supplier_accounting_code,";
|
||||
$sql .= " s.status as company_status, s.tva_intra as company_tva_intra,";
|
||||
$sql .= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype, p.tosell as pstatus, p.tobuy as pstatusbuy,";
|
||||
$sql .= " 0 as payment_id, 0 as payment_amount";
|
||||
$sql .= " 0 as payment_id, '' as payment_ref, 0 as payment_amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."societe as s,";
|
||||
$sql .= " ".MAIN_DB_PREFIX.$invoicedettable." as d";
|
||||
@ -380,7 +380,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
$sql .= " s.status as company_status, s.tva_intra as company_tva_intra,";
|
||||
$sql .= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype, p.tosell as pstatus, p.tobuy as pstatusbuy,";
|
||||
$sql .= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount,";
|
||||
$sql .= " pa.datep as datep";
|
||||
$sql .= " pa.datep as datep, pa.ref as payment_ref";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f,";
|
||||
$sql .= " ".MAIN_DB_PREFIX.$paymentfacturetable." as pf,";
|
||||
$sql .= " ".MAIN_DB_PREFIX.$paymenttable." as pa,";
|
||||
@ -492,6 +492,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
$list[$assoc['company_id']]['ptype'][] = $assoc['ptype'];
|
||||
|
||||
$list[$assoc['company_id']]['payment_id'][] = $assoc['payment_id'];
|
||||
$list[$assoc['company_id']]['payment_ref'][] = $assoc['payment_ref'];
|
||||
$list[$assoc['company_id']]['payment_amount'][] = $assoc['payment_amount'];
|
||||
|
||||
$company_id = $assoc['company_id'];
|
||||
@ -614,6 +615,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
$list[$assoc['company_id']]['ptype'][] = 'ExpenseReportPayment';
|
||||
|
||||
$list[$assoc['company_id']]['payment_id'][] = $assoc['payment_id'];
|
||||
$list[$assoc['company_id']]['payment_ref'][] = $assoc['payment_ref'];
|
||||
$list[$assoc['company_id']]['payment_amount'][] = $assoc['payment_amount'];
|
||||
|
||||
$company_id = $assoc['company_id'];
|
||||
@ -703,7 +705,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
$sql .= " s.code_compta as company_customer_accounting_code, s.code_compta_fournisseur as company_supplier_accounting_code,";
|
||||
$sql .= " s.status as company_status, s.tva_intra as company_tva_intra,";
|
||||
$sql .= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
||||
$sql .= " 0 as payment_id, 0 as payment_amount";
|
||||
$sql .= " 0 as payment_id, '' as payment_ref, 0 as payment_amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX.$invoicedettable." as d ON d.".$fk_facture."=f.rowid";
|
||||
@ -747,7 +749,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
$sql .= " s.status as company_status, s.tva_intra as company_tva_intra,";
|
||||
$sql .= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
||||
$sql .= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount,";
|
||||
$sql .= " pa.datep as datep";
|
||||
$sql .= " pa.datep as datep, pa.ref as payment_ref";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX.$paymentfacturetable." as pf ON pf.".$fk_facture2." = f.rowid";;
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX.$paymenttable." as pa ON pa.rowid = pf.".$fk_payment;
|
||||
@ -855,6 +857,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
$list[$assoc['rate']]['ptype'][] = $assoc['ptype'];
|
||||
|
||||
$list[$assoc['rate']]['payment_id'][] = $assoc['payment_id'];
|
||||
$list[$assoc['rate']]['payment_ref'][] = $assoc['payment_ref'];
|
||||
$list[$assoc['rate']]['payment_amount'][] = $assoc['payment_amount'];
|
||||
|
||||
$rate = $assoc['rate'];
|
||||
@ -882,7 +885,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
$sql .= " s.code_compta as company_customer_accounting_code, s.code_compta_fournisseur as company_supplier_accounting_code,";
|
||||
$sql .= " s.status as company_status, s.tva_intra as company_tva_intra,";
|
||||
$sql .= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
||||
$sql .= " 0 as payment_id, 0 as payment_amount";
|
||||
$sql .= " 0 as payment_id, '' as payment_ref, 0 as payment_amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX.$invoicedettable." as d ON d.".$fk_facture." = f.rowid";
|
||||
@ -926,7 +929,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
$sql .= " s.status as company_status, s.tva_intra as company_tva_intra,";
|
||||
$sql .= " p.rowid as pid, p.ref as pref, p.fk_product_type as ptype,";
|
||||
$sql .= " pf.".$fk_payment." as payment_id, pf.amount as payment_amount,";
|
||||
$sql .= " pa.datep as datep";
|
||||
$sql .= " pa.datep as datep, pa.ref as payment_ref";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$invoicetable." as f";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX.$paymentfacturetable." as pf ON pf.".$fk_facture2." = f.rowid";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX.$paymenttable." as pa ON pa.rowid = pf.".$fk_payment;
|
||||
@ -1034,6 +1037,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
$list[$assoc['rate']]['ptype'][] = $assoc['ptype'];
|
||||
|
||||
$list[$assoc['rate']]['payment_id'][] = $assoc['payment_id'];
|
||||
$list[$assoc['rate']]['payment_ref'][] = $assoc['payment_ref'];
|
||||
$list[$assoc['rate']]['payment_amount'][] = $assoc['payment_amount'];
|
||||
|
||||
$rate = $assoc['rate'];
|
||||
@ -1144,6 +1148,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
$list[$assoc['rate']]['ptype'][] = 'ExpenseReportPayment';
|
||||
|
||||
$list[$assoc['rate']]['payment_id'][] = $assoc['payment_id'];
|
||||
$list[$assoc['rate']]['payment_ref'][] = $assoc['payment_ref'];
|
||||
$list[$assoc['rate']]['payment_amount'][] = $assoc['payment_amount'];
|
||||
|
||||
$rate = $assoc['rate'];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user