Merge branch 'fronkdev' into 'master'
Preorder Billing + RML BMD Export See merge request fronk/thetool!1207
This commit is contained in:
@@ -452,6 +452,11 @@ class PreorderBillingController extends mfBaseController {
|
|||||||
$status_change_date = $status_244_change_date;
|
$status_change_date = $status_244_change_date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($status_change_date < $earliest_bill_date) {
|
||||||
|
$this->log->debug(__METHOD__.": Not billing operator_setup for preorder ".$preorder->id." because status change date ".$status_change_date->format("Y-m-d")." is before earliest_bill_date ".$earliest_bill_date->format("Y-m-d"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if($netoperator_config["billing-period"] == "quarterly" && $status_change_date->format("Ymd") > $latest_quarter_bill_date->format("Ymd")) {
|
if($netoperator_config["billing-period"] == "quarterly" && $status_change_date->format("Ymd") > $latest_quarter_bill_date->format("Ymd")) {
|
||||||
$this->log->debug(__METHOD__.": Skipping operator_setup for preorder ".$preorder->id." because Billing date ".$status_change_date->format("Y-m-d")." is after latest_quarter_bill_date ".$latest_quarter_bill_date->format("Y-m-d"));
|
$this->log->debug(__METHOD__.": Skipping operator_setup for preorder ".$preorder->id." because Billing date ".$status_change_date->format("Y-m-d")." is after latest_quarter_bill_date ".$latest_quarter_bill_date->format("Y-m-d"));
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -828,7 +828,7 @@ class PreorderBillingInvoiceController extends mfBaseController {
|
|||||||
$prozent = 20;
|
$prozent = 20;
|
||||||
$steuercode = 1;
|
$steuercode = 1;
|
||||||
|
|
||||||
$csv = "\u{FEFF}satzart;konto;gkonto;belegnr;belegdatum;buchsymbol;buchcode;prozent;steuercode;betrag;steuer;text;kost;kotraeger;kobetrag\n";
|
$csv = "\u{FEFF}satzart;konto;gkonto;belegnr;belegdatum;buchsymbol;buchcode;prozent;steuercode;betrag;steuer;text;kost;kotraeger;kobetrag;dokument\n";
|
||||||
|
|
||||||
$invoices = [];
|
$invoices = [];
|
||||||
|
|
||||||
@@ -851,8 +851,8 @@ class PreorderBillingInvoiceController extends mfBaseController {
|
|||||||
|
|
||||||
$invoice_date = new DateTime($invoice->invoice_date);
|
$invoice_date = new DateTime($invoice->invoice_date);
|
||||||
|
|
||||||
$konto = $invoice->customer_number;
|
$konto = $invoice->fibu_account_number;
|
||||||
$gkonto = $invoice->fibu_revenue_code;
|
$gkonto = $invoice->fibu_revenue_account;
|
||||||
$belegnr = $invoice->invoice_number;
|
$belegnr = $invoice->invoice_number;
|
||||||
$belegdatum = $invoice_date->format("d.m.Y");
|
$belegdatum = $invoice_date->format("d.m.Y");
|
||||||
$betrag = number_format($invoice->total_gross, 2, ",", "");
|
$betrag = number_format($invoice->total_gross, 2, ",", "");
|
||||||
@@ -860,14 +860,15 @@ class PreorderBillingInvoiceController extends mfBaseController {
|
|||||||
$text = ($invoice->company ?: $invoice->firstname." ".$invoice->lastname)." $belegnr";
|
$text = ($invoice->company ?: $invoice->firstname." ".$invoice->lastname)." $belegnr";
|
||||||
$text = str_replace(["\r","\n", '"'], [" "," ",'""'], $text);
|
$text = str_replace(["\r","\n", '"'], [" "," ",'""'], $text);
|
||||||
$kost = $invoice->fibu_cost_account;
|
$kost = $invoice->fibu_cost_account;
|
||||||
|
$dokument = $invoice->invoice_number.".pdf";
|
||||||
|
|
||||||
if(count($kostentraeger) < 2) {
|
if(count($kostentraeger) < 2) {
|
||||||
$csv_line = "$satzart;$konto;$gkonto;$belegnr;$belegdatum;$buchsymbol;$buchcode;$prozent;$steuercode;$betrag;$steuer;\"$text\";$kost";
|
$csv_line = "$satzart;$konto;$gkonto;$belegnr;$belegdatum;$buchsymbol;$buchcode;$prozent;$steuercode;$betrag;$steuer;\"$text\";$kost;;;$dokument";
|
||||||
} else {
|
} else {
|
||||||
$csv_line = "$satzart;$konto;$gkonto;$belegnr;$belegdatum;$buchsymbol;$buchcode;$prozent;$steuercode;$betrag;$steuer;\"$text\";;";
|
$csv_line = "$satzart;$konto;$gkonto;$belegnr;$belegdatum;$buchsymbol;$buchcode;$prozent;$steuercode;$betrag;$steuer;\"$text\";;;;$dokument";
|
||||||
foreach($kostentraeger as $kotraeger => $kobetrag) {
|
foreach($kostentraeger as $kotraeger => $kobetrag) {
|
||||||
$kobetrag_text = number_format($kobetrag, 2, ",", "");
|
$kobetrag_text = number_format($kobetrag, 2, ",", "");
|
||||||
$csv_line .= "\n1;;;;;;;;;;;;$kost;$kotraeger;$kobetrag_text";
|
$csv_line .= "\n1;;;;;;;;;;;;$kost;$kotraeger;$kobetrag_text;";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user