Fixing outsanding

This commit is contained in:
KhatamNugraha
2024-06-07 16:33:16 +07:00
parent ad9889fb01
commit 21055c3c43
2 changed files with 35 additions and 9 deletions

View File

@ -47,9 +47,10 @@ class Account extends Model
->join('STG_DB.COMPANY AS CP', 'AC.CO_CODE', '=', 'CP.ID')
->where('CUSTOMER_NO', $cif)
->where('COMPANY_NAME', 'like', "%" .$uppercaseKodeCabang."%")
// ->where('LIMIT_REF', null)
// ->where('ARR_A', null)
->where('AC.BATCH_DATE', $startDate)
->whereIn(DB::raw("LEFT(CATEGORY, 3)"), ['100','600','660','101'])
->whereIn(DB::raw("LEFT(CATEGORY, 3)"), ['100','600','660','101','324'])
// ->orWhere(DB::raw("LEFT(CATEGORY, 2)"),'32')
->groupBy('CUSTOMER_NO', 'ACCOUNT_NUMBER', 'SHORT_TITLE', 'SHORT_NAME', 'COMPANY_NAME', 'LIMIT_REF')
->limit(100);
} else {
@ -64,6 +65,22 @@ class Account extends Model
return $data;
}
public function getCekProduct($cust ,$acc, $startDate){
// dd($cust, $arrAccount, $startDate);
$timestamp = strtotime($startDate);
// Format the timestamp into a date format
$Year = date("Y", $timestamp);
$data = [];
$data = DB::connection("db2")->table("STG_DB.AA_ARRANGEMENT")->select('*')
->where('CUSTOMER', $cust)
->where('LINKED_APPL_ID', $acc)
// ->whereYear('BATCH_DATE', $Year)
->where('ARR_STATUS','EXPIRED')
->limit(1);
return $data;
}
public function getAccount($cif, $arrAccount, $startDate)
{
//$uppercaseKodeCabang = Str::upper($kodecabang);