Merge branch 'fronkdev' into 'master'
Added customer_number to credit invoice export See merge request fronk/thetool!596
This commit is contained in:
@@ -15,6 +15,22 @@ foreach($invoice->positions as $p):
|
||||
$price_gross = number_format($p->price_gross, 2, ",",".");
|
||||
$vatrate = number_format($p->vatrate, 0, ",",".");
|
||||
|
||||
$credit_custnum = false;
|
||||
$credit = false;
|
||||
$contract = false;
|
||||
if($p->contract_id) {
|
||||
$credit = $p->contract;
|
||||
foreach($credit->linkFrom as $link) {
|
||||
if($link->type == "credit" && $link->origin->termination_id) {
|
||||
$contract = $link->origin;
|
||||
$credit_custnum = $contract->owner->customer_number;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$timerange = "";
|
||||
if($timerange_month_only) {
|
||||
$timerange = $start_date->format("m.Y");
|
||||
@@ -29,7 +45,7 @@ foreach($invoice->positions as $p):
|
||||
}
|
||||
|
||||
?>
|
||||
<?=$invoice->invoice_number?>;<?=date("d.m.Y", $invoice->invoice_date)?>;<?=$invoice->customer_number?>;"<?=str_replace(["\n","\r"], " ", $invoice->company)?>";"<?=$invoice->lastname?>";"<?=$invoice->firstname?>";"<?=$p->product_name?>";"<?=str_replace(["\n","\r"], " ", $p->matchcode)?>";"<?=$timerange?>";<?=(float)$p->amount?>;<?=number_format($p->price_total, 2, ",", "")?>;<?=number_format($p->vatrate, 2, ",", "")?>;<?=number_format($p->price_gross, 2, ",", "")?>
|
||||
<?=$invoice->invoice_number?>;<?=date("d.m.Y", $invoice->invoice_date)?>;<?=$invoice->customer_number?>;"<?=str_replace(["\n","\r"], " ", $invoice->company)?>";"<?=$invoice->lastname?>";"<?=$invoice->firstname?>";"<?=$p->product_name?>";"<?=($credit_custnum) ? $credit_custnum."; " : ""?><?=str_replace(["\n","\r"], " ", $p->matchcode)?>";"<?=$timerange?>";<?=(float)$p->amount?>;<?=number_format($p->price_total, 2, ",", "")?>;<?=number_format($p->vatrate, 2, ",", "")?>;<?=number_format($p->price_gross, 2, ",", "")?>
|
||||
|
||||
<?php
|
||||
endforeach;
|
||||
Reference in New Issue
Block a user