Fix notification
This commit is contained in:
parent
d36f39af8f
commit
130451e1ae
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 2024.3.18
|
||||||
|
|
||||||
|
- Add Broadcasting SMS by @Focuslinkstech
|
||||||
|
- Fix Notification with Bills
|
||||||
|
|
||||||
## 2024.3.16
|
## 2024.3.16
|
||||||
|
|
||||||
- Fix Zero Charging
|
- Fix Zero Charging
|
||||||
|
@ -116,6 +116,9 @@ class Message
|
|||||||
$textInvoice = str_replace('[[phone]]', $config['phone'], $textInvoice);
|
$textInvoice = str_replace('[[phone]]', $config['phone'], $textInvoice);
|
||||||
$textInvoice = str_replace('[[invoice]]', $trx['invoice'], $textInvoice);
|
$textInvoice = str_replace('[[invoice]]', $trx['invoice'], $textInvoice);
|
||||||
$textInvoice = str_replace('[[date]]', Lang::dateAndTimeFormat($trx['recharged_on'], $trx['recharged_time']), $textInvoice);
|
$textInvoice = str_replace('[[date]]', Lang::dateAndTimeFormat($trx['recharged_on'], $trx['recharged_time']), $textInvoice);
|
||||||
|
if (!empty($trx['note'])) {
|
||||||
|
$textInvoice = str_replace('[[note]]', $trx['note'], $textInvoice);
|
||||||
|
}
|
||||||
$gc = explode("-", $trx['method']);
|
$gc = explode("-", $trx['method']);
|
||||||
$textInvoice = str_replace('[[payment_gateway]]', trim($gc[0]), $textInvoice);
|
$textInvoice = str_replace('[[payment_gateway]]', trim($gc[0]), $textInvoice);
|
||||||
$textInvoice = str_replace('[[payment_channel]]', trim($gc[1]), $textInvoice);
|
$textInvoice = str_replace('[[payment_channel]]', trim($gc[1]), $textInvoice);
|
||||||
|
@ -37,7 +37,7 @@ class Package
|
|||||||
// Zero cost recharge
|
// Zero cost recharge
|
||||||
if (isset($zero) && $zero == 1) {
|
if (isset($zero) && $zero == 1) {
|
||||||
$p['price'] = 0;
|
$p['price'] = 0;
|
||||||
}else{
|
} else {
|
||||||
// Additional cost
|
// Additional cost
|
||||||
list($bills, $add_cost) = User::getBills($id_customer);
|
list($bills, $add_cost) = User::getBills($id_customer);
|
||||||
if ($add_cost > 0 && $router_name != 'balance') {
|
if ($add_cost > 0 && $router_name != 'balance') {
|
||||||
@ -242,7 +242,7 @@ class Package
|
|||||||
if ($p['validity_unit'] == 'Period') {
|
if ($p['validity_unit'] == 'Period') {
|
||||||
// Postpaid price from field
|
// Postpaid price from field
|
||||||
$add_inv = User::getAttribute("Invoice", $id_customer);
|
$add_inv = User::getAttribute("Invoice", $id_customer);
|
||||||
if (empty ($add_inv) or $add_inv == 0) {
|
if (empty($add_inv) or $add_inv == 0) {
|
||||||
$t->price = $p['price'] + $add_cost;
|
$t->price = $p['price'] + $add_cost;
|
||||||
} else {
|
} else {
|
||||||
$t->price = $add_inv + $add_cost;
|
$t->price = $add_inv + $add_cost;
|
||||||
@ -286,7 +286,8 @@ class Package
|
|||||||
"\nRouter: " . $router_name .
|
"\nRouter: " . $router_name .
|
||||||
"\nGateway: " . $gateway .
|
"\nGateway: " . $gateway .
|
||||||
"\nChannel: " . $channel .
|
"\nChannel: " . $channel .
|
||||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
"\nPrice: " . Lang::moneyFormat($p['price']) .
|
||||||
|
"\nNote:\n" . $note);
|
||||||
} else {
|
} else {
|
||||||
if ($p['is_radius']) {
|
if ($p['is_radius']) {
|
||||||
Radius::customerAddPlan($c, $p, "$date_exp $time");
|
Radius::customerAddPlan($c, $p, "$date_exp $time");
|
||||||
@ -373,7 +374,8 @@ class Package
|
|||||||
"\nRouter: " . $router_name .
|
"\nRouter: " . $router_name .
|
||||||
"\nGateway: " . $gateway .
|
"\nGateway: " . $gateway .
|
||||||
"\nChannel: " . $channel .
|
"\nChannel: " . $channel .
|
||||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
"\nPrice: " . Lang::moneyFormat($p['price']) .
|
||||||
|
"\nNote:\n" . $note);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -436,7 +438,7 @@ class Package
|
|||||||
if ($p['validity_unit'] == 'Period') {
|
if ($p['validity_unit'] == 'Period') {
|
||||||
// Postpaid price from field
|
// Postpaid price from field
|
||||||
$add_inv = User::getAttribute("Invoice", $id_customer);
|
$add_inv = User::getAttribute("Invoice", $id_customer);
|
||||||
if (empty ($add_inv) or $add_inv == 0) {
|
if (empty($add_inv) or $add_inv == 0) {
|
||||||
$t->price = $p['price'] + $add_cost;
|
$t->price = $p['price'] + $add_cost;
|
||||||
} else {
|
} else {
|
||||||
$t->price = $add_inv + $add_cost;
|
$t->price = $add_inv + $add_cost;
|
||||||
@ -479,7 +481,8 @@ class Package
|
|||||||
"\nRouter: " . $router_name .
|
"\nRouter: " . $router_name .
|
||||||
"\nGateway: " . $gateway .
|
"\nGateway: " . $gateway .
|
||||||
"\nChannel: " . $channel .
|
"\nChannel: " . $channel .
|
||||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
"\nPrice: " . Lang::moneyFormat($p['price']) .
|
||||||
|
"\nNote:\n" . $note);
|
||||||
} else {
|
} else {
|
||||||
if ($p['is_radius']) {
|
if ($p['is_radius']) {
|
||||||
Radius::customerAddPlan($c, $p, "$date_exp $time");
|
Radius::customerAddPlan($c, $p, "$date_exp $time");
|
||||||
@ -566,7 +569,8 @@ class Package
|
|||||||
"\nRouter: " . $router_name .
|
"\nRouter: " . $router_name .
|
||||||
"\nGateway: " . $gateway .
|
"\nGateway: " . $gateway .
|
||||||
"\nChannel: " . $channel .
|
"\nChannel: " . $channel .
|
||||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
"\nPrice: " . Lang::moneyFormat($p['price']) .
|
||||||
|
"\nNote:\n" . $note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_array($bills) && count($bills) > 0) {
|
if (is_array($bills) && count($bills) > 0) {
|
||||||
@ -678,9 +682,10 @@ class Package
|
|||||||
$_admin = Admin::_info($in['admin_id']);
|
$_admin = Admin::_info($in['admin_id']);
|
||||||
// if admin not deleted
|
// if admin not deleted
|
||||||
if ($_admin) $admin = $_admin;
|
if ($_admin) $admin = $_admin;
|
||||||
}else{
|
} else {
|
||||||
$admin['fullname'] = 'Customer';
|
$admin['fullname'] = 'Customer';
|
||||||
}
|
}
|
||||||
|
$note = '';
|
||||||
//print
|
//print
|
||||||
$invoice = Lang::pad($config['CompanyName'], ' ', 2) . "\n";
|
$invoice = Lang::pad($config['CompanyName'], ' ', 2) . "\n";
|
||||||
$invoice .= Lang::pad($config['address'], ' ', 2) . "\n";
|
$invoice .= Lang::pad($config['address'], ' ', 2) . "\n";
|
||||||
@ -692,11 +697,26 @@ class Package
|
|||||||
$invoice .= Lang::pad("", '=') . "\n";
|
$invoice .= Lang::pad("", '=') . "\n";
|
||||||
$invoice .= Lang::pads(Lang::T('Type'), $in['type'], ' ') . "\n";
|
$invoice .= Lang::pads(Lang::T('Type'), $in['type'], ' ') . "\n";
|
||||||
$invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n";
|
$invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n";
|
||||||
$invoice .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ') . "\n";
|
if (!empty($in['note'])) {
|
||||||
$invoice .= Lang::pad($in['method'], ' ', 2) . "\n";
|
$in['note'] = str_replace("\r", "", $in['note']);
|
||||||
if(!empty($in['note'])){
|
$tmp = explode("\n", $in['note']);
|
||||||
|
foreach ($tmp as $t) {
|
||||||
|
if (strpos($t, " : ") === false) {
|
||||||
|
if (!empty($t)) {
|
||||||
|
$note .= "$t\n";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$tmp2 = explode(" : ", $t);
|
||||||
|
$invoice .= Lang::pads($tmp2[0], $tmp2[1], ' ') . "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$invoice .= Lang::pads(Lang::T('Total'), Lang::moneyFormat($in['price']), ' ') . "\n";
|
||||||
|
$method = explode("-", $in['method']);
|
||||||
|
$invoice .= Lang::pads($method[0], $method[1], ' ') . "\n";
|
||||||
|
if (!empty($note)) {
|
||||||
$invoice .= Lang::pad("", '=') . "\n";
|
$invoice .= Lang::pad("", '=') . "\n";
|
||||||
$invoice .= Lang::pad($in['note'], ' ', 2);
|
$invoice .= Lang::pad($note, ' ', 2) . "\n";
|
||||||
}
|
}
|
||||||
$invoice .= Lang::pad("", '=') . "\n";
|
$invoice .= Lang::pad("", '=') . "\n";
|
||||||
$invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n";
|
$invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n";
|
||||||
@ -720,11 +740,24 @@ class Package
|
|||||||
$invoice .= Lang::pad("", '=') . "\n";
|
$invoice .= Lang::pad("", '=') . "\n";
|
||||||
$invoice .= Lang::pads(Lang::T('Type'), $in['type'], ' ') . "\n";
|
$invoice .= Lang::pads(Lang::T('Type'), $in['type'], ' ') . "\n";
|
||||||
$invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n";
|
$invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n";
|
||||||
$invoice .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ') . "\n";
|
if (!empty($in['note'])) {
|
||||||
$invoice .= Lang::pad($in['method'], ' ', 2) . "\n";
|
|
||||||
if(!empty($in['note'])){
|
|
||||||
$invoice .= Lang::pad("", '=') . "\n";
|
$invoice .= Lang::pad("", '=') . "\n";
|
||||||
$invoice .= Lang::pad($in['note'], ' ', 2);
|
foreach ($tmp as $t) {
|
||||||
|
if (strpos($t, " : ") === false) {
|
||||||
|
if (!empty($t)) {
|
||||||
|
$invoice .= Lang::pad($t, ' ', 2) . "\n";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$tmp2 = explode(" : ", $t);
|
||||||
|
$invoice .= Lang::pads($tmp2[0], $tmp2[1], ' ') . "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$invoice .= Lang::pads(Lang::T('Total'), Lang::moneyFormat($in['price']), ' ') . "\n";
|
||||||
|
$invoice .= Lang::pads($method[0], $method[1], ' ') . "\n";
|
||||||
|
if (!empty($note)) {
|
||||||
|
$invoice .= Lang::pad("", '=') . "\n";
|
||||||
|
$invoice .= Lang::pad($note, ' ', 2) . "\n";
|
||||||
}
|
}
|
||||||
$invoice .= Lang::pad("", '=') . "\n";
|
$invoice .= Lang::pad("", '=') . "\n";
|
||||||
$invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n";
|
$invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n";
|
||||||
|
@ -490,5 +490,27 @@
|
|||||||
"Payment_not_found": "Payment not found",
|
"Payment_not_found": "Payment not found",
|
||||||
"If_your_friend_have_Additional_Cost__you_will_pay_for_that_too": "If your friend have Additional Cost, you will pay for that too",
|
"If_your_friend_have_Additional_Cost__you_will_pay_for_that_too": "If your friend have Additional Cost, you will pay for that too",
|
||||||
"Cache_cleared_successfully_": "Cache cleared successfully!",
|
"Cache_cleared_successfully_": "Cache cleared successfully!",
|
||||||
"Paid": "Paid"
|
"Paid": "Paid",
|
||||||
|
"Send_Message": "Send Message",
|
||||||
|
"Send_SMS_WA_Message": "Send SMS\/WA Message",
|
||||||
|
"Send_Bulk_SMS_WA_Message": "Send Bulk SMS\/WA Message",
|
||||||
|
"Send_Personal_Message": "Send Personal Message",
|
||||||
|
"Send_Via": "Send Via",
|
||||||
|
"Compose_your_message___": "Compose your message...",
|
||||||
|
"Use_placeholders_": "Use placeholders:",
|
||||||
|
"__name__": "[[name]]",
|
||||||
|
"Customer_Name": "Customer Name",
|
||||||
|
"__user_name__": "[[user_name]]",
|
||||||
|
"Customer_Username": "Customer Username",
|
||||||
|
"__phone__": "[[phone]]",
|
||||||
|
"Customer_Phone": "Customer Phone",
|
||||||
|
"__company_name__": "[[company_name]]",
|
||||||
|
"Your_Company_Name": "Your Company Name",
|
||||||
|
"Message_Sent_Successfully": "Message Sent Successfully",
|
||||||
|
"Send_Bulk_Message": "Send Bulk Message",
|
||||||
|
"Group": "Group",
|
||||||
|
"All_Customers": "All Customers",
|
||||||
|
"New_Customers": "New Customers",
|
||||||
|
"Expired_Customers": "Expired Customers",
|
||||||
|
"Active_Customers": "Active Customers"
|
||||||
}
|
}
|
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": "2024.3.16"
|
"version": "2024.3.18"
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user