remove [[bills]] if there no bills found

This commit is contained in:
Ibnu Maksum 2024-04-05 17:21:06 +07:00
parent 53a309fee8
commit 1f5033b471
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5

View File

@ -125,6 +125,8 @@ class Message
}
$note .= "Total : " . Lang::moneyFormat($add_cost+$price) . "\n";
$msg = str_replace('[[bills]]', $note, $msg);
}else{
$msg = str_replace('[[bills]]', '', $msg);
}
if ($u) {
$msg = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($u['expiration'], $u['time']), $msg);
@ -134,9 +136,9 @@ class Message
&& !empty($message) && in_array($via, ['sms', 'wa'])
) {
if ($via == 'sms') {
Message::sendSMS($customer['phonenumber'], $msg);
echo Message::sendSMS($customer['phonenumber'], $msg);
} else if ($via == 'wa') {
Message::sendWhatsapp($customer['phonenumber'], $msg);
echo Message::sendWhatsapp($customer['phonenumber'], $msg);
}
}
return "$via: $msg";