parent
e9bc5b719d
commit
44405e5415
@ -3156,6 +3156,14 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
$facthatreplace->fetch($objectidnext);
|
$facthatreplace->fetch($objectidnext);
|
||||||
print ' (' . $langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)) . ')';
|
print ' (' . $langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)) . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
|
||||||
|
$discount = new DiscountAbsolute($db);
|
||||||
|
$result = $discount->fetch(0, $object->id);
|
||||||
|
if ($result > 0){
|
||||||
|
print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'<br>';
|
||||||
|
}
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Relative and absolute discounts
|
// Relative and absolute discounts
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class DiscountAbsolute
|
|||||||
* @param int $fk_facture_source fk_facture_source
|
* @param int $fk_facture_source fk_facture_source
|
||||||
* @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($rowid,$fk_facture_source=0)
|
function fetch($rowid, $fk_facture_source=0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -386,7 +386,7 @@ class DiscountAbsolute
|
|||||||
function getSumDepositsUsed($invoice, $multicurrency=0)
|
function getSumDepositsUsed($invoice, $multicurrency=0)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::getSumDepositsUsed", LOG_DEBUG);
|
dol_syslog(get_class($this)."::getSumDepositsUsed", LOG_DEBUG);
|
||||||
|
|
||||||
if ($invoice->element == 'facture' || $invoice->element == 'invoice')
|
if ($invoice->element == 'facture' || $invoice->element == 'invoice')
|
||||||
{
|
{
|
||||||
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
||||||
@ -407,7 +407,7 @@ class DiscountAbsolute
|
|||||||
dol_print_error($this->error);
|
dol_print_error($this->error);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -432,7 +432,7 @@ class DiscountAbsolute
|
|||||||
function getSumCreditNotesUsed($invoice, $multicurrency=0)
|
function getSumCreditNotesUsed($invoice, $multicurrency=0)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG);
|
dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG);
|
||||||
|
|
||||||
if ($invoice->element == 'facture' || $invoice->element == 'invoice')
|
if ($invoice->element == 'facture' || $invoice->element == 'invoice')
|
||||||
{
|
{
|
||||||
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
||||||
@ -453,7 +453,7 @@ class DiscountAbsolute
|
|||||||
dol_print_error($this->error);
|
dol_print_error($this->error);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user