set uppercase kode cabang
This commit is contained in:
@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
|
||||||
@ -42,6 +43,7 @@ class ViewAccount extends Model
|
|||||||
$today = Carbon::now();
|
$today = Carbon::now();
|
||||||
$currentYear = $today->format("Y");
|
$currentYear = $today->format("Y");
|
||||||
$pastYear = $today->subYear(3)->format('Y');
|
$pastYear = $today->subYear(3)->format('Y');
|
||||||
|
$uppercaseKodeCabang = Str::upper($kodecabang);
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
@ -53,12 +55,12 @@ class ViewAccount extends Model
|
|||||||
dd('tess2');
|
dd('tess2');
|
||||||
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
|
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
|
||||||
->where('CUSTOMER_NO',$cif)
|
->where('CUSTOMER_NO',$cif)
|
||||||
->where('COMPANY_NAME', 'like', "%" .$kodecabang."%")
|
->where('COMPANY_NAME', 'like', "%" .$uppercaseKodeCabang."%")
|
||||||
->where('BATCH_DATE','LIKE','%'.$pastYear.'%');
|
->where('BATCH_DATE','LIKE','%'.$pastYear.'%');
|
||||||
}else {
|
}else {
|
||||||
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
|
$data = DB::connection("db2")->table("STG_DB.VW_ACCOUNTS")
|
||||||
->where('CUSTOMER_NO',$cif)
|
->where('CUSTOMER_NO',$cif)
|
||||||
->where('COMPANY_NAME', 'like', "%" .$kodecabang."%")
|
->where('COMPANY_NAME', 'like', "%" .$uppercaseKodeCabang."%")
|
||||||
->where('BATCH_DATE','LIKE','%'.$periode.'%');
|
->where('BATCH_DATE','LIKE','%'.$periode.'%');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user