Add source to invoice criteria. Modify invoice rules to get service fees from... #1701

Merged
arcticzero merged 217 commits from 746-resq-2-0-final into master 2023-11-22 08:54:48 +00:00
Showing only changes of commit df6a4ad292 - Show all commits

View file

@ -43,18 +43,26 @@ class MQTTClient
$new_sessions = [];
$cust_user = $job_order->getCustomer()->getCustomerUser();
if (!empty($cust_user)) {
if ($cust_user->isEmpty()) {
$new_sessions = $cust_user->getMobileSessions();
}
$sessions = array_merge($legacy_sessions, $new_sessions); // TODO: make this more elegant since getPhoneNumber() might differ later on
// TODO: make this more elegant. looping through each instead of merging the two because doctrine returns PersistentCollection if empty, and array if not
$sessions = [];
foreach ($legacy_sessions as $sess) {
$sessions[] = $sess;
}
if (count($sessions) == 0)
foreach ($new_sessions as $sess) {
$sessions[] = $sess;
}
if (empty($sessions))
{
error_log("no sessions to send mqtt event to");
return;
}
$channels = [];
// send to every customer session