Fix: complete labels of operation if bank journal

Conflicts:
	htdocs/compta/tva/class/tva.class.php
This commit is contained in:
Laurent Destailleur 2018-02-05 17:07:38 +01:00
parent ad384a9992
commit c2590b9c7e
3 changed files with 65 additions and 30 deletions

View File

@ -271,7 +271,8 @@ if ($result) {
if ($links[$key]['type'] == 'payment') {
$paymentstatic->id = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2);
$paymentstatic->ref = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2, '', ''); // TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this
$tabpay[$obj->rowid]["paymentid"] = $paymentstatic->id;
} else if ($links[$key]['type'] == 'payment_supplier') {
$paymentsupplierstatic->id = $links[$key]['url_id'];
@ -320,11 +321,12 @@ if ($result) {
}
} else if ($links[$key]['type'] == 'payment_donation') {
$paymentdonstatic->id = $links[$key]['url_id'];
$paymentdonstatic->ref = $links[$key]['url_id'];
$paymentdonstatic->fk_donation = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentdonstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id;
$tabtp[$obj->rowid][$account_pay_donation] += $obj->amount;
} else if ($links[$key]['type'] == 'payment_vat') {
} else if ($links[$key]['type'] == 'payment_vat') { // Payment VAT
$paymentvatstatic->id = $links[$key]['url_id'];
$paymentvatstatic->ref = $links[$key]['url_id'];
$paymentvatstatic->label = $links[$key]['label'];
@ -428,11 +430,10 @@ if (! $error && $action == 'writebookkeeping') {
{
if ($mt)
{
$reflabel = $langs->trans("Bank");
$reflabel.= ' '.$val['bank_account_ref'];
if (! empty($val['soclib'])) {
$reflabel .= " - " . dol_string_nohtmltag($val['soclib']);
}
$reflabel = '';
if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . " - ";
$reflabel.= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
if (! empty($val['soclib'])) $reflabel .= " - " . dol_string_nohtmltag($val['soclib']);
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
@ -486,7 +487,9 @@ if (! $error && $action == 'writebookkeeping') {
foreach ( $tabtp[$key] as $k => $mt ) {
if ($mt)
{
$reflabel = dol_string_nohtmltag($val['soclib']);
$reflabel = '';
if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib']?" - ":"");
$reflabel.= dol_string_nohtmltag($val['soclib']);
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
@ -586,7 +589,9 @@ if (! $error && $action == 'writebookkeeping') {
foreach ( $tabbq[$key] as $k => $mt ) {
if ($mt)
{
$reflabel = 'WaitingAccount';
$reflabel = '';
if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . " - ";
$reflabel.= dol_string_nohtmltag('WaitingAccount');
$bookkeeping = new BookKeeping($db);
$bookkeeping->doc_date = $val["date"];
@ -717,11 +722,10 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
foreach ( $tabbq[$key] as $k => $mt ) {
if ($mt)
{
$reflabel = $langs->trans("Bank");
$reflabel.= ' '.$val['bank_account_ref'];
if (! empty($val['soclib'])) {
$reflabel .= " - " . dol_string_nohtmltag($val['soclib']);
}
$reflabel = '';
if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . " - ";
$reflabel.= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
if (! empty($val['soclib'])) $reflabel .= " - " . dol_string_nohtmltag($val['soclib']);
print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep;
@ -743,7 +747,9 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
foreach ( $tabtp[$key] as $k => $mt ) {
if ($mt)
{
$reflabel = dol_string_nohtmltag($val['soclib']);
$reflabel = '';
if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib']?" - ":"");
$reflabel.= dol_string_nohtmltag($val['soclib']);
print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep;
@ -773,7 +779,9 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
foreach ( $tabbq[$key] as $k => $mt ) {
if ($mt)
{
$reflabel = 'WaitingAccount';
$reflabel = '';
if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . " - ";
$reflabel.= dol_string_nohtmltag('WaitingAccount');
print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep;
@ -904,11 +912,10 @@ if (empty($action) || $action == 'view') {
{
if ($mt)
{
$reflabel = $langs->trans("Bank");
$reflabel.= ' '.$val['bank_account_ref'];
if (! empty($val['soclib'])) {
$reflabel .= " - " . $val['soclib'];
}
$reflabel = '';
if (! empty($val['lib'])) $reflabel .= $val['lib'] . " - ";
$reflabel.= $langs->trans("Bank").' '.$val['bank_account_ref'];
if (! empty($val['soclib'])) $reflabel .= " - " . $val['soclib'];
//var_dump($tabpay[$key]);
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
@ -949,7 +956,9 @@ if (empty($action) || $action == 'view') {
foreach ( $tabtp[$key] as $k => $mt ) {
if ($mt)
{
$reflabel = $val['soclib'];
$reflabel = '';
if (! empty($val['lib'])) $reflabel .= $val['lib'] . ($val['soclib']?" - ":"");
$reflabel.= $val['soclib'];
print '<!-- Thirdparty bank.rowid='.$key.' -->';
print '<tr class="oddeven">';
@ -1024,7 +1033,9 @@ if (empty($action) || $action == 'view') {
foreach ( $tabbq[$key] as $k => $mt ) {
if ($mt)
{
$reflabel = 'WaitingAccount';
$reflabel = '';
if (! empty($val['lib'])) $reflabel .= $val['lib'] . " - ";
$reflabel.= 'WaitingAccount';
print '<!-- Wait bank.rowid='.$key.' -->';
print '<tr class="oddeven">';

View File

@ -1042,12 +1042,15 @@ class Paiement extends CommonObject
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param string $option Sur quoi pointe le lien
* @param string $mode 'withlistofinvoices'=Include list of invoices into tooltip
* @param int $notooltip 1=Disable tooltip
* @return string Chaine avec URL
*/
function getNomUrl($withpicto=0,$option='',$mode='withlistofinvoices')
function getNomUrl($withpicto=0, $option='', $mode='withlistofinvoices', $notooltip=0)
{
global $langs;
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
$result='';
$label = $langs->trans("ShowPayment").': '.$this->ref;
if ($mode == 'withlistofinvoices')
@ -1064,12 +1067,31 @@ class Paiement extends CommonObject
}
}
}
$link = '<a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkclose='';
if (empty($notooltip))
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowMyObject");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
}
else $linkclose = ($morecss?' class="'.$morecss.'"':'');
$url = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$this->id;
$linkstart = '<a href="'.$url.'"';
$linkstart.=$linkclose.'>';
$linkend='</a>';
if ($withpicto) $result.=($link.img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$link.($this->ref?$this->ref:$this->id).$linkend;
$result .= $linkstart;
if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
if ($withpicto && $withpicto != 2) $result.= $this->ref;
$result .= $linkend;
return $result;
}

View File

@ -654,9 +654,11 @@ class Tva extends CommonObject
* @param int $notooltip 1=Disable tooltip
* @return string Chaine with URL
*/
function getNomUrl($withpicto=0, $option='', $notooltip=0)
function getNomUrl($withpicto=0, $option='', $notooltip=0)
{
global $langs;
global $langs, $conf;
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
$result='';
$label=$langs->trans("ShowVatPayment").': '.$this->ref;