forked from kevinowino869/mitrobill
fix language clean after change and still use expired date from customer attribute when it have
This commit is contained in:
@ -64,14 +64,30 @@ class Package
|
||||
}
|
||||
}
|
||||
|
||||
$day_exp = 20;
|
||||
if ($p['prepaid'] == 'no') {
|
||||
$day_exp = $p['expired_date'];
|
||||
}
|
||||
if (empty($day_exp)) {
|
||||
$day_exp = 20;
|
||||
if ($p['validity_unit'] == 'Period') {
|
||||
// if customer has attribute Expired Date use it
|
||||
$day_exp = User::getAttribute("Expired Date", $c['id']);
|
||||
if (!$day_exp) {
|
||||
$day_exp = 20;
|
||||
$f = ORM::for_table('tbl_customers_fields')->create();
|
||||
$f->customer_id = $c['id'];
|
||||
$f->field_name = 'Expired Date';
|
||||
$f->field_value = $day_exp;
|
||||
$f->save();
|
||||
}else{
|
||||
// if customer no attribute Expired Date use plan expired date
|
||||
$day_exp = 20;
|
||||
if ($p['prepaid'] == 'no') {
|
||||
$day_exp = $p['expired_date'];
|
||||
}
|
||||
if (empty($day_exp)) {
|
||||
$day_exp = 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($router_name == 'balance') {
|
||||
// insert table transactions
|
||||
$t = ORM::for_table('tbl_transactions')->create();
|
||||
|
Reference in New Issue
Block a user