Merge branch 'fronkdev' into 'master'

removing PStatusNotifyLog entry when updateing Order Date

See merge request fronk/thetool!1535
This commit is contained in:
Frank Schubert
2025-07-10 12:57:45 +00:00
2 changed files with 15 additions and 2 deletions

View File

@@ -1167,6 +1167,8 @@ class PreorderController extends mfBaseController {
return false;
}
$orderdate_ts = Layout::dateToInt($order_date);
$preorder->order_date = $orderdate_ts;
if(!$preorder->save()) {
@@ -1174,6 +1176,13 @@ class PreorderController extends mfBaseController {
return false;
}
if($preorder->status->code < 500 || !$preorder->adb_wohneinheit->enduser_setup_invoice_date) {
// remove from 300-custom-new-order log if exitisting, so the email will be sent again
foreach(PreorderStatusnotificationLog::search(["preorder_id" => $preorder->id, "email_type" => "300-custom-new-order"]) as $psnl) {
$psnl->delete();
}
}
return ["message" => "Orderdate saved successfully", "preorder_id" => $preorder_id, "order_date" => $order_date];
}

View File

@@ -377,8 +377,8 @@ class PreorderBillingInvoiceController extends mfBaseController {
$position_data["article_number"] = $bill->article_number;
$position_data["product_name"] = $bill->product_name;
$position_data["article_info"] = $bill->product_info;
$position_data["total"] = round($price, 2);
$position_data["total_gross"] = round($price_gross, 2);
$position_data["total"] = $price;
$position_data["total_gross"] = $price_gross;
$position_data["vatrate"] = $bill->vatrate;
$position_data["billing_id"] = $bill->id;
$position_data["fibu_cost_account"] = $bill->fibu_cost_account;
@@ -527,6 +527,10 @@ class PreorderBillingInvoiceController extends mfBaseController {
$total_net += $position->price_total;
$total_gross += $position->price_gross;
$position->price_total = round($position->price_total, 2);
$position->price_gross = round($position->price_gross, 2);
if (!$position->save()) {
$invoice->rollbackTransaction();
die("Error saving Invoiceposition");