Fixed 0% vatrate in bmd export for non-domestic invoices
This commit is contained in:
@@ -654,6 +654,8 @@ class InvoiceController extends mfBaseController {
|
|||||||
$filter["!vatgroup_id"] = TT_VATGROUP_CREDIT;
|
$filter["!vatgroup_id"] = TT_VATGROUP_CREDIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//$filter["invoice_number"] = "RN2024-X033707";
|
||||||
|
|
||||||
//var_dump($filter);exit;
|
//var_dump($filter);exit;
|
||||||
if(!InvoiceModel::search($filter)) {
|
if(!InvoiceModel::search($filter)) {
|
||||||
$this->layout()->setFlash("Keine neuen Rechnungen seit letztem BMD-Export vorhanden.");
|
$this->layout()->setFlash("Keine neuen Rechnungen seit letztem BMD-Export vorhanden.");
|
||||||
@@ -664,10 +666,14 @@ class InvoiceController extends mfBaseController {
|
|||||||
die("wtf");
|
die("wtf");
|
||||||
}
|
}
|
||||||
|
|
||||||
$vatrate = (($invoice->total == $invoice->total_gross) ? "0" : "20");
|
|
||||||
if($invoice->total_gross){
|
if($invoice->total_gross){
|
||||||
$vatrate = 20;
|
$vatrate = 20;
|
||||||
}
|
}
|
||||||
|
if($invoice->total == $invoice->total_gross && $invoice->fibu_cost_area != "domestic") {
|
||||||
|
$vatrate = "0";
|
||||||
|
} else {
|
||||||
|
$vatrate = "20";
|
||||||
|
}
|
||||||
$vat = $invoice->total_gross - $invoice->total;
|
$vat = $invoice->total_gross - $invoice->total;
|
||||||
$vat *= -1;
|
$vat *= -1;
|
||||||
|
|
||||||
@@ -917,6 +923,11 @@ class InvoiceController extends mfBaseController {
|
|||||||
//var_dump($pdf_files);exit;
|
//var_dump($pdf_files);exit;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
|
// Merge PDFs one after the other, otherwise the cmdline arguments could become too many for the shell to handle
|
||||||
|
|
||||||
|
// Need to use a new output file name every time pdfunite runs
|
||||||
|
// Cannot use first input file as output
|
||||||
|
// So just swap 2 temp file names each round
|
||||||
$first = true;
|
$first = true;
|
||||||
$tmp_file1 = "$output_filepath.tmp1";
|
$tmp_file1 = "$output_filepath.tmp1";
|
||||||
$tmp_file2 = "$output_filepath.tmp2";
|
$tmp_file2 = "$output_filepath.tmp2";
|
||||||
|
|||||||
Reference in New Issue
Block a user