add new page konfirmasi bank

This commit is contained in:
KhatamNugraha
2023-08-02 14:09:40 +07:00
parent 61185134b5
commit 2ec52d344f
7 changed files with 471 additions and 7 deletions

View File

@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;
class ViewAccount extends Model
@ -35,6 +36,32 @@ class ViewAccount extends Model
'MATURITY_DATE'"
];
public function getSearchAccount($cif , $kodecabang, $periode){
// $store = DB::connection('oracle');
$currentDate = Carbon::now();
$formattedDate = $currentDate->format('Y');
$data = [];
if ($cif != null && $kodecabang == null && $periode == null) {
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
->where('CUSTOMER_NO',$cif)
->where('BATCH_DATE','LIKE','%'.$formattedDate.'%');
} elseif ($cif != null && $kodecabang != null && $periode == null) {
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
->where('CUSTOMER_NO',$cif)
->where('COMPANY_NAME', 'like', "%" .$kodecabang."%")
->where('BATCH_DATE','LIKE','%'.$formattedDate.'%');
}else {
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
->where('CUSTOMER_NO',$cif)
->where('COMPANY_NAME', 'like', "%" .$kodecabang."%")
->where('BATCH_DATE','LIKE','%'.$periode.'%');
}
return $data;
}
public function getAccount($cus_no,$account,$kodecabang,$periode){
$data = [];
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")->select('*')->where('CUSTOMER_NO',$cus_no)->whereIn('ACCOUNT_NUMBER',$account)->get();