don't put to tbl_transactions if customer redeem voucher code Created by Voucher Device
This commit is contained in:
parent
9ad9ba45b1
commit
630f20094a
@ -299,6 +299,9 @@ class Package
|
|||||||
$b->save();
|
$b->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($gateway == 'Voucher' && User::isUserVoucher($channel)){
|
||||||
|
// maybe someday i will do something in here
|
||||||
|
}else{
|
||||||
// insert table transactions
|
// insert table transactions
|
||||||
$t = ORM::for_table('tbl_transactions')->create();
|
$t = ORM::for_table('tbl_transactions')->create();
|
||||||
$t->invoice = $inv = "INV-" . Package::_raid();
|
$t->invoice = $inv = "INV-" . Package::_raid();
|
||||||
@ -329,6 +332,7 @@ class Package
|
|||||||
$t->admin_id = '0';
|
$t->admin_id = '0';
|
||||||
}
|
}
|
||||||
$t->save();
|
$t->save();
|
||||||
|
}
|
||||||
|
|
||||||
if ($p['validity_unit'] == 'Period') {
|
if ($p['validity_unit'] == 'Period') {
|
||||||
// insert price to fields for invoice next month
|
// insert price to fields for invoice next month
|
||||||
@ -407,6 +411,10 @@ class Package
|
|||||||
}
|
}
|
||||||
$d->save();
|
$d->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($gateway == 'Voucher' && User::isUserVoucher($channel)){
|
||||||
|
// maybe someday i will do something in here
|
||||||
|
}else{
|
||||||
// insert table transactions
|
// insert table transactions
|
||||||
$t = ORM::for_table('tbl_transactions')->create();
|
$t = ORM::for_table('tbl_transactions')->create();
|
||||||
$t->invoice = $inv = "INV-" . Package::_raid();
|
$t->invoice = $inv = "INV-" . Package::_raid();
|
||||||
@ -434,6 +442,7 @@ class Package
|
|||||||
}
|
}
|
||||||
$t->type = $p['type'];
|
$t->type = $p['type'];
|
||||||
$t->save();
|
$t->save();
|
||||||
|
}
|
||||||
|
|
||||||
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
||||||
// insert price to fields for invoice next month
|
// insert price to fields for invoice next month
|
||||||
|
@ -196,6 +196,11 @@ class User
|
|||||||
return $d;
|
return $d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function isUserVoucher($kode) {
|
||||||
|
$regex = '/^GC\d+C.{10}$/';
|
||||||
|
return preg_match($regex, $kode);
|
||||||
|
}
|
||||||
|
|
||||||
public static function _billing($id = 0)
|
public static function _billing($id = 0)
|
||||||
{
|
{
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user