Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9a65d109e7 |
@@ -1,10 +1,6 @@
|
|||||||
.git
|
.git
|
||||||
.gitea
|
|
||||||
node_modules
|
node_modules
|
||||||
vendor
|
vendor
|
||||||
.env
|
|
||||||
.env.*
|
|
||||||
!.env.example
|
|
||||||
storage/logs
|
storage/logs
|
||||||
storage/framework/cache
|
storage/framework/cache
|
||||||
storage/framework/sessions
|
storage/framework/sessions
|
||||||
@@ -13,4 +9,3 @@ storage/debugbar
|
|||||||
npm-debug.log
|
npm-debug.log
|
||||||
Dockerfile
|
Dockerfile
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
docker-compose.staging.yml
|
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
APP_NAME=Lumen
|
|
||||||
APP_ENV=staging
|
|
||||||
APP_KEY=WbPGkYNmXZ6ZQplGlvl0iZ7zyW1b09xa
|
|
||||||
APP_DEBUG=true
|
|
||||||
APP_URL=http://127.0.0.1:8090
|
|
||||||
APP_TIMEZONE=Asia/Kuala_Lumpur
|
|
||||||
|
|
||||||
# Unique host ports — change these if they collide with other containers on the server.
|
|
||||||
# Host nginx should proxy the staging domain to 127.0.0.1:${HTTP_PORT}
|
|
||||||
HTTP_PORT=8090
|
|
||||||
MYSQL_PUBLISH_PORT=3308
|
|
||||||
|
|
||||||
LOG_CHANNEL=stack
|
|
||||||
LOG_LEVEL=debug
|
|
||||||
LOG_SLACK_WEBHOOK_URL=
|
|
||||||
|
|
||||||
DB_CONNECTION=mysql
|
|
||||||
DB_HOST=mysql
|
|
||||||
DB_PORT=3306
|
|
||||||
DB_DATABASE=erahn_xtra
|
|
||||||
DB_USERNAME=root
|
|
||||||
DB_PASSWORD=root
|
|
||||||
|
|
||||||
DB_CONNECTION_7=mysql
|
|
||||||
DB_HOST_7=mysql
|
|
||||||
DB_PORT_7=3306
|
|
||||||
DB_DATABASE_7=master_erahn
|
|
||||||
DB_USERNAME_7=root
|
|
||||||
DB_PASSWORD_7=root
|
|
||||||
|
|
||||||
DB_CONNECTION_2=mysql
|
|
||||||
DB_HOST_2=mysql
|
|
||||||
DB_PORT_2=3306
|
|
||||||
DB_DATABASE_2=erahn_xtra
|
|
||||||
DB_USERNAME_2=root
|
|
||||||
DB_PASSWORD_2=root
|
|
||||||
|
|
||||||
DB_CONNECTION_3=mysql
|
|
||||||
DB_HOST_3=mysql
|
|
||||||
DB_PORT_3=3306
|
|
||||||
DB_DATABASE_3=erahn_baling
|
|
||||||
DB_USERNAME_3=root
|
|
||||||
DB_PASSWORD_3=root
|
|
||||||
|
|
||||||
DB_CONNECTION_4=mysql
|
|
||||||
DB_HOST_4=mysql
|
|
||||||
DB_PORT_4=3306
|
|
||||||
DB_DATABASE_4=arrahn_ld
|
|
||||||
DB_USERNAME_4=root
|
|
||||||
DB_PASSWORD_4=root
|
|
||||||
|
|
||||||
DB_CONNECTION_5=mysql
|
|
||||||
DB_HOST_5=mysql
|
|
||||||
DB_PORT_5=3306
|
|
||||||
DB_DATABASE_5=erahn_segamat
|
|
||||||
DB_USERNAME_5=root
|
|
||||||
DB_PASSWORD_5=root
|
|
||||||
|
|
||||||
DB_CONNECTION_7=mysql
|
|
||||||
DB_HOST_7=mysql
|
|
||||||
DB_PORT_7=3306
|
|
||||||
DB_DATABASE_7=master_erahn
|
|
||||||
DB_USERNAME_7=root
|
|
||||||
DB_PASSWORD_7=root
|
|
||||||
|
|
||||||
DB_CONNECTION_6=mysql
|
|
||||||
DB_HOST_6=mysql
|
|
||||||
DB_PORT_6=3306
|
|
||||||
DB_DATABASE_6=erahn_test
|
|
||||||
DB_USERNAME_6=root
|
|
||||||
DB_PASSWORD_6=root
|
|
||||||
|
|
||||||
# DB_CONNECTION_8=mysql
|
|
||||||
# DB_HOST_8=mysql
|
|
||||||
# DB_PORT_8=3306
|
|
||||||
# DB_DATABASE_8=arrahn_klanas
|
|
||||||
# DB_USERNAME_8=spider
|
|
||||||
# DB_PASSWORD_8=G0dz!ll42020
|
|
||||||
|
|
||||||
TENNANT_MASTER_DB=master_erahn
|
|
||||||
TENNANT_KAUNTER_DB=kaunter_erahn
|
|
||||||
|
|
||||||
CACHE_DRIVER=file
|
|
||||||
QUEUE_CONNECTION=sync
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
name: Build Docker Image
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- staging
|
|
||||||
tags:
|
|
||||||
- "v*"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-backend:
|
|
||||||
runs-on: docker
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Login to Docker registry
|
|
||||||
run: |
|
|
||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | \
|
|
||||||
docker login git.koppkb.com \
|
|
||||||
-u "${{ secrets.REGISTRY_USERNAME }}" \
|
|
||||||
--password-stdin
|
|
||||||
|
|
||||||
- name: Build & push backend image
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
|
|
||||||
IMAGE="git.koppkb.com/kopkb/api_arrahn"
|
|
||||||
TAGS="-t ${IMAGE}:${{ gitea.sha }}"
|
|
||||||
|
|
||||||
if [ "${{ gitea.ref_type }}" = "tag" ] && echo "${{ gitea.ref_name }}" | grep -q '^v'; then
|
|
||||||
TAGS="${TAGS} -t ${IMAGE}:${{ gitea.ref_name }}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${{ gitea.ref_name }}" = "staging" ]; then
|
|
||||||
TAGS="${TAGS} -t ${IMAGE}:staging"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Building and pushing backend: ${TAGS}"
|
|
||||||
docker buildx build \
|
|
||||||
--target staging \
|
|
||||||
--platform linux/amd64 \
|
|
||||||
--cache-from type=registry,ref=${IMAGE}:buildcache,ignore-error=true \
|
|
||||||
--cache-to type=registry,ref=${IMAGE}:buildcache,mode=max \
|
|
||||||
-f docker/php/Dockerfile \
|
|
||||||
${TAGS} \
|
|
||||||
--push .
|
|
||||||
@@ -1,122 +0,0 @@
|
|||||||
name: Deploy to Staging
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
image_tag:
|
|
||||||
description: "Docker image tag to deploy (commit SHA, staging, or v*)"
|
|
||||||
required: true
|
|
||||||
default: "staging"
|
|
||||||
type: string
|
|
||||||
|
|
||||||
env:
|
|
||||||
APP_IMAGE: git.koppkb.com/kopkb/api_arrahn
|
|
||||||
DEPLOY_DIR: /home/arrahn/Project/api_arrahn
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: host
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ inputs.image_tag }}
|
|
||||||
|
|
||||||
- name: Login to Docker registry
|
|
||||||
run: |
|
|
||||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | \
|
|
||||||
docker login git.koppkb.com \
|
|
||||||
-u "${{ secrets.REGISTRY_USERNAME }}" \
|
|
||||||
--password-stdin
|
|
||||||
|
|
||||||
- name: Verify image exists in registry
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
IMAGE_TAG="${{ inputs.image_tag }}"
|
|
||||||
IMAGE="${APP_IMAGE}:${IMAGE_TAG}"
|
|
||||||
|
|
||||||
echo "Checking if image exists: ${IMAGE}"
|
|
||||||
if ! docker manifest inspect "${IMAGE}" > /dev/null 2>&1; then
|
|
||||||
echo "ERROR: Image ${IMAGE} does not exist in registry!"
|
|
||||||
echo "Run the Build Docker Image workflow first."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "✓ ${IMAGE} found"
|
|
||||||
|
|
||||||
- name: Pull Docker image
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
IMAGE_TAG="${{ inputs.image_tag }}"
|
|
||||||
docker pull "${APP_IMAGE}:${IMAGE_TAG}"
|
|
||||||
echo "✓ Image pulled successfully"
|
|
||||||
|
|
||||||
- name: Sync compose file and deploy
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
IMAGE_TAG="${{ inputs.image_tag }}"
|
|
||||||
|
|
||||||
mkdir -p "${DEPLOY_DIR}/docker/nginx" "${DEPLOY_DIR}/docker/mysql"
|
|
||||||
cp docker-compose.staging.yml "${DEPLOY_DIR}/docker-compose.yml"
|
|
||||||
cp docker/nginx/default.conf "${DEPLOY_DIR}/docker/nginx/default.conf"
|
|
||||||
cp -R docker/mysql/init "${DEPLOY_DIR}/docker/mysql/"
|
|
||||||
|
|
||||||
if [ ! -f "${DEPLOY_DIR}/.env.staging" ]; then
|
|
||||||
if [ -f .env.staging ]; then
|
|
||||||
cp .env.staging "${DEPLOY_DIR}/.env.staging"
|
|
||||||
echo "Copied .env.staging from repo (first deploy). Edit ${DEPLOY_DIR}/.env.staging on the server if needed."
|
|
||||||
else
|
|
||||||
echo "ERROR: ${DEPLOY_DIR}/.env.staging is missing on the server"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd "${DEPLOY_DIR}"
|
|
||||||
|
|
||||||
export APP_IMAGE
|
|
||||||
export IMAGE_TAG
|
|
||||||
|
|
||||||
docker compose --env-file .env.staging -f docker-compose.yml pull app
|
|
||||||
docker compose --env-file .env.staging -f docker-compose.yml up -d --no-build --force-recreate --remove-orphans app web
|
|
||||||
|
|
||||||
echo "✓ Deployed IMAGE_TAG=${IMAGE_TAG}"
|
|
||||||
|
|
||||||
- name: Verify deployment
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
cd "${DEPLOY_DIR}"
|
|
||||||
|
|
||||||
echo "Waiting for services to start..."
|
|
||||||
sleep 10
|
|
||||||
|
|
||||||
for SERVICE in app web mysql; do
|
|
||||||
STATUS=$(docker compose --env-file .env.staging -f docker-compose.yml ps --status running --format '{{.Name}}' "$SERVICE" 2>/dev/null || true)
|
|
||||||
if [ -z "$STATUS" ]; then
|
|
||||||
echo "ERROR: ${SERVICE} is not running"
|
|
||||||
docker compose --env-file .env.staging -f docker-compose.yml ps
|
|
||||||
docker compose --env-file .env.staging -f docker-compose.yml logs --tail=50 "$SERVICE" || true
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "✓ ${SERVICE} is running (${STATUS})"
|
|
||||||
done
|
|
||||||
|
|
||||||
HTTP_PORT=$(grep -E '^HTTP_PORT=' .env.staging 2>/dev/null | cut -d= -f2- | tr -d '"' || true)
|
|
||||||
HTTP_PORT=${HTTP_PORT:-8090}
|
|
||||||
|
|
||||||
check_health() {
|
|
||||||
NAME=$1
|
|
||||||
URL=$2
|
|
||||||
for i in 1 2 3 4 5 6; do
|
|
||||||
if curl -sf "$URL" > /dev/null; then
|
|
||||||
echo "✓ ${NAME} health check passed (${URL})"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
echo "Waiting for ${NAME}... attempt ${i}/6"
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
echo "ERROR: ${NAME} health check failed (${URL})"
|
|
||||||
docker compose --env-file .env.staging -f docker-compose.yml logs --tail=50 app web || true
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
check_health "api" "http://127.0.0.1:${HTTP_PORT}/health"
|
|
||||||
@@ -8,4 +8,3 @@ ray.php
|
|||||||
/docker_src
|
/docker_src
|
||||||
/.vscode
|
/.vscode
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
db-dump
|
|
||||||
@@ -15,10 +15,3 @@ FLUSH PRIVILEGES;
|
|||||||
|
|
||||||
Gadai=Pembiayaan
|
Gadai=Pembiayaan
|
||||||
Tebus=penyelesaian penuh/ansuran
|
Tebus=penyelesaian penuh/ansuran
|
||||||
|
|
||||||
## Load db dump without using docker
|
|
||||||
```bash
|
|
||||||
docker exec -i api_arrahn_staging_mysql mysql -uroot -proot erahn_test < erahn_test.sql
|
|
||||||
```
|
|
||||||
|
|
||||||
## Disable the cawangan in arrahn_master_db
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
class Anggota extends Model
|
|
||||||
{
|
|
||||||
protected $table = 'anggota';
|
|
||||||
protected $connection = 'mysql7';
|
|
||||||
|
|
||||||
protected $fillable = [
|
|
||||||
'no_anggota',
|
|
||||||
'nama',
|
|
||||||
'noic',
|
|
||||||
'no_tel',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
class BatchPembiayaanOnline extends Model
|
|
||||||
{
|
|
||||||
protected $table = 'batch_pembiayaan_online';
|
|
||||||
|
|
||||||
protected $fillable = [
|
|
||||||
'batch_no',
|
|
||||||
'kodcaw',
|
|
||||||
'tarikh',
|
|
||||||
'slot',
|
|
||||||
'bilangan',
|
|
||||||
'jumlah_keseluruhan',
|
|
||||||
'status',
|
|
||||||
'pc_submitted_by',
|
|
||||||
'submitted_at',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -11,17 +11,6 @@ class Cawangan extends Model
|
|||||||
|
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* Display name from master table (`details_caw`).
|
|
||||||
* Keep this as the single mapping so callers do not guess nama/namacaw.
|
|
||||||
*/
|
|
||||||
public function getNamaCawanganAttribute()
|
|
||||||
{
|
|
||||||
$nama = trim((string) ($this->attributes['details_caw'] ?? ''));
|
|
||||||
|
|
||||||
return $nama !== '' ? $nama : (string) ($this->attributes['kodcaw'] ?? '');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,95 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
|
||||||
|
|
||||||
use App\Cawangan;
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
use Illuminate\Support\Facades\Artisan;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class ImportCsv extends Command
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'csv:import';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Import CSV file to MySQL table';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new command instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the console command.
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function handle()
|
|
||||||
{
|
|
||||||
$file = resource_path('data/anggota.csv');
|
|
||||||
$handle = fopen($file, 'r');
|
|
||||||
$header = fgetcsv($handle);
|
|
||||||
|
|
||||||
$columnMap = [
|
|
||||||
'no_anggota' => 'no_anggota',
|
|
||||||
'nama' => 'nama',
|
|
||||||
'no_kp' => 'noic',
|
|
||||||
'telefon' => 'no_tel',
|
|
||||||
];
|
|
||||||
|
|
||||||
$chunk = [];
|
|
||||||
$chunkSize = 1000;
|
|
||||||
$totalRows = 0;
|
|
||||||
|
|
||||||
$bar = $this->output->createProgressBar();
|
|
||||||
$bar->start();
|
|
||||||
|
|
||||||
try {
|
|
||||||
while (($row = fgetcsv($handle)) !== false) {
|
|
||||||
$csvData = array_combine($header, $row);
|
|
||||||
$data = [];
|
|
||||||
|
|
||||||
foreach ($columnMap as $csvCol => $dbCol) {
|
|
||||||
$data[$dbCol] = $csvData[$csvCol] ?? null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$data['status'] = 1;
|
|
||||||
$chunk[] = $data;
|
|
||||||
|
|
||||||
if (count($chunk) >= $chunkSize) {
|
|
||||||
DB::table('anggota')->insertOrIgnore($chunk);
|
|
||||||
$totalRows += count($chunk);
|
|
||||||
$chunk = [];
|
|
||||||
$bar->advance($chunkSize);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($chunk)) {
|
|
||||||
DB::table('anggota')->insertOrIgnore($chunk);
|
|
||||||
$totalRows += count($chunk);
|
|
||||||
}
|
|
||||||
|
|
||||||
$bar->finish();
|
|
||||||
$this->info("\n✅ Successfully imported {$totalRows} rows");
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
$this->error("\n❌ Error: " . $e->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose($handle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,7 +24,6 @@ class Kernel extends ConsoleKernel
|
|||||||
Commands\ClearCachesAll::class,
|
Commands\ClearCachesAll::class,
|
||||||
Commands\RestartSupervisor::class,
|
Commands\RestartSupervisor::class,
|
||||||
Commands\InsertSempornaData::class,
|
Commands\InsertSempornaData::class,
|
||||||
//Commands\ImportCsv::class,
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -61,9 +61,7 @@ class Customer extends Model
|
|||||||
'kumpulan',
|
'kumpulan',
|
||||||
'telefon2',
|
'telefon2',
|
||||||
'nota_pekerjaan',
|
'nota_pekerjaan',
|
||||||
'tagpelanggan',
|
'tagpelanggan'
|
||||||
'tag_anggota',
|
|
||||||
'gambar_mykad'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ class Gadai extends Model
|
|||||||
'nilaimarhun',
|
'nilaimarhun',
|
||||||
'berat',
|
'berat',
|
||||||
'pinjaman',
|
'pinjaman',
|
||||||
'cara_terima',
|
|
||||||
'telahbayar',
|
'telahbayar',
|
||||||
'upahtelahbyr',
|
'upahtelahbyr',
|
||||||
'cajtelahbyr',
|
'cajtelahbyr',
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ use App\Status;
|
|||||||
use App\LookupStatus;
|
use App\LookupStatus;
|
||||||
use App\ARFiles;
|
use App\ARFiles;
|
||||||
use App\WTDDraft;
|
use App\WTDDraft;
|
||||||
use App\WTDSimulasi;
|
|
||||||
use App\SerahBaki;
|
use App\SerahBaki;
|
||||||
use App\WTD;
|
use App\WTD;
|
||||||
use App\StokAudit1;
|
use App\StokAudit1;
|
||||||
@@ -63,6 +62,7 @@ use Illuminate\Pagination\LengthAwarePaginator;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use App\Jobs\AccountCheckJob;
|
use App\Jobs\AccountCheckJob;
|
||||||
|
use App\Penyelarasan;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
@@ -2365,6 +2365,7 @@ class AdminPageController extends Controller
|
|||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
|
||||||
|
|
||||||
//$latestbatch = SerahBaki::on($cawangan['mysql'])->where('norujukan','baru')->get()->toArray();
|
//$latestbatch = SerahBaki::on($cawangan['mysql'])->where('norujukan','baru')->get()->toArray();
|
||||||
|
|
||||||
//new added
|
//new added
|
||||||
$serahBaki = SerahBaki::on($cawangan['mysql'])
|
$serahBaki = SerahBaki::on($cawangan['mysql'])
|
||||||
->where('norujukan', 'baru')
|
->where('norujukan', 'baru')
|
||||||
@@ -2437,16 +2438,18 @@ class AdminPageController extends Controller
|
|||||||
{
|
{
|
||||||
//array_push($latestbatch,['recno' => 0,'norujukan' => 'lama','batchno' => 0,'baki' => $lelong_data->sum('baki'),'aktif' => 1]);
|
//array_push($latestbatch,['recno' => 0,'norujukan' => 'lama','batchno' => 0,'baki' => $lelong_data->sum('baki'),'aktif' => 1]);
|
||||||
array_push($finalDataArray,['recno' => 0,'norujukan' => 'lama','batchno' => 0,'baki' => $lelong_data->sum('baki'),'aktif' => 1]);
|
array_push($finalDataArray,['recno' => 0,'norujukan' => 'lama','batchno' => 0,'baki' => $lelong_data->sum('baki'),'aktif' => 1]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//$data = $this->paginate($latestbatch,8);
|
//$data = $this->paginate($latestbatch,8);
|
||||||
$data = $this->paginate($finalDataArray,8);
|
$data = $this->paginate($finalDataArray,8);
|
||||||
|
|
||||||
|
//dd($data);
|
||||||
|
|
||||||
return response()->json($data,200);
|
return response()->json($data,200);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function rekodWTDByBatchNo($batchno,Request $request){
|
public function rekodWTDByBatchNo($batchno,Request $request){
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
|
||||||
@@ -2724,7 +2727,7 @@ class AdminPageController extends Controller
|
|||||||
'prkod' => "01",
|
'prkod' => "01",
|
||||||
'teller' => "DM",
|
'teller' => "DM",
|
||||||
'bakipjm' => ($lel['bakipjm']) ? $lel['bakipjm'] : 0,
|
'bakipjm' => ($lel['bakipjm']) ? $lel['bakipjm'] : 0,
|
||||||
'bakiupah' => $lel['bakiupah'],
|
'bakiupah' => ($lel['bakiupah']) ? $lel['bakiupah'] : 0,
|
||||||
'cajlain' => '0.00',
|
'cajlain' => '0.00',
|
||||||
'cajlelong' => $lel['cajlelong'],
|
'cajlelong' => $lel['cajlelong'],
|
||||||
'kodgl' => '',
|
'kodgl' => '',
|
||||||
@@ -2746,7 +2749,7 @@ class AdminPageController extends Controller
|
|||||||
't_jual' => $lel['t_jual'],
|
't_jual' => $lel['t_jual'],
|
||||||
'hargajual' => $lel['hargajual'],
|
'hargajual' => $lel['hargajual'],
|
||||||
'pinjaman' => $lel['pinjaman'],
|
'pinjaman' => $lel['pinjaman'],
|
||||||
'bakiupah' => $lel['bakiupah'],
|
'bakiupah' => ($lel['bakiupah']) ? $lel['bakiupah'] : 0,
|
||||||
'cajlelong' => $lel['cajlelong'],
|
'cajlelong' => $lel['cajlelong'],
|
||||||
'gst_cl' => $lel['gst_cl'],
|
'gst_cl' => $lel['gst_cl'],
|
||||||
'baki' => $lel['baki'],
|
'baki' => $lel['baki'],
|
||||||
@@ -2776,6 +2779,222 @@ class AdminPageController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function janaSimulasiWTD(Request $request)
|
||||||
|
{
|
||||||
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw', '=', $request->kodcaw)->first();
|
||||||
|
|
||||||
|
//listing sag belum tuntut cwgn
|
||||||
|
$sag_cwgn = collect(
|
||||||
|
Lelong::on($cawangan['mysql'])
|
||||||
|
->selectRaw('norujukan')
|
||||||
|
->whereYear('t_jual', $request->tahun)
|
||||||
|
->whereNull('trkhtuntut')
|
||||||
|
->where('baki', '>', 0)
|
||||||
|
->pluck('norujukan') // lebih bersih
|
||||||
|
);
|
||||||
|
|
||||||
|
//listing sag blocked
|
||||||
|
$sag_online = collect(
|
||||||
|
WTDDraft::on('mysql7')
|
||||||
|
->selectRaw('norujukan')
|
||||||
|
->where('kodcaw', '=', $request->kodcaw)
|
||||||
|
->pluck('norujukan')
|
||||||
|
);
|
||||||
|
//dd($sag_online);
|
||||||
|
//filter sag yg tk wujud dlm wtd_draft
|
||||||
|
$filtersag = $sag_cwgn->diff($sag_online);
|
||||||
|
|
||||||
|
//query baru
|
||||||
|
$tarikh_belum_tuntut = Lelong::on($cawangan['mysql'])
|
||||||
|
->selectRaw('
|
||||||
|
MONTH(t_jual) as bulan,
|
||||||
|
SUM(pinjaman) as pembiayaan,
|
||||||
|
ABS(SUM(baki)) as baki,
|
||||||
|
COUNT(DISTINCT norujukan) as jumlah_norujukan,
|
||||||
|
kodcaw
|
||||||
|
')
|
||||||
|
->whereIn('norujukan', $filtersag)
|
||||||
|
->groupBy('bulan', 'kodcaw')
|
||||||
|
->orderBy('bulan')
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$tarikh_belum_tuntut = $tarikh_belum_tuntut->map(function ($item) {
|
||||||
|
$item->bulan = \Carbon\Carbon::create()->month($item->bulan)->format('F');
|
||||||
|
return $item;
|
||||||
|
});
|
||||||
|
|
||||||
|
return response()->json($tarikh_belum_tuntut);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function RekodSimulasiWTD(Request $request)
|
||||||
|
{
|
||||||
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw', '=', $request->kodcaw)->first();
|
||||||
|
|
||||||
|
$rekod_simulasi = Lelong::on($cawangan['mysql'])
|
||||||
|
->join('gadai','lelong.norujukan','=','gadai.norujukan')
|
||||||
|
->selectRaw('ABS(lelong.baki) as baki, lelong.t_lelong, lelong.pinjaman, lelong.norujukan, gadai.nokp')
|
||||||
|
->whereMonth('lelong.t_jual', $request->month)
|
||||||
|
->whereYear('lelong.t_jual', $request->year)
|
||||||
|
->whereNull('lelong.trkhtuntut')
|
||||||
|
->where('lelong.baki', '>', 0)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
return response()->json($rekod_simulasi);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function prosesSimulasiWTD(Request $request)
|
||||||
|
{
|
||||||
|
$proses = $request->input;
|
||||||
|
|
||||||
|
// dd($proses, $cawangan);
|
||||||
|
|
||||||
|
$baki = 0;
|
||||||
|
$jumlahPembiayaan = 0;
|
||||||
|
$simulasi = WTDSimulasi::max('simulasi')+1;
|
||||||
|
|
||||||
|
foreach ($proses as $item) {
|
||||||
|
WTDSimulasi::create([
|
||||||
|
'bulan' => $item['bulan'],
|
||||||
|
'tahun' => $item['tahun'],
|
||||||
|
'kodcaw' => $item['kodcaw'],
|
||||||
|
'jumlah_sag' => $item['jumlah_sag'],
|
||||||
|
'pembiayaan'=> $item['pembiayaan'],
|
||||||
|
'baki'=> $item['baki'],
|
||||||
|
'simulasi' => $simulasi,
|
||||||
|
]);
|
||||||
|
$baki += $item['baki'];
|
||||||
|
$jumlahPembiayaan = $item['pembiayaan'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json(['status' => 'success','simulasi' => $simulasi,'baki' => $baki,'pinjaman' => $jumlahPembiayaan]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function pengesahanSimulasiWTD(Request $request)
|
||||||
|
{
|
||||||
|
// Decode the JSON records from the request
|
||||||
|
$records = json_decode($request->records, true);
|
||||||
|
|
||||||
|
// Retrieve and clean 'kodcaw' from the request
|
||||||
|
$kodcaw = $request->kodcaw;
|
||||||
|
$kodcaw_clean = str_replace('"', '', $kodcaw);
|
||||||
|
|
||||||
|
// Get the database connection for the branch (cawangan)
|
||||||
|
$cawangan = Cawangan::where('kodcaw', $kodcaw_clean)->first();
|
||||||
|
|
||||||
|
// Check if 'Cawangan' exists
|
||||||
|
if (!$cawangan) {
|
||||||
|
return response()->json(['status' => 'error', 'message' => 'Invalid branch code (kodcaw).'], 404);
|
||||||
|
}
|
||||||
|
|
||||||
|
$cawangan_connection = $cawangan->mysql;
|
||||||
|
|
||||||
|
// Get the latest batch number and increment it
|
||||||
|
$latestBatch = SerahBaki::on($cawangan_connection)->max('batchno') + 1;
|
||||||
|
|
||||||
|
// Initialize total variables
|
||||||
|
$totalPembiayaan = 0;
|
||||||
|
$totalBaki = 0;
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Iterate through the records and save them to the WTDDraft table
|
||||||
|
foreach ($records as $record) {
|
||||||
|
// Check if 'bulan' and 'tahun' exist in the record
|
||||||
|
if (!isset($record['bulan']) || !isset($record['tahun'])) {
|
||||||
|
return response()->json(['status' => 'error', 'message' => 'Missing bulan or tahun in records.'], 400);
|
||||||
|
}
|
||||||
|
$month = DateTime::createFromFormat('F', $record["bulan"])->format('n');
|
||||||
|
|
||||||
|
|
||||||
|
// Query norujukan records from the database
|
||||||
|
$query_norujukan = Lelong::on($cawangan_connection)
|
||||||
|
->join('gadai', 'lelong.norujukan', '=', 'gadai.norujukan')
|
||||||
|
->selectRaw('ABS(lelong.baki) as baki, lelong.t_lelong, lelong.pinjaman, lelong.norujukan, gadai.nokp, lelong.t_jual')
|
||||||
|
->whereMonth('lelong.t_jual', $month)
|
||||||
|
->whereYear('lelong.t_jual', $record["tahun"])
|
||||||
|
->whereNull('lelong.trkhtuntut')
|
||||||
|
->where('lelong.baki', '>', 0)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
// Save each record to the WTDDraft table
|
||||||
|
foreach ($query_norujukan as $query) {
|
||||||
|
$wtddraft = new WTDDraft();
|
||||||
|
$wtddraft->nokp = $query['nokp'];
|
||||||
|
$wtddraft->kodcaw = $kodcaw_clean;
|
||||||
|
$wtddraft->norujukan = $query['norujukan'];
|
||||||
|
$wtddraft->t_jual = $query['t_jual'];
|
||||||
|
$wtddraft->t_gadai = $query['t_gadai'] ?? null; // Optional: ensure 't_gadai' exists
|
||||||
|
$wtddraft->t_lelong = $query['t_lelong'];
|
||||||
|
$wtddraft->batchno_serah = $latestBatch;
|
||||||
|
$wtddraft->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Accumulate totals
|
||||||
|
$totalPembiayaan += $record['pembiayaan'] ?? 0;
|
||||||
|
$totalBaki += $record['baki'] ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a new record in the SerahBaki table
|
||||||
|
SerahBaki::on($cawangan_connection)->create([
|
||||||
|
'norujukan' => 'baru',
|
||||||
|
'batchno' => $latestBatch,
|
||||||
|
'hargajual' => 0.00,
|
||||||
|
'pinjaman' => $totalPembiayaan,
|
||||||
|
'upah' => 0.00,
|
||||||
|
'cajlel' => 0.00,
|
||||||
|
'gst_cl' => 0.00,
|
||||||
|
'gst_hj' => 0.00,
|
||||||
|
'baki' => $totalBaki,
|
||||||
|
'tarikh' => Carbon::now()->toDateString(),
|
||||||
|
't_jual' => Carbon::now()->toDateString(),
|
||||||
|
'nopelanggan' => '',
|
||||||
|
'aktif' => 0,
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Return a success response with the new batch number
|
||||||
|
return response()->json(['status' => 'success', 'batchno' => $latestBatch], 200);
|
||||||
|
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
// Log the error and return a failure response
|
||||||
|
Log::error($e->getMessage());
|
||||||
|
Log::error($e->getLine());
|
||||||
|
return response()->json(['status' => 'error', 'message' => $e->getMessage()], 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function simulasiToDraft(Request $request)
|
||||||
|
{
|
||||||
|
$bulan = $request->bulan;
|
||||||
|
|
||||||
|
if (!$bulan || count($bulan) === 0) {
|
||||||
|
return response()->json(['error' => 'Sila pilih sekurang-kurangnya satu bulan.'], 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
$simulasi = WTDSimulasi::whereIn('bulan', $bulan)->get();
|
||||||
|
|
||||||
|
if ($simulasi->isEmpty()) {
|
||||||
|
return response()->json(['error' => 'Tiada data untuk bulan yang dipilih.'], 404);
|
||||||
|
}
|
||||||
|
|
||||||
|
// foreach ($simulasi as $data) {
|
||||||
|
// WTDDraft::create([
|
||||||
|
// 'nokp' => $data->nokp ?? null,
|
||||||
|
// 'kodcaw' => $data->kodcaw ?? null,
|
||||||
|
// 'norujukan' => $data->norujukan ?? null,
|
||||||
|
// 't_jual' => $data->t_jual ?? null,
|
||||||
|
// 't_gadai' => $data->t_gadai ?? null,
|
||||||
|
// 't_lelong' => $data->t_lelong ?? null,
|
||||||
|
// 'batchno_serah' => $data->simulasi, // Simpan sebagai rujukan
|
||||||
|
// ]);
|
||||||
|
// }
|
||||||
|
|
||||||
|
dd($bulan, $simulasi);
|
||||||
|
|
||||||
|
return response()->json(['message' => 'Data berjaya dipindahkan ke WTD Draft!']);
|
||||||
|
|
||||||
|
}
|
||||||
public function PenjanaanPC(Request $request){
|
public function PenjanaanPC(Request $request){
|
||||||
|
|
||||||
$timeloni = Carbon::now();
|
$timeloni = Carbon::now();
|
||||||
@@ -3227,6 +3446,8 @@ class AdminPageController extends Controller
|
|||||||
return response()->json($customers);
|
return response()->json($customers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function AkruKeuntunganSebenar(Request $request){
|
public function AkruKeuntunganSebenar(Request $request){
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
|
||||||
@@ -3824,13 +4045,13 @@ class AdminPageController extends Controller
|
|||||||
|
|
||||||
$get_imbangduga = imbangdugabackup::on($cawangan['mysql'])->where('tarikh', $lastDayOfYear)->first();
|
$get_imbangduga = imbangdugabackup::on($cawangan['mysql'])->where('tarikh', $lastDayOfYear)->first();
|
||||||
$get_imbangduga = optional($get_imbangduga)->toArray() ?? [];
|
$get_imbangduga = optional($get_imbangduga)->toArray() ?? [];
|
||||||
// if(empty($get_imbangduga)){
|
if(empty($get_imbangduga)){
|
||||||
// $requestData = new Request([
|
$requestData = new Request([
|
||||||
// 'tarikh' => $request->tarikh,
|
'tarikh' => $request->tarikh,
|
||||||
// 'kodcaw' => $kodcaw,
|
'kodcaw' => $kodcaw,
|
||||||
// ]);
|
]);
|
||||||
// $exception_case = $this->AkruKeuntunganSebenar($requestData);
|
$exception_case = $this->AkruKeuntunganSebenar($requestData)->getData();
|
||||||
// }
|
}
|
||||||
|
|
||||||
$backdate_keun_sebenar += isset($get_imbangduga['keun_sebenar']) ? $get_imbangduga['keun_sebenar'] : 0;
|
$backdate_keun_sebenar += isset($get_imbangduga['keun_sebenar']) ? $get_imbangduga['keun_sebenar'] : 0;
|
||||||
$backdate_keun_sebenar += (float) ($exception_case ?? 0);
|
$backdate_keun_sebenar += (float) ($exception_case ?? 0);
|
||||||
@@ -3851,6 +4072,13 @@ class AdminPageController extends Controller
|
|||||||
if($kodcaw == '011229')
|
if($kodcaw == '011229')
|
||||||
$total -= 45390.37;
|
$total -= 45390.37;
|
||||||
|
|
||||||
|
if($kodcaw == 'KB2')
|
||||||
|
$total -= 64.8;
|
||||||
|
|
||||||
|
$total += Penyelarasan::on('mysql7')
|
||||||
|
->where('kodcaw', $kodcaw)
|
||||||
|
->sum(DB::raw('rugilelong + bakilelong + `lain-lain`'));
|
||||||
|
|
||||||
return response()->json($total,200);
|
return response()->json($total,200);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4022,222 +4250,4 @@ class AdminPageController extends Controller
|
|||||||
'result' => $status === 'completed' ? $result : null,
|
'result' => $status === 'completed' ? $result : null,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//function wtd baru
|
|
||||||
public function janaSimulasiWTD(Request $request)
|
|
||||||
{
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw', '=', $request->kodcaw)->first();
|
|
||||||
|
|
||||||
//listing sag belum tuntut cwgn
|
|
||||||
$sag_cwgn = collect(
|
|
||||||
Lelong::on($cawangan['mysql'])
|
|
||||||
->selectRaw('norujukan')
|
|
||||||
->whereYear('t_jual', $request->tahun)
|
|
||||||
->whereNull('trkhtuntut')
|
|
||||||
->where('baki', '>', 0)
|
|
||||||
->pluck('norujukan') // lebih bersih
|
|
||||||
);
|
|
||||||
|
|
||||||
//listing sag blocked
|
|
||||||
$sag_online = collect(
|
|
||||||
WTDDraft::on('mysql7')
|
|
||||||
->selectRaw('norujukan')
|
|
||||||
->where('kodcaw', '=', $request->kodcaw)
|
|
||||||
->pluck('norujukan')
|
|
||||||
);
|
|
||||||
//dd($sag_online);
|
|
||||||
//filter sag yg tk wujud dlm wtd_draft
|
|
||||||
$filtersag = $sag_cwgn->diff($sag_online);
|
|
||||||
|
|
||||||
//query baru
|
|
||||||
$tarikh_belum_tuntut = Lelong::on($cawangan['mysql'])
|
|
||||||
->selectRaw('
|
|
||||||
MONTH(t_jual) as bulan,
|
|
||||||
SUM(pinjaman) as pembiayaan,
|
|
||||||
ABS(SUM(baki)) as baki,
|
|
||||||
COUNT(DISTINCT norujukan) as jumlah_norujukan,
|
|
||||||
kodcaw
|
|
||||||
')
|
|
||||||
->whereIn('norujukan', $filtersag)
|
|
||||||
->groupBy('bulan', 'kodcaw')
|
|
||||||
->orderBy('bulan')
|
|
||||||
->get();
|
|
||||||
|
|
||||||
$tarikh_belum_tuntut = $tarikh_belum_tuntut->map(function ($item) {
|
|
||||||
$item->bulan = \Carbon\Carbon::create()->month($item->bulan)->format('F');
|
|
||||||
return $item;
|
|
||||||
});
|
|
||||||
|
|
||||||
return response()->json($tarikh_belum_tuntut);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function RekodSimulasiWTD(Request $request)
|
|
||||||
{
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw', '=', $request->kodcaw)->first();
|
|
||||||
|
|
||||||
$rekod_simulasi = Lelong::on($cawangan['mysql'])
|
|
||||||
->join('gadai','lelong.norujukan','=','gadai.norujukan')
|
|
||||||
->selectRaw('ABS(lelong.baki) as baki, lelong.t_lelong, lelong.pinjaman, lelong.norujukan, gadai.nokp')
|
|
||||||
->whereMonth('lelong.t_jual', $request->month)
|
|
||||||
->whereYear('lelong.t_jual', $request->year)
|
|
||||||
->whereNull('lelong.trkhtuntut')
|
|
||||||
->where('lelong.baki', '>', 0)
|
|
||||||
->get();
|
|
||||||
|
|
||||||
return response()->json($rekod_simulasi);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function prosesSimulasiWTD(Request $request)
|
|
||||||
{
|
|
||||||
$proses = $request->input;
|
|
||||||
|
|
||||||
// dd($proses, $cawangan);
|
|
||||||
|
|
||||||
$baki = 0;
|
|
||||||
$jumlahPembiayaan = 0;
|
|
||||||
$simulasi = WTDSimulasi::max('simulasi')+1;
|
|
||||||
|
|
||||||
foreach ($proses as $item) {
|
|
||||||
WTDSimulasi::create([
|
|
||||||
'bulan' => $item['bulan'],
|
|
||||||
'tahun' => $item['tahun'],
|
|
||||||
'kodcaw' => $item['kodcaw'],
|
|
||||||
'jumlah_sag' => $item['jumlah_sag'],
|
|
||||||
'pembiayaan'=> $item['pembiayaan'],
|
|
||||||
'baki'=> $item['baki'],
|
|
||||||
'simulasi' => $simulasi,
|
|
||||||
]);
|
|
||||||
$baki += $item['baki'];
|
|
||||||
$jumlahPembiayaan = $item['pembiayaan'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return response()->json(['status' => 'success','simulasi' => $simulasi,'baki' => $baki,'pinjaman' => $jumlahPembiayaan]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function pengesahanSimulasiWTD(Request $request)
|
|
||||||
{
|
|
||||||
// Decode the JSON records from the request
|
|
||||||
$records = json_decode($request->records, true);
|
|
||||||
|
|
||||||
// Retrieve and clean 'kodcaw' from the request
|
|
||||||
$kodcaw = $request->kodcaw;
|
|
||||||
$kodcaw_clean = str_replace('"', '', $kodcaw);
|
|
||||||
|
|
||||||
// Get the database connection for the branch (cawangan)
|
|
||||||
$cawangan = Cawangan::where('kodcaw', $kodcaw_clean)->first();
|
|
||||||
|
|
||||||
// Check if 'Cawangan' exists
|
|
||||||
if (!$cawangan) {
|
|
||||||
return response()->json(['status' => 'error', 'message' => 'Invalid branch code (kodcaw).'], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$cawangan_connection = $cawangan->mysql;
|
|
||||||
|
|
||||||
// Get the latest batch number and increment it
|
|
||||||
$latestBatch = SerahBaki::on($cawangan_connection)->max('batchno') + 1;
|
|
||||||
|
|
||||||
// Initialize total variables
|
|
||||||
$totalPembiayaan = 0;
|
|
||||||
$totalBaki = 0;
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Iterate through the records and save them to the WTDDraft table
|
|
||||||
foreach ($records as $record) {
|
|
||||||
// Check if 'bulan' and 'tahun' exist in the record
|
|
||||||
if (!isset($record['bulan']) || !isset($record['tahun'])) {
|
|
||||||
return response()->json(['status' => 'error', 'message' => 'Missing bulan or tahun in records.'], 400);
|
|
||||||
}
|
|
||||||
$month = DateTime::createFromFormat('F', $record["bulan"])->format('n');
|
|
||||||
|
|
||||||
|
|
||||||
// Query norujukan records from the database
|
|
||||||
$query_norujukan = Lelong::on($cawangan_connection)
|
|
||||||
->join('gadai', 'lelong.norujukan', '=', 'gadai.norujukan')
|
|
||||||
->selectRaw('ABS(lelong.baki) as baki, lelong.t_lelong, lelong.pinjaman, lelong.norujukan, gadai.nokp, lelong.t_jual')
|
|
||||||
->whereMonth('lelong.t_jual', $month)
|
|
||||||
->whereYear('lelong.t_jual', $record["tahun"])
|
|
||||||
->whereNull('lelong.trkhtuntut')
|
|
||||||
->where('lelong.baki', '>', 0)
|
|
||||||
->get();
|
|
||||||
|
|
||||||
// Save each record to the WTDDraft table
|
|
||||||
foreach ($query_norujukan as $query) {
|
|
||||||
$wtddraft = new WTDDraft();
|
|
||||||
$wtddraft->nokp = $query['nokp'];
|
|
||||||
$wtddraft->kodcaw = $kodcaw_clean;
|
|
||||||
$wtddraft->norujukan = $query['norujukan'];
|
|
||||||
$wtddraft->t_jual = $query['t_jual'];
|
|
||||||
$wtddraft->t_gadai = $query['t_gadai'] ?? null; // Optional: ensure 't_gadai' exists
|
|
||||||
$wtddraft->t_lelong = $query['t_lelong'];
|
|
||||||
$wtddraft->batchno_serah = $latestBatch;
|
|
||||||
$wtddraft->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Accumulate totals
|
|
||||||
$totalPembiayaan += $record['pembiayaan'] ?? 0;
|
|
||||||
$totalBaki += $record['baki'] ?? 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a new record in the SerahBaki table
|
|
||||||
SerahBaki::on($cawangan_connection)->create([
|
|
||||||
'norujukan' => 'baru',
|
|
||||||
'batchno' => $latestBatch,
|
|
||||||
'hargajual' => 0.00,
|
|
||||||
'pinjaman' => $totalPembiayaan,
|
|
||||||
'upah' => 0.00,
|
|
||||||
'cajlel' => 0.00,
|
|
||||||
'gst_cl' => 0.00,
|
|
||||||
'gst_hj' => 0.00,
|
|
||||||
'baki' => $totalBaki,
|
|
||||||
'tarikh' => Carbon::now()->toDateString(),
|
|
||||||
't_jual' => Carbon::now()->toDateString(),
|
|
||||||
'nopelanggan' => '',
|
|
||||||
'aktif' => 0,
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Return a success response with the new batch number
|
|
||||||
return response()->json(['status' => 'success', 'batchno' => $latestBatch], 200);
|
|
||||||
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
// Log the error and return a failure response
|
|
||||||
Log::error($e->getMessage());
|
|
||||||
Log::error($e->getLine());
|
|
||||||
return response()->json(['status' => 'error', 'message' => $e->getMessage()], 500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function simulasiToDraft(Request $request)
|
|
||||||
{
|
|
||||||
$bulan = $request->bulan;
|
|
||||||
|
|
||||||
if (!$bulan || count($bulan) === 0) {
|
|
||||||
return response()->json(['error' => 'Sila pilih sekurang-kurangnya satu bulan.'], 400);
|
|
||||||
}
|
|
||||||
|
|
||||||
$simulasi = WTDSimulasi::whereIn('bulan', $bulan)->get();
|
|
||||||
|
|
||||||
if ($simulasi->isEmpty()) {
|
|
||||||
return response()->json(['error' => 'Tiada data untuk bulan yang dipilih.'], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
// foreach ($simulasi as $data) {
|
|
||||||
// WTDDraft::create([
|
|
||||||
// 'nokp' => $data->nokp ?? null,
|
|
||||||
// 'kodcaw' => $data->kodcaw ?? null,
|
|
||||||
// 'norujukan' => $data->norujukan ?? null,
|
|
||||||
// 't_jual' => $data->t_jual ?? null,
|
|
||||||
// 't_gadai' => $data->t_gadai ?? null,
|
|
||||||
// 't_lelong' => $data->t_lelong ?? null,
|
|
||||||
// 'batchno_serah' => $data->simulasi, // Simpan sebagai rujukan
|
|
||||||
// ]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
//dd($bulan, $simulasi);
|
|
||||||
|
|
||||||
return response()->json(['message' => 'Data berjaya dipindahkan ke WTD Draft!']);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ namespace App\Http\Controllers;
|
|||||||
use App\Audit;
|
use App\Audit;
|
||||||
use App\Marhun;
|
use App\Marhun;
|
||||||
use App\BankMaster;
|
use App\BankMaster;
|
||||||
use App\ARFiles;
|
|
||||||
use App\Customer;
|
use App\Customer;
|
||||||
use App\Gadai;
|
use App\Gadai;
|
||||||
use App\Lelong;
|
use App\Lelong;
|
||||||
@@ -16,7 +15,6 @@ use App\AuditCustomer;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\TuntutBaki;
|
use App\TuntutBaki;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use App\Anggota;
|
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
@@ -65,7 +63,7 @@ class CustomerController extends Controller
|
|||||||
->orWhere('kpbaru','=',$ic)
|
->orWhere('kpbaru','=',$ic)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
return response()->json($this->withMykadPhoto($customer));
|
return response()->json($customer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showOneCustomerByICAdmin(Request $request){
|
public function showOneCustomerByICAdmin(Request $request){
|
||||||
@@ -75,7 +73,7 @@ class CustomerController extends Controller
|
|||||||
->orWhere('kpbaru','=',$request->ic)
|
->orWhere('kpbaru','=',$request->ic)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
return response()->json($this->withMykadPhoto($customer));
|
return response()->json($customer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showOneCustomerByICMobile($ic){
|
public function showOneCustomerByICMobile($ic){
|
||||||
@@ -369,8 +367,6 @@ class CustomerController extends Controller
|
|||||||
'tujuangadai'=>$request->tujuangadai
|
'tujuangadai'=>$request->tujuangadai
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->attachMykadPhoto($customer, $request);
|
|
||||||
|
|
||||||
$audit = new Audit();
|
$audit = new Audit();
|
||||||
$audit->users = $request->teller;
|
$audit->users = $request->teller;
|
||||||
$audit->actions = "Daftar Pelanggan Baru";
|
$audit->actions = "Daftar Pelanggan Baru";
|
||||||
@@ -380,7 +376,7 @@ class CustomerController extends Controller
|
|||||||
$audit->updated_at = $current;
|
$audit->updated_at = $current;
|
||||||
$audit->save();
|
$audit->save();
|
||||||
|
|
||||||
return response()->json($this->withMykadPhoto($customer), 201);
|
return response()->json($customer, 201);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function customerUpdate($nokp,Request $request){
|
public function customerUpdate($nokp,Request $request){
|
||||||
@@ -398,39 +394,12 @@ class CustomerController extends Controller
|
|||||||
'nota_pekerjaan'=>$request->nota_pekerjaan,
|
'nota_pekerjaan'=>$request->nota_pekerjaan,
|
||||||
// 'nota_arcc'=>$request->nota_arcc,
|
// 'nota_arcc'=>$request->nota_arcc,
|
||||||
'telefon' => $request->telefon1,
|
'telefon' => $request->telefon1,
|
||||||
'telefon2' => $request->telefon2,
|
'telefon2' => $request->telefon2
|
||||||
'telefon2' => $request->telefon2,
|
|
||||||
));
|
));
|
||||||
|
|
||||||
return response()->json($customer_update, 200);
|
return response()->json($customer_update, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assignAnggota($noic, Request $request)
|
|
||||||
{
|
|
||||||
// Semak sama ada pelanggan wujud
|
|
||||||
$customer = Customer::on('mysql7')
|
|
||||||
->where('kpbaru', $noic)
|
|
||||||
->orWhere('kplama', $noic)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if (!$customer) {
|
|
||||||
return response()->json([
|
|
||||||
'success' => false,
|
|
||||||
'message' => 'Pelanggan tidak dijumpai.'
|
|
||||||
], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Kemaskini tag_anggota
|
|
||||||
$customer->tag_anggota = 1;
|
|
||||||
$customer->save();
|
|
||||||
|
|
||||||
return response()->json([
|
|
||||||
'success' => true,
|
|
||||||
'message' => 'Tag anggota berjaya dikemaskini.',
|
|
||||||
'data' => $customer
|
|
||||||
], 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function customerUpdateKaunter($nokp,$kodcaw, Request $request){
|
public function customerUpdateKaunter($nokp,$kodcaw, Request $request){
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
|
|
||||||
@@ -857,14 +826,6 @@ class CustomerController extends Controller
|
|||||||
return response()->json($blacklist);
|
return response()->json($blacklist);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function anggotaKoperasi(Request $request){
|
|
||||||
|
|
||||||
$anggota = Anggota::where('noic',$request->noic)->first();
|
|
||||||
|
|
||||||
return response()->json($anggota);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function showCustomerByEachCawangan($ic)
|
public function showCustomerByEachCawangan($ic)
|
||||||
{
|
{
|
||||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
@@ -1106,149 +1067,4 @@ public function AdminsearchCustomerBySAG(Request $request)
|
|||||||
return response()->json($results);
|
return response()->json($results);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateTagPdpa(Request $request)
|
|
||||||
{
|
|
||||||
$tarikh_cetak_pdpa = Carbon::now()->toDateString();
|
|
||||||
|
|
||||||
$no_ic = $request->input('no_ic');
|
|
||||||
|
|
||||||
$customer = Customer::where('kplama', $no_ic)
|
|
||||||
->orWhere('kpbaru', $no_ic)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if (!$customer) {
|
|
||||||
return response()->json(['error' => 'Customer not found.'], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$customer->tag_pdpa = $request->input('tag_pdpa');
|
|
||||||
$customer->tarikh_cetak_pdpa = $tarikh_cetak_pdpa;
|
|
||||||
$customer->save();
|
|
||||||
|
|
||||||
return response()->json(['message' => 'Customer PDPA updated successfully.'], 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save MyKad photo into arrahn_files and link it on customer.gambar_mykad.
|
|
||||||
*/
|
|
||||||
protected function attachMykadPhoto($customer, Request $request)
|
|
||||||
{
|
|
||||||
if (!$customer) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$raw = $this->photoBase64FromRequest($request);
|
|
||||||
if ($raw === '') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$fileId = $this->storeMykadPhoto($raw, $request->input('photo_mime', $request->json('photo_mime')), $customer);
|
|
||||||
if (!$fileId) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Customer::on('mysql7')
|
|
||||||
->where('kpbaru', $customer->kpbaru)
|
|
||||||
->where('kplama', $customer->kplama)
|
|
||||||
->update(['gambar_mykad' => $fileId]);
|
|
||||||
|
|
||||||
$customer->gambar_mykad = $fileId;
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
Log::error('Failed to attach MyKad photo: ' . $e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function photoBase64FromRequest(Request $request)
|
|
||||||
{
|
|
||||||
$raw = $request->input('photo_base64');
|
|
||||||
if ($raw === null || $raw === '') {
|
|
||||||
$raw = $request->json('photo_base64');
|
|
||||||
}
|
|
||||||
|
|
||||||
return is_string($raw) ? $raw : '';
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function storeMykadPhoto($raw, $mime, $customer)
|
|
||||||
{
|
|
||||||
$commaPos = strpos($raw, ',');
|
|
||||||
if ($commaPos !== false) {
|
|
||||||
$raw = substr($raw, $commaPos + 1);
|
|
||||||
}
|
|
||||||
$raw = preg_replace('/\s+/', '', $raw);
|
|
||||||
|
|
||||||
if ($raw === '') {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$decoded = base64_decode($raw, true);
|
|
||||||
if ($decoded === false) {
|
|
||||||
$decoded = base64_decode($raw);
|
|
||||||
}
|
|
||||||
if ($decoded === false || $decoded === '') {
|
|
||||||
Log::warning('MyKad photo skipped: invalid base64');
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strlen($raw) > 400000) {
|
|
||||||
Log::warning('MyKad photo skipped: payload too large');
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$mime = strtolower((string) ($mime ?: 'image/jpeg'));
|
|
||||||
if (!in_array($mime, ['image/jpeg', 'image/jpg', 'image/png'], true)) {
|
|
||||||
$mime = 'image/jpeg';
|
|
||||||
}
|
|
||||||
|
|
||||||
$nric = preg_replace('/[^0-9A-Za-z]/', '', (string) ($customer->kpbaru ?: ''));
|
|
||||||
$ext = $mime === 'image/png' ? 'png' : 'jpg';
|
|
||||||
|
|
||||||
$file = new ARFiles();
|
|
||||||
$file->data = $raw;
|
|
||||||
$file->filename = ($nric !== '' ? $nric : 'mykad') . '.' . $ext;
|
|
||||||
$file->type = $mime;
|
|
||||||
$file->tarikhmasa = Carbon::now()->toDateTimeString();
|
|
||||||
$file->save();
|
|
||||||
|
|
||||||
return $file->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function withMykadPhoto($customer)
|
|
||||||
{
|
|
||||||
if (!$customer) {
|
|
||||||
return $customer;
|
|
||||||
}
|
|
||||||
|
|
||||||
$payload = $customer->toArray();
|
|
||||||
$payload['photo_base64'] = null;
|
|
||||||
$payload['photo_mime'] = null;
|
|
||||||
|
|
||||||
if (empty($customer->gambar_mykad)) {
|
|
||||||
return $payload;
|
|
||||||
}
|
|
||||||
|
|
||||||
$file = ARFiles::on('mysql7')->where('id', $customer->gambar_mykad)->first();
|
|
||||||
if ($file && $file->data) {
|
|
||||||
$payload['photo_base64'] = $file->data;
|
|
||||||
$payload['photo_mime'] = $file->type ?: 'image/jpeg';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $payload;
|
|
||||||
}
|
|
||||||
|
|
||||||
// public function createNotaArcc($kodcaw, Request $request)
|
|
||||||
// {
|
|
||||||
// $current = Carbon::now();
|
|
||||||
|
|
||||||
// $customer = Customer::on('mysql7')->create([
|
|
||||||
// 'kodcaw' => $kodcaw,
|
|
||||||
// 'tarikhdaftar' => $current->toDateString(),
|
|
||||||
// 'nota_arcc' => $request->nota_arcc,
|
|
||||||
// 'teller' => $request->teller,
|
|
||||||
// 'aktif' => 'A'
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
// return response()->json($customer, 201);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ use App\Audit;
|
|||||||
use App\Mohon;
|
use App\Mohon;
|
||||||
use App\Cawangan;
|
use App\Cawangan;
|
||||||
use App\Mohonid;
|
use App\Mohonid;
|
||||||
use App\MohonAnggota;
|
|
||||||
use App\Customer;
|
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
@@ -231,98 +229,6 @@ class KelulusanController extends Controller
|
|||||||
return response()->json($kelulusan,201);
|
return response()->json($kelulusan,201);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateAnggota($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
$harini = Carbon::now();
|
|
||||||
|
|
||||||
// Dapatkan sambungan database cawangan
|
|
||||||
$cawangan = Cawangan::on('mysql7')
|
|
||||||
->where('kodcaw', '=', $kodcaw)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if (!$cawangan) {
|
|
||||||
return response()->json(['success' => false, 'message' => 'Kod cawangan tidak sah'], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
$nokp = $request->nokp;
|
|
||||||
$komen = $request->komenkelulusan;
|
|
||||||
$namaoperasi = $request->namaoperasi;
|
|
||||||
$status = $request->sahkan; // 1 = Lulus, 2 = Batal
|
|
||||||
|
|
||||||
// Debug log masuk
|
|
||||||
Log::info('UpdateKelulusanAnggota triggered', [
|
|
||||||
'kodcaw' => $kodcaw,
|
|
||||||
'nokp' => $nokp,
|
|
||||||
'status' => $status,
|
|
||||||
'komen' => $komen,
|
|
||||||
'namaoperasi' => $namaoperasi
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Kalau LULUS
|
|
||||||
if ($status == 1) {
|
|
||||||
$kelulusan = MohonAnggota::on($cawangan['mysql'])
|
|
||||||
->where('nokp', '=', $nokp)
|
|
||||||
->update([
|
|
||||||
'status' => 'DILULUSKAN',
|
|
||||||
'komen' => $komen,
|
|
||||||
'peloperasi' => $namaoperasi,
|
|
||||||
'datetime_pelulus' => $harini,
|
|
||||||
'updated_at' => $harini,
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Update CUSTOMER di pusat (mysql7)
|
|
||||||
Customer::on('mysql7')
|
|
||||||
->where('kpbaru', '=', $nokp)
|
|
||||||
->update([
|
|
||||||
'tag_anggota' => 1,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
// Kalau BATAL / TOLAK
|
|
||||||
else if ($status == 2) {
|
|
||||||
$kelulusan = MohonAnggota::on($cawangan['mysql'])
|
|
||||||
->where('nokp', '=', $nokp)
|
|
||||||
->update([
|
|
||||||
'status' => 'DITOLAK',
|
|
||||||
'komen' => $komen,
|
|
||||||
'peloperasi' => $namaoperasi,
|
|
||||||
'datetime_pelulus' => $harini,
|
|
||||||
'updated_at' => $harini,
|
|
||||||
]);
|
|
||||||
} else {
|
|
||||||
return response()->json(['success' => false, 'message' => 'Status tidak sah'], 400);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 🧾 Simpan audit log
|
|
||||||
$audit = new Audit();
|
|
||||||
$audit->users = $namaoperasi;
|
|
||||||
$audit->actions = ($status == 1)
|
|
||||||
? "Kelulusan anggota oleh operasi (tag_anggota=1)"
|
|
||||||
: "Pembatalan / tolak anggota oleh operasi";
|
|
||||||
$audit->new_data = json_encode([
|
|
||||||
'nokp' => $nokp,
|
|
||||||
'status' => $status,
|
|
||||||
'komen' => $komen,
|
|
||||||
]);
|
|
||||||
$audit->kodcaw = $kodcaw;
|
|
||||||
$audit->created_at = $harini;
|
|
||||||
$audit->updated_at = $harini;
|
|
||||||
$audit->save();
|
|
||||||
|
|
||||||
Log::info('Kelulusan anggota dikemas kini', [
|
|
||||||
'nokp' => $nokp,
|
|
||||||
'status' => $status,
|
|
||||||
'updated_tag_anggota' => ($status == 1) ? 1 : 0
|
|
||||||
]);
|
|
||||||
|
|
||||||
return response()->json([
|
|
||||||
'success' => true,
|
|
||||||
'status' => ($status == 1) ? 'DILULUSKAN' : 'DITOLAK',
|
|
||||||
'updated_rows' => $kelulusan
|
|
||||||
], 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function updatekomen($kodcaw,$norujukan,Request $request)
|
public function updatekomen($kodcaw,$norujukan,Request $request)
|
||||||
{
|
{
|
||||||
$harini = Carbon::now();
|
$harini = Carbon::now();
|
||||||
@@ -408,64 +314,6 @@ public function create(REQUEST $request,$kodcaw,$norujukan,$roles)
|
|||||||
return response()->json($kelulusan);
|
return response()->json($kelulusan);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createKelulusanAnggota(Request $request, $kodcaw)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$harini = Carbon::now();
|
|
||||||
|
|
||||||
// ✅ Dapatkan maklumat cawangan (database connection)
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw', $kodcaw)->first();
|
|
||||||
|
|
||||||
if (!$cawangan) {
|
|
||||||
return response()->json(['success' => false, 'message' => 'Cawangan tidak dijumpai'], 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ✅ Simpan ke dalam model MohonAnggota
|
|
||||||
$kelulusan = new MohonAnggota();
|
|
||||||
$kelulusan->setConnection($cawangan['mysql']); // guna connection cawangan dinamik
|
|
||||||
$kelulusan->tarikh = $harini->toDateString();
|
|
||||||
$kelulusan->nokp = $request->nokp;
|
|
||||||
$kelulusan->nama = $request->nama ?? null;
|
|
||||||
$kelulusan->status = 'MENUNGGU OPERASI';
|
|
||||||
$kelulusan->komen = $request->komen;
|
|
||||||
$kelulusan->teller = $request->teller;
|
|
||||||
$kelulusan->peloperasi = null;
|
|
||||||
$kelulusan->created_at = $harini;
|
|
||||||
$kelulusan->updated_at = $harini;
|
|
||||||
$kelulusan->save();
|
|
||||||
|
|
||||||
// ✅ Simpan audit trail
|
|
||||||
$audit = new Audit();
|
|
||||||
$audit->users = $request->teller;
|
|
||||||
$audit->actions = 'Mohon kelulusan anggota';
|
|
||||||
$audit->new_data = json_encode(['mohon_anggota_id' => $kelulusan->id]);
|
|
||||||
$audit->kodcaw = $kodcaw;
|
|
||||||
$audit->created_at = $harini;
|
|
||||||
$audit->updated_at = $harini;
|
|
||||||
$audit->save();
|
|
||||||
|
|
||||||
// ✅ Return JSON response ke frontend
|
|
||||||
return response()->json([
|
|
||||||
'success' => true,
|
|
||||||
'message' => 'Permohonan kelulusan anggota berjaya dihantar kepada operasi.',
|
|
||||||
'data' => [
|
|
||||||
'id' => $kelulusan->id,
|
|
||||||
'nokp' => $kelulusan->nokp,
|
|
||||||
'status' => $kelulusan->status,
|
|
||||||
'komen' => $kelulusan->komen,
|
|
||||||
'teller' => $kelulusan->teller,
|
|
||||||
],
|
|
||||||
], 201);
|
|
||||||
|
|
||||||
} catch (\Throwable $th) {
|
|
||||||
Log::error('❌ createKelulusanAnggota error: ' . $th->getMessage());
|
|
||||||
return response()->json([
|
|
||||||
'success' => false,
|
|
||||||
'message' => $th->getMessage(),
|
|
||||||
], 500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//KEPOHONAN EDIT DAN HAPUS
|
//KEPOHONAN EDIT DAN HAPUS
|
||||||
|
|
||||||
public function kepohonancreate(REQUEST $request,$kodcaw,$norujukan)
|
public function kepohonancreate(REQUEST $request,$kodcaw,$norujukan)
|
||||||
@@ -692,54 +540,6 @@ public function create(REQUEST $request,$kodcaw,$norujukan,$roles)
|
|||||||
return response()->json($kelulusan, 200);
|
return response()->json($kelulusan, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function listKelulusanAnggota(Request $request)
|
|
||||||
{
|
|
||||||
$harini = Carbon::now();
|
|
||||||
Log::info($request->all());
|
|
||||||
$cawangan = Cawangan::on('mysql7')->get();
|
|
||||||
|
|
||||||
$array_kelulusan = [];
|
|
||||||
|
|
||||||
foreach ($cawangan as $caw) {
|
|
||||||
|
|
||||||
$kelulusan = MohonAnggota::on($caw['mysql'])
|
|
||||||
->whereDate('tarikh', $harini->toDateString())
|
|
||||||
->where(function ($query) {
|
|
||||||
$query->where('peloperasi', '=', 0)
|
|
||||||
->orWhereNull('peloperasi');
|
|
||||||
})
|
|
||||||
->orderBy('id', 'desc')
|
|
||||||
->get();
|
|
||||||
|
|
||||||
if ($kelulusan->isNotEmpty()) {
|
|
||||||
|
|
||||||
// Kumpul semua nokp daripada senarai kelulusan
|
|
||||||
$nokpList = $kelulusan->pluck('nokp')->unique()->toArray();
|
|
||||||
|
|
||||||
// Ambil semua nama daripada table customer (main DB)
|
|
||||||
$customers = Customer::whereIn('kpbaru', $nokpList)
|
|
||||||
->pluck('nama', 'kpbaru')
|
|
||||||
->toArray();
|
|
||||||
|
|
||||||
// Masukkan nama ke dalam setiap item kelulusan
|
|
||||||
$kelulusan = $kelulusan->map(function ($item) use ($customers) {
|
|
||||||
$item->nama = $customers[$item->nokp] ?? '-';
|
|
||||||
return $item;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Tambah ke array utama
|
|
||||||
$array_kelulusan[] = [
|
|
||||||
"kelulusanall" => $kelulusan,
|
|
||||||
"cawangan" => $caw['details_caw'],
|
|
||||||
"cawangankod" => $caw['kodcaw']
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return response()->json($array_kelulusan, 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,18 +145,15 @@ class KomuditiController extends Controller
|
|||||||
$komuditi_current = KomuditiPurchase::on('mysql7')->where('date_purchase','=',$current->toDateString())->orderBy('created_at','desc')->first();
|
$komuditi_current = KomuditiPurchase::on('mysql7')->where('date_purchase','=',$current->toDateString())->orderBy('created_at','desc')->first();
|
||||||
|
|
||||||
$unit_current = $komuditi_current['unit_komuditi'];
|
$unit_current = $komuditi_current['unit_komuditi'];
|
||||||
$update_unit = $unit_current - $request->unit_komuditi;
|
|
||||||
|
|
||||||
$unit_current = round((float) $komuditi_current['unit_komuditi'], 2);
|
$update_unit = $unit_current - $request->unit_komuditi;
|
||||||
$unit_komuditi = round((float) $request->unit_komuditi, 2);
|
|
||||||
$update_unit = round($unit_current - $unit_komuditi, 2);
|
|
||||||
|
|
||||||
$update_komuditi = KomuditiPurchase::on('mysql7')->where('id','=',$komuditi_current['id'])->update([
|
$update_komuditi = KomuditiPurchase::on('mysql7')->where('id','=',$komuditi_current['id'])->update([
|
||||||
'unit_komuditi' => $update_unit
|
'unit_komuditi' => $update_unit
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$komuditi_transaksi = KomuditiTransaksi::on('mysql7')->create([
|
$komuditi_transaksi = KomuditiTransaksi::on('mysql7')->create([
|
||||||
'unit_komuditi' => $unit_komuditi,
|
'unit_komuditi' => $request->unit_komuditi,
|
||||||
'nosijil'=>$komuditi_current['no_sijil'],
|
'nosijil'=>$komuditi_current['no_sijil'],
|
||||||
'norujukan' => $request->norujukan,
|
'norujukan' => $request->norujukan,
|
||||||
'kodcaw' => $request->kodcaw ,
|
'kodcaw' => $request->kodcaw ,
|
||||||
|
|||||||
@@ -846,8 +846,7 @@ $date = new Carbon($request->tarikh);
|
|||||||
$bilangan_gadai = $gadai->count();
|
$bilangan_gadai = $gadai->count();
|
||||||
$bilangan_tebus = $tebus->count();
|
$bilangan_tebus = $tebus->count();
|
||||||
// $bilangan_ansuran = $ansuran->count();
|
// $bilangan_ansuran = $ansuran->count();
|
||||||
//$bilangan_customer_baru = Customer::on($cawangan['mysql'])->where([['tarikhdaftar','>=',$request->mula],['tarikhdaftar','<=',$request->akhir]])->count();
|
$bilangan_customer_baru = Customer::on($cawangan['mysql'])->where([['tarikhdaftar','>=',$request->mula],['tarikhdaftar','<=',$request->akhir]])->count();
|
||||||
$bilangan_customer_baru = Customer::on('mysql7')->whereBetween('tarikhdaftar', [$request->mula, $request->akhir])->where('kodcaw', $request->kodcaw)->count();
|
|
||||||
|
|
||||||
//f
|
//f
|
||||||
$data_lelong = Lelong::on($cawangan['mysql'])->where([['t_jual','>=',$request->mula],['t_jual','<=',$request->akhir]])->get();
|
$data_lelong = Lelong::on($cawangan['mysql'])->where([['t_jual','>=',$request->mula],['t_jual','<=',$request->akhir]])->get();
|
||||||
@@ -975,11 +974,23 @@ $date = new Carbon($request->tarikh);
|
|||||||
|
|
||||||
$gadaiDataKaunter = Gadai::on($cawangan['mysql'])->whereIn('norujukan',$total_keuntunganansuran_data_kaunter)->whereNotNull('hargajualan')->pluck('norujukan');
|
$gadaiDataKaunter = Gadai::on($cawangan['mysql'])->whereIn('norujukan',$total_keuntunganansuran_data_kaunter)->whereNotNull('hargajualan')->pluck('norujukan');
|
||||||
|
|
||||||
|
// $keuntunganansuran_kaunter_query = TransaksiKeuntungan::on('mysql7')
|
||||||
|
// ->whereIn('norujukan',$gadaiDataKaunter)
|
||||||
|
// ->whereDate('tarikh_bayaran','>=',$request->mula)
|
||||||
|
// ->whereDate('tarikh_bayaran','<=',$request->akhir);
|
||||||
|
// //new update
|
||||||
$keuntunganansuran_kaunter_query = TransaksiKeuntungan::on('mysql7')
|
$keuntunganansuran_kaunter_query = TransaksiKeuntungan::on('mysql7')
|
||||||
->whereIn('norujukan',$gadaiDataKaunter)
|
->leftJoin('transaction as trans', function($join)
|
||||||
->whereDate('tarikh_bayaran','>=',$request->mula)
|
{
|
||||||
->whereDate('tarikh_bayaran','<=',$request->akhir);
|
$join->on('transaksi_keuntungan.norujukan', '=', 'trans.norujukan');
|
||||||
|
$join->on('transaksi_keuntungan.tarikh_bayaran', '=', 'trans.created_at');
|
||||||
|
})
|
||||||
|
->whereDate('trans.created_at','>=',$request->mula)
|
||||||
|
->whereDate('trans.created_at','<=',$request->akhir)
|
||||||
|
->where('trans.teller','<>','Online')
|
||||||
|
->where('trans.trans_type','=','A')
|
||||||
|
->where('trans.kodcaw',$request->kodcaw)
|
||||||
|
->pluck('transaksi_keuntungan.norujukan');
|
||||||
|
|
||||||
|
|
||||||
$total_keuntunganansuran_kaunter = $keuntunganansuran_kaunter_query->sum('bayaran_keuntungan');
|
$total_keuntunganansuran_kaunter = $keuntunganansuran_kaunter_query->sum('bayaran_keuntungan');
|
||||||
@@ -1245,7 +1256,7 @@ $date = new Carbon($request->tarikh);
|
|||||||
array_push($atarray,[
|
array_push($atarray,[
|
||||||
'tarikh' => $tarikh,
|
'tarikh' => $tarikh,
|
||||||
'masa' => $masa,
|
'masa' => $masa,
|
||||||
'users' => $at['users'],
|
'users' => isset($at['users']) && $at['users'] !== '' ? $at['users'] : '-',
|
||||||
'pelulus' => isset($atnewdata['namapelulus']) ? $atnewdata['namapelulus'] : '-',
|
'pelulus' => isset($atnewdata['namapelulus']) ? $atnewdata['namapelulus'] : '-',
|
||||||
'actions' => $at['actions'],
|
'actions' => $at['actions'],
|
||||||
'norujukan' => $at['norujukan'],
|
'norujukan' => $at['norujukan'],
|
||||||
|
|||||||
@@ -605,9 +605,9 @@ class LelongController extends Controller
|
|||||||
|
|
||||||
if($cawangan['tagarrahnbid'] == 1){
|
if($cawangan['tagarrahnbid'] == 1){
|
||||||
if(env('APP_ENV') != 'production'){
|
if(env('APP_ENV') != 'production'){
|
||||||
$link = 'https://adminbid-kopkb.erahn.com.my/api/portalApi';
|
$link = 'http://niklah.arrahn.com.my/api/portalApi';
|
||||||
}else{
|
}else{
|
||||||
$link = 'https://adminbid-kopkb.erahn.com.my/api/portalApi';
|
$link = 'http://adminbid.arrahn/api/portalApi';
|
||||||
}
|
}
|
||||||
|
|
||||||
$lelong = Http::withOptions(['verify' => true])->get($link,[
|
$lelong = Http::withOptions(['verify' => true])->get($link,[
|
||||||
|
|||||||
@@ -203,10 +203,7 @@ class MarhunController extends Controller
|
|||||||
$marhun = Marhun::on($cawangan['mysql'])
|
$marhun = Marhun::on($cawangan['mysql'])
|
||||||
->select('marhun.norujukan','gadai.nokp','customer.nama','marhun.marhun','marhun.nota','marhun.berat','marhun.karat','marhun.harga','marhun.n_marhun','marhun.t_gadai','marhun.tag_permata', 'marhun.berat_batu_permata')
|
->select('marhun.norujukan','gadai.nokp','customer.nama','marhun.marhun','marhun.nota','marhun.berat','marhun.karat','marhun.harga','marhun.n_marhun','marhun.t_gadai','marhun.tag_permata', 'marhun.berat_batu_permata')
|
||||||
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
|
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
|
||||||
->rightJoin('master_erahn.customer as customer', function($join) {
|
->rightJoin(config('tennant_database.master_db') . '.customer as customer', 'customer.kpbaru','=','gadai.nokp')
|
||||||
$join->on('customer.kpbaru', '=', 'gadai.nokp')
|
|
||||||
->orOn('customer.kplama', '=', 'gadai.nokp');
|
|
||||||
})
|
|
||||||
->where('marhun.t_gadai','=',$tarikh)
|
->where('marhun.t_gadai','=',$tarikh)
|
||||||
->orderBy('marhun.t_gadai')
|
->orderBy('marhun.t_gadai')
|
||||||
->get();
|
->get();
|
||||||
@@ -224,10 +221,7 @@ class MarhunController extends Controller
|
|||||||
$marhun = Marhun::on($cawangan['mysql'])
|
$marhun = Marhun::on($cawangan['mysql'])
|
||||||
->select('marhun.norujukan','gadai.sttebus','gadai.pinjaman','gadai.nokp','customer.nama','marhun.marhun','marhun.nota','marhun.berat','marhun.karat','marhun.harga','marhun.n_marhun','marhun.t_gadai')
|
->select('marhun.norujukan','gadai.sttebus','gadai.pinjaman','gadai.nokp','customer.nama','marhun.marhun','marhun.nota','marhun.berat','marhun.karat','marhun.harga','marhun.n_marhun','marhun.t_gadai')
|
||||||
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
|
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
|
||||||
->rightJoin('master_erahn.customer as customer', function($join) {
|
->rightJoin(config('tennant_database.master_db') . '.customer as customer', 'customer.kpbaru','=','gadai.nokp')
|
||||||
$join->on('customer.kpbaru', '=', 'gadai.nokp')
|
|
||||||
->orOn('customer.kplama', '=', 'gadai.nokp');
|
|
||||||
})
|
|
||||||
->where('marhun.t_gadai','<=',$tarikh)
|
->where('marhun.t_gadai','<=',$tarikh)
|
||||||
->whereYear('marhun.t_gadai','=',$current->year)
|
->whereYear('marhun.t_gadai','=',$current->year)
|
||||||
->where('gadai.sttebus','=','')
|
->where('gadai.sttebus','=','')
|
||||||
|
|||||||
@@ -1,160 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use App\Services\PembiayaanOnline\ModalOnlineService;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class ModalOnlineController extends Controller
|
|
||||||
{
|
|
||||||
protected $service;
|
|
||||||
|
|
||||||
public function __construct(ModalOnlineService $service = null)
|
|
||||||
{
|
|
||||||
$this->service = $service ?: new ModalOnlineService();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function respond(array $result)
|
|
||||||
{
|
|
||||||
return response()->json($result['payload'], $result['status']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/modal-online/{kodcaw}
|
|
||||||
* Read-only: does not create today's row.
|
|
||||||
*/
|
|
||||||
public function get($kodcaw)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->get($kodcaw));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Alias of get() — no longer auto-creates RM100k.
|
|
||||||
*/
|
|
||||||
public function getOrCreate($kodcaw)
|
|
||||||
{
|
|
||||||
return $this->get($kodcaw);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/modal-online/{kodcaw}/reserve
|
|
||||||
*/
|
|
||||||
public function reserve($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->reserve($kodcaw, $request->input('amaun', 0)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/initiate/modal-online?zone=all|{zone}
|
|
||||||
*/
|
|
||||||
public function initiate(Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->initiate($request->input('zone', 'all')));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/modal-online/{kodcaw}/topup/request
|
|
||||||
* PC mohon had (hari pertama) atau tambah modal. Body: amaun, dimohon_oleh, nota?
|
|
||||||
*/
|
|
||||||
public function requestTopUp($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->requestTopUp(
|
|
||||||
$kodcaw,
|
|
||||||
$request->input('amaun', 0),
|
|
||||||
$request->input('dimohon_oleh', ''),
|
|
||||||
$request->input('nota')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/modal-online/{kodcaw}/topup/requests?status=&tarikh=
|
|
||||||
*/
|
|
||||||
public function listTopUpByCawangan($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->listTopUpRequests(
|
|
||||||
$kodcaw,
|
|
||||||
$request->input('status'),
|
|
||||||
$request->input('tarikh')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/modal-online/operasi/topup/requests?status=PENDING&tarikh=
|
|
||||||
*/
|
|
||||||
public function listTopUpOperasi(Request $request)
|
|
||||||
{
|
|
||||||
$status = $request->input('status', 'PENDING');
|
|
||||||
if ($status === 'all' || $status === '') {
|
|
||||||
$status = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->respond($this->service->listTopUpRequests(
|
|
||||||
null,
|
|
||||||
$status,
|
|
||||||
$request->input('tarikh')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/modal-online/operasi/topup/{id}/approve
|
|
||||||
* Body: diluluskan_oleh, nota?, amaun? (optional override)
|
|
||||||
*/
|
|
||||||
public function approveTopUp($id, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->approveTopUp(
|
|
||||||
$id,
|
|
||||||
$request->input('diluluskan_oleh', ''),
|
|
||||||
$request->input('nota'),
|
|
||||||
null,
|
|
||||||
$request->input('amaun')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/modal-online/operasi/topup/{id}/reject
|
|
||||||
* Body: diluluskan_oleh, nota?
|
|
||||||
*/
|
|
||||||
public function rejectTopUp($id, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->rejectTopUp(
|
|
||||||
$id,
|
|
||||||
$request->input('diluluskan_oleh', ''),
|
|
||||||
$request->input('nota')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/modal-online/{kodcaw}/close
|
|
||||||
* Body: ditutup_oleh
|
|
||||||
*/
|
|
||||||
public function close($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->close(
|
|
||||||
$kodcaw,
|
|
||||||
$request->input('ditutup_oleh', '')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/modal-online/operasi/eod?zone=all&tarikh=
|
|
||||||
*/
|
|
||||||
public function listToday(Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->listToday(
|
|
||||||
$request->input('zone', 'all'),
|
|
||||||
$request->input('tarikh')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/modal-online/operasi/eod/close-all
|
|
||||||
* Body: ditutup_oleh, zone?
|
|
||||||
*/
|
|
||||||
public function closeAll(Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->closeAll(
|
|
||||||
$request->input('ditutup_oleh', ''),
|
|
||||||
$request->input('zone', 'all')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use App\Services\PembiayaanOnline\PembiayaanOnlineService;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class PembiayaanOnlineController extends Controller
|
|
||||||
{
|
|
||||||
protected $service;
|
|
||||||
|
|
||||||
public function __construct(PembiayaanOnlineService $service = null)
|
|
||||||
{
|
|
||||||
$this->service = $service ?: new PembiayaanOnlineService();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function respond(array $result)
|
|
||||||
{
|
|
||||||
return response()->json($result['payload'], $result['status']);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/pembiayaan-online/{kodcaw}
|
|
||||||
*/
|
|
||||||
public function store($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->store($kodcaw, $request->all()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/pembiayaan-online/{kodcaw}/by-norujukan/{norujukan}
|
|
||||||
*/
|
|
||||||
public function show($kodcaw, $norujukan)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->show($kodcaw, $norujukan));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/pembiayaan-online/{kodcaw}/queue
|
|
||||||
*/
|
|
||||||
public function queue($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->queue($kodcaw, $request->input('status')));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PUT /api/pembiayaan-online/{kodcaw}/lines/{id}
|
|
||||||
*/
|
|
||||||
public function updateLine($kodcaw, $id, Request $request)
|
|
||||||
{
|
|
||||||
// Prefer only present keys so "has" semantics match previous controller.
|
|
||||||
$input = [];
|
|
||||||
foreach ([
|
|
||||||
'kodbank', 'noakaun', 'nama_bank', 'nama_akaun', 'nota',
|
|
||||||
'bukti_akaun_file_id', 'borang_file_id', 'update_customer_bank',
|
|
||||||
] as $key) {
|
|
||||||
if ($request->has($key)) {
|
|
||||||
$input[$key] = $request->input($key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->respond($this->service->updateLine($kodcaw, $id, $input));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/pembiayaan-online/{kodcaw}/batches
|
|
||||||
*/
|
|
||||||
public function listBatches($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->listBatches(
|
|
||||||
$kodcaw,
|
|
||||||
$request->input('tarikh'),
|
|
||||||
$request->input('status')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/pembiayaan-online/{kodcaw}/batches/{batchId}
|
|
||||||
*/
|
|
||||||
public function showBatch($kodcaw, $batchId)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->showBatch($kodcaw, $batchId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/pembiayaan-online/{kodcaw}/batches/submit
|
|
||||||
*/
|
|
||||||
public function submitBatch($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->submitBatch(
|
|
||||||
$kodcaw,
|
|
||||||
$request->input('ids', []),
|
|
||||||
$request->input('pc_submitted_by', ''),
|
|
||||||
$request->input('slot')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/pembiayaan-online/operasi/batches
|
|
||||||
*/
|
|
||||||
public function operasiListBatches(Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->operasiListBatches(
|
|
||||||
$request->input('status', 'SUBMITTED'),
|
|
||||||
$request->input('tarikh')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/pembiayaan-online/operasi/{kodcaw}/batches/{batchId}
|
|
||||||
*/
|
|
||||||
public function operasiShowBatch($kodcaw, $batchId)
|
|
||||||
{
|
|
||||||
return $this->showBatch($kodcaw, $batchId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/pembiayaan-online/operasi/{kodcaw}/lines/{id}/approve
|
|
||||||
*/
|
|
||||||
public function operasiApproveLine($kodcaw, $id, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->operasiApproveLine(
|
|
||||||
$kodcaw,
|
|
||||||
$id,
|
|
||||||
$request->input('ops_by', '')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/pembiayaan-online/operasi/{kodcaw}/lines/{id}/reject
|
|
||||||
*/
|
|
||||||
public function operasiRejectLine($kodcaw, $id, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->operasiRejectLine(
|
|
||||||
$kodcaw,
|
|
||||||
$id,
|
|
||||||
$request->input('ops_by', ''),
|
|
||||||
$request->input('reject_reason', '')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/pembiayaan-online/operasi/{kodcaw}/batches/{batchId}/approve
|
|
||||||
*/
|
|
||||||
public function operasiApproveBatch($kodcaw, $batchId, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->operasiApproveBatch(
|
|
||||||
$kodcaw,
|
|
||||||
$batchId,
|
|
||||||
$request->input('ops_by', '')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/pembiayaan-online/operasi/{kodcaw}/lines/{id}/paid
|
|
||||||
* Body: ops_by, no_rujukan_bayaran, tarikh_bayaran?,
|
|
||||||
* bukti_data + bukti_filename + bukti_type OR bukti_file_id
|
|
||||||
*/
|
|
||||||
public function operasiMarkPaid($kodcaw, $id, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->operasiMarkPaid($kodcaw, $id, $request->all()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/pembiayaan-online/operasi/{kodcaw}/batches/{batchId}/paid
|
|
||||||
*/
|
|
||||||
public function operasiMarkPaidBatch($kodcaw, $batchId, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->operasiMarkPaidBatch($kodcaw, $batchId, $request->all()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/pembiayaan-online/{kodcaw}/lines/{id}/bukti
|
|
||||||
*/
|
|
||||||
public function getBukti($kodcaw, $id)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->getBukti($kodcaw, $id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET /api/pembiayaan-online/{kodcaw}/paid?blast_sent=0
|
|
||||||
*/
|
|
||||||
public function paidQueue($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
return $this->respond($this->service->paidQueue(
|
|
||||||
$kodcaw,
|
|
||||||
$request->input('blast_sent')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST /api/pembiayaan-online/{kodcaw}/paid/blast
|
|
||||||
* Body: ids[] (or ids), blast_by?
|
|
||||||
*/
|
|
||||||
public function markBlastSent($kodcaw, Request $request)
|
|
||||||
{
|
|
||||||
$ids = $request->input('ids', $request->input('id'));
|
|
||||||
return $this->respond($this->service->markBlastSent(
|
|
||||||
$kodcaw,
|
|
||||||
$ids,
|
|
||||||
$request->input('blast_by')
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -48,7 +48,7 @@ class GadaianController extends Controller
|
|||||||
$summary_gadaian_data = array_map(function ($db_connection) use ($request) {
|
$summary_gadaian_data = array_map(function ($db_connection) use ($request) {
|
||||||
$query = Gadai::on($db_connection);
|
$query = Gadai::on($db_connection);
|
||||||
|
|
||||||
$query->select(DB::raw('count(norujukan) as total_gadaian, sum(berat) as sum_berat, sum(nilaimarhun) as sum_nilai_marhun, sum(pinjaman) as sum_pinjaman, sum(upah12) as sum_upah_12'));
|
$query->select(DB::raw('count(norujukan) as total_gadaian, sum(berat) as sum_berat, sum(nilaimarhun) as sum_nilai_marhun, sum(pinjaman) as sum_pinjaman'));
|
||||||
|
|
||||||
$query->when($request->filled('startDate') and $request->filled('endDate'), function ($q) use ($request) {
|
$query->when($request->filled('startDate') and $request->filled('endDate'), function ($q) use ($request) {
|
||||||
return $q->where('t_gadai', '>=', $request->startDate)
|
return $q->where('t_gadai', '>=', $request->startDate)
|
||||||
|
|||||||
@@ -400,14 +400,12 @@ class VaultController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$bakiakhirVault = $vault ? $vault['bakiakhir'] : 0;
|
|
||||||
|
|
||||||
if($total != 0)
|
if($total != 0)
|
||||||
{
|
{
|
||||||
$totalbakiakhirtunai = $bakiakhirVault + $total;
|
$totalbakiakhirtunai = $vault['bakiakhir'] + $total;
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
$totalbakiakhirtunai = $bakiakhirVault;
|
$totalbakiakhirtunai = $vault['bakiakhir'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json($totalbakiakhirtunai);
|
return response()->json($totalbakiakhirtunai);
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
class ModalOnline extends Model
|
|
||||||
{
|
|
||||||
protected $table = 'modal_online';
|
|
||||||
|
|
||||||
protected $fillable = [
|
|
||||||
'tarikh',
|
|
||||||
'kodcaw',
|
|
||||||
'had',
|
|
||||||
'digunakan',
|
|
||||||
'baki',
|
|
||||||
'tambah',
|
|
||||||
'kurang',
|
|
||||||
'ditutup',
|
|
||||||
'ditutup_oleh',
|
|
||||||
'ditutup_at',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
class MohonAnggota extends Model
|
|
||||||
{
|
|
||||||
protected $table = 'mohon_anggota';
|
|
||||||
protected $connection = 'mysql7';
|
|
||||||
|
|
||||||
protected $fillable = [
|
|
||||||
'tarikh', 'nokp', 'status', 'komen', 'siri', 'teller', 'pelulus', 'peloperasi'
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
class PembiayaanOnline extends Model
|
|
||||||
{
|
|
||||||
protected $table = 'pembiayaan_online';
|
|
||||||
|
|
||||||
protected $fillable = [
|
|
||||||
'norujukan',
|
|
||||||
'nokp',
|
|
||||||
'nopelanggan',
|
|
||||||
'nama_pelanggan',
|
|
||||||
'kodcaw',
|
|
||||||
'pinjaman',
|
|
||||||
'kodbank',
|
|
||||||
'nama_bank',
|
|
||||||
'noakaun',
|
|
||||||
'nama_akaun',
|
|
||||||
'bukti_akaun_file_id',
|
|
||||||
'borang_file_id',
|
|
||||||
'status',
|
|
||||||
'reject_reason',
|
|
||||||
'rejected_by',
|
|
||||||
'rejected_at',
|
|
||||||
'batch_id',
|
|
||||||
'bukti_file_id',
|
|
||||||
'no_rujukan_bayaran',
|
|
||||||
'tarikh_bayaran',
|
|
||||||
'paid_at',
|
|
||||||
'created_by',
|
|
||||||
'pc_submitted_by',
|
|
||||||
'ops_by',
|
|
||||||
'nota',
|
|
||||||
'blast_sent',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
class RequestModalOnline extends Model
|
|
||||||
{
|
|
||||||
protected $table = 'request_modal_online';
|
|
||||||
protected $connection = 'mysql7';
|
|
||||||
|
|
||||||
protected $fillable = [
|
|
||||||
'kodcaw',
|
|
||||||
'tarikh',
|
|
||||||
'amaun',
|
|
||||||
'dimohon_oleh',
|
|
||||||
'status',
|
|
||||||
'diluluskan_oleh',
|
|
||||||
'nota',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,858 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Services\PembiayaanOnline;
|
|
||||||
|
|
||||||
use App\Cawangan;
|
|
||||||
use App\ModalOnline;
|
|
||||||
use App\RequestModalOnline;
|
|
||||||
use Carbon\Carbon;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
class ModalOnlineService
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed,mysql?:string}
|
|
||||||
*/
|
|
||||||
public function resolveMysql($kodcaw)
|
|
||||||
{
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw', '=', $kodcaw)->first();
|
|
||||||
|
|
||||||
if (!$cawangan) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 404,
|
|
||||||
'payload' => ['message' => 'Cawangan tidak dijumpai'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 200,
|
|
||||||
'payload' => null,
|
|
||||||
'mysql' => $cawangan['mysql'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function todayDate()
|
|
||||||
{
|
|
||||||
return Carbon::now()->toDateString();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function findPending($kodcaw)
|
|
||||||
{
|
|
||||||
return RequestModalOnline::on('mysql7')
|
|
||||||
->where('kodcaw', $kodcaw)
|
|
||||||
->where('status', 'PENDING')
|
|
||||||
->first();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function pendingPayload($pending)
|
|
||||||
{
|
|
||||||
return $pending ? $pending->toArray() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function missingSnapshot($kodcaw, $tarikh, $pending = null)
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'tarikh' => $tarikh,
|
|
||||||
'kodcaw' => $kodcaw,
|
|
||||||
'had' => 0.00,
|
|
||||||
'digunakan' => 0.00,
|
|
||||||
'baki' => 0.00,
|
|
||||||
'tambah' => 0.00,
|
|
||||||
'kurang' => 0.00,
|
|
||||||
'ditutup' => 0,
|
|
||||||
'missing' => true,
|
|
||||||
'pending_request' => $this->pendingPayload($pending),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function recalcBaki($modal)
|
|
||||||
{
|
|
||||||
$modal->baki = round(
|
|
||||||
(float) $modal->had + (float) $modal->tambah - (float) $modal->kurang - (float) $modal->digunakan,
|
|
||||||
2
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get today's modal_online row. Does not create — PC must request had from Operasi.
|
|
||||||
*
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed}
|
|
||||||
*/
|
|
||||||
public function get($kodcaw)
|
|
||||||
{
|
|
||||||
$resolved = $this->resolveMysql($kodcaw);
|
|
||||||
if (!$resolved['ok']) {
|
|
||||||
return $resolved;
|
|
||||||
}
|
|
||||||
|
|
||||||
$mysql = $resolved['mysql'];
|
|
||||||
$tarikh = $this->todayDate();
|
|
||||||
$pending = $this->findPending($kodcaw);
|
|
||||||
|
|
||||||
$modal = ModalOnline::on($mysql)
|
|
||||||
->where('kodcaw', $kodcaw)
|
|
||||||
->where('tarikh', $tarikh)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if (!$modal) {
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 200,
|
|
||||||
'payload' => $this->missingSnapshot($kodcaw, $tarikh, $pending),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$payload = $modal->toArray();
|
|
||||||
$payload['missing'] = false;
|
|
||||||
$payload['pending_request'] = $this->pendingPayload($pending);
|
|
||||||
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 200,
|
|
||||||
'payload' => $payload,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use get(). Kept so existing callers do not auto-seed RM100k.
|
|
||||||
*/
|
|
||||||
public function getOrCreate($kodcaw)
|
|
||||||
{
|
|
||||||
return $this->get($kodcaw);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reserve amount inside an existing branch DB connection (caller may wrap in transaction).
|
|
||||||
*
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed}
|
|
||||||
*/
|
|
||||||
public function reserveAmountOnConnection($mysql, $kodcaw, $amaun, $tarikh = null)
|
|
||||||
{
|
|
||||||
$amaun = round((float) $amaun, 2);
|
|
||||||
if ($amaun <= 0) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => ['message' => 'Amaun tidak sah'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$tarikh = $tarikh ?: Carbon::now()->toDateString();
|
|
||||||
|
|
||||||
$modal = ModalOnline::on($mysql)
|
|
||||||
->where('kodcaw', $kodcaw)
|
|
||||||
->where('tarikh', $tarikh)
|
|
||||||
->lockForUpdate()
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if (!$modal) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => [
|
|
||||||
'message' => 'Modal online belum diwujudkan. Sila mohon had daripada Operasi terlebih dahulu.',
|
|
||||||
'missing' => true,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((int) ($modal->ditutup ?? 0) === 1) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => [
|
|
||||||
'message' => 'Modal online hari ini sudah ditutup (EOD)',
|
|
||||||
'modal_online' => $modal,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((float) $modal->baki < $amaun) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => [
|
|
||||||
'message' => 'Baki modal online tidak mencukupi',
|
|
||||||
'baki' => (float) $modal->baki,
|
|
||||||
'amaun' => $amaun,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$modal->digunakan = round((float) $modal->digunakan + $amaun, 2);
|
|
||||||
$modal->baki = round(
|
|
||||||
(float) $modal->had + (float) $modal->tambah - (float) $modal->kurang - (float) $modal->digunakan,
|
|
||||||
2
|
|
||||||
);
|
|
||||||
$modal->save();
|
|
||||||
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 200,
|
|
||||||
'payload' => $modal,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reserve amount from today's online float (transactional).
|
|
||||||
*
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed}
|
|
||||||
*/
|
|
||||||
public function reserve($kodcaw, $amaun)
|
|
||||||
{
|
|
||||||
$resolved = $this->resolveMysql($kodcaw);
|
|
||||||
if (!$resolved['ok']) {
|
|
||||||
return $resolved;
|
|
||||||
}
|
|
||||||
|
|
||||||
$mysql = $resolved['mysql'];
|
|
||||||
$amaun = round((float) $amaun, 2);
|
|
||||||
|
|
||||||
if ($amaun <= 0) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => ['message' => 'Amaun tidak sah'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
return DB::connection($mysql)->transaction(function () use ($mysql, $kodcaw, $amaun) {
|
|
||||||
return $this->reserveAmountOnConnection($mysql, $kodcaw, $amaun);
|
|
||||||
});
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
Log::error('ModalOnline reserve failed: ' . $e->getMessage());
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 500,
|
|
||||||
'payload' => ['message' => 'Gagal reserve modal online'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Had is no longer auto-seeded. Returns how many branches already have a row today.
|
|
||||||
*
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed}
|
|
||||||
*/
|
|
||||||
public function initiate($zone = 'all')
|
|
||||||
{
|
|
||||||
$current = $this->todayDate();
|
|
||||||
|
|
||||||
if ($zone == 'all') {
|
|
||||||
$cawanganAll = Cawangan::on('mysql7')->get();
|
|
||||||
} else {
|
|
||||||
$cawanganAll = Cawangan::on('mysql7')->where('zone', $zone)->get();
|
|
||||||
}
|
|
||||||
|
|
||||||
$existing = 0;
|
|
||||||
$missing = 0;
|
|
||||||
|
|
||||||
foreach ($cawanganAll as $cawangan) {
|
|
||||||
try {
|
|
||||||
$exists = ModalOnline::on($cawangan['mysql'])
|
|
||||||
->where('kodcaw', $cawangan['kodcaw'])
|
|
||||||
->where('tarikh', $current)
|
|
||||||
->exists();
|
|
||||||
|
|
||||||
if ($exists) {
|
|
||||||
$existing++;
|
|
||||||
} else {
|
|
||||||
$missing++;
|
|
||||||
}
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
Log::warning('initiate modal_online skip ' . $cawangan['kodcaw'] . ': ' . $e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 200,
|
|
||||||
'payload' => [
|
|
||||||
'tarikh' => $current,
|
|
||||||
'created' => 0,
|
|
||||||
'existing' => $existing,
|
|
||||||
'missing' => $missing,
|
|
||||||
'message' => 'Modal online tidak di-initiate automatik. PC perlu mohon had daripada Operasi.',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PC request opening had (or extra top-up) from Operasi.
|
|
||||||
*
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed}
|
|
||||||
*/
|
|
||||||
public function requestTopUp($kodcaw, $amaun, $dimohonOleh, $nota = null)
|
|
||||||
{
|
|
||||||
$resolved = $this->resolveMysql($kodcaw);
|
|
||||||
if (!$resolved['ok']) {
|
|
||||||
return $resolved;
|
|
||||||
}
|
|
||||||
$mysql = $resolved['mysql'];
|
|
||||||
|
|
||||||
$amaun = round((float) $amaun, 2);
|
|
||||||
$dimohonOleh = trim((string) $dimohonOleh);
|
|
||||||
|
|
||||||
if ($amaun <= 0) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => ['message' => 'Amaun tidak sah'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
if ($dimohonOleh === '') {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => ['message' => 'dimohon_oleh diperlukan'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$tarikh = $this->todayDate();
|
|
||||||
$pending = $this->findPending($kodcaw);
|
|
||||||
|
|
||||||
if ($pending) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 409,
|
|
||||||
'payload' => [
|
|
||||||
'message' => 'Masih ada permohonan modal online PENDING untuk cawangan ini',
|
|
||||||
'request' => $pending,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$modal = ModalOnline::on($mysql)
|
|
||||||
->where('kodcaw', $kodcaw)
|
|
||||||
->where('tarikh', $tarikh)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if ($modal && (int) ($modal->ditutup ?? 0) === 1) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => [
|
|
||||||
'message' => 'Modal online hari ini sudah ditutup (EOD). Tidak boleh mohon.',
|
|
||||||
'modal_online' => $modal,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$jenis = $modal ? 'TOPUP' : 'HAD';
|
|
||||||
|
|
||||||
$request = RequestModalOnline::on('mysql7')->create([
|
|
||||||
'kodcaw' => $kodcaw,
|
|
||||||
'tarikh' => $tarikh,
|
|
||||||
'amaun' => $amaun,
|
|
||||||
'dimohon_oleh' => $dimohonOleh,
|
|
||||||
'status' => 'PENDING',
|
|
||||||
'nota' => $nota,
|
|
||||||
]);
|
|
||||||
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 201,
|
|
||||||
'payload' => [
|
|
||||||
'request' => $request,
|
|
||||||
'jenis' => $jenis,
|
|
||||||
'modal_online' => $modal ?: $this->missingSnapshot($kodcaw, $tarikh, $request),
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* List top-up requests.
|
|
||||||
* For PC: pass kodcaw. For Operasi: omit kodcaw (all branches).
|
|
||||||
*
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed}
|
|
||||||
*/
|
|
||||||
public function listTopUpRequests($kodcaw = null, $status = null, $tarikh = null)
|
|
||||||
{
|
|
||||||
$query = RequestModalOnline::on('mysql7')->newQuery();
|
|
||||||
|
|
||||||
if ($kodcaw) {
|
|
||||||
$query->where('kodcaw', $kodcaw);
|
|
||||||
}
|
|
||||||
if ($status) {
|
|
||||||
$query->where('status', $status);
|
|
||||||
}
|
|
||||||
if ($tarikh) {
|
|
||||||
$query->where('tarikh', $tarikh);
|
|
||||||
}
|
|
||||||
|
|
||||||
$rows = $query->orderBy('id', 'desc')->get();
|
|
||||||
|
|
||||||
$cawMap = [];
|
|
||||||
if (!$kodcaw) {
|
|
||||||
foreach (Cawangan::on('mysql7')->get() as $caw) {
|
|
||||||
$cawMap[$caw->kodcaw] = $caw->nama_cawangan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = [];
|
|
||||||
foreach ($rows as $row) {
|
|
||||||
$item = $row->toArray();
|
|
||||||
if (!$kodcaw) {
|
|
||||||
$item['cawangan_nama'] = $cawMap[$row->kodcaw] ?? null;
|
|
||||||
}
|
|
||||||
$data[] = $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 200,
|
|
||||||
'payload' => [
|
|
||||||
'bilangan' => count($data),
|
|
||||||
'data' => $data,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Operasi approve: first request of the day sets had; later requests add tambah.
|
|
||||||
* Optional $amaunOverride lets operasi lulus a different amount than dimohon.
|
|
||||||
*
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed}
|
|
||||||
*/
|
|
||||||
public function approveTopUp($requestId, $diluluskanOleh, $nota = null, $expectedKodcaw = null, $amaunOverride = null)
|
|
||||||
{
|
|
||||||
$diluluskanOleh = trim((string) $diluluskanOleh);
|
|
||||||
if ($diluluskanOleh === '') {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => ['message' => 'diluluskan_oleh diperlukan'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$req = RequestModalOnline::on('mysql7')->where('id', $requestId)->first();
|
|
||||||
if (!$req) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 404,
|
|
||||||
'payload' => ['message' => 'Permohonan tidak dijumpai'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($expectedKodcaw && $req->kodcaw !== $expectedKodcaw) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 404,
|
|
||||||
'payload' => ['message' => 'Permohonan tidak dijumpai'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($req->status !== 'PENDING') {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => [
|
|
||||||
'message' => 'Hanya permohonan PENDING boleh diluluskan',
|
|
||||||
'status' => $req->status,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$kodcaw = $req->kodcaw;
|
|
||||||
$resolved = $this->resolveMysql($kodcaw);
|
|
||||||
if (!$resolved['ok']) {
|
|
||||||
return $resolved;
|
|
||||||
}
|
|
||||||
$mysql = $resolved['mysql'];
|
|
||||||
$amaunDimohon = round((float) $req->amaun, 2);
|
|
||||||
$amaun = $amaunDimohon;
|
|
||||||
if ($amaunOverride !== null && $amaunOverride !== '') {
|
|
||||||
$amaun = round((float) $amaunOverride, 2);
|
|
||||||
if ($amaun <= 0) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => ['message' => 'Amaun diluluskan tidak sah'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$tarikh = $this->todayDate();
|
|
||||||
|
|
||||||
try {
|
|
||||||
$applied = DB::connection($mysql)->transaction(function () use ($mysql, $kodcaw, $tarikh, $amaun) {
|
|
||||||
$modal = ModalOnline::on($mysql)
|
|
||||||
->where('kodcaw', $kodcaw)
|
|
||||||
->where('tarikh', $tarikh)
|
|
||||||
->lockForUpdate()
|
|
||||||
->first();
|
|
||||||
|
|
||||||
$jenis = 'TOPUP';
|
|
||||||
|
|
||||||
if (!$modal) {
|
|
||||||
$modal = ModalOnline::on($mysql)->create([
|
|
||||||
'tarikh' => $tarikh,
|
|
||||||
'kodcaw' => $kodcaw,
|
|
||||||
'had' => $amaun,
|
|
||||||
'digunakan' => 0.00,
|
|
||||||
'baki' => $amaun,
|
|
||||||
'tambah' => 0.00,
|
|
||||||
'kurang' => 0.00,
|
|
||||||
'ditutup' => 0,
|
|
||||||
]);
|
|
||||||
$modal = ModalOnline::on($mysql)
|
|
||||||
->where('id', $modal->id)
|
|
||||||
->lockForUpdate()
|
|
||||||
->first();
|
|
||||||
$jenis = 'HAD';
|
|
||||||
} else {
|
|
||||||
if ((int) ($modal->ditutup ?? 0) === 1) {
|
|
||||||
throw new \RuntimeException('MODAL_ONLINE_CLOSED');
|
|
||||||
}
|
|
||||||
|
|
||||||
$modal->tambah = round((float) $modal->tambah + $amaun, 2);
|
|
||||||
$this->recalcBaki($modal);
|
|
||||||
$modal->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
return ['modal' => $modal, 'jenis' => $jenis];
|
|
||||||
});
|
|
||||||
|
|
||||||
$modal = $applied['modal'];
|
|
||||||
$jenis = $applied['jenis'];
|
|
||||||
|
|
||||||
$req->status = 'APPROVED';
|
|
||||||
$req->diluluskan_oleh = $diluluskanOleh;
|
|
||||||
$req->amaun = $amaun;
|
|
||||||
|
|
||||||
$notes = [];
|
|
||||||
if (abs($amaun - $amaunDimohon) >= 0.01) {
|
|
||||||
$notes[] = 'Amaun dimohon RM ' . number_format($amaunDimohon, 2)
|
|
||||||
. ', diluluskan RM ' . number_format($amaun, 2);
|
|
||||||
}
|
|
||||||
if ($nota !== null && trim((string) $nota) !== '') {
|
|
||||||
$notes[] = trim((string) $nota);
|
|
||||||
}
|
|
||||||
if ($notes) {
|
|
||||||
$existing = trim((string) $req->nota);
|
|
||||||
$req->nota = $existing === ''
|
|
||||||
? implode(' | ', $notes)
|
|
||||||
: $existing . ' | ' . implode(' | ', $notes);
|
|
||||||
}
|
|
||||||
$req->save();
|
|
||||||
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 200,
|
|
||||||
'payload' => [
|
|
||||||
'request' => $req->fresh(),
|
|
||||||
'jenis' => $jenis,
|
|
||||||
'modal_online' => $modal,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
if ($e->getMessage() === 'MODAL_ONLINE_CLOSED') {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => ['message' => 'Modal online hari ini sudah ditutup (EOD). Tidak boleh lulus permohonan.'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
Log::error('approveTopUp failed: ' . $e->getMessage());
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 500,
|
|
||||||
'payload' => ['message' => 'Gagal lulus permohonan modal online'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Operasi reject top-up request.
|
|
||||||
*
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed}
|
|
||||||
*/
|
|
||||||
public function rejectTopUp($requestId, $diluluskanOleh, $nota = null, $expectedKodcaw = null)
|
|
||||||
{
|
|
||||||
$diluluskanOleh = trim((string) $diluluskanOleh);
|
|
||||||
if ($diluluskanOleh === '') {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => ['message' => 'diluluskan_oleh diperlukan'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$req = RequestModalOnline::on('mysql7')->where('id', $requestId)->first();
|
|
||||||
if (!$req) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 404,
|
|
||||||
'payload' => ['message' => 'Permohonan tidak dijumpai'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($expectedKodcaw && $req->kodcaw !== $expectedKodcaw) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 404,
|
|
||||||
'payload' => ['message' => 'Permohonan tidak dijumpai'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($req->status !== 'PENDING') {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => [
|
|
||||||
'message' => 'Hanya permohonan PENDING boleh ditolak',
|
|
||||||
'status' => $req->status,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$req->status = 'REJECTED';
|
|
||||||
$req->diluluskan_oleh = $diluluskanOleh;
|
|
||||||
if ($nota !== null && trim((string) $nota) !== '') {
|
|
||||||
$req->nota = trim(
|
|
||||||
trim((string) $req->nota) === ''
|
|
||||||
? (string) $nota
|
|
||||||
: $req->nota . ' | ' . $nota
|
|
||||||
);
|
|
||||||
}
|
|
||||||
$req->save();
|
|
||||||
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 200,
|
|
||||||
'payload' => ['request' => $req],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EOD close for one branch: return unused baki via kurang, mark ditutup.
|
|
||||||
* Also auto-rejects PENDING top-up requests for the branch.
|
|
||||||
*
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed}
|
|
||||||
*/
|
|
||||||
public function close($kodcaw, $ditutupOleh)
|
|
||||||
{
|
|
||||||
$resolved = $this->resolveMysql($kodcaw);
|
|
||||||
if (!$resolved['ok']) {
|
|
||||||
return $resolved;
|
|
||||||
}
|
|
||||||
$mysql = $resolved['mysql'];
|
|
||||||
|
|
||||||
$ditutupOleh = trim((string) $ditutupOleh);
|
|
||||||
if ($ditutupOleh === '') {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => ['message' => 'ditutup_oleh diperlukan'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$tarikh = Carbon::now()->toDateString();
|
|
||||||
$now = Carbon::now();
|
|
||||||
|
|
||||||
try {
|
|
||||||
$result = DB::connection($mysql)->transaction(function () use ($mysql, $kodcaw, $tarikh, $ditutupOleh, $now) {
|
|
||||||
$modal = ModalOnline::on($mysql)
|
|
||||||
->where('kodcaw', $kodcaw)
|
|
||||||
->where('tarikh', $tarikh)
|
|
||||||
->lockForUpdate()
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if (!$modal) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 404,
|
|
||||||
'payload' => [
|
|
||||||
'message' => 'Tiada modal online hari ini untuk ditutup. Teller belum mohon / PC belum lulus had.',
|
|
||||||
'missing' => true,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((int) ($modal->ditutup ?? 0) === 1) {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 409,
|
|
||||||
'payload' => [
|
|
||||||
'message' => 'Modal online sudah ditutup untuk hari ini',
|
|
||||||
'modal_online' => $modal,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$unused = round((float) $modal->baki, 2);
|
|
||||||
$modal->kurang = round((float) $modal->kurang + $unused, 2);
|
|
||||||
$modal->baki = round(
|
|
||||||
(float) $modal->had + (float) $modal->tambah - (float) $modal->kurang - (float) $modal->digunakan,
|
|
||||||
2
|
|
||||||
);
|
|
||||||
$modal->ditutup = 1;
|
|
||||||
$modal->ditutup_oleh = $ditutupOleh;
|
|
||||||
$modal->ditutup_at = $now;
|
|
||||||
$modal->save();
|
|
||||||
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 200,
|
|
||||||
'payload' => [
|
|
||||||
'modal_online' => $modal,
|
|
||||||
'dikembalikan' => $unused,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!$result['ok']) {
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
$pendingRejected = RequestModalOnline::on('mysql7')
|
|
||||||
->where('kodcaw', $kodcaw)
|
|
||||||
->where('status', 'PENDING')
|
|
||||||
->get();
|
|
||||||
|
|
||||||
foreach ($pendingRejected as $req) {
|
|
||||||
$req->status = 'REJECTED';
|
|
||||||
$req->diluluskan_oleh = $ditutupOleh;
|
|
||||||
$tag = 'Auto reject: EOD close';
|
|
||||||
$req->nota = trim((string) $req->nota) === ''
|
|
||||||
? $tag
|
|
||||||
: trim($req->nota) . ' | ' . $tag;
|
|
||||||
$req->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
$result['payload']['pending_topup_ditolak'] = $pendingRejected->count();
|
|
||||||
return $result;
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
Log::error('modal online close failed: ' . $e->getMessage());
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 500,
|
|
||||||
'payload' => ['message' => 'Gagal tutup modal online'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Operasi: list today's modal_online across branches.
|
|
||||||
*
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed}
|
|
||||||
*/
|
|
||||||
public function listToday($zone = 'all', $tarikh = null)
|
|
||||||
{
|
|
||||||
$tarikh = $tarikh ?: Carbon::now()->toDateString();
|
|
||||||
|
|
||||||
if ($zone == 'all') {
|
|
||||||
$cawanganAll = Cawangan::on('mysql7')->get();
|
|
||||||
} else {
|
|
||||||
$cawanganAll = Cawangan::on('mysql7')->where('zone', $zone)->get();
|
|
||||||
}
|
|
||||||
|
|
||||||
$rows = [];
|
|
||||||
foreach ($cawanganAll as $cawangan) {
|
|
||||||
try {
|
|
||||||
$modal = ModalOnline::on($cawangan['mysql'])
|
|
||||||
->where('kodcaw', $cawangan['kodcaw'])
|
|
||||||
->where('tarikh', $tarikh)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
$row = $modal ? $modal->toArray() : [
|
|
||||||
'tarikh' => $tarikh,
|
|
||||||
'kodcaw' => $cawangan['kodcaw'],
|
|
||||||
'had' => 0,
|
|
||||||
'digunakan' => 0,
|
|
||||||
'baki' => 0,
|
|
||||||
'tambah' => 0,
|
|
||||||
'kurang' => 0,
|
|
||||||
'ditutup' => 0,
|
|
||||||
'missing' => true,
|
|
||||||
];
|
|
||||||
$row['cawangan_nama'] = $cawangan->nama_cawangan;
|
|
||||||
$row['missing'] = empty($modal);
|
|
||||||
$rows[] = $row;
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
Log::warning('listToday modal_online skip ' . $cawangan['kodcaw'] . ': ' . $e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
usort($rows, function ($a, $b) {
|
|
||||||
return strcmp((string) ($a['kodcaw'] ?? ''), (string) ($b['kodcaw'] ?? ''));
|
|
||||||
});
|
|
||||||
|
|
||||||
$open = 0;
|
|
||||||
$closed = 0;
|
|
||||||
$missing = 0;
|
|
||||||
foreach ($rows as $row) {
|
|
||||||
if (!empty($row['missing'])) {
|
|
||||||
$missing++;
|
|
||||||
} elseif ((int) ($row['ditutup'] ?? 0) === 1) {
|
|
||||||
$closed++;
|
|
||||||
} else {
|
|
||||||
$open++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 200,
|
|
||||||
'payload' => [
|
|
||||||
'tarikh' => $tarikh,
|
|
||||||
'bilangan' => count($rows),
|
|
||||||
'open' => $open,
|
|
||||||
'closed' => $closed,
|
|
||||||
'missing' => $missing,
|
|
||||||
'data' => $rows,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Operasi bulk EOD close for open branches today.
|
|
||||||
*
|
|
||||||
* @return array{ok:bool,status:int,payload:mixed}
|
|
||||||
*/
|
|
||||||
public function closeAll($ditutupOleh, $zone = 'all')
|
|
||||||
{
|
|
||||||
$ditutupOleh = trim((string) $ditutupOleh);
|
|
||||||
if ($ditutupOleh === '') {
|
|
||||||
return [
|
|
||||||
'ok' => false,
|
|
||||||
'status' => 422,
|
|
||||||
'payload' => ['message' => 'ditutup_oleh diperlukan'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$list = $this->listToday($zone);
|
|
||||||
$closed = 0;
|
|
||||||
$skipped = 0;
|
|
||||||
$failed = [];
|
|
||||||
|
|
||||||
foreach ($list['payload']['data'] as $row) {
|
|
||||||
if (!empty($row['missing']) || (int) ($row['ditutup'] ?? 0) === 1) {
|
|
||||||
$skipped++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$res = $this->close($row['kodcaw'], $ditutupOleh);
|
|
||||||
if ($res['ok']) {
|
|
||||||
$closed++;
|
|
||||||
} else {
|
|
||||||
$failed[] = [
|
|
||||||
'kodcaw' => $row['kodcaw'],
|
|
||||||
'message' => $res['payload']['message'] ?? 'gagal',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
'ok' => true,
|
|
||||||
'status' => 200,
|
|
||||||
'payload' => [
|
|
||||||
'closed' => $closed,
|
|
||||||
'skipped' => $skipped,
|
|
||||||
'failed' => $failed,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -398,7 +398,7 @@ class OnePercentService
|
|||||||
$t_gadai = Carbon::parse($gadai->t_gadai);
|
$t_gadai = Carbon::parse($gadai->t_gadai);
|
||||||
$t_bayaran = Carbon::parse($trans->tarikh_bayaran);
|
$t_bayaran = Carbon::parse($trans->tarikh_bayaran);
|
||||||
|
|
||||||
if (($t_gadai->month == $t_bayaran->month) && ($t_gadai->year == $t_bayaran->year)) {
|
if ($t_gadai->month === $t_bayaran->month && $t_gadai->year === $t_bayaran->year) {
|
||||||
return false;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ use Illuminate\Http\Request as HttpRequest;
|
|||||||
use App\Support\v2\GadaiV2 as Version2Gadai;
|
use App\Support\v2\GadaiV2 as Version2Gadai;
|
||||||
use App\Support\v2\Penebusan;
|
use App\Support\v2\Penebusan;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
class OnePercent extends MasterServices
|
class OnePercent extends MasterServices
|
||||||
{
|
{
|
||||||
protected $kodcaw;
|
protected $kodcaw;
|
||||||
@@ -63,30 +61,18 @@ class OnePercent extends MasterServices
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKadarUjrah(HttpRequest $request)
|
public function getKadarUjrah(HttpRequest $request){
|
||||||
{
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw',$request->kodcaw)->first();
|
||||||
// Log::info('[DEBUG-CONTROLLER] Data request', [
|
|
||||||
// 'nokp' => $request->nokp,
|
|
||||||
// 'kodcaw' => $request->kodcaw,
|
|
||||||
// 'nilaimarhun' => $request->nilaimarhun
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw', $request->kodcaw)->first();
|
|
||||||
$onePercentServices = new Calculation();
|
$onePercentServices = new Calculation();
|
||||||
|
$kadarujrah = $onePercentServices->getKadarUjrah($request->nilaimarhun,$cawangan['group_id']);
|
||||||
$kadarujrah = $onePercentServices->getKadarUjrah(
|
|
||||||
$request->nilaimarhun,
|
|
||||||
$cawangan['group_id'],
|
|
||||||
$request->nokp
|
|
||||||
);
|
|
||||||
|
|
||||||
return $kadarujrah;
|
return $kadarujrah;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOnePercent(HttpRequest $request){
|
public function getOnePercent(HttpRequest $request){
|
||||||
$margin = (!is_numeric($request->margin)) ? 0 : $request->margin;
|
$margin = (!is_numeric($request->margin)) ? 0 : $request->margin;
|
||||||
$onePercentServices = new Calculation();
|
$onePercentServices = new Calculation();
|
||||||
$keuntungan = $onePercentServices->kiraanKeuntunganSebenar($request->pembiayaan,$request->nilaimarhun,$request->kadarujrah,$margin, $request->nokp);
|
$keuntungan = $onePercentServices->kiraanKeuntunganSebenar($request->pembiayaan,$request->nilaimarhun,$request->kadarujrah,$margin);
|
||||||
|
|
||||||
return $keuntungan;
|
return $keuntungan;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ namespace App\Support\v2;
|
|||||||
|
|
||||||
use App\Audit;
|
use App\Audit;
|
||||||
use App\Cawangan;
|
use App\Cawangan;
|
||||||
use App\Customer;
|
|
||||||
use App\KadarUpah;
|
use App\KadarUpah;
|
||||||
use App\Support\v2\Calculation;
|
use App\Support\v2\Calculation;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
@@ -58,34 +57,6 @@ class GadaiV2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getKadarUpahAnggota($nokp, $total_nilai_marhun = 0, $groupid = 2): ?float
|
|
||||||
{
|
|
||||||
if (!$nokp) {
|
|
||||||
return null; // tiada nokp = tak boleh tentukan kadar
|
|
||||||
}
|
|
||||||
|
|
||||||
$customer = Customer::on('mysql7')
|
|
||||||
->select('tag_anggota')
|
|
||||||
->where(function ($q) use ($nokp) {
|
|
||||||
$q->where('kpbaru', $nokp)
|
|
||||||
->orWhere('kplama', $nokp);
|
|
||||||
})
|
|
||||||
->first();
|
|
||||||
|
|
||||||
$customer = $customer ? $customer->toArray() : [];
|
|
||||||
|
|
||||||
if (isset($customer['tag_anggota']) && $customer['tag_anggota'] == 1) {
|
|
||||||
return 0.00; // ahli — kadar 0.00 memang sah
|
|
||||||
}
|
|
||||||
|
|
||||||
$kadar = KadarUpah::where('min', '<=', $total_nilai_marhun)
|
|
||||||
->where('max', '>=', $total_nilai_marhun)
|
|
||||||
->where('group_id', $groupid)
|
|
||||||
->value('kadarujrah');
|
|
||||||
|
|
||||||
return is_null($kadar) ? null : (float) $kadar; // tak jumpa row = null (block)
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createMarhun($norujukan,HttpRequest $request){
|
public function createMarhun($norujukan,HttpRequest $request){
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
@@ -111,24 +82,15 @@ class GadaiV2
|
|||||||
$total_nilai_marhun = Marhun::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->sum('n_marhun');
|
$total_nilai_marhun = Marhun::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->sum('n_marhun');
|
||||||
$total_berat = Marhun::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->sum('berat');
|
$total_berat = Marhun::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->sum('berat');
|
||||||
|
|
||||||
$kadar_raw = $this->getKadarUpahAnggota($request->nokp, $total_nilai_marhun, $cawangan['group_id']);
|
//query kadar upah baru
|
||||||
|
$kadar_raw = KadarUpah::where('min','<=',$total_nilai_marhun)->where('max','>=',$total_nilai_marhun)->where('group_id',$cawangan['group_id'])->first();
|
||||||
|
|
||||||
if (is_null($kadar_raw)) {
|
|
||||||
Log::error('[BLOCKED] Kadar upah tidak dijumpai', [
|
|
||||||
'nokp' => $request->nokp,
|
|
||||||
'total_nilai_marhun' => $total_nilai_marhun,
|
|
||||||
'group_id' => $cawangan['group_id'],
|
|
||||||
]);
|
|
||||||
throw new \Exception("Kadar upah tidak dijumpai, transaksi dibatalkan!");
|
|
||||||
}
|
|
||||||
|
|
||||||
// $kadar_raw = 0.00 (ahli) akan lepas ke sini dan diteruskan
|
|
||||||
|
|
||||||
// query kadar upah lama
|
// query kadar upah lama
|
||||||
// $kadar_raw = KadarUpah::where('min','<=',$total_nilai_marhun)->where('max','>=',$total_nilai_marhun)->first();
|
// $kadar_raw = KadarUpah::where('min','<=',$total_nilai_marhun)->where('max','>=',$total_nilai_marhun)->first();
|
||||||
|
|
||||||
$onepercentservices = new Calculation();
|
$onepercentservices = new Calculation();
|
||||||
$keuntungan = $onepercentservices->kiraanKeuntunganSebenar($request->pinjaman,$total_nilai_marhun,$kadar_raw,$margin_pinjam);
|
$keuntungan = $onepercentservices->kiraanKeuntunganSebenar($request->pinjaman,$total_nilai_marhun,$kadar_raw['kadarujrah'],$margin_pinjam);
|
||||||
// $upah1 = $request->pinjaman * ($kadar_raw['kadarupdah']/100);
|
// $upah1 = $request->pinjaman * ($kadar_raw['kadarupdah']/100);
|
||||||
// $upah6 = $upah1 * 6;
|
// $upah6 = $upah1 * 6;
|
||||||
// $upah12 = $upah1 * 12;
|
// $upah12 = $upah1 * 12;
|
||||||
@@ -140,7 +102,7 @@ if (is_null($kadar_raw)) {
|
|||||||
|
|
||||||
$hargajualan = $request->pinjaman + $upah12;
|
$hargajualan = $request->pinjaman + $upah12;
|
||||||
|
|
||||||
$akrual = $this->kiraupahTawarruqStokAuditUjrahOnePercent(0.5,0,$kadar_raw,$request->pinjaman,$total_nilai_marhun,$margin_pinjam);
|
$akrual = $this->kiraupahTawarruqStokAuditUjrahOnePercent(0.5,0,$kadar_raw['kadarujrah'],$request->pinjaman,$total_nilai_marhun,$margin_pinjam);
|
||||||
|
|
||||||
$gadai = Gadai::on($cawangan['mysql'])
|
$gadai = Gadai::on($cawangan['mysql'])
|
||||||
->where('norujukan','=',$norujukan)
|
->where('norujukan','=',$norujukan)
|
||||||
@@ -148,7 +110,7 @@ if (is_null($kadar_raw)) {
|
|||||||
'nilaimarhun' => $total_nilai_marhun,
|
'nilaimarhun' => $total_nilai_marhun,
|
||||||
'berat'=> $total_berat,
|
'berat'=> $total_berat,
|
||||||
'pinjaman' => $request->pinjaman,
|
'pinjaman' => $request->pinjaman,
|
||||||
'kadarupah' => $kadar_raw,
|
'kadarupah' => $kadar_raw['kadarujrah'],
|
||||||
'marhun' => $request->marhun,
|
'marhun' => $request->marhun,
|
||||||
'percentpinj' => $margin_pinjam,
|
'percentpinj' => $margin_pinjam,
|
||||||
'teller' => $request->teller,
|
'teller' => $request->teller,
|
||||||
@@ -169,7 +131,7 @@ if (is_null($kadar_raw)) {
|
|||||||
'upahdibayar' => 0.00,
|
'upahdibayar' => 0.00,
|
||||||
'tempohbayar' => 0.00,
|
'tempohbayar' => 0.00,
|
||||||
'lelong_tawarruq' => 1,
|
'lelong_tawarruq' => 1,
|
||||||
'kadarujrah' => $kadar_raw,
|
'kadarujrah' => $kadar_raw['kadarujrah'],
|
||||||
'ujrah' => $ujrah,
|
'ujrah' => $ujrah,
|
||||||
'onepercent' => $onepercent,
|
'onepercent' => $onepercent,
|
||||||
'margin_semasa' => $margin_pinjam,
|
'margin_semasa' => $margin_pinjam,
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
/cache
|
|
||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'excluded_cawangan' => []
|
'excluded_cawangan' => [
|
||||||
|
'lahad datu',
|
||||||
|
]
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class CreateAnggotaTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::create('anggota', function (Blueprint $table) {
|
|
||||||
$table->id();
|
|
||||||
$table->string('no_anggota')->unique()->nullable(); // No keahlian
|
|
||||||
$table->string('nama');
|
|
||||||
$table->string('noic')->unique(); // IC wajib unik
|
|
||||||
$table->string('no_tel')->nullable();
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('anggota');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddStatusToAnggotaTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('anggota', function (Blueprint $table) {
|
|
||||||
$table->tinyInteger('status')
|
|
||||||
->default(1)
|
|
||||||
->comment('1 = aktif, 0 = tidak aktif')
|
|
||||||
->after('no_tel');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('anggota', function (Blueprint $table) {
|
|
||||||
//
|
|
||||||
$table->dropColumn('status');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddTagAnggotaToCustomerTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::table('customer', function (Blueprint $table) {
|
|
||||||
$table->boolean('tag_anggota')->default(0)->after('ahli');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::table('customer', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('tag_anggota');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class CreateMohonAnggotaTable extends Migration
|
|
||||||
{
|
|
||||||
// Dapatkan semua sambungan DB aktif (kecuali mysql7 pusat)
|
|
||||||
public function getActiveDB()
|
|
||||||
{
|
|
||||||
$config_db = array_keys(config("database.connections"));
|
|
||||||
|
|
||||||
$db_connection = array_filter($config_db, function($connection) {
|
|
||||||
try {
|
|
||||||
if ($connection == 'mysql7') return false; // skip pusat
|
|
||||||
DB::connection($connection)->getPdo();
|
|
||||||
return true;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return $db_connection;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Jalankan migration
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
$db_connection = $this->getActiveDB();
|
|
||||||
|
|
||||||
foreach ($db_connection as $dbase) {
|
|
||||||
if (!Schema::connection($dbase)->hasTable('mohon_anggota')) {
|
|
||||||
Schema::connection($dbase)->create('mohon_anggota', function (Blueprint $table) {
|
|
||||||
$table->bigIncrements('id');
|
|
||||||
$table->date('tarikh')->nullable();
|
|
||||||
$table->string('nokp', 20)->nullable();
|
|
||||||
$table->string('nama', 100)->nullable();
|
|
||||||
$table->string('status', 50)->default('MENUNGGU OPERASI');
|
|
||||||
$table->text('komen')->nullable();
|
|
||||||
$table->string('teller', 100)->nullable();
|
|
||||||
$table->string('peloperasi', 100)->nullable();
|
|
||||||
$table->dateTime('datetime_pelulus')->nullable();
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Undur migration
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
$db_connection = $this->getActiveDB();
|
|
||||||
|
|
||||||
foreach ($db_connection as $dbase) {
|
|
||||||
Schema::connection($dbase)->dropIfExists('mohon_anggota');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class CreateModalOnlineTable extends Migration
|
|
||||||
{
|
|
||||||
public function getActiveDB()
|
|
||||||
{
|
|
||||||
$config_db = array_keys(config('database.connections'));
|
|
||||||
|
|
||||||
return array_filter($config_db, function ($connection) {
|
|
||||||
try {
|
|
||||||
if ($connection === 'mysql7') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
DB::connection($connection)->getPdo();
|
|
||||||
return true;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
foreach ($this->getActiveDB() as $dbase) {
|
|
||||||
if (!Schema::connection($dbase)->hasTable('modal_online')) {
|
|
||||||
Schema::connection($dbase)->create('modal_online', function (Blueprint $table) {
|
|
||||||
$table->bigIncrements('id');
|
|
||||||
$table->date('tarikh');
|
|
||||||
$table->string('kodcaw', 20);
|
|
||||||
$table->decimal('had', 12, 2)->default(100000.00);
|
|
||||||
$table->decimal('digunakan', 12, 2)->default(0.00);
|
|
||||||
$table->decimal('baki', 12, 2)->default(100000.00);
|
|
||||||
$table->decimal('tambah', 12, 2)->default(0.00);
|
|
||||||
$table->decimal('kurang', 12, 2)->default(0.00);
|
|
||||||
$table->timestamps();
|
|
||||||
$table->unique(['tarikh', 'kodcaw']);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
foreach ($this->getActiveDB() as $dbase) {
|
|
||||||
Schema::connection($dbase)->dropIfExists('modal_online');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class CreateBatchPembiayaanOnlineTable extends Migration
|
|
||||||
{
|
|
||||||
public function getActiveDB()
|
|
||||||
{
|
|
||||||
$config_db = array_keys(config('database.connections'));
|
|
||||||
|
|
||||||
return array_filter($config_db, function ($connection) {
|
|
||||||
try {
|
|
||||||
if ($connection === 'mysql7') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
DB::connection($connection)->getPdo();
|
|
||||||
return true;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
foreach ($this->getActiveDB() as $dbase) {
|
|
||||||
if (!Schema::connection($dbase)->hasTable('batch_pembiayaan_online')) {
|
|
||||||
Schema::connection($dbase)->create('batch_pembiayaan_online', function (Blueprint $table) {
|
|
||||||
$table->bigIncrements('id');
|
|
||||||
$table->string('batch_no', 50);
|
|
||||||
$table->string('kodcaw', 20);
|
|
||||||
$table->date('tarikh');
|
|
||||||
$table->string('slot', 20)->nullable()->comment('BATCH1 / BATCH2');
|
|
||||||
$table->integer('bilangan')->default(0);
|
|
||||||
$table->decimal('jumlah_keseluruhan', 12, 2)->default(0.00);
|
|
||||||
$table->string('status', 30)->default('DRAFT');
|
|
||||||
$table->string('pc_submitted_by', 100)->nullable();
|
|
||||||
$table->timestamp('submitted_at')->nullable();
|
|
||||||
$table->timestamps();
|
|
||||||
$table->index(['kodcaw', 'tarikh', 'status']);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
foreach ($this->getActiveDB() as $dbase) {
|
|
||||||
Schema::connection($dbase)->dropIfExists('batch_pembiayaan_online');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class CreatePembiayaanOnlineTable extends Migration
|
|
||||||
{
|
|
||||||
public function getActiveDB()
|
|
||||||
{
|
|
||||||
$config_db = array_keys(config('database.connections'));
|
|
||||||
|
|
||||||
return array_filter($config_db, function ($connection) {
|
|
||||||
try {
|
|
||||||
if ($connection === 'mysql7') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
DB::connection($connection)->getPdo();
|
|
||||||
return true;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
foreach ($this->getActiveDB() as $dbase) {
|
|
||||||
if (!Schema::connection($dbase)->hasTable('pembiayaan_online')) {
|
|
||||||
Schema::connection($dbase)->create('pembiayaan_online', function (Blueprint $table) {
|
|
||||||
$table->bigIncrements('id');
|
|
||||||
$table->string('norujukan', 50);
|
|
||||||
$table->string('nokp', 20);
|
|
||||||
$table->string('nopelanggan', 50)->nullable();
|
|
||||||
$table->string('nama_pelanggan', 150)->nullable();
|
|
||||||
$table->string('kodcaw', 20);
|
|
||||||
$table->decimal('pinjaman', 12, 2);
|
|
||||||
$table->string('kodbank', 20)->nullable();
|
|
||||||
$table->string('nama_bank', 100)->nullable();
|
|
||||||
$table->string('noakaun', 50)->nullable();
|
|
||||||
$table->string('nama_akaun', 150)->nullable();
|
|
||||||
$table->unsignedBigInteger('bukti_akaun_file_id')->nullable();
|
|
||||||
$table->unsignedBigInteger('borang_file_id')->nullable();
|
|
||||||
$table->string('status', 30)->default('PENDING_PC');
|
|
||||||
$table->text('reject_reason')->nullable();
|
|
||||||
$table->string('rejected_by', 100)->nullable();
|
|
||||||
$table->timestamp('rejected_at')->nullable();
|
|
||||||
$table->unsignedBigInteger('batch_id')->nullable();
|
|
||||||
$table->unsignedBigInteger('bukti_file_id')->nullable();
|
|
||||||
$table->string('no_rujukan_bayaran', 100)->nullable();
|
|
||||||
$table->date('tarikh_bayaran')->nullable();
|
|
||||||
$table->timestamp('paid_at')->nullable();
|
|
||||||
$table->string('created_by', 100)->nullable();
|
|
||||||
$table->string('pc_submitted_by', 100)->nullable();
|
|
||||||
$table->string('ops_by', 100)->nullable();
|
|
||||||
$table->text('nota')->nullable();
|
|
||||||
$table->tinyInteger('blast_sent')->default(0);
|
|
||||||
$table->timestamps();
|
|
||||||
$table->index(['kodcaw', 'status']);
|
|
||||||
$table->index('norujukan');
|
|
||||||
$table->index('batch_id');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
foreach ($this->getActiveDB() as $dbase) {
|
|
||||||
Schema::connection($dbase)->dropIfExists('pembiayaan_online');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
|
|
||||||
class AddCaraTerimaToGadaiTable extends Migration
|
|
||||||
{
|
|
||||||
public function getActiveDB()
|
|
||||||
{
|
|
||||||
$config_db = array_keys(config('database.connections'));
|
|
||||||
|
|
||||||
return array_filter($config_db, function ($connection) {
|
|
||||||
try {
|
|
||||||
if ($connection === 'mysql7') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
DB::connection($connection)->getPdo();
|
|
||||||
return true;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
foreach ($this->getActiveDB() as $dbase) {
|
|
||||||
if (
|
|
||||||
Schema::connection($dbase)->hasTable('gadai')
|
|
||||||
&& !Schema::connection($dbase)->hasColumn('gadai', 'cara_terima')
|
|
||||||
) {
|
|
||||||
Schema::connection($dbase)->table('gadai', function (Blueprint $table) {
|
|
||||||
$table->string('cara_terima', 20)->nullable()->after('pinjaman');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
foreach ($this->getActiveDB() as $dbase) {
|
|
||||||
if (
|
|
||||||
Schema::connection($dbase)->hasTable('gadai')
|
|
||||||
&& Schema::connection($dbase)->hasColumn('gadai', 'cara_terima')
|
|
||||||
) {
|
|
||||||
Schema::connection($dbase)->table('gadai', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('cara_terima');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class CreateRequestModalOnlineTable extends Migration
|
|
||||||
{
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
if (!Schema::connection('mysql7')->hasTable('request_modal_online')) {
|
|
||||||
Schema::connection('mysql7')->create('request_modal_online', function (Blueprint $table) {
|
|
||||||
$table->bigIncrements('id');
|
|
||||||
$table->string('kodcaw', 20);
|
|
||||||
$table->date('tarikh');
|
|
||||||
$table->decimal('amaun', 12, 2);
|
|
||||||
$table->string('dimohon_oleh', 100)->nullable();
|
|
||||||
$table->string('status', 20)->default('PENDING');
|
|
||||||
$table->string('diluluskan_oleh', 100)->nullable();
|
|
||||||
$table->text('nota')->nullable();
|
|
||||||
$table->timestamps();
|
|
||||||
$table->index(['kodcaw', 'tarikh', 'status']);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::connection('mysql7')->dropIfExists('request_modal_online');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class CreateArrahnFilesTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Master DB (mysql7) — shared file store for CIT / permohonan / bukti pembiayaan online.
|
|
||||||
* Matches App\ARFiles usage: data (base64), filename, type, tarikhmasa; id used as file reference.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
if (!Schema::connection('mysql7')->hasTable('arrahn_files')) {
|
|
||||||
Schema::connection('mysql7')->create('arrahn_files', function (Blueprint $table) {
|
|
||||||
$table->bigIncrements('id');
|
|
||||||
$table->unsignedBigInteger('files_id')->nullable()->index();
|
|
||||||
$table->longText('data')->nullable();
|
|
||||||
$table->string('filename', 255)->nullable();
|
|
||||||
$table->string('type', 100)->nullable();
|
|
||||||
$table->string('tarikhmasa', 50)->nullable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::connection('mysql7')->dropIfExists('arrahn_files');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddEodCloseColumnsToModalOnlineTable extends Migration
|
|
||||||
{
|
|
||||||
public function getActiveDB()
|
|
||||||
{
|
|
||||||
return array_filter(
|
|
||||||
array_keys(config('database.connections')),
|
|
||||||
function ($connection) {
|
|
||||||
try {
|
|
||||||
if ($connection === 'mysql7') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
DB::connection($connection)->getPdo();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
foreach ($this->getActiveDB() as $dbase) {
|
|
||||||
Schema::connection($dbase)->table('modal_online', function (Blueprint $table) {
|
|
||||||
$table->tinyInteger('ditutup')
|
|
||||||
->default(0)
|
|
||||||
->after('kurang');
|
|
||||||
|
|
||||||
$table->string('ditutup_oleh', 100)
|
|
||||||
->nullable()
|
|
||||||
->after('ditutup');
|
|
||||||
|
|
||||||
$table->timestamp('ditutup_at')
|
|
||||||
->nullable()
|
|
||||||
->after('ditutup_oleh');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
foreach ($this->getActiveDB() as $dbase) {
|
|
||||||
Schema::connection($dbase)->table('modal_online', function (Blueprint $table) {
|
|
||||||
$table->dropColumn([
|
|
||||||
'ditutup',
|
|
||||||
'ditutup_oleh',
|
|
||||||
'ditutup_at',
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class AddGambarMykadToCustomerTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Master DB (mysql7) — stores arrahn_files.id for the MyKad photo.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
if (
|
|
||||||
Schema::connection('mysql7')->hasTable('customer')
|
|
||||||
&& !Schema::connection('mysql7')->hasColumn('customer', 'gambar_mykad')
|
|
||||||
) {
|
|
||||||
Schema::connection('mysql7')->table('customer', function (Blueprint $table) {
|
|
||||||
if (Schema::connection('mysql7')->hasColumn('customer', 'tag_anggota')) {
|
|
||||||
$table->unsignedBigInteger('gambar_mykad')->nullable()->after('tag_anggota');
|
|
||||||
} else {
|
|
||||||
$table->unsignedBigInteger('gambar_mykad')->nullable();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
if (
|
|
||||||
Schema::connection('mysql7')->hasTable('customer')
|
|
||||||
&& Schema::connection('mysql7')->hasColumn('customer', 'gambar_mykad')
|
|
||||||
) {
|
|
||||||
Schema::connection('mysql7')->table('customer', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('gambar_mykad');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
# Staging stack — isolated from local docker-compose.yml (8080 / 3306)
|
|
||||||
# and from other apps on the server (unique project name + host ports).
|
|
||||||
#
|
|
||||||
# Local:
|
|
||||||
# docker compose --env-file .env.staging -f docker-compose.staging.yml up -d --build
|
|
||||||
#
|
|
||||||
# CI (image already in registry):
|
|
||||||
# APP_IMAGE=git.koppkb.com/KoPKB/api_arrahn IMAGE_TAG=<sha> \
|
|
||||||
# docker compose --env-file .env.staging -f docker-compose.staging.yml up -d --no-build --force-recreate app web
|
|
||||||
#
|
|
||||||
# Host nginx reverse-proxies the public domain to 127.0.0.1:${HTTP_PORT}.
|
|
||||||
# See docker/nginx/host-proxy.example.conf
|
|
||||||
#
|
|
||||||
# If 8090 or 3308 is already taken, set HTTP_PORT / MYSQL_PUBLISH_PORT in .env.staging.
|
|
||||||
|
|
||||||
name: api_arrahn_staging
|
|
||||||
|
|
||||||
services:
|
|
||||||
app:
|
|
||||||
image: ${APP_IMAGE:-api_arrahn}:${IMAGE_TAG:-staging}
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: docker/php/Dockerfile
|
|
||||||
target: staging
|
|
||||||
container_name: api_arrahn_staging_app
|
|
||||||
working_dir: /var/www/html
|
|
||||||
volumes:
|
|
||||||
- storage_staging:/var/www/html/storage
|
|
||||||
- ./.env.staging:/var/www/html/.env.staging:ro
|
|
||||||
env_file:
|
|
||||||
- .env.staging
|
|
||||||
environment:
|
|
||||||
APP_ENV: staging
|
|
||||||
USE_STAGING_ENV: "true"
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
depends_on:
|
|
||||||
mysql:
|
|
||||||
condition: service_healthy
|
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
web:
|
|
||||||
image: nginx:1.25-alpine
|
|
||||||
container_name: api_arrahn_staging_web
|
|
||||||
ports:
|
|
||||||
- "${HTTP_PORT:-8090}:80"
|
|
||||||
volumes:
|
|
||||||
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
|
||||||
depends_on:
|
|
||||||
- app
|
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
mysql:
|
|
||||||
image: mysql:8.0
|
|
||||||
container_name: api_arrahn_staging_mysql
|
|
||||||
command: --default-authentication-plugin=mysql_native_password
|
|
||||||
ports:
|
|
||||||
- "127.0.0.1:${MYSQL_PUBLISH_PORT:-3308}:3306"
|
|
||||||
environment:
|
|
||||||
MYSQL_DATABASE: erahn_xtra
|
|
||||||
MYSQL_USER: xtrauser
|
|
||||||
MYSQL_PASSWORD: password
|
|
||||||
MYSQL_ROOT_PASSWORD: root
|
|
||||||
volumes:
|
|
||||||
- mysql_staging_data:/var/lib/mysql
|
|
||||||
- ./docker/mysql/init:/docker-entrypoint-initdb.d:ro
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-uroot", "-proot"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 30
|
|
||||||
start_period: 20s
|
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
mysql_staging_data:
|
|
||||||
storage_staging:
|
|
||||||
@@ -3,7 +3,6 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: docker/php/Dockerfile
|
dockerfile: docker/php/Dockerfile
|
||||||
target: development
|
|
||||||
working_dir: /var/www/html
|
working_dir: /var/www/html
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/var/www/html:cached
|
- ./:/var/www/html:cached
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
CREATE DATABASE IF NOT EXISTS master_erahn;
|
|
||||||
CREATE DATABASE IF NOT EXISTS kaunter_erahn;
|
|
||||||
|
|
||||||
GRANT ALL PRIVILEGES ON master_erahn.* TO 'xtrauser'@'%';
|
|
||||||
GRANT ALL PRIVILEGES ON kaunter_erahn.* TO 'xtrauser'@'%';
|
|
||||||
GRANT ALL PRIVILEGES ON erahn_xtra.* TO 'xtrauser'@'%';
|
|
||||||
FLUSH PRIVILEGES;
|
|
||||||
@@ -6,20 +6,9 @@ server {
|
|||||||
index index.php index.html;
|
index index.php index.html;
|
||||||
|
|
||||||
charset utf-8;
|
charset utf-8;
|
||||||
client_max_body_size 50M;
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
rewrite ^/(.*)/$ /$1 last;
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
try_files $uri @php;
|
|
||||||
}
|
|
||||||
|
|
||||||
location @php {
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME /var/www/html/public/index.php;
|
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
||||||
fastcgi_pass app:9000;
|
|
||||||
fastcgi_index index.php;
|
|
||||||
fastcgi_read_timeout 120s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
@@ -28,10 +17,10 @@ server {
|
|||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
fastcgi_pass app:9000;
|
fastcgi_pass app:9000;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_read_timeout 120s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ /\.(?!well-known).* {
|
location ~ /\.(?!well-known).* {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-23
@@ -1,4 +1,4 @@
|
|||||||
FROM php:7.4-fpm AS base
|
FROM php:7.4-fpm
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
@@ -25,27 +25,6 @@ RUN apt-get update \
|
|||||||
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
|
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
|
||||||
|
|
||||||
COPY docker/php/php.ini /usr/local/etc/php/conf.d/app.ini
|
COPY docker/php/php.ini /usr/local/etc/php/conf.d/app.ini
|
||||||
COPY docker/php/zz-clear-env.conf /usr/local/etc/php-fpm.d/zz-clear-env.conf
|
|
||||||
COPY docker/php/entrypoint.sh /usr/local/bin/app-entrypoint.sh
|
|
||||||
|
|
||||||
RUN chmod +x /usr/local/bin/app-entrypoint.sh \
|
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
|
||||||
&& usermod -u 1000 www-data && groupmod -g 1000 www-data
|
|
||||||
|
|
||||||
ENTRYPOINT ["app-entrypoint.sh"]
|
|
||||||
CMD ["php-fpm"]
|
|
||||||
|
|
||||||
FROM base AS staging
|
|
||||||
|
|
||||||
COPY --chown=www-data:www-data . /var/www/html
|
|
||||||
|
|
||||||
RUN composer install --no-interaction --prefer-dist --no-dev --optimize-autoloader \
|
|
||||||
&& mkdir -p \
|
|
||||||
storage/logs \
|
|
||||||
storage/framework/cache/data \
|
|
||||||
storage/framework/views \
|
|
||||||
storage/framework/sessions \
|
|
||||||
storage/app/public \
|
|
||||||
bootstrap/cache \
|
|
||||||
&& chown -R www-data:www-data storage bootstrap/cache vendor
|
|
||||||
|
|
||||||
FROM base AS development
|
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
cd /var/www/html
|
|
||||||
|
|
||||||
if [ "${USE_STAGING_ENV:-false}" = "true" ] && [ -f .env.staging ]; then
|
|
||||||
cp .env.staging .env
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f composer.json ]; then
|
|
||||||
if [ -f vendor/autoload.php ] && [ "${USE_STAGING_ENV:-false}" = "true" ]; then
|
|
||||||
: # vendor is baked into the staging image
|
|
||||||
elif [ "${USE_STAGING_ENV:-false}" = "true" ]; then
|
|
||||||
composer install --no-interaction --prefer-dist --no-dev --optimize-autoloader
|
|
||||||
else
|
|
||||||
composer install --no-interaction --prefer-dist
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p \
|
|
||||||
storage/logs \
|
|
||||||
storage/framework/cache/data \
|
|
||||||
storage/framework/views \
|
|
||||||
storage/framework/sessions \
|
|
||||||
storage/app/public \
|
|
||||||
bootstrap/cache
|
|
||||||
|
|
||||||
chown -R www-data:www-data storage bootstrap/cache
|
|
||||||
|
|
||||||
exec docker-php-entrypoint "$@"
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
[www]
|
|
||||||
; Pass container env vars (from compose env_file) through to PHP workers.
|
|
||||||
clear_env = no
|
|
||||||
@@ -1,417 +0,0 @@
|
|||||||
id,nama,no_kp,telefon,no_anggota
|
|
||||||
9,WAN ZULKIFLY B WAN MOHAMED,680509035997,010-8995997,1
|
|
||||||
13,HASANAH MOHAMAD,740325036196,1169670585,2
|
|
||||||
14,HASLINA HASBULLAH,630216035760,1111473265,3
|
|
||||||
16,NURWIDAD BINTI AZLY,891020035246,134040289,4
|
|
||||||
19,ZULAILA BINTI CHE MAT,840313035290,1137707081,5
|
|
||||||
25,MUHAMMAD HAFIFI BIN ABD RAHMAN,970403035003,1114884900,6
|
|
||||||
33,FARAHAIN FATIN BINTI MOHD FAUZI,940624035560,169877154,7
|
|
||||||
45,NURHANA BINTI FARHAN,910508125764,1137425769,8
|
|
||||||
51,CHE FAHMI AMIRUL BIN CHE MOHAMAD ZAID,930702035381,1139239497,9
|
|
||||||
53,KELVIN @ MOHD NAJIB BIN KEREAN,900420125525,146750406,10
|
|
||||||
55,MUHAMMAD NAZIF BIN ABDULLAH,840830025541,166892948,11
|
|
||||||
56,SUHAIBAH BINTI JUSOH,931212035148,199128698,12
|
|
||||||
58,ELMA HARFAZLYANA BINTI BAHAR,990827126556,198782708,13
|
|
||||||
59,MARINAH MAZNAH BINTI AMAT @ ABD RAHMAN,961109126102,1128686033,14
|
|
||||||
60,SITI NUR ATHIRAH BINTI ZULKIFLI,980222036786,128108084,15
|
|
||||||
61,MOHAMAD HAFIZUL BIN SANUAR,930619036201,149246474,16
|
|
||||||
63,MUHAMAD MUSLIM BIN MADIRAN,970326035551,179726697,17
|
|
||||||
64,EQA NURFITRIANA BINTI ALIMUDDIN,980202126442,1112085474,18
|
|
||||||
65,ZULKARNAIN BIN MOHD JAMAL,980203126321,1139237021,19
|
|
||||||
68,IRFAHANNA EMIRAH BINTI MOHD ALWI,10506031090,1110311820,20
|
|
||||||
70,NURAIN SYAFIKA BINTI BURHAN,20828030380,179016282,21
|
|
||||||
71,NUR FADHILAH AFIFAH BINTI MOHD NAZMI,980827035268,1117821334,22
|
|
||||||
75,MOHD HAFIZUDDIN BIN HARUN,930822115351,134986658,23
|
|
||||||
76,MUHAMMAD AMMAR FIRDAUS BIN RIDZUAN,970826035291,109253592,24
|
|
||||||
77,MOHAMAD AFDHAL BIN ANWAR,890818075031,012 2017437,25
|
|
||||||
78,NOR AIN BINTI ABDULLAH AZID,920411035470,1131590164,26
|
|
||||||
79,SITI NOORAINI BINTI LAZIM,900617025042,1140794473,27
|
|
||||||
82,FATIN AFIQAH BINTI MOHD SHAH,920322036084,199084590,28
|
|
||||||
84,NUR ASIAH BINTI MUHAMMAD,950324035840,010-4152116,29
|
|
||||||
85,AHMAD NAZRI BIN ISMAIL,700601035039,199179559,30
|
|
||||||
86,TUAN NURHAFIZA BINTI TUAN ZULKIFLI,890624035306,133925842,31
|
|
||||||
87,MOHAMAD NAZMI BIN MOHD SUKRI,980131035999,139245295,32
|
|
||||||
88,AMIRUL HISHAM AIMI BIN CHE AMRAN,940515035545,139622447,33
|
|
||||||
90,MUHAMMAD HAFIZI WAJDI BIN HASSAN,951103036043,1125509097,34
|
|
||||||
91,NUR AMIRAH BINTI ZULKIPLI,980422036502,134863252,35
|
|
||||||
92,WAN NOR AZIAN WAN ABDUL MANAF,740428035008,179142365,36
|
|
||||||
94,SITI MARIAM BINTI MUHAMMAD AZHAR,800123035154,199288851,37
|
|
||||||
95,TUAN NOR DIANA BT TUAN AZHAN,940401035870,193770187,38
|
|
||||||
96,MOHAMMAD IZFAN BIN MAT IZANI,970805036113,137884588,39
|
|
||||||
97,NUR IZZAH IWANI BT MOHD RAZDI,970624035146,179189543,40
|
|
||||||
98,WAN ROZARINA BT WAN ZAIN,801210035368,129616201,41
|
|
||||||
100,SYAHADAL AUZAEAIN BIN ZULKARNAIN,961020855069,169324952,42
|
|
||||||
101,SYARIFAH AL QURAISYAH BT SAYED MUSTAPHA,970319035596,105750423,43
|
|
||||||
106,MOHAMAD HAFIZ BIN CHE SOH,890905035337,199720813,44
|
|
||||||
110,NIK NUREN SYAFIKAH BT NIK MOHAMED NAZRI,950501035164,179406274,45
|
|
||||||
121,SITI FATIMAH SALWANI BT ROSMAN,891222035658,126209004,46
|
|
||||||
122,AHMAD AFKAR BIN MOHD NOOR,10626030957,108847563,47
|
|
||||||
123,MOHD THAQAFI BIN SHAMSUDDIN,920409036669,179162486,48
|
|
||||||
124,NUR AYUNI BINTI AHMAD FAUZI,971101035686,1111433401,49
|
|
||||||
127,NOR AZILA BT CHE SOH,751005035980,1110742242,50
|
|
||||||
153,ALILYHAYATIE BINTI MOHAMED,840101036822,123015583,51
|
|
||||||
162,ERNINGSIH BINTI JUNAIDI,900705125262,1139238537,52
|
|
||||||
165,FATIN NADIA BINTI ZAIDI,920114-03-6346,199405259,53
|
|
||||||
168,ISMAIL BIN ZAKARIA,870210035359,105681405,54
|
|
||||||
171,KAMSAH BIN LINGGISAN,870513496697,146555718,55
|
|
||||||
179,MOHAMAD FAIZ MOHAMED ASRI,850922035543,139938243,56
|
|
||||||
207,RAZAKI BIN MAMAT,770215035851,199178946,57
|
|
||||||
208,HAFEIZAH BT . AB KADIR,790918035426,129897112,58
|
|
||||||
219,MOHD HAYYUL ILTIZAM BIN OTHMAN,851018035793,133929331,59
|
|
||||||
232,MOHD SHAHMIN BIN SA'ARI,861130295121,196438873,60
|
|
||||||
237,MUHAMAD FARIZ BIN ABDULLAH,871004035205,179268308,61
|
|
||||||
245,MUHAMMAD SYAKIRIN BIN MOHD AMINUDDIN,880425065327,129077963,62
|
|
||||||
262,MOHAMED AZMI MAHMOOD,840511035443,199731345,63
|
|
||||||
264,MOHD RAZANI A. RAHIM,670930106593,199099713,64
|
|
||||||
272,NOROSMINI BT. MAT NOOR,821001035984,129493588,65
|
|
||||||
280,WAN MOHAMMAD ARMANI WAN SHARIFUDIN,870119035091,189022406,66
|
|
||||||
312,NORALINA MOHD YUSOFF,630106035380,182269464,67
|
|
||||||
319,NOR'AINI AH KOM BT ABDULLAH,631231675058,1112301671,68
|
|
||||||
320,AZLY BIN OTHMAN,620809035425,199598184,69
|
|
||||||
324,FARIDAH BT. MAMAT,600813035112,139492226,70
|
|
||||||
325,MOHD NAIM MOHAMAD,570805035441,169214503,71
|
|
||||||
327,NUR IZZATI HUSNA BINTI ABD RAHMAN,880417035750,194166991,72
|
|
||||||
328,NORAZERA BINTI ADIN,930513126372,143560193,73
|
|
||||||
343,NOR AZIAH BINTI AHMAD,770716035702,129521803,74
|
|
||||||
354,SITI ANIZA BT HARDAH,890801125848,143751889,75
|
|
||||||
358,RUFAIDA BINTI HAJIHIL,861221125160,178317763,76
|
|
||||||
363,MUHAMMAD AMIN BIN RIFFIN,950626035483,132747420,77
|
|
||||||
364,MUHAMMAD RASIHI BIN ABD KARIM,830401035435,134487279,78
|
|
||||||
366,LIYANA FARIEHA BINTI BAKHORI,960209025136,194622615,79
|
|
||||||
367,AFA HUSNA BINTI MD RADZI,921018025748,103737560,80
|
|
||||||
369,NOR INTAN MARLINI BT NOR AZLAN,851124035914,139269494,81
|
|
||||||
370,NUR AIN SOFIA BINTI ROSLI,960131035018,169409127,82
|
|
||||||
376,MOHD FAIZUL AZAHA BIN UMANAH,840502035417,199992928,83
|
|
||||||
378,MOHD FAIZAL BIN SAFIE,871129295529,139922275,84
|
|
||||||
380,HASWATI BINTI KARIMIN .,820421126036,1119544351,85
|
|
||||||
381,JURINA BINTI MADAYA,880609125224,168178634,86
|
|
||||||
383,NURFARAHIM BT MOHD OMAR,900427035418,1126220662,87
|
|
||||||
386,SHAZRINA BINTI AZLIND,970518125682,128373831,88
|
|
||||||
388,HASANUDDIN BIN HUSAING,980814126339,128376008,89
|
|
||||||
390,SITI ANNA SHAHEERA BINTI ALI,921121125026,146567467,90
|
|
||||||
397,NUR AFRINA BINTI ALIMI,990616065714,137969408,91
|
|
||||||
398,ABDUL HALIM BIN TALIB,901025065707,1111313873,92
|
|
||||||
399,NUR IZZATI BINTI ZULKIFLI,890123035826,178916936,93
|
|
||||||
400,NUR LIANA SYAFIKAH BINTI SALAM,940605035186,148478780,94
|
|
||||||
401,AHMAD SYAHMI BIN AHMAD IZANI,870828035545,1111706484,95
|
|
||||||
402,ROZALMI BIN RAZALI,820101035629,138973594,96
|
|
||||||
403,SHAMSURIATI BINTI HASSAN,880826035444,133605298,97
|
|
||||||
404,MOHD AMIRRUDDIN BIN ARZAMI,840417025943,137868197,98
|
|
||||||
405,MOHD AZIZI BIN AB RASHID,870112295165,148983787,99
|
|
||||||
406,SUHAIRAH BINTI SULIMAN,840615036280,139463484,100
|
|
||||||
407,MOHD FARID BIN IBRAHIM,790406035393,199499704,101
|
|
||||||
408,MOHD FAIZUL BIN HUSSAIN,850910035837,139090920,102
|
|
||||||
409,MOHD KHAIDIR BIN AWANG,880606035899,139742581,103
|
|
||||||
410,NOR AZIAH BINTI AHMAD,770716-03-5702,129521803,104
|
|
||||||
411,FATIHA BINTI CHE ABDULLAH,950102915068,129698210,105
|
|
||||||
412,NIK ABDULLAH BIN NIK MUHAMMAD,630411035213,148125345,106
|
|
||||||
413,MAHNUN BINTI HUSSIN,740530035352,1155061673,107
|
|
||||||
414,SYUKRI BIN ARIFFIN,771218715013,183416221,108
|
|
||||||
415,ARMIN BIN MANDANGAN,981019126449,169369704,109
|
|
||||||
416,ZAID BIN ZAKARIA,670108035479,199179138,110
|
|
||||||
417,MOHD FIRDAUS BIN MAHAMOOD,900202035513,145075069,111
|
|
||||||
419,NORAZANI BINTI HUSAIN,721203035204,179818808,112
|
|
||||||
420,AZURAWATY BINTI AHMAD,840821025208,175800844,113
|
|
||||||
421,WAN RUSLAILE BINTI WAN MOHD ZAIN,841118035644,145060899,114
|
|
||||||
422,NOOR HAFIZI BIN MOHAMAD,890922095155,1133406383,115
|
|
||||||
423,ISMAIL BIN ZAKARIA,870201035359,010 5681405,116
|
|
||||||
424,MOHAMMAD FARIZ BIN MUSTAPHA,850115035969,196017695,117
|
|
||||||
425,ABDUL HAKIM BIN AHMAD AB.NASHIR,901116025225,143464266,118
|
|
||||||
426,AZIRIN BIN RIFFIN,730605035551,199104757,119
|
|
||||||
427,KATHERINE RUMBANG,770421125700,1139025242,120
|
|
||||||
428,MUHAMAD SHAHARIL BIN SIDIK,860104035049,199868018,121
|
|
||||||
429,AMIRAH FARHAN BINTI MOHD ASRI,890711035566,136246932,122
|
|
||||||
430,MUHAMAD HAZLAN BIN RAMLI,940225036443,148030664,123
|
|
||||||
431,MOHD FARIS BIN RUSLEE,870812035081,179119982,124
|
|
||||||
433,RIDHUAN BIN ABDULLAH,840612125739,1116518794,125
|
|
||||||
434,MANIAH BINTI ASUN,840331126284,105897892,126
|
|
||||||
435,NORFISHAH BINTI MUSTAFFA,870406026294,124478826,127
|
|
||||||
436,NOR AZIAM BINTI JUSOH,830621035488,179627003,128
|
|
||||||
437,HAFIZUL RAHMAN BIN MOHD FAUZI,830521035683,129397958,129
|
|
||||||
438,NIK NOR SHAHIRAH BINTI NIK YUSOFF,950923035690,109510068,130
|
|
||||||
439,MOHAMMED SHAZWAN BIN NORDIN,850729036165,1111683685,131
|
|
||||||
440,MOHD REDZUAN BIN SHAARANI,870710085395,179022324,132
|
|
||||||
441,Noor Azlan bin md noor,841201035127,199034008,133
|
|
||||||
442,SITI RAIHAN BINTI MAT SAN,890907115154,197284647,134
|
|
||||||
443,NIK MOHAMAD HAZIM AQMAL BIN NIK ALIM AMIRAH,920609035353,104473383,135
|
|
||||||
445,RAJA NOR AIDAH BINTI RAJA AHMAD,901012065900,139515155,136
|
|
||||||
447,NORLIN BINTI SAIMAN,871205235350,1160575580,137
|
|
||||||
448,MUHAMMAD KHAIRUL BIN ALI,841212035595,179484638,138
|
|
||||||
449,ROSLINA BINTI MOHD RAMLI,820804034326,139824757,139
|
|
||||||
450,NUR AIN FARINA PANAI ABDULLAH,870728125228,146557037,140
|
|
||||||
451,SUZIANA BINTI YUSOF,840822035520,104568684,141
|
|
||||||
452,KAMSAH BIN LINGGISAN,870513 49 6697,014 655 5718,142
|
|
||||||
453,MOHD. RAMDHAN BIN WARIMIN,890430125629,109430138,143
|
|
||||||
454,MUHAMMAD DAUD BIN ABDULLAH,930921017159,1119526732,144
|
|
||||||
455,NIK MUHAMMAD ARASH PUTRA BIN AZIHAN,981109036041,179003770,145
|
|
||||||
456,MUHAMMAD IQABAL ZUEL,831202035533,149404101,146
|
|
||||||
457,MOHD FAHMI BIN MAT LUDIN,801104115567,1121039021,147
|
|
||||||
458,MOHD ARIFIN BIN ISMAIL,680229035095,109262869,148
|
|
||||||
461,MOHD NOR BIN OSMAN,830601035405,129247270,149
|
|
||||||
462,NURFARAHIAH BINTI MAT JUSOH,891028035718,199403985,150
|
|
||||||
463,NURUL NISHA BINTI MUHAMMAD,841218035676,1110948404,151
|
|
||||||
464,MUHAMAD IZZUWAN BIN MD SHUKRI,910607035537,179515004,152
|
|
||||||
465,NORALINA BINTI MOHD YUSOFF,630106-03-5380,018-2269464,153
|
|
||||||
466,NUR AININA BINTI MOHAMMAD,961010036086,1119723793,154
|
|
||||||
467,TUAN MOHD NOR NAZRIM BIN TUAN MOHAMMAD,820527115175,122428020,155
|
|
||||||
469,MUHAMMAD FAQIH AMRI BIN JAILANI,980917035229,166138478,156
|
|
||||||
470,SITI NOORAAINI BINTI DAUD,761026035532,129602691,157
|
|
||||||
471,MOHAMAD DAWAWI BIN IBRAHIM,810215035505,179415892,158
|
|
||||||
472,RAKIAH BINTI YAACOB,590208035476,145177720,159
|
|
||||||
473,ASMA BINTI AHMAD,871129295094,135675063,160
|
|
||||||
474,AHMAD AZIMAN BIN CHE ALIAS,970425035485,1137999991,161
|
|
||||||
475,MOHD SYAHMIE SYAWAL BIN MOHD BAKRI,900503036069,145144451,162
|
|
||||||
476,MARJUNI BIN MOHD ALI,840503126521,1116027090,163
|
|
||||||
477,AINIE HAYATIE HAMAZAH,880122115024,1116168995,164
|
|
||||||
478,MUHAMMAD IZWAN BIN IBRAHIM,890601035127,1129079797,165
|
|
||||||
480,FARIDAH BINTI MAMAT,600813-03-5112,139492226,166
|
|
||||||
481,MOHD SABRI BIN ABDULLAH,530502035069,199813353,167
|
|
||||||
482,MOHD KHALID BIN ABDUL RAHMAN,630807035295,145036476,168
|
|
||||||
483,AZMADI B. HJ. OMAR,681028035093,199803003,169
|
|
||||||
484,RUSMAWATI MAMAT,660827035548,104559409,170
|
|
||||||
485,AZIMAH BT. ABDULLAH,580910035282,018770 4639,171
|
|
||||||
486,MIHAMIDAH BT. HAMAT,680930035552,1127486160,172
|
|
||||||
488,NOR AISAH BT. RAMELI,720723035748,1115469653,173
|
|
||||||
490,RAZAKI B. CHE OMAR,681228035207,148131565,174
|
|
||||||
491,SULAINI BT. JAAFAR @ MAT ZIN,740628035916,199058471,175
|
|
||||||
492,TUAN RAZAK B. TUAN MUDA,670301035817,129695589,176
|
|
||||||
493,AMINUDDIN MD NOR,690217035097,199975353,177
|
|
||||||
494,ROHANA MAEL,711021035730,129249968,178
|
|
||||||
495,WAN NOR AZIAN WAN ABDUL MANAF,720428035008,179142365,179
|
|
||||||
496,ZAILILAH BT. HASSAN,700825035062,189163000,180
|
|
||||||
497,NARWATI BT. LUPIN,740110035874,10416116,181
|
|
||||||
498,CHE SOH B. HASSAN,591010035935,139070565,182
|
|
||||||
499,MOHD EZANEE B. MOHD NOOR,610916035317,199815500,183
|
|
||||||
500,MASTURA MUHAMMAD,761003035214,139856061,184
|
|
||||||
501,HASSAN SHUKRI B. HUSSEIN,660604035049,139026550,185
|
|
||||||
502,MOHD RAMLI B. YAACOB,570601035001,145091165,186
|
|
||||||
504,NIK NOOR MASTURA BT NIK SOH,750607035174,183134464,187
|
|
||||||
506,ROSEMALIZA BT. MUHAMAD,700224035542,199092277,188
|
|
||||||
507,ROSHAFIZA B MAMAT,800619035051,179653635,189
|
|
||||||
508,FATIMAH BTE MAT ZIN,821025036084,139360958,190
|
|
||||||
509,MOHD SAHARUDIN B AB RAHMAN,810310035757,1131056099,191
|
|
||||||
510,KAMARUL IRWAN BIN ABDUL RAZAK,780508035619,199195969,192
|
|
||||||
511,MOHD BIN YAACOB,580925115015,129623355,193
|
|
||||||
512,ANIS ISMAIL,720504035190,199105226,194
|
|
||||||
513,HAFEIZAH BT. AB KADIR,790918035246,129897112,195
|
|
||||||
514,MOHD FAIZAL B. MOHAMMAD,790118035305,139521113,196
|
|
||||||
515,KAMRUL HISAN BIN MOHD KAMSON,650127035003,139817419,197
|
|
||||||
516,SAFINAH BT MAHAT,620212065058,189832242,198
|
|
||||||
517,NIK JAWAHIR BT NIK ISMAIL,700602035276,129599499,199
|
|
||||||
518,ASMAH LAILY HUSSEIN,710328035204,139636908,200
|
|
||||||
519,W.M. AZHARI B WAN ABDULLAH,700325035605,139821822,201
|
|
||||||
520,WAN AZKAN BIN WAN HASSAN,660304035653,199825653,202
|
|
||||||
521,ZAITON MAT ADAM,600821035462,179631848,203
|
|
||||||
522,WAN MOHAMED SHARIF B WAN MUSA,540704035365,199115365,204
|
|
||||||
523,RAMELAH BINTI DERAMAN,650629035046,196953070,205
|
|
||||||
524,NORLY BINTI DERAMAN @ IBRAHIM,691213035190,169243019,206
|
|
||||||
525,MUHAMAD SUKRI BIN SEMAN,740906035335,179702750,207
|
|
||||||
526,ZAILANI YAACOB,681215035179,103346695,208
|
|
||||||
527,AMIRIZA HAMZAH,680919035447,199806158,209
|
|
||||||
528,MUHD NASROM SHAH B. YUSUF,720208035305,199505505,210
|
|
||||||
529,A'SRI CHE ALI,610820035873,1111255604,211
|
|
||||||
530,FARIDAH CHE ALI,690103035478,1139190727,212
|
|
||||||
531,ABDUL RAHMAN ALI,701112086323,129516256,213
|
|
||||||
532,RAMILAN ABDUL RAHMAN,650207035433,199583737,214
|
|
||||||
533,MD AZHARI ABD RAHMAN,640406035111,139676728,215
|
|
||||||
534,NOR FAZILLAWATI MOHAMED,830720035328,199475444,216
|
|
||||||
535,SARINA MOHD ZAIN,700926035096,137617588,217
|
|
||||||
536,ROSELINA MOHD MAHIDDIN,651027035588,129535394,218
|
|
||||||
537,AMRAN MOHAMAD,720417035475,199448955,219
|
|
||||||
538,ROZIANI BT. AHAMED KAMIL,750101039848,011 26403553,220
|
|
||||||
539,MOHD YAMIN ISMAIL,630904035043,199602549,221
|
|
||||||
540,AZIZAH KAMARUL ZAMAN,680615035210,179594611,222
|
|
||||||
541,MOHD FIRDAUS JAMALUDIN,880218035387,129540047,223
|
|
||||||
542,NOR AZLIMAH RAMLI,850708035112,179722326,224
|
|
||||||
543,MOHD AZRUL FAIZAL ABU BAKAR,821105035735,194458020,225
|
|
||||||
544,ABDULLAH ZAWAWI BIN MAMAT,730119035695,145042276,226
|
|
||||||
545,AZIMAT MAMAT,650501035629,148098787,227
|
|
||||||
546,NORHAYATI YAACOB,670110035304,179191617,228
|
|
||||||
547,MOHD NORIKHWAN BIN SHAHIMI,850216035415,179730779,229
|
|
||||||
548,ASHAMDI ASAARI,810910035427,173332616,230
|
|
||||||
549,NIK NABIHAH NIK YUSOFF,880923035956,172989264,231
|
|
||||||
550,MUHAMAD BUKHARI ABD RAHIM,820112035587,129469118,232
|
|
||||||
551,MOHD ZANI MD ZAIN,650519035491,139972365,233
|
|
||||||
552,NURHAIDA ABD SAMAD,821230015194,139321786,234
|
|
||||||
553,MUHAMAD FARKIAMI AB. RAHIM,761216035621,133999602,235
|
|
||||||
554,MOHD FAIZUL AZAHA UMANAH,840502038417,199992928,236
|
|
||||||
555,SAIDITINA AISHAH MAHAMUD,891128065084,139278425,237
|
|
||||||
556,MOHD HAFIZ YAHAYA,820209035567,199087605,238
|
|
||||||
557,AHMAD KHALLIFA MOHD HANAPI,870217035167,179238977,239
|
|
||||||
558,NUR RASHIHAH SALLEH,851117035318,139089829,240
|
|
||||||
559,NIK FADHLINEE NIK MARWAN @ NIK FAUZI,841217035308,129578497,241
|
|
||||||
560,ROSLINA MOHD RAMLI,820804035326,139824757,242
|
|
||||||
561,WAN RAMLAH WAN DERAMAN,770227035840,1125712878,243
|
|
||||||
562,MOHD ROSLAN MOHD ALI,610821035779,146455992,244
|
|
||||||
563,ZANJABILA MOHD SALEH,851020035522,199859436,245
|
|
||||||
564,NORAI MAT DAUD,750607035262,146060678,246
|
|
||||||
565,MARIYANI MUDA,801209035512,129900535,247
|
|
||||||
566,ABDULLAH HAKIM AB. ALIM,821128035885,199497979,248
|
|
||||||
567,NOR HAFIZUDIN MOHAMED,861115296249,179274383,249
|
|
||||||
568,NORMALA MOHD NOOR,850827035270,133267027,250
|
|
||||||
569,SHAHILLA CHE RAZALI,830131075006,145297313,251
|
|
||||||
570,NUR IDAYU MAT NASIR,861008295152,139019799,252
|
|
||||||
571,MOHAMED AZMI MAHMOOD,840511-03-5443,199731345,253
|
|
||||||
572,ABDUL RAZAK OMAR,640822035671,1111929667,254
|
|
||||||
573,MOHD EKHWAN ZAKARIA,880422065567,1151667076,255
|
|
||||||
574,ABDUL HAFIZ NAWAWI,870526025085,176755443,256
|
|
||||||
575,FARAH AWANIS EDRUS,831209035296,129229523,257
|
|
||||||
576,SADEED MUHDHAR MOHD ZAIN,870621035767,139121305,258
|
|
||||||
577,NURUL AINI HARUN,860606296396,1137504434,259
|
|
||||||
578,WAN MOHD RAZIS WAN SUHAIMI,831220035721,139839010,260
|
|
||||||
579,NIK LOKMAN NIK MAN,830209035013,137440221,261
|
|
||||||
580,MOHD SHAHRUL RIDZUAN ABDULLAH,850316035383,126865723,262
|
|
||||||
581,WAN MOHD RIDHUAN WAN MAT LUDIN,861016296219,179717099,263
|
|
||||||
582,MOHAMAD FAIZ MOHAMED ASRI,850922-03-5543,139347720,264
|
|
||||||
583,MUHAMMAD FERDAUS NOOR ABAS,870119065071,179704287,265
|
|
||||||
584,NUR FARAZLIN ROSLI,880611035172,196132336,266
|
|
||||||
585,OTHMAN BIN DAUD,740522035889,139504781,267
|
|
||||||
586,NOOR HAFIZI BIN MOHAMMAD,890922035155,174677645,268
|
|
||||||
587,SITI ZALEHA HARUN,840731036042,1137550567,269
|
|
||||||
588,FATIN FAUZANA BT. MOHD RAMLI,870615035568,1110109118,270
|
|
||||||
589,AZID @ ABDUL AZID BIN SULAIMAN,700618035799,199271623,271
|
|
||||||
590,MOHD SHAFIK AFFANDIE BIN MAMAT,870725035323,173550586,272
|
|
||||||
591,HAZRUL BIN HUSSIN,831219035169,139697822,273
|
|
||||||
592,NUR ADNIN BINTI MOHAMED,830725035298,109333696,274
|
|
||||||
593,SAMSIANA BINTI RAHENG,840808035516,199900575,275
|
|
||||||
594,MOHD FAIZ BIN MOHD WARDI,850817035955,1111617548,276
|
|
||||||
595,MOHD ZAIRY BIN MOHD ROSLI,810118035503,173594115,277
|
|
||||||
596,MOHD ASRI BIN MUKHTAR,791007035681,199721640,278
|
|
||||||
597,NORHAPIZAH BINTI MOHAMMED @ AZIZ,871120035544,199329511,279
|
|
||||||
598,NURUL ZATUR NAJAHAH BT YUNUS,870717065020,132128673,280
|
|
||||||
599,MOHD EZUAN BIN ISMAIL,840324035077,137745031,281
|
|
||||||
600,CHE RUSLI BIN MUHAMMAD,721110035459,139462647,282
|
|
||||||
601,AHMAD AMIN BIN RASHID,850606035525,104515525,283
|
|
||||||
602,MOHD HAFIZ BIN MOHAMMAD,840515035141,129394353,284
|
|
||||||
603,MUZANI BIN IBRAHIM,680518035841,1140297681,285
|
|
||||||
604,WAN AZMEER BIN WAN MAHMOOD,900114035839,133136965,286
|
|
||||||
605,KHAIRUL ANUAR BIN YAACOB,850127035333,199618159,287
|
|
||||||
606,AZHAN BIN MAT,870802035651,199117990,288
|
|
||||||
607,SAKRI BIN MAT NOR,720104036207,129295955,289
|
|
||||||
608,NASRUL HAFEZ B. MAT NASIR,831220035975,1110105975,290
|
|
||||||
609,ARJUNAIDEY AZWAR BIN AB RAHMAN,830113035019,148284946,291
|
|
||||||
610,MOHAMAD AZIZI BIN MOHAMED NOOR,870824295657,013 9109873,292
|
|
||||||
611,MUHAMAD HAFIZ BIN ZAKARIA,871115035873,179156428,293
|
|
||||||
612,MUHAMMAD ARIEZ BIN AZMAN,910504035219,179808962,294
|
|
||||||
613,MOHAMAD RIDZWAN BIN MOHAMAD,920720035749,169357949,295
|
|
||||||
614,ATHIRAH AZRI BINTI AZMI,870619035426,179235024,296
|
|
||||||
615,MOHD ZULFADLI BIN IBRAHIM,860216035481,1129276057,297
|
|
||||||
616,AIDAMARNI BINTI SALLEH,810123035890,139131328,298
|
|
||||||
617,NORMAHWATI BT BELUDTU,840301125854,198405462,299
|
|
||||||
618,NURHUSIN BIN APAN,831010127337,178190102,300
|
|
||||||
619,MUHAMMAD NAFIS B ZAINUDIN,870509035089,194714564,301
|
|
||||||
620,MOHD HAFIZUL FIKRI BIN SIDI MOHAMED NOOR,880422035149,179514823,302
|
|
||||||
621,AHMAD ZULKHAIRI BIN ZULKFLI,890910036289,102911183,303
|
|
||||||
622,MOHD AL-AMIN BIN YUSOFF,870516295487,1133301744,304
|
|
||||||
623,CHE KHAIRUL AZLI CHE HASHIM,920827035829,179008827,305
|
|
||||||
624,MOHD FIRDAUS BIN MOHAMAD,850127035237,139440200,306
|
|
||||||
625,MOHD AYUB BIN SUHAIMI,871231675069,189650520,307
|
|
||||||
626,MD AZWAN BIN NORDIN,900826125883,109313914,308
|
|
||||||
627,MOHD HAFIZ FAHMI BIN SAHAK,871104125355,198955381,309
|
|
||||||
628,SITI MASHITA BINTI MARIJIN,860930495944,019 5324767,310
|
|
||||||
629,RIDZAN NURLINA BT MOHAMED NASIR,850119065698,189160395,311
|
|
||||||
630,MOHAMAD FURQANUL AIZAT BIN FAUZI,900728035593,1120722721,312
|
|
||||||
631,MUHAMMAD IZZUDDIN BIN MOKHTAR,890209035333,199011095,313
|
|
||||||
632,MOHAMAD SHAKIR BIN ABDUL MANAN,901105035591,1110630511,314
|
|
||||||
633,NOOR SUHAILA BINTI IBRAHIM,940423035150,104164407,315
|
|
||||||
634,SITI NORAZNI BINTI HASSAN,900515036058,145268580,316
|
|
||||||
635,MOHD HANIF BIN MAT ROF,811107035721,129637776,317
|
|
||||||
636,ASMARIHAN BINTI AB GHANI,880205035150,1110970931,318
|
|
||||||
637,HADAFI BIN MOHD ZUKIPELI,890302035071,1110104559,319
|
|
||||||
638,MOHD SHAHLAN B. ANUAR,900728035913,179872315,320
|
|
||||||
639,MOHD FAIZAL BIN IBRAHIM,870504295017,194178298,321
|
|
||||||
640,MOHAMMAD KHAIRULNIZAN BIN JUSOF,910218036157,179600102,322
|
|
||||||
641,MUHAMAD HAFIZ SHAR'E BIN HANAFI,940607035497,136749495,323
|
|
||||||
642,ROHAYA BINTI MUHAMAD,620101038014,1117932057,324
|
|
||||||
644,MAHARI BUKHARI BIN MAT,891115035169,145161951,325
|
|
||||||
645,MOHAMAD AZUHAIDIE BIN AHMAD,940801035677,145116331,326
|
|
||||||
646,MOHD ZULKIFLIE BIN MOHD ZAIN,841120035977,139559841,327
|
|
||||||
647,IRMA SYUHADA BT IBRAHIM,840229145446,139403344,328
|
|
||||||
648,MUHAMMAD SHAKIL BIN HAMIDIN,901226035221,179864356,329
|
|
||||||
649,MARIATI BINTI MADAN,850919125118,198122726,330
|
|
||||||
650,NOOR ATIQAH BT AHMAD,881228125268,102025862,331
|
|
||||||
652,WAN MANITA BT HAMAD@ WAN MOHD,890711035662,179545432,332
|
|
||||||
653,WAN NURHAFIZOL BIN WAN MANSOR,850127035739,179676792,333
|
|
||||||
654,LUQMAN HAKIM BIN MOHD YAHAYA,911129035421,193458235,334
|
|
||||||
655,MUHAMAD ASYWAM BIN A'SRI,940908036063,199016835,335
|
|
||||||
656,MOHD HISYAM KHAIRIE BIN MOHD YUSNI,900713035689,132829323,336
|
|
||||||
657,WAN NURUL AMIRA BINTI WAN HARON,881119035132,1110764243,337
|
|
||||||
658,MOHD ZARIM BIN MOHD ZAMRI,930609125147,143595362,338
|
|
||||||
659,MUHAMMAD FAIZUL HAKIMI BIN MUSTAPA,880711035225,197523023,339
|
|
||||||
660,MOHD FAHMIE BIN ZAKARIA,910721036285,1116507469,340
|
|
||||||
661,PG. SITI KADIZAH BINTI PG. ABDULLAH,800705125272,146510936,341
|
|
||||||
662,SAFITERI BINTI TARNO,901121125730,168137928,342
|
|
||||||
663,MUHAMMAD KHAIRUL AMIRIN BIN MOHD ROSLI,940425036165,129536020,343
|
|
||||||
664,NUR FAKHIRA BINTI AHMAD KAMIL,950711035138,149693382,344
|
|
||||||
665,MUHAMMAD HAZIM BIN MOHD ASRI,950310145475,196154087,345
|
|
||||||
666,NURUL HIDAYAH BINTI MUSTAPA@DERAMAN,910729035308,199419472,346
|
|
||||||
667,MOHD MUSTAKIM BIN YUSOFF,850213035911,1110814060,347
|
|
||||||
668,NORIZAN BINTI AWANG,701017035288,1137589963,348
|
|
||||||
669,NAZIRAH BINTI MOHAMED,911116036150,179413710,349
|
|
||||||
670,MOHD NAWITAR BIN MOHD,780825035663,179763812,350
|
|
||||||
671,WAN NORHISHAM BIN WAN JAAFAR,700908035391,197293648,351
|
|
||||||
672,MOHAMAD HAMIRUL BIN HALID,901202146381,195126381,352
|
|
||||||
673,MUNAWIR BIN MD NASIR,931019125045,198449355,353
|
|
||||||
674,MOHD FHAEIS BIN MUHAMMAD,940413035755,187730960,354
|
|
||||||
675,SARIP BIN SALANI,881022125297,168269145,355
|
|
||||||
676,WAN AHMAD KAMAL BIN MOHD NOR,930530036037,173267793,356
|
|
||||||
677,ABDUL MUHAIMIN BIN AHMAD,891218036009,136444757,357
|
|
||||||
678,NUR ALISSYA BINTI MOHD HAZMAN,941128035232,1117806234,358
|
|
||||||
679,DATO' DR WAN ZAWAWI BIN WAN ISMAIL,610613035547,199889217,359
|
|
||||||
680,ABDUL MUHAIMIN BIN ABDULLAH,870129295153,1128005291,360
|
|
||||||
681,FATIN NADIA BINTI ZAIDI,920114036346,199405259,361
|
|
||||||
682,MOHAMMAD ASWAT BIN PATEK MOHD,850514065129,129742514,362
|
|
||||||
683,ASMADI BIN ABDUL WAHED,900702035683,139072135,363
|
|
||||||
684,AHMAD TARZIDIE BIN AB MANAF,851223035055,0112-6018916,364
|
|
||||||
685,NURUL ALIA BINTI MOHAMAD KAMAL,940726035326,105705470,365
|
|
||||||
686,JUNAIDI BIN BAKRI,890128125249,1136662466,366
|
|
||||||
687,ASHIKIN ABDULLAH,590406035258,1111420604,367
|
|
||||||
688,NIK NUREN SYAFIKAH BT NIK MOHAMED NAZRI,950101035164,179406274,368
|
|
||||||
689,NOORHISHAM B. SAMAT @ MAT JURI,751016125447,139449192,369
|
|
||||||
690,NIK MOHD NASIRUDDIN BIN NIK COB,740714036093,148007363,370
|
|
||||||
691,AB AZIZ BIN YUNUS,600410035193,199891913,371
|
|
||||||
692,MOHAMAD HAFIZ BIN CHE SOH,890905035331,199720813,372
|
|
||||||
693,NIK NISREEN BT MUHAMMAD FITRI,961201855068,148471010,373
|
|
||||||
694,FAIZAL BIN MOKTAR,920721125455,1162289550,374
|
|
||||||
695,FATHIAH BT TAIP,921127126396,1133145854,375
|
|
||||||
696,ABD MUHAIMIN BIN TURIDI,920126855015,184664503,376
|
|
||||||
697,MUHAMMAD HIZHAM BIN ZAKARIA,930817035701,179442383,377
|
|
||||||
698,ZALIHA BT MD ZAIN,870215295360,173831225,378
|
|
||||||
699,MOHD FADZLI BIN MOHD NASRAH,950712035797,1160860255,379
|
|
||||||
700,HASWATI BT KARIMIN,820421036036,1119544351,380
|
|
||||||
701,NURATIKAH BINTI AJANI,940111125392,196946450,381
|
|
||||||
702,MOHD FADILLAH BIN MATLIN,930711125549,178958563,382
|
|
||||||
704,NAFISAH BINTI MUHAMADIN,950827125784,189602088,383
|
|
||||||
706,WAN NUR FATIN NATASYA BT W M AZHARI,970113035574,136652264,384
|
|
||||||
707,HAZNINA AINI BINTI HASSAN,880608295176,139973524,385
|
|
||||||
708,MUHAMAD SHAUQI BIN SHAHAPUDIN,931013036439,148340734,386
|
|
||||||
709,NUR FARAHIM BT MOHD OMAR,900427045418,1126220662,387
|
|
||||||
710,NORAZRINA BINTI KAMIN,921214125834,128668241,388
|
|
||||||
711,MOHD AMIRUDDIN BIN AZAMI,840417025942,137868197,389
|
|
||||||
712,SRI NUR FARHANA BINTI KASIM,931114086208,010 8816543,390
|
|
||||||
713,NOR AMYLIA EZATY BT ISMAIL,980315036312,142144227,391
|
|
||||||
714,WAN NOR IZYAN BINTI WAN HISHAM,990415105986,1140201378,392
|
|
||||||
715,U'WAIMAR BIN ZULHAZMI,950819885011,139984700,393
|
|
||||||
716,MUHAMMAD AMMAR BIN ISMAIL,203030737,193517702,394
|
|
||||||
717,AMIR THAQIF THARIY BIN SHAMSUDDIN,980822036069,1114932463,395
|
|
||||||
718,MOHD AIZAD SALIM BIN AGUS SALIM,1126121073,136613176,396
|
|
||||||
719,FADZLYEENA BINTI SAIREN,900204126128,149550642,397
|
|
||||||
720,NURUL AIN IZAZI BINTI ABD AZIZ,10528030056,1112908502,398
|
|
||||||
721,ARMAN SHARIF IBRAHIM BIN HISHAMUDIN,990624106475,129018250,399
|
|
||||||
722,MUHAMMAD AFIQ BIN HAMZAH,910130035045,1159983870,400
|
|
||||||
723,ZULKIFLI BIN AB HAMID,850102035679,179475958,401
|
|
||||||
724,MUHAMAD AIMAN BIN MAZLAN,990808035309,138399913,402
|
|
||||||
725,MOHAMAD HAFIZUDIN BIN ABDUL SATAR,910917035997,139577319,403
|
|
||||||
726,ZULIYANA BINTI TAJUDIN,911117015992,197591920,404
|
|
||||||
727,WAN MUHAMMAD SHAHRIL BIN WAN MOHD FADZLI,970824036039,143342577,405
|
|
||||||
728,MUHAMMAD AIMAN HAKIM BIN MOHD RODHI,961010465075,105116144,406
|
|
||||||
729,WAM MUHAMMAD JAMALUL'AQIL BIN WAN ZAKARIA,961117036035,169315308,407
|
|
||||||
730,MUHAMMAD YAZID BIN OSMAN,20506040041,165276449,408
|
|
||||||
731,PUTERI NUR AISHAH BINTI WAGIMIN,20528010740,177315254,409
|
|
||||||
732,NURFARHANA BINTI ALIRNOR,911112065034,148160691,410
|
|
||||||
733,AHMAD SUHAIL IRFAN BIN ZAMRI,10629030979,129607215,411
|
|
||||||
734,NUR HUSNINA BT LUKMAN,961226035322,199652655,412
|
|
||||||
735,CHE SOH B HASSAN,591010035395,139070565,413
|
|
||||||
736,NUR MUZIERA SHAZRINA BINTI MUHAMAD,1024030736,172604369,414
|
|
||||||
737,FAZILA BINTI TOMAS,951226126794,1169309126,415
|
|
||||||
738,RIDZUAN BIN AMRAN,911118125691,1173376044,416
|
|
||||||
|
@@ -21,10 +21,6 @@ use App\Http\Controllers\TransactionOnlineTrailController;
|
|||||||
use App\Http\Controllers\Reports\RingkasanHarianController;
|
use App\Http\Controllers\Reports\RingkasanHarianController;
|
||||||
use App\Transaction;
|
use App\Transaction;
|
||||||
|
|
||||||
$router->get('/health', function () {
|
|
||||||
return response()->json(['status' => 'ok']);
|
|
||||||
});
|
|
||||||
|
|
||||||
$router->group(['namespace' => '\Rap2hpoutre\LaravelLogViewer'], function() use ($router) {
|
$router->group(['namespace' => '\Rap2hpoutre\LaravelLogViewer'], function() use ($router) {
|
||||||
$router->get('logs', 'LogViewerController@index');
|
$router->get('logs', 'LogViewerController@index');
|
||||||
});
|
});
|
||||||
@@ -63,11 +59,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
|||||||
$router->put('customers/information/update/admin', ['uses' => 'CustomerController@customerUpdateAdmin']); //blh refer sini izazi
|
$router->put('customers/information/update/admin', ['uses' => 'CustomerController@customerUpdateAdmin']); //blh refer sini izazi
|
||||||
$router->get('admin/customers/nokp/search',['uses'=>'CustomerController@showOneCustomerByICAdmin']);
|
$router->get('admin/customers/nokp/search',['uses'=>'CustomerController@showOneCustomerByICAdmin']);
|
||||||
$router->get('customer/blacklist',['uses'=>'CustomerController@blacklistCustomer']);
|
$router->get('customer/blacklist',['uses'=>'CustomerController@blacklistCustomer']);
|
||||||
$router->get('customer/anggota',['uses'=>'CustomerController@anggotaKoperasi']);
|
|
||||||
$router->get('customer/eachcawangan/{ic}',['uses'=>'CustomerController@showCustomerByEachCawangan']);
|
$router->get('customer/eachcawangan/{ic}',['uses'=>'CustomerController@showCustomerByEachCawangan']);
|
||||||
$router->put('customers/{noic}/assign-anggota', ['uses' => 'CustomerController@assignAnggota']);
|
|
||||||
$router->post('/customers/update-tag-pdpa', ['uses' => 'CustomerController@updateTagPdpa']);
|
|
||||||
|
|
||||||
//arcc
|
//arcc
|
||||||
$router->get('customer/searchbyname',['uses'=>'CustomerController@searchByName']);
|
$router->get('customer/searchbyname',['uses'=>'CustomerController@searchByName']);
|
||||||
$router->get('customer/searchbygadai/{kodcaw}/{norujukan}',['uses'=>'CustomerController@AdminsearchGadai']);
|
$router->get('customer/searchbygadai/{kodcaw}/{norujukan}',['uses'=>'CustomerController@AdminsearchGadai']);
|
||||||
@@ -412,20 +404,15 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
|||||||
$router->get('SenaraiDahLulus/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@listdahlulus']);
|
$router->get('SenaraiDahLulus/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@listdahlulus']);
|
||||||
$router->get('ListLatestLulus/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@listlatestlulus']);
|
$router->get('ListLatestLulus/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@listlatestlulus']);
|
||||||
$router->put('UpdateKelulusan/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@update']);
|
$router->put('UpdateKelulusan/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@update']);
|
||||||
$router->put('UpdateKelulusanAnggota/{kodcaw}',['uses'=>'KelulusanController@updateAnggota']);
|
|
||||||
$router->put('UpdateKelulusanKomen/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@updatekomen']);
|
$router->put('UpdateKelulusanKomen/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@updatekomen']);
|
||||||
|
|
||||||
$router->post('CreateKelulusan/{kodcaw}/{norujukan}/roles/{roles}',['uses'=>'KelulusanController@create']);
|
$router->post('CreateKelulusan/{kodcaw}/{norujukan}/roles/{roles}',['uses'=>'KelulusanController@create']);
|
||||||
$router->post('CreateKelulusanAnggota/{kodcaw}/roles/{roles}',['uses'=>'KelulusanController@createKelulusanAnggota']);
|
|
||||||
$router->post('CreateLulus/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@kepohonancreate']);
|
$router->post('CreateLulus/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@kepohonancreate']);
|
||||||
$router->get('GetLulus/{kodcaw}/',['uses'=>'KelulusanController@kepohonangetteller']);
|
$router->get('GetLulus/{kodcaw}/',['uses'=>'KelulusanController@kepohonangetteller']);
|
||||||
$router->put('UpdateKelulusan/kepohonan/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@updatekepohonankhazanah']);
|
$router->put('UpdateKelulusan/kepohonan/{kodcaw}/{norujukan}',['uses'=>'KelulusanController@updatekepohonankhazanah']);
|
||||||
$router->get('GetLulusAll/{kodcaw}/',['uses'=>'KelulusanController@listkepohonan']);
|
$router->get('GetLulusAll/{kodcaw}/',['uses'=>'KelulusanController@listkepohonan']);
|
||||||
$router->get('ListOperasi/',['uses'=>'KelulusanController@listoperasi']);
|
$router->get('ListOperasi/',['uses'=>'KelulusanController@listoperasi']);
|
||||||
$router->get('ListOperasiKelulusan/',['uses'=>'KelulusanController@listoperasikelulusan']);
|
$router->get('ListOperasiKelulusan/',['uses'=>'KelulusanController@listoperasikelulusan']);
|
||||||
$router->get('list/approval/anggota',['uses'=>'KelulusanController@listKelulusanAnggota']);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//API REQUEST TELLER
|
//API REQUEST TELLER
|
||||||
@@ -673,42 +660,6 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
|||||||
|
|
||||||
//initiateTunai
|
//initiateTunai
|
||||||
$router->get('initiate/tunai',['uses'=>'TunaiController@initiateTunai']);
|
$router->get('initiate/tunai',['uses'=>'TunaiController@initiateTunai']);
|
||||||
|
|
||||||
// Modal Online (pembiayaan atas talian float)
|
|
||||||
// Operasi top-up routes before {kodcaw} catch-alls
|
|
||||||
$router->get('modal-online/operasi/topup/requests', ['uses' => 'ModalOnlineController@listTopUpOperasi']);
|
|
||||||
$router->post('modal-online/operasi/topup/{id}/approve', ['uses' => 'ModalOnlineController@approveTopUp']);
|
|
||||||
$router->post('modal-online/operasi/topup/{id}/reject', ['uses' => 'ModalOnlineController@rejectTopUp']);
|
|
||||||
$router->get('modal-online/operasi/eod', ['uses' => 'ModalOnlineController@listToday']);
|
|
||||||
$router->post('modal-online/operasi/eod/close-all', ['uses' => 'ModalOnlineController@closeAll']);
|
|
||||||
|
|
||||||
$router->get('modal-online/{kodcaw}', ['uses' => 'ModalOnlineController@get']);
|
|
||||||
$router->post('modal-online/{kodcaw}/reserve', ['uses' => 'ModalOnlineController@reserve']);
|
|
||||||
$router->post('modal-online/{kodcaw}/topup/request', ['uses' => 'ModalOnlineController@requestTopUp']);
|
|
||||||
$router->get('modal-online/{kodcaw}/topup/requests', ['uses' => 'ModalOnlineController@listTopUpByCawangan']);
|
|
||||||
$router->post('modal-online/{kodcaw}/close', ['uses' => 'ModalOnlineController@close']);
|
|
||||||
$router->get('initiate/modal-online', ['uses' => 'ModalOnlineController@initiate']);
|
|
||||||
|
|
||||||
// Operasi kelulusan pembiayaan online (must be before {kodcaw} routes)
|
|
||||||
$router->get('pembiayaan-online/operasi/batches', ['uses' => 'PembiayaanOnlineController@operasiListBatches']);
|
|
||||||
$router->get('pembiayaan-online/operasi/{kodcaw}/batches/{batchId}', ['uses' => 'PembiayaanOnlineController@operasiShowBatch']);
|
|
||||||
$router->post('pembiayaan-online/operasi/{kodcaw}/lines/{id}/approve', ['uses' => 'PembiayaanOnlineController@operasiApproveLine']);
|
|
||||||
$router->post('pembiayaan-online/operasi/{kodcaw}/lines/{id}/reject', ['uses' => 'PembiayaanOnlineController@operasiRejectLine']);
|
|
||||||
$router->post('pembiayaan-online/operasi/{kodcaw}/lines/{id}/paid', ['uses' => 'PembiayaanOnlineController@operasiMarkPaid']);
|
|
||||||
$router->post('pembiayaan-online/operasi/{kodcaw}/batches/{batchId}/approve', ['uses' => 'PembiayaanOnlineController@operasiApproveBatch']);
|
|
||||||
$router->post('pembiayaan-online/operasi/{kodcaw}/batches/{batchId}/paid', ['uses' => 'PembiayaanOnlineController@operasiMarkPaidBatch']);
|
|
||||||
|
|
||||||
// Pembiayaan Online (payout line + PC queue / batch)
|
|
||||||
$router->post('pembiayaan-online/{kodcaw}', ['uses' => 'PembiayaanOnlineController@store']);
|
|
||||||
$router->get('pembiayaan-online/{kodcaw}/queue', ['uses' => 'PembiayaanOnlineController@queue']);
|
|
||||||
$router->get('pembiayaan-online/{kodcaw}/paid', ['uses' => 'PembiayaanOnlineController@paidQueue']);
|
|
||||||
$router->post('pembiayaan-online/{kodcaw}/paid/blast', ['uses' => 'PembiayaanOnlineController@markBlastSent']);
|
|
||||||
$router->put('pembiayaan-online/{kodcaw}/lines/{id}', ['uses' => 'PembiayaanOnlineController@updateLine']);
|
|
||||||
$router->get('pembiayaan-online/{kodcaw}/lines/{id}/bukti', ['uses' => 'PembiayaanOnlineController@getBukti']);
|
|
||||||
$router->get('pembiayaan-online/{kodcaw}/batches', ['uses' => 'PembiayaanOnlineController@listBatches']);
|
|
||||||
$router->get('pembiayaan-online/{kodcaw}/batches/{batchId}', ['uses' => 'PembiayaanOnlineController@showBatch']);
|
|
||||||
$router->post('pembiayaan-online/{kodcaw}/batches/submit', ['uses' => 'PembiayaanOnlineController@submitBatch']);
|
|
||||||
$router->get('pembiayaan-online/{kodcaw}/by-norujukan/{norujukan}', ['uses' => 'PembiayaanOnlineController@show']);
|
|
||||||
//WTD
|
//WTD
|
||||||
$router->get('check/wtd',['uses'=>'WTDController@getDraftWTD']);
|
$router->get('check/wtd',['uses'=>'WTDController@getDraftWTD']);
|
||||||
$router->get('check/customer',['uses' => 'WTDController@getCustomerWTD']);
|
$router->get('check/customer',['uses' => 'WTDController@getCustomerWTD']);
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
/debugbar
|
|
||||||
/framework/sessions
|
|
||||||
Reference in New Issue
Block a user