This commit is contained in:
LAPTOP-DGCU80CH\user1
2020-12-24 10:56:32 +08:00
parent c0ae6a04a0
commit 15cf079e2d
26 changed files with 75 additions and 796 deletions
+25 -3
View File
@@ -96,11 +96,33 @@ class CustomersController extends Controller
*/
public function store(Request $request)
{
$customer = $this->customerService->createNewCustomer($request);
dd($request);
if($request->warganegara){
$warganegara = 'Y';
}else{
$warganegara = 'N';
}
if($request->bumiputera){
$bumiputera = 'Y';
}else{
$bumiputera = 'N';
}
if($request->jantina == 'Lelaki'){
$jantina = 'L';
}elseif($request->jantina == 'Perampuan'){
$jantina = 'P';
}
$split_date = explode('/',$request->tarikh_lahir);
$tarikh_lahir = $split_date[2].'-'.$split_date[1].'-'.$split_date[0];
$auth_user = Auth::user();
$latest_customer = Http::get(config('api.url') . '/api/customers/latest/' . $auth_user['cawangan'])->json();
$customer_info = Customer::where('noic','=',$request['noic'])->first();
$nosiri_latest = $latest_customer['nosiri']+1;
$count = sprintf("%08d", $nosiri_latest);
$no_pelanggan = $request->bangsa . substr($request->noic,6,2).'-'.$count;
// dd($tarikh_lahir);
// dd($customer_info);
Session::put('customer_info',$customer_info);
return redirect()->route('customer_info')->with( ['customer_info' => $customer_info] );
}
@@ -1,43 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCustomersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('customers', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('noic')->unique();
$table->string('alamat');
$table->string('main_phone');
$table->string('alternate_phone')->nullable();
$table->string('alamat_menyurat');
$table->integer('poskod');
$table->string('daerah');
$table->string('negeri');
$table->integer('umur');
$table->string('warganegara');
$table->string('bangsa');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('customers');
}
}
@@ -1,31 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateGadaianTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('gadaian', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('gadaian');
}
}
@@ -1,43 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMarhunTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('marhun', function (Blueprint $table) {
$table->id();
$table->String('no_rujukan');
$table->String('marhun');
$table->String('note');
$table->boolean('rosak');
$table->boolean('putus');
$table->boolean('patah');
$table->boolean('permata');
$table->boolean('sebelah');
$table->String('karat');
$table->String('berat');
$table->float('harga');
$table->float('nilai_marhun');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('marhun');
}
}
@@ -1,31 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePenebusanTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('penebusan', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('penebusan');
}
}
@@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddRolesToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->String('roles');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('roles');
});
}
}
@@ -1,34 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRolesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('roles', function (Blueprint $table) {
$table->id();
$table->String('role_name');
$table->String('role_code');
$table->String('description');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('roles');
}
}
@@ -1,35 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateHargaEmasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('harga_emas', function (Blueprint $table) {
$table->id();
$table->String('mutu_emas');
$table->String('karat');
$table->float('kaunter');
$table->float('harga_gram');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('harga_emas');
}
}
@@ -1,39 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCawanganTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cawangan', function (Blueprint $table) {
$table->id();
$table->String('nama');
$table->String('code');
$table->String('alamat');
$table->String('poskod');
$table->String('daerah');
$table->String('negeri');
$table->String('no_telefon');
$table->String('no_fax');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cawangan');
}
}
@@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCawanganToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->String('cawangan');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('cawangan');
});
}
}
@@ -1,34 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddInfoUserToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->String('no_kp');
$table->String('no_telefon');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('no_kp');
$table->dropColumn('no_telefon');
});
}
}
@@ -1,31 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBangsaTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bangsa', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('bangsa');
}
}
@@ -1,33 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBankTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bank', function (Blueprint $table) {
$table->id();
$table->String('bank_name');
$table->String('bank_code');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('bank');
}
}
@@ -1,38 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMediaTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
Schema::create('media', function (Blueprint $table) {
$table->bigIncrements('id');
$table->morphs('model');
$table->string('collection_name');
$table->string('name');
$table->string('file_name');
$table->string('mime_type')->nullable();
$table->string('disk');
$table->unsignedBigInteger('size');
$table->json('manipulations');
$table->json('custom_properties');
$table->json('responsive_images');
$table->unsignedInteger('order_column')->nullable();
$table->nullableTimestamps();
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::dropIfExists('media');
}
}
@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSessionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->unique();
$table->foreignId('user_id')->nullable();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->text('payload');
$table->integer('last_activity');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sessions');
}
}
-16
View File
@@ -1,16 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class BangsaSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
}
}
-16
View File
@@ -1,16 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class BankSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
}
}
-16
View File
@@ -1,16 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class CawanganSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
}
}
-59
View File
@@ -1,59 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class HargaEmasSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('harga_emas')->insert([
[
'mutu_emas' => '999',
'karat' => '24K',
'kaunter' => 183.68,
'harga_gram' => 262.40
],
[
'mutu_emas' => '950',
'karat' => '23K',
'kaunter' => 174.50,
'harga_gram' => 249.28
],
[
'mutu_emas' => '916',
'karat' => '22K',
'kaunter' => 168.25,
'harga_gram' => 240.36
],
[
'mutu_emas' => '900',
'karat' => '21K',
'kaunter' => 165.31,
'harga_gram' => 236.16
],
[
'mutu_emas' => '835',
'karat' => '20K',
'kaunter' => 153.57,
'harga_gram' => 219.10
],
[
'mutu_emas' => '750',
'karat' => '18K',
'kaunter' => 137.76,
'harga_gram' => 196.80
],
[
'mutu_emas' => '585',
'karat' => '14K',
'kaunter' => 137.76,
'harga_gram' => 153.50
]
]);
}
}
-98
View File
@@ -1,98 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class PoskodSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('poskod')->insert([
[
'poskod'=>'01000',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01007',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01009',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01500',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01502',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01503',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01504',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01505',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01506',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01508',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01512',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01514',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01516',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01517',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01518',
'bandar'=>'Kangar',
'negeri'=>'PLS'
],
[
'poskod'=>'01524',
'bandar'=>'Kangar',
'negeri'=>'PLS'
]
]);
}
}
-37
View File
@@ -1,37 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class RolesSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB:table('roles')->insert([
[
'role_name' => 'Penolong Pengurus Cawangan',
'role_code' => 'PPC',
'description' => 'Penolong Pengurus Cawangan',
],
[
'role_name' => 'Khazanah',
'role_code' => 'Khazanah',
'description' => 'Khazanah',
],
[
'role_name' => 'Juruwang',
'role_code' => 'TT',
'description' => 'Juruwang',
],
[
'role_name' => 'Penilai',
'role_code' => 'PP',
'description' => 'Penilai',
]
]);
}
}
-81
View File
@@ -1,81 +0,0 @@
<?php
use Illuminate\Database\Seeder;
class StateSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('state')->insert([
[
'nama_negeri' => 'Kelantan',
'code_negeri' => 'KEL'
],
[
'nama_negeri' => 'Johor',
'code_negeri' => 'JHR'
],
[
'nama_negeri' => 'Kedah',
'code_negeri' => 'KDH'
],
[
'nama_negeri' => 'Kuala Lumpur',
'code_negeri' => 'KUL'
],
[
'nama_negeri' => 'Labuan',
'code_negeri' => 'LBN'
],
[
'nama_negeri' => 'Melaka',
'code_negeri' => 'MLK'
],
[
'nama_negeri' => 'Negeri Sembilan',
'code_negeri' => 'NSN'
],
[
'nama_negeri' => 'Pahang',
'code_negeri' => 'PHG'
],
[
'nama_negeri' => 'Penang',
'code_negeri' => 'PNG'
],
[
'nama_negeri' => 'Perak',
'code_negeri' => 'PRK'
],
[
'nama_negeri' => 'Perlis',
'code_negeri' => 'PLS'
],
[
'nama_negeri' => 'Putrajaya',
'code_negeri' => 'PJY'
],
[
'nama_negeri' => 'Sabah',
'code_negeri' => 'SBH'
],
[
'nama_negeri' => 'Sarawak',
'code_negeri' => 'SRW'
],
[
'nama_negeri' => 'Selangor',
'code_negeri' => 'SGR'
],
[
'nama_negeri' => 'Terengganu',
'code_negeri' => 'TRG'
]
]);
}
}
+6 -6
View File
@@ -51,7 +51,7 @@
<div class="row form-group">
<div class="col-md-4">Nama</div>
<div class="col-md-8"><input class="form-control" type="text" name="name" id="name" autocomplete="off"></div>
<div class="col-md-4">No Kad Pengenalan</div>
<div class="col-md-4">No KP</div>
<div class="col-md-8"><input class="form-control" type="text" name="noic" id="noic" value="{{$noic ?? ''}}" readonly></div>
<div class="col-md-4">Tarikh Lahir</div>
<div class="col-md-8"><input class="form-control" type="text" name="tarikh_lahir" id="tarikh_lahir" readonly></div>
@@ -125,17 +125,17 @@
<div class="col-md-8">
<select class="form-control" name="bangsa" id="bangsa">
<option disabled selected value> -- Pilih Bangsa -- </option>
<option value="melayu">Melayu</option>
<option value="cina">Cina</option>
<option value="india">India</option>
<option value="lain">Lain-lain</option>
<option value="M">Melayu</option>
<option value="C">Cina</option>
<option value="I">India</option>
<option value="L">Lain-lain</option>
</select>
</div>
<div class="col-md-4">Bank</div>
<div class="col-md-8">
<select class="form-control" name="bank_name" data-placeholder="Pilih Bank" id="bank_name">
<option disabled selected value> -- Pilih Bank -- </option>
@foreach($bank as $banks)
<option disabled selected value> -- Pilih Bank -- </option>
<option value="{{ $banks['abbreviation'] }}">{{ $banks['name'] }}</option>
@endforeach
</select>
@@ -36,7 +36,8 @@
</form>
</div>
<div class="col-md-6">
<button class="btn btn-primary" id="pembelian_komuditi">Pembelian Komuditi</button>
<!-- <button class="btn btn-primary" id="pembelian_komuditi">Pembelian Komuditi</button> -->
<a href="" id="pembelian_komuditi" class="btn btn-primary">Pembelian Komuditi</a>
</div>
</div>
</div>
@@ -293,6 +294,8 @@
var kodcaw = button.data('kodcaw');
var hargajualan = button.data('hargajualan');
$('#pembelian_komuditi').attr('href','http://bsas-arrahn.test/pembelian/komuditi?norujukan='+norujukan);
$('#norujukan_modal').val(norujukan);
cetakSAG(kodcaw,norujukan);
$('#tablemarhun').empty();
@@ -93,7 +93,7 @@
#details td, #details th {
padding: 8px;
font-size:11px;
font-size:8px;
}
#details tr:nth-child(even){background-color: #ffffff;}
@@ -224,8 +224,7 @@
</tr>
@endif
<tr>
<td></td>
<td>{{$item['norujukan']}}</td>
<td colspan=2 style="width:100px">{{$item['norujukan']}}</td>
<td>
@php
$customer_detail = Http::get($api_url . '/api/customers/' . $item['nokp'])->json();
@@ -93,7 +93,7 @@
#details td, #details th {
padding: 8px;
font-size:11px;
font-size:8px;
}
#details tr:nth-child(even){background-color: #ffffff;}
@@ -226,8 +226,7 @@
</tr>
@endif
<tr>
<td></td>
<td>{{$item['norujukan']}}</td>
<td colspan=2>{{$item['norujukan']}}</td>
<td>
@php
$gadai_detail = Http::get($api_url . '/api/gadai/norujukan/'. $item['norujukan'])->json();