Fix origin currency not visible in absolute discount view
This commit is contained in:
parent
b2e0b1216e
commit
75b875ae55
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -411,7 +411,7 @@ if ($socid > 0)
|
||||
print load_fiche_titre($langs->trans("CustomerDiscounts"), '', '');
|
||||
}
|
||||
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql.= " rc.datec as dc, rc.description,";
|
||||
$sql.= " rc.fk_facture_source,";
|
||||
$sql.= " u.login, u.rowid as user_id,";
|
||||
@ -433,10 +433,18 @@ if ($socid > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
|
||||
print '<td>'.$langs->trans("ReasonDiscount").'</td>';
|
||||
print '<td width="150" class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.$langs->trans("MulticurrencyAmountHT").'</td>';
|
||||
}
|
||||
print '<td align="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.$langs->trans("MulticurrencyAmountTTC").'</td>';
|
||||
}
|
||||
print '<td width="100" align="center">'.$langs->trans("DiscountOfferedBy").'</td>';
|
||||
print '<td width="50"> </td>';
|
||||
print '</tr>';
|
||||
@ -455,7 +463,7 @@ if ($socid > 0)
|
||||
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
|
||||
if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturestatic->id=$obj->fk_facture_source;
|
||||
$facturestatic->ref=$obj->ref;
|
||||
$facturestatic->type=$obj->type;
|
||||
@ -464,7 +472,7 @@ if ($socid > 0)
|
||||
}
|
||||
elseif (preg_match('/\(DEPOSIT\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturestatic->id=$obj->fk_facture_source;
|
||||
$facturestatic->ref=$obj->ref;
|
||||
$facturestatic->type=$obj->type;
|
||||
@ -473,7 +481,7 @@ if ($socid > 0)
|
||||
}
|
||||
elseif (preg_match('/\(EXCESS RECEIVED\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturestatic->id=$obj->fk_facture_source;
|
||||
$facturestatic->ref=$obj->ref;
|
||||
$facturestatic->type=$obj->type;
|
||||
@ -482,14 +490,22 @@ if ($socid > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
print '<td class="minwidth100">';
|
||||
print $obj->description;
|
||||
print '</td>';
|
||||
}
|
||||
print '<td class="nowrap">'.$langs->trans("NotConsumed").'</td>';
|
||||
print '<td align="right">'.price($obj->amount_ht).'</td>';
|
||||
print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td align="right">'.vatrate($obj->tva_tx, true).'</td>';
|
||||
print '<td align="right">'.price($obj->amount_ttc).'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.price($obj->multicurrency_amount_ttc).'</td>';
|
||||
}
|
||||
print '<td align="center">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>';
|
||||
print '</td>';
|
||||
@ -497,7 +513,7 @@ if ($socid > 0)
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=split&remid='.$obj->rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_split($langs->trans("SplitDiscount")).'</a>';
|
||||
print ' ';
|
||||
//print ' ';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&remid='.$obj->rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
@ -550,7 +566,7 @@ if ($socid > 0)
|
||||
/*
|
||||
* Liste remises fixes fournisseur restant en cours (= liees a aucune facture ni ligne de facture)
|
||||
*/
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql.= " rc.datec as dc, rc.description,";
|
||||
$sql.= " rc.fk_invoice_supplier_source,";
|
||||
$sql.= " u.login, u.rowid as user_id,";
|
||||
@ -572,10 +588,18 @@ if ($socid > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
|
||||
print '<td>'.$langs->trans("ReasonDiscount").'</td>';
|
||||
print '<td width="150" class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.$langs->trans("MulticurrencyAmountHT").'</td>';
|
||||
}
|
||||
print '<td align="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.$langs->trans("MulticurrencyAmountTTC").'</td>';
|
||||
}
|
||||
print '<td width="100" align="center">'.$langs->trans("DiscountOfferedBy").'</td>';
|
||||
print '<td width="50"> </td>';
|
||||
print '</tr>';
|
||||
@ -594,7 +618,7 @@ if ($socid > 0)
|
||||
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
|
||||
if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturefournstatic->id=$obj->fk_invoice_supplier_source;
|
||||
$facturefournstatic->ref=$obj->ref;
|
||||
$facturefournstatic->type=$obj->type;
|
||||
@ -603,7 +627,7 @@ if ($socid > 0)
|
||||
}
|
||||
elseif (preg_match('/\(DEPOSIT\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturefournstatic->id=$obj->fk_invoice_supplier_source;
|
||||
$facturefournstatic->ref=$obj->ref;
|
||||
$facturefournstatic->type=$obj->type;
|
||||
@ -612,7 +636,7 @@ if ($socid > 0)
|
||||
}
|
||||
elseif (preg_match('/\(EXCESS PAID\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturefournstatic->id=$obj->fk_invoice_supplier_source;
|
||||
$facturefournstatic->ref=$obj->ref;
|
||||
$facturefournstatic->type=$obj->type;
|
||||
@ -621,14 +645,22 @@ if ($socid > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
print '<td class="minwidth100">';
|
||||
print $obj->description;
|
||||
print '</td>';
|
||||
}
|
||||
print '<td class="nowrap">'.$langs->trans("NotConsumed").'</td>';
|
||||
print '<td align="right">'.price($obj->amount_ht).'</td>';
|
||||
print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td align="right">'.vatrate($obj->tva_tx, true).'</td>';
|
||||
print '<td align="right">'.price($obj->amount_ttc).'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.price($obj->multicurrency_amount_ttc).'</td>';
|
||||
}
|
||||
print '<td align="center">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>';
|
||||
print '</td>';
|
||||
@ -636,7 +668,7 @@ if ($socid > 0)
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=split&remid='.$obj->rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_split($langs->trans("SplitDiscount")).'</a>';
|
||||
print ' ';
|
||||
//print ' ';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&remid='.$obj->rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
@ -700,7 +732,7 @@ if ($socid > 0)
|
||||
}
|
||||
|
||||
// Remises liees a lignes de factures
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
|
||||
$sql.= " rc.fk_facture_source,";
|
||||
$sql.= " u.login, u.rowid as user_id,";
|
||||
@ -745,10 +777,18 @@ if ($socid > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
|
||||
print '<td>'.$langs->trans("ReasonDiscount").'</td>';
|
||||
print '<td width="150" class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.$langs->trans("MulticurrencyAmountHT").'</td>';
|
||||
}
|
||||
print '<td align="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.$langs->trans("MulticurrencyAmountTTC").'</td>';
|
||||
}
|
||||
print '<td width="100" align="center">'.$langs->trans("Author").'</td>';
|
||||
print '<td width="50"> </td>';
|
||||
print '</tr>';
|
||||
@ -788,7 +828,7 @@ if ($socid > 0)
|
||||
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
|
||||
if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturestatic->id=$obj->fk_facture_source;
|
||||
$facturestatic->ref=$obj->ref;
|
||||
$facturestatic->type=$obj->type;
|
||||
@ -797,7 +837,7 @@ if ($socid > 0)
|
||||
}
|
||||
elseif (preg_match('/\(DEPOSIT\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturestatic->id=$obj->fk_facture_source;
|
||||
$facturestatic->ref=$obj->ref;
|
||||
$facturestatic->type=$obj->type;
|
||||
@ -806,7 +846,7 @@ if ($socid > 0)
|
||||
}
|
||||
elseif (preg_match('/\(EXCESS RECEIVED\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturestatic->id=$obj->fk_facture_source;
|
||||
$facturestatic->ref=$obj->ref;
|
||||
$facturestatic->type=$obj->type;
|
||||
@ -815,14 +855,22 @@ if ($socid > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
print '<td class="minwidth100">';
|
||||
print $obj->description;
|
||||
print '</td>';
|
||||
}
|
||||
print '<td align="left" class="nowrap"><a href="'.DOL_URL_ROOT.'/compta/facture/card.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.'</a></td>';
|
||||
print '<td align="right">'.price($obj->amount_ht).'</td>';
|
||||
print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td align="right">'.vatrate($obj->tva_tx, true).'</td>';
|
||||
print '<td align="right">'.price($obj->amount_ttc).'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.price($obj->multicurrency_amount_ttc).'</td>';
|
||||
}
|
||||
print '<td align="center">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>';
|
||||
print '</td>';
|
||||
@ -854,7 +902,7 @@ if ($socid > 0)
|
||||
}
|
||||
|
||||
// Remises liees a lignes de factures
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx,";
|
||||
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
|
||||
$sql.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
|
||||
$sql.= " rc.fk_invoice_supplier_source,";
|
||||
$sql.= " u.login, u.rowid as user_id,";
|
||||
@ -899,10 +947,18 @@ if ($socid > 0)
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
|
||||
print '<td>'.$langs->trans("ReasonDiscount").'</td>';
|
||||
print '<td width="150" class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td width="120" align="right">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td width="80" align="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td width="120" align="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("ConsumedBy").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.$langs->trans("MulticurrencyAmountHT").'</td>';
|
||||
}
|
||||
print '<td align="right">'.$langs->trans("VATRate").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.$langs->trans("MulticurrencyAmountTTC").'</td>';
|
||||
}
|
||||
print '<td width="100" align="center">'.$langs->trans("Author").'</td>';
|
||||
print '<td width="50"> </td>';
|
||||
print '</tr>';
|
||||
@ -942,7 +998,7 @@ if ($socid > 0)
|
||||
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
|
||||
if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturefournstatic->id=$obj->fk_invoice_supplier_source;
|
||||
$facturefournstatic->ref=$obj->ref;
|
||||
$facturefournstatic->type=$obj->type;
|
||||
@ -951,7 +1007,7 @@ if ($socid > 0)
|
||||
}
|
||||
elseif (preg_match('/\(DEPOSIT\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturefournstatic->id=$obj->fk_invoice_supplier_source;
|
||||
$facturefournstatic->ref=$obj->ref;
|
||||
$facturefournstatic->type=$obj->type;
|
||||
@ -960,7 +1016,7 @@ if ($socid > 0)
|
||||
}
|
||||
elseif (preg_match('/\(EXCESS PAID\)/',$obj->description))
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="minwidth100">';
|
||||
$facturefournstatic->id=$obj->fk_invoice_supplier_source;
|
||||
$facturefournstatic->ref=$obj->ref;
|
||||
$facturefournstatic->type=$obj->type;
|
||||
@ -969,14 +1025,22 @@ if ($socid > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
print '<td class="minwidth100">';
|
||||
print $obj->description;
|
||||
print '</td>';
|
||||
}
|
||||
print '<td align="left" class="nowrap"><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.'</a></td>';
|
||||
print '<td align="right">'.price($obj->amount_ht).'</td>';
|
||||
print '<td align="right">'.price2num($obj->tva_tx,'MU').'%</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.price($obj->multicurrency_amount_ht).'</td>';
|
||||
}
|
||||
print '<td align="right">'.vatrate($obj->tva_tx, true).'</td>';
|
||||
print '<td align="right">'.price($obj->amount_ttc).'</td>';
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">'.price($obj->multicurrency_amount_ttc).'</td>';
|
||||
}
|
||||
print '<td align="center">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a>';
|
||||
print '</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user