Rimo Import: Fixed setting Preorderstatus to 140 when setting flag 141

This commit is contained in:
Frank Schubert
2025-04-15 15:28:59 +02:00
parent e983ad383f
commit 54365078b7

View File

@@ -147,7 +147,7 @@ class AddressDB {
if(!$wohneinheit_id) return true;
$log = mfLoghandler::singleton();
//echo "in handleRimoStatusUpdate\n";
$log->debug(__METHOD__.": =============================== in handleRimoStatusUpdate");
$wohneinheit = new ADBWohneinheit($wohneinheit_id);
if(!$wohneinheit->id) {
@@ -190,6 +190,14 @@ class AddressDB {
$status_matrix = array_reverse(TT_PREORDER_RIMO_STATUS_MATRIX);
$log->debug(__METHOD__.": b_ex_state: ".$b_ex_state);
$log->debug(__METHOD__.": b_op_state: ".$b_op_state);
$log->debug(__METHOD__.": h_ex_state: ".$h_ex_state);
$log->debug(__METHOD__.": h_op_state: ".$h_op_state);
$log->debug(__METHOD__.": wo_state: ".$wo_state);
$log->debug(__METHOD__.": order_type: ".$order_type);
foreach($status_matrix as $matrix) {
//var_dump($matrix);
if($matrix["rbop"]) {
@@ -218,8 +226,22 @@ class AddressDB {
$log->debug(__METHOD__.": new Preorder Status: ".$matrix["p"]);
if($preorder) {
$preorderstatus = $matrix["p"];
$preorderstatus = null;
$preorderstatus_flag = null;
if(array_key_exists("p", $matrix) && $matrix["p"]) {
$preorderstatus = $matrix["p"];
}
if(array_key_exists("pf", $matrix) && $matrix["pf"]) {
$preorderstatus_flag = $matrix["pf"];
}
if($preorderstatus) {
$log->debug(__METHOD__.": Setting Preorder Status to ".$preorderstatus);
$preorder->setNewStatusCode($preorderstatus);
$preorder->save();
}
if($preorderstatus_flag) {
$log->debug(__METHOD__.": Setting Preorder Status Flag ".$preorderstatus);
$preorder->setNewStatusCode($preorderstatus);
$preorder->save();
}