mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-22 13:54:17 +00:00
solved conflict
This commit is contained in:
+2
-1
@@ -4,11 +4,12 @@
|
||||
/public/js
|
||||
/public/css
|
||||
/storage/*.key
|
||||
/vendor
|
||||
/vendor/**
|
||||
/.idea
|
||||
/.vscode
|
||||
/.vagrant
|
||||
/data
|
||||
vendor/composer
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
npm-debug.log
|
||||
|
||||
+3
-2
@@ -1,7 +1,8 @@
|
||||
FROM php:7.1.3
|
||||
RUN apt-get update -y && apt-get install -y openssl zip unzip git zlib1g-dev netcat mysql-client
|
||||
RUN apt-get update -y && apt-get install -y openssl zip unzip git zlib1g-dev netcat mysql-client libgd-dev libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
|
||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
RUN docker-php-ext-install pdo pdo_mysql zip
|
||||
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
|
||||
RUN docker-php-ext-install pdo pdo_mysql zip gd
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
RUN composer install
|
||||
|
||||
+24
-1
@@ -7,10 +7,33 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Booking extends Model
|
||||
{
|
||||
// protected $guarded = [];
|
||||
protected $fillable = ['term', 'amount', 'rate_id', 'user_id', 'account_name', 'account_num', 'bank_name', 'bank_branch', 'company_name', 'company_address', 'bank_address', 'swift_code', 'cnap' ,'verification_status'];
|
||||
protected $hidden = array('user_id',
|
||||
"rate_id",
|
||||
"rmb_book_amount",
|
||||
"rmb_book_pay_method",
|
||||
"rmb_book_account_name",
|
||||
"rmb_book_bank_name",
|
||||
"rmb_book_acc_no",
|
||||
"rmb_book_bank_branch",
|
||||
"usd_book_amount",
|
||||
"usd_book_pay_method",
|
||||
"usd_book_company_name",
|
||||
"usd_book_company_address",
|
||||
"usd_book_swift_code",
|
||||
"usd_book_cnap",
|
||||
"usd_book_bank_branch");
|
||||
|
||||
protected $fillable = ['term', 'rate_id', 'user_id', 'amount', 'account_name', 'account_num', 'bank_name',
|
||||
'bank_branch', 'company_name'];
|
||||
|
||||
public $timestamps = true;
|
||||
|
||||
public function user(){
|
||||
return $this->belongsTo('app\User');
|
||||
}
|
||||
|
||||
public function userBankSlip(){
|
||||
return $this->hasOne(UserBankSlip::class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ class ForgotPasswordController extends Controller
|
||||
* @param string $response
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
protected function sendResetLinkResponse($response)
|
||||
{
|
||||
protected function sendResetLinkEmail($response)
|
||||
{
|
||||
return ['status' => trans($response)];
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\User;
|
||||
use App\Role;
|
||||
use App\Marking;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
@@ -56,8 +58,16 @@ class RegisterController extends Controller
|
||||
* @param array $data
|
||||
* @return User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
protected function create(Request $data)
|
||||
{
|
||||
$marking = Marking::Where('email',$data['email'])->first();
|
||||
if(!$marking){
|
||||
return response()->json('Access Denied', 401);
|
||||
}
|
||||
if($marking->marking != $data['marking']){
|
||||
return response()->json('Wrong Marking', 400);
|
||||
}
|
||||
|
||||
$role = Role::where('name','=','member')->first();
|
||||
$user = new User();
|
||||
$user->name = $data['name'];
|
||||
@@ -66,7 +76,6 @@ class RegisterController extends Controller
|
||||
$user->save();
|
||||
$user->attachRole($role);
|
||||
|
||||
return $user;
|
||||
|
||||
return response()->json($user, 201);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ class ResetPasswordController extends Controller
|
||||
}
|
||||
|
||||
protected function showResetForm(){
|
||||
return view('index');
|
||||
return view('index');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,200 +2,484 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\PurchaseOrder;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Booking;
|
||||
use App\Rate;
|
||||
use App\UserBankSlip;
|
||||
use App\User;
|
||||
use App\Invoice;
|
||||
use Auth;
|
||||
use Validator;
|
||||
use DateTime;
|
||||
|
||||
class BookingController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
//public function index()
|
||||
//{
|
||||
// return response()->json(['success' => true, 'message'=> "You have successfully logged out."]);
|
||||
//}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
//public function create()
|
||||
//{
|
||||
// return response()->json(['success' => true, 'message'=> "Success"]);
|
||||
//}
|
||||
public function index(){
|
||||
$bookings = Booking::select('id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
->where('user_id',Auth::user()->id)
|
||||
->get();
|
||||
|
||||
// reformat to fit frontend structure
|
||||
foreach ($bookings as $booking) {
|
||||
// set timeout
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
|
||||
// TODO : you can make it better
|
||||
if($difference_in_seconds < 0 ){
|
||||
$booking->timeout = 0;
|
||||
}
|
||||
|
||||
// TODO : transfer_amount change name to bia
|
||||
$booking->transfer_amount = $booking->bia;
|
||||
|
||||
$booking->track_status = "(". $booking->status ."/6)";
|
||||
switch ($booking->status) {
|
||||
case 1:
|
||||
$status_desc = "Order in progress";
|
||||
break;
|
||||
case 2:
|
||||
$status_desc = "Waiting for payment";
|
||||
break;
|
||||
case 3:
|
||||
$status_desc = "Waiting verification";
|
||||
break;
|
||||
case 4:
|
||||
$status_desc = "Processing transfer";
|
||||
break;
|
||||
case 5:
|
||||
$status_desc = "Transfer Complete, please upload your PO";
|
||||
break;
|
||||
case 6:
|
||||
$status_desc = "Processing invoice";
|
||||
break;
|
||||
default:
|
||||
$biastatus_desc = "";
|
||||
}
|
||||
$booking->status_desc = $status_desc;
|
||||
}
|
||||
|
||||
return $bookings;
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id', $id)->first();
|
||||
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
|
||||
if (!$booking){
|
||||
return response()->json(['success'=>false, 'message'=>'not found'], 404);
|
||||
}
|
||||
return $booking;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
|
||||
$rates = Rate::all()->last();
|
||||
$rates = Rate::orderby('updated_at','desc')->first();
|
||||
$term = $request->input('term');
|
||||
$rate = 1;
|
||||
$amount = $request->input("amount");
|
||||
$user = Auth::user();
|
||||
$rate = 1; // default rate to 1
|
||||
|
||||
switch($term){
|
||||
switch ($term) {
|
||||
case "x1_cash":
|
||||
$rate = $rates->x1_cash;
|
||||
$rate = $rates->x1_cash;
|
||||
break;
|
||||
case "x1_cheque":
|
||||
$rate = $rates->x1_cheque;
|
||||
$rate = $rates->x1_cheque;
|
||||
break;
|
||||
case "x1_ba":
|
||||
$rate = $rates->x1_ba;
|
||||
break;
|
||||
case "x2_cash":
|
||||
$rate = $rates->x2_cash;
|
||||
$rate = $rates->x2_cash;
|
||||
break;
|
||||
case "x2_cheque":
|
||||
$rate = $rates->x2_cheque;
|
||||
$rate = $rates->x2_cheque;
|
||||
break;
|
||||
case "x2_ba":
|
||||
$rate = $rates->x2_ba;
|
||||
break;
|
||||
default:
|
||||
return response()->json(["success"=>false, "message"=>"Term not found"], 400);
|
||||
|
||||
//$rate = "no";
|
||||
return Response::json(array(
|
||||
'code' => 422,
|
||||
'message' => 'Invalid input'
|
||||
), 422);
|
||||
break;
|
||||
}
|
||||
|
||||
//Calculation part
|
||||
// $bookings = Booking::all();
|
||||
$amount = $request->input("amount");
|
||||
$svcharge=20.00;
|
||||
$bia = round(($amount + ($svcharge / $rate)), 2);
|
||||
|
||||
$amount = $request->input("amount");
|
||||
if ($amount >= 10000 && ($term == 'x2_cash' || $term = 'x2_cheque' || $term = 'x2_ba')) {
|
||||
$svcharge = 0;
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Invalid input',
|
||||
], 422);
|
||||
break;
|
||||
}
|
||||
|
||||
// Service charge (RMB) : if amount higher than 10,000, no service charge. if amount lower than 10,000, 20.00 service charge
|
||||
if ($amount >= 10000 && ($term == 'x2_cash' || $term = 'x2_cheque' || $term = 'x2_ba')) {
|
||||
$svcharge = 0;
|
||||
} else {
|
||||
$svcharge = 20.00;
|
||||
}
|
||||
else {
|
||||
$svcharge = 20.00;
|
||||
}
|
||||
|
||||
$bia = round(($amount + $svcharge) / $rate + (0*($amount + $svcharge)), 2);
|
||||
//gst = 0.00% -> (0*($amount + $svcharge))
|
||||
//bia = bank in amount in MYR
|
||||
// initial rmb to myr amount
|
||||
$RMBinMYR = (($amount + $svcharge) / $rate);
|
||||
|
||||
// return $bia;
|
||||
$user = Auth::user();
|
||||
$booking = new Booking();
|
||||
$booking->account_name = $request->input('account_name');
|
||||
$booking->account_num = $request->input('account_num');
|
||||
$booking->bank_name = $request->input('bank_name');
|
||||
$booking->bank_branch = $request->input('bank_branch');
|
||||
// $booking->company_name = $request->input('company_name');
|
||||
// $booking->company_address = $request->input('company_address');
|
||||
// $booking->bank_address = $request->input('bank_address');
|
||||
// $booking->swift_code = $request->input('swift_code');
|
||||
// $booking->cnap = $request->input('cnap');
|
||||
$booking->term = $term;
|
||||
$booking->amount = $amount;
|
||||
$booking->rate_id = $rate;
|
||||
// TODO : Should be remove this ?
|
||||
// gst 0%
|
||||
$gst = 0 * $RMBinMYR;
|
||||
|
||||
$booking->rmb_book_amount = $request->input('rmb_book_amount');
|
||||
$booking->rmb_book_pay_method = $request->input('rmb_book_pay_method');
|
||||
$booking->rmb_book_account_name = $request->input('rmb_book_account_name');
|
||||
$booking->rmb_book_acc_no = $request->input('rmb_book_acc_no');
|
||||
$booking->rmb_book_bank_branch = $request->input('rmb_book_bank_branch');
|
||||
// Sales tax : 10 %
|
||||
$sales_tax = 0.10 * $RMBinMYR;
|
||||
|
||||
$booking->usd_book_amount = $request->input('usd_book_amount');
|
||||
$booking->usd_book_pay_method = $request->input('usd_book_pay_method');
|
||||
$booking->usd_book_company_name = $request->input('usd_book_company_name');
|
||||
$booking->usd_book_company_address = $request->input('usd_book_company_address');
|
||||
$booking->usd_book_swift_code = $request->input('usd_book_swift_code');
|
||||
$booking->usd_book_cnap = $request->input('usd_book_cnap');
|
||||
$booking->usd_book_bank_branch = $request->input('usd_book_bank_branch');
|
||||
$booking->verification_status = $request->input('verification_status');
|
||||
// Billing fees : 1.5%
|
||||
$billing = 0.015 * $RMBinMYR;
|
||||
|
||||
$booking->user()->associate($user);
|
||||
//$booking->user_id = $request->input('user_id');
|
||||
$booking->bia = $bia;
|
||||
$booking->save();
|
||||
// Bank in amount
|
||||
$bia = round($RMBinMYR + $gst + $sales_tax + $billing, 2);
|
||||
|
||||
// return false;
|
||||
//$booking = Booking::create($request->all());
|
||||
return ['redirect' => route('upload')];
|
||||
// return response()->json($booking, 201);
|
||||
$booking = new Booking();
|
||||
$booking->account_name = $request->input('account_name');
|
||||
$booking->account_num = $request->input('account_num');
|
||||
$booking->bank_name = $request->input('bank_name');
|
||||
$booking->bank_branch = $request->input('bank_branch');
|
||||
$booking->amount = $request->input('amount');
|
||||
$booking->term = $term;
|
||||
$booking->rate_id = $rates->id;
|
||||
$booking->rate = $rate;
|
||||
$booking->rmb_book_amount = $request->input('amount');
|
||||
$booking->status = 2;
|
||||
$booking->bia = $bia;
|
||||
// $booking->user_id = $user->id;
|
||||
$booking->user()->associate($user);
|
||||
|
||||
|
||||
// The test failed due to ->save() before filling up the information at below
|
||||
|
||||
// TODO : handle RMB, MYR and USD (we can use exchange type: USDtoMYR, RMBtoMYR vise versa to switch case)
|
||||
// $booking->rmb_book_pay_method = $request->input('payment_method');
|
||||
// $booking->rmb_book_account_name = $request->input('rmb_book_account_name');
|
||||
// $booking->rmb_book_acc_no = $request->input('rmb_book_acc_no');
|
||||
// $booking->rmb_book_bank_branch = $request->input('rmb_book_bank_branch');
|
||||
// $booking->company_name = $request->input('company_name');
|
||||
// $booking->company_address = $request->input('company_address');
|
||||
// $booking->bank_address = $request->input('bank_address');
|
||||
// $booking->swift_code = $request->input('swift_code');
|
||||
// $booking->cnap = $request->input('cnap');
|
||||
// $booking->term = $request->input('term');
|
||||
|
||||
// $booking->usd_book_amount = $request->input('usd_book_amount');
|
||||
// $booking->usd_book_pay_method = $request->input('usd_book_pay_method');
|
||||
// $booking->usd_book_company_name = $request->input('usd_book_company_name');
|
||||
// $booking->usd_book_company_address = $request->input('usd_book_company_address');
|
||||
// $booking->usd_book_swift_code = $request->input('usd_book_swift_code');
|
||||
// $booking->usd_book_cnap = $request->input('usd_book_cnap');
|
||||
// $booking->usd_book_bank_branch = $request->input('usd_book_bank_branch');
|
||||
// $booking->verification_status = $request->input('verification_status');
|
||||
$booking->save();
|
||||
return response()->json($booking, 201);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
//public function show($id)
|
||||
//{
|
||||
// $booking = Booking::find($id);
|
||||
// return view('booking.index');
|
||||
//}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
//public function edit($id)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $book_id)
|
||||
{
|
||||
$book_id = Booking::find($book_id);
|
||||
|
||||
//$com_id->id = $request->input('id');
|
||||
$book_id->account_name = $request->input('account_name');
|
||||
$book_id->account_num = $request->input('account_num');
|
||||
$book_id->bank_name = $request->input('bank_name');
|
||||
$book_id->bank_branch = $request->input('bank_branch');
|
||||
$book_id->company_name = $request->input('company_name');
|
||||
$book_id->company_address = $request->input('company_address');
|
||||
$book_id->bank_address = $request->input('bank_address');
|
||||
$book_id->swift_code = $request->input('swift_code');
|
||||
$book_id->cnap = $request->input('cnap');
|
||||
$book_id->save();
|
||||
|
||||
return response()->json(['book_id'=>$book_id],200);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function delete(Booking $book_id)
|
||||
{
|
||||
$book_id->delete($book_id);
|
||||
$book_id = Booking::find($book_id);
|
||||
$book_id->account_name = $request->input('account_name');
|
||||
$book_id->account_num = $request->input('account_num');
|
||||
$book_id->bank_name = $request->input('bank_name');
|
||||
$book_id->bank_branch = $request->input('bank_branch');
|
||||
$book_id->company_name = $request->input('company_name');
|
||||
$book_id->company_address = $request->input('company_address');
|
||||
$book_id->bank_address = $request->input('bank_address');
|
||||
$book_id->swift_code = $request->input('swift_code');
|
||||
$book_id->cnap = $request->input('cnap');
|
||||
$book_id->save();
|
||||
|
||||
return response()->json($book_id, 204);
|
||||
return response()->json(['book_id'=>$book_id],200);
|
||||
}
|
||||
|
||||
public function uploadbankslip(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
|
||||
/* Validation*/
|
||||
if (!$booking)
|
||||
{
|
||||
return response()->json(['message'=>'Access denied'], 200);
|
||||
}
|
||||
|
||||
$validator = Validator::make($request->all(), [
|
||||
'file' => 'image|mimes:jpg,jpeg,bmp,png'
|
||||
]);
|
||||
|
||||
if($validator->fails())
|
||||
{
|
||||
return response()->json(['message'=>'Incorrect format'],200);
|
||||
}
|
||||
|
||||
|
||||
if(!$bankslip_file = $request->file('file'))
|
||||
{
|
||||
return response()->json(['message' => 'No file detected'], 400);
|
||||
}
|
||||
/* End Validation */
|
||||
$filename = $bankslip_file->getClientOriginalName();
|
||||
$ext = $bankslip_file->getClientOriginalExtension();
|
||||
$input['file'] = $filename;
|
||||
|
||||
$unique_name = 'bank_slip_' . md5($filename. time()); // probably not a good idea
|
||||
$unique_image_path = $unique_name. '.' .$ext;
|
||||
Storage::putFileAs(
|
||||
'user_bankslip', $bankslip_file, $unique_image_path
|
||||
);
|
||||
|
||||
$user_bankslip = new UserBankSlip;
|
||||
$user_bankslip->booking_id = $booking->id;
|
||||
$user_bankslip->bankslip_path = $unique_image_path;
|
||||
$user_bankslip->transfer_amount = $request->input('transfer_amount');
|
||||
$user_bankslip->save();
|
||||
|
||||
|
||||
return response()->json(['message'=>"Success"],200);
|
||||
}
|
||||
|
||||
public function updateBankSlipAmount(Request $request, $id){
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
$user_bankslip = $booking->userBankSlip()->first();
|
||||
|
||||
if(!$user_bankslip){
|
||||
return response()->json(["message"=> "not found"],400);
|
||||
}
|
||||
$user_bankslip->transfer_amount = $request->input('transfer_amount');
|
||||
$user_bankslip->save();
|
||||
return response()->json(["message"=> "Success"],200);
|
||||
}
|
||||
|
||||
public function uploadPurchaseOrder(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
|
||||
/* Validation */
|
||||
if (!$booking)
|
||||
{
|
||||
return response()->json(['message'=>'Access denied'], 200);
|
||||
}
|
||||
|
||||
$validator = Validator::make($request->all(), [
|
||||
'file' => 'image|mimes:jpg,jpeg,bmp,png'
|
||||
]);
|
||||
|
||||
if($validator->fails())
|
||||
{
|
||||
return response()->json(['message'=>'Incorrect format'],200);
|
||||
}
|
||||
|
||||
if(!$user_input_file = $request->file('file'))
|
||||
{
|
||||
return response()->json(['message' => 'No file detected'], 400);
|
||||
}
|
||||
/* End Validation */
|
||||
|
||||
$filename = $user_input_file->getClientOriginalName();
|
||||
$ext = $user_input_file->getClientOriginalExtension();
|
||||
|
||||
$input['file'] = $filename;
|
||||
$unique_name = 'purchase_order_' . md5($filename. time());
|
||||
$unique_image_path = $unique_name. '.' .$ext;
|
||||
Storage::putFileAs(
|
||||
'purchase_order',/*folder name*/ $user_input_file, $unique_image_path
|
||||
);
|
||||
|
||||
$user_po = new PurchaseOrder;
|
||||
$user_po->image_path = $unique_image_path;
|
||||
$user_po->book_id = $booking->id;
|
||||
$user_po->save();
|
||||
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
|
||||
public function confirmPurchaseOrder($id){
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
$booking->status = 5;
|
||||
$booking->save();
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
|
||||
public function delete(Booking $book_id)
|
||||
{
|
||||
$booking = Booking::where('user_id', Auth::user())->where('id', $book_id)->firstOrFail();
|
||||
$booking->delete($book_id);
|
||||
return response()->json($book_id, 204);
|
||||
}
|
||||
|
||||
public function cancel(Request $request, $book_id)
|
||||
{
|
||||
if (!$booking = Booking::where('user_id',Auth::user()->id)->where('id',$book_id)->first())
|
||||
{
|
||||
return response()->json(['message'=>'Access denied'], 200);
|
||||
}
|
||||
|
||||
$booking->is_cancel = true;
|
||||
$booking->save();
|
||||
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
|
||||
public function calculation(Request $request)
|
||||
{
|
||||
$amount = $request->input('amount');
|
||||
$term = $request->input('term');
|
||||
$china_beneficiary = $request->input('china_beneficiary');
|
||||
$rates = Rate::orderby('updated_at','desc')->first();
|
||||
|
||||
// TODO : get marking
|
||||
$marking = "123X";
|
||||
|
||||
switch ($term) {
|
||||
case "x1_cash":
|
||||
$rate = $rates->x1_cash;
|
||||
$payment_method = "cash";
|
||||
break;
|
||||
case "x1_cheque":
|
||||
$rate = $rates->x1_cheque;
|
||||
$payment_method = "Cheque";
|
||||
break;
|
||||
case "x1_ba":
|
||||
$rate = $rates->x1_ba;
|
||||
$payment_method = "BA";
|
||||
break;
|
||||
case "x2_cash":
|
||||
$rate = $rates->x2_cash;
|
||||
$payment_method = "Cash";
|
||||
break;
|
||||
case "x2_cheque":
|
||||
$rate = $rates->x2_cheque;
|
||||
$payment_method = "Cheque";
|
||||
break;
|
||||
case "x2_ba":
|
||||
$rate = $rates->x2_ba;
|
||||
$payment_method = "BA";
|
||||
break;
|
||||
default:
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Invalid input',
|
||||
], 422);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($amount >= 10000 && ($term == 'x2_cash' || $term = 'x2_cheque' || $term = 'x2_ba')) {
|
||||
$svcharge = 0;
|
||||
} else {
|
||||
$svcharge = 20.00;
|
||||
}
|
||||
|
||||
$bankin_amount = round(($amount + $svcharge) / $rate + (0 * ($amount + $svcharge)), 2);
|
||||
|
||||
return response()->json([
|
||||
'date' => date('Y-m-d'),
|
||||
'marking' => $marking,
|
||||
'amount' => $amount,
|
||||
'payment_method' => $payment_method,
|
||||
'service_charge' => $svcharge,
|
||||
'rate' => $rate,
|
||||
'bankin_amount' => $bankin_amount,
|
||||
'china_beneficary' => $china_beneficiary
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function approveBankSlip(Request $request, $book_id)
|
||||
{
|
||||
if (!$booking = Booking::where('user_id',Auth::user()->id)->where('id',$book_id)->first())
|
||||
{
|
||||
return response()->json(['message'=>'Access denied'], 200);
|
||||
}
|
||||
|
||||
if(!$userBankSlip = UserBankSlip::where('book_id',$booking->id)->first())
|
||||
{
|
||||
return response()->json(['message'=>'Access denied'], 200);
|
||||
}
|
||||
|
||||
// Rejected bankslip cannot be approve again
|
||||
if($userBankSlip->is_reject == 1)
|
||||
{
|
||||
return response()->json(['message'=>'Bankslip already rejected'],200);
|
||||
}
|
||||
|
||||
$userBankSlip->is_approve = 1;
|
||||
$userBankSlip->save();
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
|
||||
public function rejectBankSlip(Request $request, $book_id)
|
||||
{
|
||||
if (!$booking = Booking::where('user_id',Auth::user()->id)->where('id',$book_id)->first())
|
||||
{
|
||||
return response()->json(['message'=>'Access denied'], 200);
|
||||
}
|
||||
|
||||
if(!$userBankSlip = UserBankSlip::where('book_id',$booking->id)->first())
|
||||
{
|
||||
return response()->json(['message'=>'Access denied'], 200);
|
||||
}
|
||||
|
||||
// approved bankslip cannot be reject again
|
||||
if($userBankSlip->is_approve == 1)
|
||||
{
|
||||
return response()->json(['message'=>'Bankslip already approved'],200);
|
||||
}
|
||||
|
||||
$userBankSlip->is_reject = 1;
|
||||
$userBankSlip->reject_reason = $request->reject_reason;
|
||||
$userBankSlip->save();
|
||||
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
|
||||
public function uploadInvoice(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
|
||||
/* Validation */
|
||||
if (!$booking)
|
||||
{
|
||||
return response()->json(['message'=>'Access denied'], 200);
|
||||
}
|
||||
|
||||
$validator = Validator::make($request->all(), [
|
||||
'invoice_path' => 'mimes:jpg,jpeg,bmp,png,pdf,doc,docx'
|
||||
]);
|
||||
|
||||
if($validator->fails())
|
||||
{
|
||||
return response()->json(['message'=>'Incorrect format'],200);
|
||||
}
|
||||
|
||||
if(!$input_file = $request->file('invoice_path'))
|
||||
{
|
||||
return response()->json(['message'=>'No file detected'], 400);
|
||||
}
|
||||
/* End Validation */
|
||||
|
||||
$filename = $input_file->getClientOriginalName();
|
||||
$ext = $input_file->getClientOriginalExtension();
|
||||
|
||||
$input['invoice_path'] = $filename;
|
||||
$unique_name = 'invoice' . md5($filename. time());
|
||||
$unique_file_url = $unique_name. '.' .$ext;
|
||||
Storage::putFileAs(
|
||||
'invoice',/*folder name*/ $input_file, $unique_file_url
|
||||
);
|
||||
|
||||
$invoice = new Invoice;
|
||||
$invoice->invoice_path = $unique_file_url;
|
||||
$invoice->amount = $request->input('amount');
|
||||
$invoice->booking_id = $booking->id;
|
||||
$invoice->save();
|
||||
|
||||
return response()->json(['message'=>"Success"],200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('home');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Marking;
|
||||
|
||||
class MarkingController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return Marking::all();
|
||||
}
|
||||
|
||||
public function show(Marking $marking)
|
||||
{
|
||||
return $marking;
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$marking = Marking::create($request->all());
|
||||
|
||||
return response()->json($marking, 201);
|
||||
}
|
||||
|
||||
public function update(Request $request, Marking $marking)
|
||||
{
|
||||
$marking->update($request->all());
|
||||
|
||||
return response()->json($marking, 200);
|
||||
}
|
||||
|
||||
public function delete(Marking $marking)
|
||||
{
|
||||
$marking->delete();
|
||||
|
||||
return response()->json(null, 204);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\ChinaBankSlip $chinaBankSlip
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Request $request)
|
||||
{
|
||||
return $request->user();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class WelcomeController extends Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\ChinaBankSlip $chinaBankSlip
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('index');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Invoice extends Model
|
||||
{
|
||||
protected $fillable = ['invoice_url','amount','booking_id'];
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Marking extends Model
|
||||
{
|
||||
protected $fillable = ['email','marking'];
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PurchaseOrder extends Model
|
||||
{
|
||||
protected $fillable = ['image_url','amount','booking_id'];
|
||||
}
|
||||
+1
-1
@@ -99,7 +99,7 @@ class User extends Authenticatable implements JWTSubject
|
||||
}
|
||||
|
||||
public function booking(){
|
||||
return $this->hasMany('App\Booking');
|
||||
return $this->hasMany(Booking::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UserBankSlip extends Model
|
||||
{
|
||||
protected $fillable = ['bank_slip_type','bankslip_url','transfer_amount','booking_id','cust_marking'];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -6,14 +6,15 @@
|
||||
"type": "project",
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"doctrine/dbal": "^2.7",
|
||||
"fideloper/proxy": "^4.0",
|
||||
"intervention/image": "^2.4",
|
||||
"laravel/framework": "5.6.*",
|
||||
"laravel/socialite": "^3.0",
|
||||
"laravel/tinker": "~1.0",
|
||||
"laravelcollective/html": "^5.6",
|
||||
"tymon/jwt-auth": "^1.0.0-rc.2",
|
||||
"zizaco/entrust": "dev-master",
|
||||
"laravelcollective/html": "^5.6"
|
||||
"zizaco/entrust": "dev-master"
|
||||
},
|
||||
"require-dev": {
|
||||
"filp/whoops": "^2.0",
|
||||
|
||||
Generated
+368
-11
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "be0b3eae101bbe8134154fd539fdafaa",
|
||||
"content-hash": "3f411d272d823b9e69fdedb77a2abf73",
|
||||
"packages": [
|
||||
{
|
||||
"name": "dnoegel/php-xdg-base-dir",
|
||||
@@ -39,6 +39,363 @@
|
||||
"description": "implementation of xdg base directory specification for php",
|
||||
"time": "2014-10-24T07:27:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/annotations",
|
||||
"version": "v1.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/annotations.git",
|
||||
"reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5",
|
||||
"reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/lexer": "1.*",
|
||||
"php": "^7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/cache": "1.*",
|
||||
"phpunit/phpunit": "^6.4"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.6.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Docblock Annotations Parser",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"annotations",
|
||||
"docblock",
|
||||
"parser"
|
||||
],
|
||||
"time": "2017-12-06T07:11:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/cache",
|
||||
"version": "v1.7.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/cache.git",
|
||||
"reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/cache/zipball/b3217d58609e9c8e661cd41357a54d926c4a2a1a",
|
||||
"reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "~7.1"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/common": ">2.2,<2.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"alcaeus/mongo-php-adapter": "^1.1",
|
||||
"mongodb/mongodb": "^1.1",
|
||||
"phpunit/phpunit": "^5.7",
|
||||
"predis/predis": "~1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.7.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Caching library offering an object-oriented API for many cache backends",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"caching"
|
||||
],
|
||||
"time": "2017-08-25T07:02:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/collections",
|
||||
"version": "v1.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/collections.git",
|
||||
"reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf",
|
||||
"reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/coding-standard": "~0.1@dev",
|
||||
"phpunit/phpunit": "^5.7"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Doctrine\\Common\\Collections\\": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Collections Abstraction library",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"array",
|
||||
"collections",
|
||||
"iterator"
|
||||
],
|
||||
"time": "2017-07-22T10:37:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/common",
|
||||
"version": "v2.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/common.git",
|
||||
"reference": "f68c297ce6455e8fd794aa8ffaf9fa458f6ade66"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/common/zipball/f68c297ce6455e8fd794aa8ffaf9fa458f6ade66",
|
||||
"reference": "f68c297ce6455e8fd794aa8ffaf9fa458f6ade66",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/annotations": "1.*",
|
||||
"doctrine/cache": "1.*",
|
||||
"doctrine/collections": "1.*",
|
||||
"doctrine/inflector": "1.*",
|
||||
"doctrine/lexer": "1.*",
|
||||
"php": "~7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5.7"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.8.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Doctrine\\Common\\": "lib/Doctrine/Common"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Johannes Schmitt",
|
||||
"email": "schmittjoh@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Common Library for Doctrine projects",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"annotations",
|
||||
"collections",
|
||||
"eventmanager",
|
||||
"persistence",
|
||||
"spl"
|
||||
],
|
||||
"time": "2017-08-31T08:43:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/dbal",
|
||||
"version": "v2.7.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/dbal.git",
|
||||
"reference": "11037b4352c008373561dc6fc836834eed80c3b5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/dbal/zipball/11037b4352c008373561dc6fc836834eed80c3b5",
|
||||
"reference": "11037b4352c008373561dc6fc836834eed80c3b5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/common": "^2.7.1",
|
||||
"ext-pdo": "*",
|
||||
"php": "^7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/coding-standard": "^4.0",
|
||||
"phpunit/phpunit": "^7.0",
|
||||
"phpunit/phpunit-mock-objects": "!=3.2.4,!=3.2.5",
|
||||
"symfony/console": "^2.0.5||^3.0",
|
||||
"symfony/phpunit-bridge": "^3.4.5|^4.0.5"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/console": "For helpful console commands such as SQL execution and import of files."
|
||||
},
|
||||
"bin": [
|
||||
"bin/doctrine-dbal"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Doctrine\\DBAL\\": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Roman Borschel",
|
||||
"email": "roman@code-factory.org"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Eberlei",
|
||||
"email": "kontakt@beberlei.de"
|
||||
},
|
||||
{
|
||||
"name": "Guilherme Blanco",
|
||||
"email": "guilhermeblanco@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Database Abstraction Layer",
|
||||
"homepage": "http://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"database",
|
||||
"dbal",
|
||||
"persistence",
|
||||
"queryobject"
|
||||
],
|
||||
"time": "2018-04-07T18:44:18+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/inflector",
|
||||
"version": "v1.3.0",
|
||||
@@ -706,16 +1063,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v5.6.24",
|
||||
"version": "v5.6.25",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "56290edeb0d8051826d40b4cbd8ed3c30348b2b5"
|
||||
"reference": "a15efe4fbcd6b38ea76edc5c8939ffde4f4c7b7f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/56290edeb0d8051826d40b4cbd8ed3c30348b2b5",
|
||||
"reference": "56290edeb0d8051826d40b4cbd8ed3c30348b2b5",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/a15efe4fbcd6b38ea76edc5c8939ffde4f4c7b7f",
|
||||
"reference": "a15efe4fbcd6b38ea76edc5c8939ffde4f4c7b7f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -841,7 +1198,7 @@
|
||||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"time": "2018-06-04T14:51:03+00:00"
|
||||
"time": "2018-06-12T14:39:24+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/socialite",
|
||||
@@ -4373,16 +4730,16 @@
|
||||
},
|
||||
{
|
||||
"name": "sebastian/comparator",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/comparator.git",
|
||||
"reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5"
|
||||
"reference": "591a30922f54656695e59b1f39501aec513403da"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ed5fd2281113729f1ebcc64d101ad66028aeb3d5",
|
||||
"reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/591a30922f54656695e59b1f39501aec513403da",
|
||||
"reference": "591a30922f54656695e59b1f39501aec513403da",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4433,7 +4790,7 @@
|
||||
"compare",
|
||||
"equality"
|
||||
],
|
||||
"time": "2018-04-18T13:33:00+00:00"
|
||||
"time": "2018-06-14T15:05:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/diff",
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Booking::class, function (Faker $faker) {
|
||||
$rate_id = App\Rate::pluck('id')->toArray();
|
||||
$user_id = App\User::pluck('id')->toArray();
|
||||
|
||||
return [
|
||||
'account_name' => $faker->name,
|
||||
'account_num' => $faker->unique()->randomDigit,
|
||||
'bank_name' => $faker->name,
|
||||
'bank_branch' => $faker->unique()->address,
|
||||
'company_name' => $faker->name,
|
||||
'company_address' => $faker->unique()->address,
|
||||
'bank_address' => $faker->unique()->address,
|
||||
'swift_code' => $faker->unique()->randomDigit,
|
||||
'cnap' => $faker->randomDigit,
|
||||
'term' => str_random(10),
|
||||
'amount'=> $faker->randomDigit,
|
||||
|
||||
'rate_id' => $faker->randomElement($rate_id),
|
||||
'user_id' => $faker->randomElement($user_id),
|
||||
|
||||
'rmb_book_amount' => $faker->randomDigit,
|
||||
'rmb_book_pay_method' => str_random(10),
|
||||
'rmb_book_account_name' => $faker->name,
|
||||
'rmb_book_acc_no' => $faker->randomDigit,
|
||||
'rmb_book_bank_branch' => $faker->unique()->address,
|
||||
|
||||
'usd_book_amount' => $faker->randomDigit,
|
||||
'usd_book_pay_method'=> str_random(10),
|
||||
'usd_book_company_name'=> $faker->name,
|
||||
'usd_book_company_address' => $faker->unique()->address,
|
||||
'usd_book_swift_code'=> $faker->unique()->randomDigit,
|
||||
'usd_book_cnap' => $faker->randomDigit,
|
||||
'usd_book_bank_branch' => $faker->unique()->address,
|
||||
|
||||
];
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Marking::class, function (Faker $faker) {
|
||||
return [
|
||||
'email' => $faker->unique()->safeEmail,
|
||||
'marking' => str_random(10)
|
||||
];
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\PurchaseOrder::class, function (Faker $faker) {
|
||||
return [
|
||||
//
|
||||
];
|
||||
});
|
||||
@@ -4,6 +4,11 @@ use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Rate::class, function (Faker $faker) {
|
||||
return [
|
||||
//
|
||||
'x1_cash' => $faker->randomDigit,
|
||||
'x1_cheque' => $faker->randomDigit,
|
||||
'x1_ba' => $faker->randomDigit,
|
||||
'x2_cash' => $faker->randomDigit,
|
||||
'x2_cheque' => $faker->randomDigit,
|
||||
'x2_ba' => $faker->randomDigit
|
||||
];
|
||||
});
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\UserBankSlip::class, function (Faker $faker) {
|
||||
$book_id = App\Booking::pluck('id')->toArray();
|
||||
|
||||
return [
|
||||
'bank_slip_type' => str_random(10),
|
||||
'bankslip_path' => str_random(10),
|
||||
'transfer_amount' => $faker->randomDigit,
|
||||
'cust_marking' => str_random(10),
|
||||
'booking_id' => $faker->randomElement($book_id),
|
||||
];
|
||||
});
|
||||
@@ -15,7 +15,7 @@ class CreateChinaBankSlipsTable extends Migration
|
||||
{
|
||||
Schema::create('china_bank_slips', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('bompany_name');
|
||||
$table->string('company_name');
|
||||
$table->string('bank_name');
|
||||
$table->string('acc_no');
|
||||
$table->string('bank_address');
|
||||
|
||||
@@ -15,8 +15,6 @@ class AddBiaInBookingsTable extends Migration
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
$table->double('bia')->default('0');
|
||||
;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class MakeNullableFieldBookingsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
$table->decimal('rmb_book_amount',9,3)->nullable()->change();
|
||||
$table->string('rmb_book_pay_method')->nullable()->change();
|
||||
$table->string('rmb_book_account_name')->nullable()->change();
|
||||
$table->string('rmb_book_bank_name')->nullable()->change();
|
||||
$table->string('rmb_book_acc_no')->nullable()->change();
|
||||
$table->string('rmb_book_bank_branch')->nullable()->change();
|
||||
|
||||
$table->decimal('usd_book_amount', 9,3)->nullable()->change();
|
||||
$table->string('usd_book_pay_method')->nullable()->change();
|
||||
$table->string('usd_book_company_name')->nullable()->change();
|
||||
$table->string('usd_book_company_address')->nullable()->change();
|
||||
$table->string('usd_book_swift_code')->nullable()->change();
|
||||
$table->string('usd_book_cnap')->nullable()->change();
|
||||
$table->string('usd_book_bank_branch')->nullable()->change();
|
||||
$table->boolean('verification_status')->nullable()->change(); // Results in a default value of 1.
|
||||
|
||||
// $table->foreign('status_id')
|
||||
// ->references('id')->on('status')
|
||||
// ->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateUserBankSlipsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('user_bank_slips', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('bank_slip_type')->nullable();
|
||||
$table->string('bankslip_url')->nullable();
|
||||
$table->double('transfer_amount')->nullable();
|
||||
$table->string('cust_marking')->nullable();
|
||||
|
||||
$table->integer('book_id')->unsigned();
|
||||
$table->foreign('book_id')->references('id')->on('bookings');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('user_bank_slips');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreatePurchaseOrdersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('purchase_orders', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('image_url');
|
||||
$table->double('amount');
|
||||
$table->integer('book_id')->unsigned();
|
||||
$table->foreign('book_id')->references('id')->on('bookings');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('purchase_orders');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UpdateUploadBookingBankslip extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('user_bank_slips', function (Blueprint $table) {
|
||||
$table->boolean('is_approve')->default('0');
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('user_bank_slips', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddCancelBookingTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
$table->boolean('is_cancel')->default('0');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
if (Schema::hasColumn('bookings', 'is_cancel')) {
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
// $table->dropColumn('is_cancel');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddRejectUserBankSlipTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('user_bank_slips', function (Blueprint $table) {
|
||||
$table->boolean('is_reject')->default('0');
|
||||
$table->string('reject_reason')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
if (Schema::hasColumn('user_bank_slips', 'is_reject')) {
|
||||
Schema::table('user_bank_slips', function (Blueprint $table) {
|
||||
// $table->dropColumn('is_reject');
|
||||
// $table->dropColumn('reject_reason');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class RenameBookIdToBookingIdInUserbankslipTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('user_bank_slips', function($table)
|
||||
{
|
||||
$table->renameColumn('book_id', 'booking_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateMarkingTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('markings', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('email')->unique();
|
||||
$table->string('marking')->unique();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('marking');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddRateToBooking extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
$table->double('rate')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
$table->dropColumn('rate');
|
||||
// $table->dropColumn('reject_reason');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddStatusToBookingTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
$table->integer('status')->default(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
$table->dropColumn('status');
|
||||
// $table->dropColumn('reject_reason');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateInvoiceTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('invoices', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('invoice_path');
|
||||
$table->double('amount');
|
||||
$table->integer('booking_id')->unsigned();
|
||||
$table->foreign('booking_id')->references('id')->on('bookings');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('invoices');
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class RenameImageurlToImagepathInUserbankslipsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('user_bank_slips', function($table)
|
||||
{
|
||||
$table->renameColumn('bankslip_url', 'bankslip_path');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class RenameImageurlToImagepathInPurchaseordersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('purchase_orders', function($table)
|
||||
{
|
||||
$table->renameColumn('image_url', 'image_path');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class RemoveAmountcolumnFromPoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('purchase_orders', function (Blueprint $table) {
|
||||
$table->dropColumn('amount');
|
||||
// $table->dropColumn('reject_reason');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('purchase_orders', function (Blueprint $table) {
|
||||
$table->double('amount');
|
||||
// $table->dropColumn('reject_reason');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,9 @@
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">./app</directory>
|
||||
<exclude>
|
||||
<file>./app/Http/routes.php</file>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<php>
|
||||
@@ -31,5 +34,6 @@
|
||||
<env name="MAIL_DRIVER" value="array"/>
|
||||
<env name="DB_CONNECTION" value="sqlite"/>
|
||||
<env name="DB_DATABASE" value=":memory:"/>
|
||||
<ini name="display_errors" value="true"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<el-row>
|
||||
<el-steps v-bind:value="value" :active="value" :alignCenter="true" process-status="wait" finish-status="success">
|
||||
<el-step title="Booking"></el-step>
|
||||
<el-step title="Payment"></el-step>
|
||||
<el-step title="Order Confirmation"></el-step>
|
||||
<el-step title="Processing Transfer"></el-step>
|
||||
<el-step title="Transfer Complete"></el-step>
|
||||
<el-step title="Order Complete"></el-step>
|
||||
</el-steps>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
/* .el-row {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.el-steps {
|
||||
padding-top: 70px;
|
||||
}
|
||||
|
||||
.el-step .el-step__main {
|
||||
transform: translateY(-70px);
|
||||
}
|
||||
.el-step__title.is-wait {
|
||||
font-size: 10pt;
|
||||
}
|
||||
.el-step__title {
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.el-step .is-success .el-step__line {
|
||||
background-color: #67c23a;
|
||||
} */
|
||||
</style>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['value'],
|
||||
data: () => ({
|
||||
status: 1
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@@ -4,7 +4,7 @@ export default async (to, from, next) => {
|
||||
if (!store.getters['auth/check']) {
|
||||
next({ name: 'login' })
|
||||
} else if (store.getters['auth/user'].role === 'admin') {
|
||||
next({ name: 'home' })
|
||||
next({ name: 'admin.home' })
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
|
||||
@@ -80,34 +80,37 @@ export default {
|
||||
|
||||
methods: {
|
||||
async login () {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Logging in',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
setTimeout(() => {
|
||||
loading.close();
|
||||
}, 1500);
|
||||
|
||||
|
||||
// Submit the form.
|
||||
const { data } = await this.form.post('/api/login')
|
||||
|
||||
|
||||
// Add loading screen
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Logging in',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
// Save the token.
|
||||
this.$store.dispatch('auth/saveToken', {
|
||||
token: data.token,
|
||||
remember: this.remember
|
||||
remember: this.remember,
|
||||
})
|
||||
|
||||
// Fetch the user.
|
||||
await this.$store.dispatch('auth/fetchUser')
|
||||
|
||||
|
||||
|
||||
// Redirect home.
|
||||
if(store.getters['auth/user'].role === 'admin'){
|
||||
if (store.getters['auth/user'].role === 'admin') {
|
||||
this.$router.push({ name: 'admin.home' })
|
||||
loading.close()
|
||||
}
|
||||
this.$router.push({ name: 'home' })
|
||||
loading.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,10 +96,9 @@ export default {
|
||||
await this.$store.dispatch('auth/updateUser', { user: data })
|
||||
|
||||
// Redirect home.
|
||||
if(store.getters['auth/user'].role === 'admin'){
|
||||
if (store.getters['auth/user'].role === 'admin') {
|
||||
this.$router.push({ name: 'admin.home' })
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
this.$router.push({ name: 'home' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<progress-track v-model="status"></progress-track>
|
||||
|
||||
<div align="center">
|
||||
<h4 style="margin-top:5%;">Order Completed</h4>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<!-- upload card -->
|
||||
<br>
|
||||
<el-row :gutter="12" justify="center" align="center">
|
||||
<el-col :span="8">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Purchase Order</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row type="flex" :gutter="12">
|
||||
<el-col :span="12">
|
||||
<a target=" _blank" href="https://placeholder.com">
|
||||
<img width="100%" height="100%" src="http://via.placeholder.com/700x800">
|
||||
</a>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Invoice</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row type="flex" :gutter="12">
|
||||
<el-col :span="12">
|
||||
<a target=" _blank" href="https://placeholder.com">
|
||||
<img width="100%" height="100%" src="http://via.placeholder.com/700x800">
|
||||
</a>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>China Bank Slip</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row type="flex" :gutter="12">
|
||||
<el-col :span="12">
|
||||
<a target=" _blank" href="https://placeholder.com">
|
||||
<img width="100%" height="100%" src="http://via.placeholder.com/700x800">
|
||||
</a>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<br>
|
||||
|
||||
<!-- order details -->
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Order Details</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable" align="center" :show-header="false">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable2" align="center" :show-header="false">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-row>
|
||||
<br>
|
||||
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Order Bankin Slip</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="22" style="text-align:center">
|
||||
<img src="http://via.placeholder.com/600x400" class="image">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</template>
|
||||
<style>
|
||||
.booking-details {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import VueCountdown from '@dmaksimovic/vue-countdown'
|
||||
import ProgressTrack from '~/components/ProgressTrack'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 6,
|
||||
bookingConfirmTable: [{
|
||||
data1: 'Order Number :',
|
||||
data2: '001'
|
||||
}, {
|
||||
data1: 'Date :',
|
||||
data2: '25/5/2018'
|
||||
}, {
|
||||
data1: 'Customer Marking :',
|
||||
data2: 'CIEF/150ECE'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}, {
|
||||
data1: 'Payment Method :',
|
||||
data2: 'Cash/Bank Transfer'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}],
|
||||
bookingConfirmTable2: [{
|
||||
data1: 'CNY/RMB :',
|
||||
data2: 'CNY 120,500.00'
|
||||
}, {
|
||||
data1: '+ Service Charge :',
|
||||
data2: 'CNY 20.00'
|
||||
}, {
|
||||
data1: '/ RATE :',
|
||||
data2: '1.63'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: 'MYR 73,848.04'
|
||||
}, {
|
||||
data1: '+ GST 6% :',
|
||||
data2: 'MYR 4,430.88'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: 'MYR 78,278.92'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<progress-track v-model="status"></progress-track>
|
||||
|
||||
<div align="center">
|
||||
<h4 style="margin-top:5%;">Bankin Slip Verification In Progress</h4>
|
||||
<br>
|
||||
<el-button type="primary" @click="$router.go(-1)">Go Back</el-button>
|
||||
</div>
|
||||
<br>
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Order Details</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable" align="center" :show-header="false">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable2" align="center" :show-header="false">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-row>
|
||||
<br>
|
||||
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>BankinSlip</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="22" style="text-align:center">
|
||||
<img src="http://via.placeholder.com/600x400" class="image">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</template>
|
||||
<style>
|
||||
.booking-details {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import VueCountdown from '@dmaksimovic/vue-countdown'
|
||||
import ProgressTrack from '~/components/ProgressTrack'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 3,
|
||||
bookingConfirmTable: [{
|
||||
data1: 'Order Number :',
|
||||
data2: '001'
|
||||
}, {
|
||||
data1: 'Date :',
|
||||
data2: '25/5/2018'
|
||||
}, {
|
||||
data1: 'Customer Marking :',
|
||||
data2: 'CIEF/150ECE'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}, {
|
||||
data1: 'Payment Method :',
|
||||
data2: 'Cash/Bank Transfer'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}],
|
||||
bookingConfirmTable2:[{
|
||||
data1: 'CNY/RMB :',
|
||||
data2: 'CNY 120,500.00'
|
||||
}, {
|
||||
data1: '+ Service Charge :',
|
||||
data2: 'CNY 20.00'
|
||||
}, {
|
||||
data1: '/ RATE :',
|
||||
data2: '1.63'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: 'MYR 73,848.04'
|
||||
}, {
|
||||
data1: '+ GST 6% :',
|
||||
data2: 'MYR 4,430.88'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: 'MYR 78,278.92'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<progress-track v-model="status"></progress-track>
|
||||
|
||||
<div align="center">
|
||||
<h4 style="margin-top:5%;">Processing Invoice</h4>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<!-- upload card -->
|
||||
<br>
|
||||
<el-row :gutter="12" justify="center" align="center">
|
||||
<el-col :span="12">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Purchase Order</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row type="flex" :gutter="12">
|
||||
<el-col :span="12">
|
||||
<a target=" _blank" href="https://placeholder.com">
|
||||
<img width="100%" height="100%" src="http://via.placeholder.com/700x800">
|
||||
</a>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>China Bank Slip</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row type="flex" :gutter="12">
|
||||
<el-col :span="12">
|
||||
<a target=" _blank" href="https://placeholder.com">
|
||||
<img width="100%" height="100%" src="http://via.placeholder.com/700x800">
|
||||
</a>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<br>
|
||||
|
||||
<!-- order details -->
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Order Details</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable" align="center" :show-header="false">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable2" align="center" :show-header="false">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-row>
|
||||
<br>
|
||||
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Order Bankin Slip</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="22" style="text-align:center">
|
||||
<img src="http://via.placeholder.com/600x400" class="image">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</template>
|
||||
<style>
|
||||
.booking-details {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import VueCountdown from '@dmaksimovic/vue-countdown'
|
||||
import ProgressTrack from '~/components/ProgressTrack'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 5,
|
||||
bookingConfirmTable: [{
|
||||
data1: 'Order Number :',
|
||||
data2: '001'
|
||||
}, {
|
||||
data1: 'Date :',
|
||||
data2: '25/5/2018'
|
||||
}, {
|
||||
data1: 'Customer Marking :',
|
||||
data2: 'CIEF/150ECE'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}, {
|
||||
data1: 'Payment Method :',
|
||||
data2: 'Cash/Bank Transfer'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}],
|
||||
bookingConfirmTable2: [{
|
||||
data1: 'CNY/RMB :',
|
||||
data2: 'CNY 120,500.00'
|
||||
}, {
|
||||
data1: '+ Service Charge :',
|
||||
data2: 'CNY 20.00'
|
||||
}, {
|
||||
data1: '/ RATE :',
|
||||
data2: '1.63'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: 'MYR 73,848.04'
|
||||
}, {
|
||||
data1: '+ GST 6% :',
|
||||
data2: 'MYR 4,430.88'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: 'MYR 78,278.92'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,117 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<progress-track v-model="status"></progress-track>
|
||||
|
||||
<div align="center">
|
||||
<h4 style="margin-top:5%;">Transfer In Progress</h4>
|
||||
<br>
|
||||
<h5> ETA : 3 days 14 Hours </h5>
|
||||
<br>
|
||||
<el-button type="primary" @click="$router.go(-1)">Go Back</el-button>
|
||||
</div>
|
||||
<br>
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Order Details</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable" align="center" :show-header="false">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable2" align="center" :show-header="false">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-row>
|
||||
<br>
|
||||
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>BankinSlip</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="22" style="text-align:center">
|
||||
<img src="http://via.placeholder.com/600x400" class="image">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</template>
|
||||
<style>
|
||||
.booking-details {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import VueCountdown from '@dmaksimovic/vue-countdown'
|
||||
import ProgressTrack from '~/components/ProgressTrack'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 4,
|
||||
bookingConfirmTable: [{
|
||||
data1: 'Order Number :',
|
||||
data2: '001'
|
||||
}, {
|
||||
data1: 'Date :',
|
||||
data2: '25/5/2018'
|
||||
}, {
|
||||
data1: 'Customer Marking :',
|
||||
data2: 'CIEF/150ECE'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}, {
|
||||
data1: 'Payment Method :',
|
||||
data2: 'Cash/Bank Transfer'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}],
|
||||
bookingConfirmTable2:[{
|
||||
data1: 'CNY/RMB :',
|
||||
data2: 'CNY 120,500.00'
|
||||
}, {
|
||||
data1: '+ Service Charge :',
|
||||
data2: 'CNY 20.00'
|
||||
}, {
|
||||
data1: '/ RATE :',
|
||||
data2: '1.63'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: 'MYR 73,848.04'
|
||||
}, {
|
||||
data1: '+ GST 6% :',
|
||||
data2: 'MYR 4,430.88'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: 'MYR 78,278.92'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<progress-track v-model="status"></progress-track>
|
||||
|
||||
<div align="center">
|
||||
<h4 style="margin-top:5%;">Transfer Completed</h4>
|
||||
<h5> Please upload your PO </h5>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<!-- upload card -->
|
||||
<br>
|
||||
<el-row :gutter="12" justify="center" align="center">
|
||||
<el-col :span="12">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Upload PO</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
|
||||
<!-- upload image -->
|
||||
<el-upload class="upload-demo" drag v-bind:action="'/api/booking/' + booking_id + '/upload-po'"
|
||||
:on-exceed="handleExceed"
|
||||
:on-preview="handlePreview"
|
||||
:on-remove="handleRemove"
|
||||
multiple>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">Drop file here or
|
||||
<em>click to upload</em>
|
||||
</div>
|
||||
<div class="el-upload__tip" slot="tip">jpg/png/pdf files with a size less than 3mb</div>
|
||||
</el-upload>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="bottom clearfix" style="text-align:right;">
|
||||
<el-button @click="uploadPo" :loading="loading" type="primary">Submit</el-button>
|
||||
</div>
|
||||
<!-- upload image end -->
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>China Bank Slip</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row type="flex" :gutter="12">
|
||||
<el-col :span="12">
|
||||
<a href="https://placeholder.com">
|
||||
<img width="100%" height="100%" src="http://via.placeholder.com/700x800">
|
||||
</a>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<br>
|
||||
|
||||
<!-- order details -->
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Order Details</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable" align="center" :show-header="false">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable2" align="center" :show-header="false">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-row>
|
||||
<br>
|
||||
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Order Bankin Slip</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="22" style="text-align:center">
|
||||
<img src="http://via.placeholder.com/600x400" class="image">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</template>
|
||||
<style>
|
||||
.booking-details {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import VueCountdown from '@dmaksimovic/vue-countdown'
|
||||
import ProgressTrack from '~/components/ProgressTrack'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
booking_id: this.$route.params.id,
|
||||
status: 5,
|
||||
loading: false,
|
||||
bookingConfirmTable: [{
|
||||
data1: 'Order Number :',
|
||||
data2: '001'
|
||||
}, {
|
||||
data1: 'Date :',
|
||||
data2: '25/5/2018'
|
||||
}, {
|
||||
data1: 'Customer Marking :',
|
||||
data2: 'CIEF/150ECE'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}, {
|
||||
data1: 'Payment Method :',
|
||||
data2: 'Cash/Bank Transfer'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}],
|
||||
bookingConfirmTable2: [{
|
||||
data1: 'CNY/RMB :',
|
||||
data2: 'CNY 120,500.00'
|
||||
}, {
|
||||
data1: '+ Service Charge :',
|
||||
data2: 'CNY 20.00'
|
||||
}, {
|
||||
data1: '/ RATE :',
|
||||
data2: '1.63'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: 'MYR 73,848.04'
|
||||
}, {
|
||||
data1: '+ GST 6% :',
|
||||
data2: 'MYR 4,430.88'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: 'MYR 78,278.92'
|
||||
}, {
|
||||
data1: '',
|
||||
data2: ''
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
uploadPo(){
|
||||
this.loading = true
|
||||
axios
|
||||
.post('/api/booking/' + this.$route.params.id + '/confirm-po')
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Your PO has been uploaded. We are processing the Invoice.',
|
||||
type: 'success',
|
||||
duration: 5000,
|
||||
});
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
})
|
||||
this.loading = false
|
||||
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
loading.close()
|
||||
this.$router.push({
|
||||
name: 'notfound'
|
||||
})
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(`The limit is 3, you selected ${files.length} files this time, add up to ${files.length + fileList.length} totally`);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${ file.name }?`);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,238 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<progress-track v-model="status"></progress-track>
|
||||
|
||||
<div align="center">
|
||||
<h4 style="margin-top:5%;">Waiting For Payment</h4>
|
||||
</div>
|
||||
|
||||
<el-row justify="center" align="center">
|
||||
<table class="table-responsive el-table" style="display:table; width:50%; margin: 0 auto;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="el-table_2_column_9 is-right ">Amount : </td>
|
||||
<td class="el-table_2_column_9 is-left ">
|
||||
<b> RMB {{ booking.amount }} </b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="el-table_2_column_9 is-right ">Bankin Amount : </td>
|
||||
<td width="200" class="el-table_2_column_9 is-left ">
|
||||
<b> MYR {{ booking.bankin_amount }} </b>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</el-row>
|
||||
<br>
|
||||
|
||||
|
||||
<!-- action="https://jsonplaceholder.typicode.com/posts/" -->
|
||||
|
||||
|
||||
<div align="center">
|
||||
|
||||
<vue-countdown :countdownend="handleCoutdownend" :time="booking.timeout">
|
||||
<template slot-scope="props">Time Remaining:<br>{{ props.days }} days, {{ props.hours }} hours, {{ props.minutes }} minutes, {{ props.seconds }} seconds.</template>
|
||||
</vue-countdown>
|
||||
<!-- <button v-on:click="startTimer">Start timer</button> -->
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
<!-- upload image -->
|
||||
<el-upload v-bind:action="'/api/booking/' + booking_id + '/upload-user-bankslip'" :on-preview="handlePictureCardPreview" :on-remove="handleRemove"
|
||||
list-type="picture-card" align="center">
|
||||
<i class="el-icon-plus" />
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible">
|
||||
<img :src="dialogImageUrl" width="100%" alt="">
|
||||
</el-dialog>
|
||||
<br>
|
||||
<!-- upload image end -->
|
||||
|
||||
<!-- <el-form label-width="300px">
|
||||
<el-form-item label="Amount (RM) :"> -->
|
||||
<div align="center">
|
||||
Bankin Amount (RM) :
|
||||
<el-form :model="user_slip_form" :rules="rules" ref="user_slip_form">
|
||||
<div align="center">
|
||||
<el-form-item prop="transfer_amount">
|
||||
<el-input v-model="user_slip_form.transfer_amount" type="text" placeholder="Transfer Amount" style="width: 20%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div align="center">
|
||||
<el-button type="primary" :loading="loading" @click="submitUserSlip('user_slip_form')">Submit</el-button>
|
||||
<router-link :to="{ name: 'home' }" class="small ml-auto my-auto">
|
||||
Upload Later
|
||||
</router-link>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
<!-- </el-form-item>
|
||||
</el-form> -->
|
||||
|
||||
|
||||
|
||||
</el-main>
|
||||
</template>
|
||||
<style>
|
||||
.booking-details {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import VueCountdown from '@xkeshi/vue-countdown'
|
||||
import ProgressTrack from '~/components/ProgressTrack'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
middleware: ['auth'],
|
||||
name: 'MyComponent',
|
||||
components: {
|
||||
'vue-countdown': VueCountdown,
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 2,
|
||||
start: false,
|
||||
loading: false,
|
||||
dialogImageUrl: '',
|
||||
dialogVisible: false,
|
||||
booking_id: this.$route.params.id,
|
||||
user_slip_form:{
|
||||
transfer_amount : ''
|
||||
},
|
||||
booking: {
|
||||
amount: '',
|
||||
bankin_amount: '',
|
||||
timeout: 1
|
||||
},
|
||||
rules: {
|
||||
transfer_amount: [{
|
||||
required: true,
|
||||
message: 'Please input amount',
|
||||
trigger: 'change'
|
||||
}, ],}
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Please wait..',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
axios
|
||||
.get('/api/booking/' + this.$route.params.id)
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
this.booking.amount = response.data.amount
|
||||
this.booking.bankin_amount = response.data.bia
|
||||
this.booking.timeout = response.data.timeout * 1000
|
||||
this.start = true;
|
||||
loading.close()
|
||||
|
||||
if(this.booking.timeout < 0 ){
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Booking timeout, please make another booking.',
|
||||
type: 'error',
|
||||
duration: 30000,
|
||||
});
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
})
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
loading.close()
|
||||
this.$router.push({
|
||||
name: 'notfound'
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleCoutdownend(){
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Booking timeout, please make another booking.',
|
||||
type: 'error',
|
||||
duration: 30000,
|
||||
});
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
})
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList)
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitUserSlip(formName) {
|
||||
this.loading = true
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let newConfirmation = {
|
||||
amount: this.booking.amount,
|
||||
term: this.term
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
});
|
||||
let newUserSlip = {
|
||||
transfer_amount : this.user_slip_form.transfer_amount
|
||||
}
|
||||
axios.patch('/api/booking/'+ this.booking_id +'/bankslip-amount', newUserSlip)
|
||||
.then((response) => {
|
||||
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Your bankinslip has been submitted, please wait admin to approve.',
|
||||
type: 'success',
|
||||
duration: 5000,
|
||||
});
|
||||
|
||||
console.log(response)
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
})
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
this.loading = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Please upload your bankin slip first.',
|
||||
type: 'warning',
|
||||
duration: 10000,
|
||||
});
|
||||
console.log(error)
|
||||
return
|
||||
})
|
||||
},
|
||||
handleTimeExpire() {
|
||||
alert('Booking expired')
|
||||
},
|
||||
startTimer() {
|
||||
this.start = true
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -3,7 +3,7 @@
|
||||
<h3 class="mb-4">{{ $t('page_not_found') }}</h3>
|
||||
|
||||
<div class="links">
|
||||
<router-link :to="{ name: 'welcome' }">
|
||||
<router-link :to="{ name: 'home' }">
|
||||
{{ $t('go_home') }}
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
+473
-226
@@ -2,285 +2,532 @@
|
||||
|
||||
<el-main>
|
||||
|
||||
<!-- Input-Amount -->
|
||||
<!-- Input-Amount -->
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col :span="8"><div class="grid-content bg-purple" align="left"><el-input placeholder="Amount" v-model="Booking.amount"></el-input></div></el-col>
|
||||
<el-col :span="10"><div class="grid-content bg-purple" align="center"> <el-select v-model="value" placeholder="MYR">
|
||||
<el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
<el-option v-for="item in options2" :key="item.value2" :label="item.label2" :value="item.value2"></el-option>
|
||||
</el-select></div></el-col>
|
||||
<el-col :span="20">
|
||||
<div class="grid-content bg-purple" align="center">
|
||||
I need :
|
||||
<el-select v-model="value" placeholder="RMB">
|
||||
<el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<!-- <el-option v-for="item in options2" :key="item.value2" :label="item.label2" :value="item.value2" /> -->
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- Input-Amount-end -->
|
||||
<br>
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col :xs="18" :sm="18" :md="8" :lg="8" :xl="8">
|
||||
<div class="grid-content bg-purple" align="left">
|
||||
<el-input v-model="booking.amount" placeholder="Amount" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- Input-Amount-end -->
|
||||
<hr>
|
||||
<!-- Rate-Display -->
|
||||
<br>
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col><div class="grid-content bg-purple" align="right"></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="left"></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">Cash/Bank Transfer</div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">Cheque</div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">BA</div></el-col>
|
||||
</el-row>
|
||||
<!-- Rate-Display -->
|
||||
<br>
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="right" />
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="left" />
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">Cash/Bank Transfer</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">Cheque</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">BA</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col><div class="grid-content bg-purple" align="right"><i type="button" class="el-icon-question" circle></i></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="left">X1 :</div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">1.56</div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">1.64</div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">1.62</div></el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col>
|
||||
<el-tooltip class="item" effect="dark" content="Payment to China Supplier" placement="left">
|
||||
<div class="grid-content bg-purple" align="right">
|
||||
<i type="button" class="el-icon-question" circle/>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<!-- <el-col><div class="grid-content bg-purple" align="right"><i type="button" class="el-icon-question" circle/></div></el-col> -->
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="left">X1 :</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.56</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.64</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.62</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col><div class="grid-content bg-purple"></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple"></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="dialogFormVisible = true, acceptTerm('x1_cash')">Book</el-button></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="dialogFormVisible = true, acceptTerm('x1_cheque')">Book</el-button></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="dialogFormVisible = true, acceptTerm('x1_ba')">Book</el-button></div></el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" />
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" />
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="acceptTerm('x1_cash')">Book</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="acceptTerm('x1_cheque')">Book</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="acceptTerm('x1_ba')">Book</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<br>
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col><div class="grid-content bg-purple" align="right"><i type="button" class="el-icon-question" circle></i></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="left">X2 :</div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">1.56</div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">1.64</div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">1.62</div></el-col>
|
||||
</el-row>
|
||||
<br>
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col>
|
||||
<el-tooltip class="item" effect="dark" content="Payment to China Supplier Only" placement="left">
|
||||
<div class="grid-content bg-purple" align="right">
|
||||
<i type="button" class="el-icon-question" circle/>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="left">X2 :</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.56</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.64</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.62</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col><div class="grid-content bg-purple"></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple"></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="dialogFormVisible = true, acceptTerm('x2_cash')">Book</el-button></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="dialogFormVisible = true, acceptTerm('x2_cheque')">Book</el-button></div></el-col>
|
||||
<el-col><div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="acceptTerm('x2_ba')">Book</el-button></div></el-col>
|
||||
</el-row>
|
||||
<!-- Rate-Display-end -->
|
||||
<el-row :gutter="20" type="flex" justify="center" align="middle">
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" />
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" />
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="acceptTerm('x2_cash')">Book</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="acceptTerm('x2_cheque')">Book</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">
|
||||
<el-button type="text" @click="acceptTerm('x2_ba')">Book</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- Rate-Display-end -->
|
||||
|
||||
<!-- Form_popup -->
|
||||
<el-dialog title="Booking" :visible.sync="dialogFormVisible" center fullscreen:true>
|
||||
<el-form><div align="center">
|
||||
<el-form-item>
|
||||
<el-input type="text" placeholder="China Beneficiary Account" style="width: 80%" v-model="Booking.account_name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input type="text" placeholder="Bank Name / AliPay / WechatPay" style="width: 80%" v-model="Booking.bank_name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input type="text" placeholder="Branch / 分行/支行" style="width: 80%" v-model="Booking.bank_branch"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input type="text" placeholder="Account Number / AliPay_ID / WechatPay_ID" style="width: 80%" v-model="Booking.account_num"></el-input>
|
||||
</el-form-item></div>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">Cancel</el-button>
|
||||
<el-button type="submit" @click="createBooking">Book Now</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- Form_popup-end -->
|
||||
<!-- Form_popup -->
|
||||
<el-dialog :visible.sync="dialogFormVisible" title="Booking" :fullscreen="true" center>
|
||||
<el-form :model="bookingForm" :rules="rules" ref="bookingForm">
|
||||
<div align="center">
|
||||
<el-form-item prop="account_name">
|
||||
<el-input v-model="bookingForm.account_name" placeholder="China Beneficiary Account" style="width: 80%" required="true" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="bank_name">
|
||||
<el-input v-model="bookingForm.bank_name" type="text" placeholder="Bank Name / AliPay / WechatPay" style="width: 80%" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="bank_branch">
|
||||
<el-input v-model="bookingForm.bank_branch" type="text" placeholder="Branch / 分行/支行" style="width: 80%" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="account_num">
|
||||
<el-input v-model="bookingForm.account_num" type="text" placeholder="Account Number / AliPay_ID / WechatPay_ID" style="width: 80%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="dialogFormVisible = false">Cancel</el-button>
|
||||
|
||||
<!-- Booking_confirmation_popup -->
|
||||
<el-dialog title="Booking Confirmation" :visible.sync="dialogFormVisible1" center fullscreen:true>
|
||||
<el-button type="primary" :loading="loading" @click="getCalculationValue('bookingForm')">Book Now</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<!-- Form_popup-end -->
|
||||
|
||||
<!-- Table_booking_confirmation -->
|
||||
<el-table :data="tableData1" align="center">
|
||||
<el-table-column prop="data1" align="right" width="200"></el-table-column>
|
||||
<el-table-column prop="data2" align="left" width="200"></el-table-column>
|
||||
</el-table>
|
||||
<!-- Table_booking_confirmation-end -->
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<!-- <el-button @click="dialogFormVisible = false">Cancel</el-button> -->
|
||||
<el-button type="primary" @click="dialogFormVisible1 = false">Confirm</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- Booking_confirmation_popup -->
|
||||
<!-- Booking_confirmation_popup -->
|
||||
<el-dialog :visible.sync="dialogFormVisible1" title="Booking Confirmation" :fullscreen="true" center>
|
||||
|
||||
<br><br>
|
||||
<hr>
|
||||
<!-- Table_booking_confirmation -->
|
||||
<!-- <el-table :data="bookingConfirmTable" align="center">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table> -->
|
||||
<!-- Table_booking_confirmation-end -->
|
||||
|
||||
<!-- Booking Table -->
|
||||
<el-row :gutter="20" >
|
||||
<div>
|
||||
<el-table>
|
||||
<el-table-column label="Order No" sortable width="106">
|
||||
</el-table-column>
|
||||
<el-table-column label="Date" sortable width="92">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="Term" :filters="[{text: 'X1', value: 'X1'}, {text: 'X2', value: 'X2'}]" :filter-method="filterHandler">
|
||||
<table class="table-responsive el-table" style="display:table; width:80%; margin: 0 auto;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="el-table_2_column_9 is-right ">Date : </td>
|
||||
<td class="el-table_2_column_9 is-left "> {{ bookingConfirmTable.date }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="el-table_2_column_9 is-right ">Customer Marking : </td>
|
||||
<td width="200" class="el-table_2_column_9 is-left "> {{ bookingConfirmTable.marking }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="el-table_2_column_9 is-right ">Payment Method : </td>
|
||||
<td width="200" class="el-table_2_column_9 is-left "> {{ bookingConfirmTable.payment_method }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="el-table_2_column_9 is-right ">CNY/RMB : </td>
|
||||
<td width="200" class="el-table_2_column_9 is-left "> {{ bookingConfirmTable.amount }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="el-table_2_column_9 is-right ">+ Service Charge : </td>
|
||||
<td width="200" class="el-table_2_column_9 is-left "> RMB {{ bookingConfirmTable.service_charge }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="el-table_2_column_9 is-right "> RATE :</td>
|
||||
<td width="200" class="el-table_2_column_9 is-left "> {{ bookingConfirmTable.rate }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="el-table_2_column_9 is-right "> </td>
|
||||
<td width="200" class="el-table_2_column_9 is-left "> RM {{ bookingConfirmTable.bankin_amount }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="el-table_2_column_9 is-right "> </td>
|
||||
<td width="200" class="el-table_2_column_9 is-left "></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="200" class="el-table_2_column_9 is-right ">China Beneficiary Acc :</td>
|
||||
<td width="200" class="el-table_2_column_9 is-left "> {{ bookingConfirmTable.account_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="el-table_2_column_9 is-right ">Bank in Amount :</td>
|
||||
<td width="200" class="el-table_2_column_9 is-left ">
|
||||
<b> RM {{ bookingConfirmTable.bankin_amount }}</b>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<!-- <el-button @click="dialogFormVisible = false">Cancel</el-button> -->
|
||||
<el-button type="primary" :loading="loading" @click="createBooking">Confirm</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- Booking_confirmation_popup -->
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<hr>
|
||||
|
||||
<!-- Booking Table -->
|
||||
<el-row :gutter="20">
|
||||
<div>
|
||||
<el-table :data="bookingTable">
|
||||
<el-table-column label="No." width="100">
|
||||
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">Update</el-button>
|
||||
<el-button type="text" slot-scope="scope" @click="(event) => { BookingStatus(scope.row.status, scope.row.id) }"> {{scope.row.id}}</el-button>
|
||||
</el-table-column>
|
||||
<el-table-column label="DateTime" prop="created_at" width="180" sortable/>
|
||||
<el-table-column label="Term" prop="term" :filters="[{text: 'X1', value: 'X1'}, {text: 'X2', value: 'X2'}]" width="100" :filter-method="filterHandler">
|
||||
</el-table-column> -->
|
||||
<el-table-column label="Rate" sortable width="74">
|
||||
</el-table-column>
|
||||
<el-table-column label="Amount" sortable justify="center" width="98">
|
||||
</el-table-column>
|
||||
<el-table-column label="Transfer Amount (RMB / USD)" :filters="[{text: 'RMB', value: 'RMB'}, {text: 'USD', value: 'USD'}]" :filter-method="filterHandler" width="133">
|
||||
</el-table-column>
|
||||
<el-table-column label="ETA" sortable width="92">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="Payment Method" :filters="[{text: 'Cash', value: 'Cash'}, {text: 'Cheque', value: 'Cheque'}, {text: 'BA', value: 'BA'}]" :filter-method="filterHandler">
|
||||
<el-table-column label="Rate" width="74" prop="rate" />
|
||||
<el-table-column label="Amount" prop="amount" justify="center" width="110" />
|
||||
<el-table-column :filters="[{text: 'RMB', value: 'RMB'}, {text: 'USD', value: 'USD'}]" :filter-method="filterHandler" label="Transfer Amount"
|
||||
prop="transfer_amount" width="170" />
|
||||
<!-- <el-table-column label="ETA" sortable width="100"/> -->
|
||||
<!-- <el-table-column label="Payment Method" :filters="[{text: 'Cash', value: 'Cash'}, {text: 'Cheque', value: 'Cheque'}, {text: 'BA', value: 'BA'}]" :filter-method="filterHandler">
|
||||
</el-table-column> -->
|
||||
<el-table-column label="Status" :filters="[{text: '(1/6)', value: '(1/6) Order Done'}, {text: '(2/6)', value: '(2/6) Waiting for Upload Bank in Slip'}, {text: '(3/6)', value: '(3/6) Order Confirmation'}, {text: '(4/6)', value: '(4/6) Processing Transfer'}, {text: '(5/6)', value: '(5/6) Waiting for Upload PO'}, {text: '(6/6)', value: '(6/6) Order Complete'}]" :filter-method="filterHandler">
|
||||
</el-table-column>
|
||||
<el-table-column label="Balance Amount (RMB/USD)" sortable width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="Time Left" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="Tag" width="82" :filters="[{ text: 'Success', value: 'Success' }, { text: 'Pending', value: 'Pending' }]"
|
||||
:filter-method="filterTag" filter-placement="bottom-end">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.tag === 'Home' ? 'primary' : 'success'" disable-transitions>{{scope.row.tag}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <el-table-column :filters="[{text: '(1/6)', value: '(1/6) Order Done'}, {text: '(2/6)', value: '(2/6) Waiting for Upload Bank in Slip'}, {text: '(3/6)', value: '(3/6) Order Confirmation'}, {text: '(4/6)', value: '(4/6) Processing Transfer'}, {text: '(5/6)', value: '(5/6) Waiting for Upload PO'}, {text: '(6/6)', value: '(6/6) Order Complete'}]" :filter-method="filterHandler" prop="status" label="Status"/> -->
|
||||
<el-table-column label="Status" width="106">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="click" placement="top">
|
||||
<p>{{ scope.row.status_desc }}</p>
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag size="medium">{{ scope.row.track_status }}</el-tag>
|
||||
</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="Balance" prop="transfer_amount" sortable width="100"/> -->
|
||||
<!-- <el-table-column prop="timeout" label="Bankin Timeout" /> -->
|
||||
<el-table-column :filters="[{ text: 'Success', value: 'Success' }, { text: 'Pending', value: 'Pending' }]" :filter-method="filterTag"
|
||||
label="" width="180" filter-placement="bottom-end">
|
||||
<el-button type="text" slot-scope="scope" @click="(event) => { BookingStatus(scope.row.status, scope.row.id) }"> View Status </el-button>
|
||||
<!-- <template slot-scope="scope">
|
||||
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">View Status</el-button>
|
||||
<el-button size="mini" type="danger" @click="BookingStatus(scope.$index, scope.row)">Cancel</el-button>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-row>
|
||||
<!-- Booking Table-end -->
|
||||
<!-- Booking Table-end -->
|
||||
|
||||
</el-main>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
.el-tag {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import Form from 'vform'
|
||||
import LoginWithGithub from '~/components/LoginWithGithub'
|
||||
import store from '~/store'
|
||||
import axios from 'axios'
|
||||
import Form from 'vform'
|
||||
import LoginWithGithub from '~/components/LoginWithGithub'
|
||||
import store from '~/store'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
middleware: ['auth'],
|
||||
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
Booking: {amount:'', account_name:'', bank_name:'', bank_branch:'', account_num:''},
|
||||
confirmForm: new Form({
|
||||
term: '',
|
||||
amount: ''
|
||||
}),
|
||||
loading: false,
|
||||
status: '',
|
||||
booking: {
|
||||
amount: '',
|
||||
rate: ''
|
||||
},
|
||||
bookingForm: {
|
||||
//amount: '',
|
||||
account_name: '',
|
||||
bank_name: '',
|
||||
bank_branch: '',
|
||||
account_num: ''
|
||||
},
|
||||
rules: {
|
||||
amount: [{
|
||||
required: true,
|
||||
message: 'Please input amount',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
bank_name: [{
|
||||
required: true,
|
||||
message: 'Please input bank name',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
account_name: [{
|
||||
required: true,
|
||||
message: 'Please input account name',
|
||||
trigger: 'change'
|
||||
}],
|
||||
bank_branch: [{
|
||||
required: true,
|
||||
message: 'Please input branch',
|
||||
trigger: 'change'
|
||||
}],
|
||||
account_num: [{
|
||||
required: true,
|
||||
message: 'Please input account number',
|
||||
trigger: 'change'
|
||||
}]
|
||||
},
|
||||
term: '',
|
||||
options1: [{
|
||||
value: 'RMB',
|
||||
label: 'RMB to MYR'
|
||||
label: 'RMB'
|
||||
}],
|
||||
options2: [{
|
||||
value2: 'MYR',
|
||||
label2: 'MYR to RMB'
|
||||
label2: 'MYR'
|
||||
}],
|
||||
value: '',
|
||||
value2: '',
|
||||
input: '',
|
||||
value: 'RMB',
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
formLabelWidth: '0px',
|
||||
tableData1: [{
|
||||
data1: 'Order Number :',
|
||||
data2: '001'
|
||||
},{
|
||||
data1: 'Date :',
|
||||
data2: '25/5/2018'
|
||||
},{
|
||||
data1: 'Customer Marking :',
|
||||
data2: 'CIEF/150ECE'
|
||||
},{
|
||||
data1: '',
|
||||
data2: ''
|
||||
},{
|
||||
data1: 'Payment Method :',
|
||||
data2: 'Cash/Bank Transfer'
|
||||
},{
|
||||
data1: '',
|
||||
data2: ''
|
||||
},{
|
||||
data1: 'CNY/RMB :',
|
||||
data2: 'CNY 120,500.00'
|
||||
},{
|
||||
data1: '+ Service Charge :',
|
||||
data2: 'CNY 20.00'
|
||||
},{
|
||||
data1: '/ RATE :',
|
||||
data2: '1.63'
|
||||
},{
|
||||
data1: '',
|
||||
data2: 'MYR 73,848.04'
|
||||
},{
|
||||
data1: '+ GST 6% :',
|
||||
data2: 'MYR 4,430.88'
|
||||
},{
|
||||
data1: '',
|
||||
data2: 'MYR 78,278.92'
|
||||
},{
|
||||
data1: '',
|
||||
data2: ''
|
||||
},{
|
||||
data1: 'China Beneficiary Acc :',
|
||||
data2: ''
|
||||
},{
|
||||
data1: '',
|
||||
data2: 'PENDING'
|
||||
},{
|
||||
data1: '',
|
||||
data2: ''
|
||||
},{
|
||||
data1: 'Bank In Amount :',
|
||||
data2: 'MYR 78,278.92'
|
||||
},{
|
||||
data1: '',
|
||||
data2: ''
|
||||
}],
|
||||
};
|
||||
bookingTable: [
|
||||
],
|
||||
bookingConfirmTable: {
|
||||
date: 'undefined',
|
||||
marking: 'undefined',
|
||||
payment_method: 'undefined',
|
||||
amount: 'undefined',
|
||||
service_charge: 'undefined',
|
||||
rate: 'undefined',
|
||||
bankin_amount: 'undefined',
|
||||
china_beneficiary: 'undefined',
|
||||
status: 2
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
axios
|
||||
.get('/api/booking/')
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
this.bookingTable = response.data
|
||||
|
||||
//loading.close()
|
||||
}).catch((error) => {
|
||||
// console.log(error)
|
||||
// loading.close()
|
||||
// this.$router.push({
|
||||
// name: 'notfound'
|
||||
// })
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// TODO fetch booking data on load
|
||||
formatter(row, column) {
|
||||
return row.address;
|
||||
return row.address
|
||||
},
|
||||
filterTag(value, row) {
|
||||
return row.tag === value;
|
||||
return row.tag === value
|
||||
},
|
||||
filterHandler(value, row, column) {
|
||||
const property = column['property'];
|
||||
return row[property] === value;
|
||||
const property = column['property']
|
||||
return row[property] === value
|
||||
},
|
||||
acceptTerm: function(newterm){
|
||||
acceptTerm: function (newterm) {
|
||||
if (this.booking.amount == '') {
|
||||
this.$message({
|
||||
message: 'Please input amount',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.dialogFormVisible = true
|
||||
this.term = newterm
|
||||
},
|
||||
createBooking : function(){
|
||||
BookingList() {
|
||||
axios.get('api/booking')
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
this.list = response.data
|
||||
})
|
||||
},
|
||||
// Get calculation before submitting booking
|
||||
getCalculationValue(formName) {
|
||||
this.loading = true
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let newConfirmation = {
|
||||
amount: this.booking.amount,
|
||||
term: this.term
|
||||
}
|
||||
axios.post('api/booking/calculation', newConfirmation)
|
||||
.then((response) => {
|
||||
this.loading = false
|
||||
console.log(response)
|
||||
this.bookingConfirmTable.date = response.data.date
|
||||
this.bookingConfirmTable.marking = response.data.marking
|
||||
this.bookingConfirmTable.payment_method = response.data.payment_method
|
||||
this.bookingConfirmTable.amount = response.data.amount
|
||||
this.bookingConfirmTable.service_charge = response.data.service_charge
|
||||
this.bookingConfirmTable.rate = response.data.rate
|
||||
this.bookingConfirmTable.bankin_amount = response.data.bankin_amount
|
||||
this.bookingConfirmTable.account_name = this.bookingForm.account_name
|
||||
this.dialogFormVisible = false
|
||||
this.dialogFormVisible1 = true
|
||||
})
|
||||
.catch((error) => {
|
||||
this.loading = false
|
||||
console.log(error)
|
||||
})
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
createBooking: function () {
|
||||
this.loading = true,
|
||||
this.dialogFormVisible1 = true
|
||||
|
||||
|
||||
let newBooking = {
|
||||
amount: this.Booking.amount,
|
||||
account_name: this.Booking.account_name,
|
||||
bank_name: this.Booking.bank_name,
|
||||
bank_branch: this.Booking.bank_branch,
|
||||
account_num: this.Booking.account_num,
|
||||
account_name: this.bookingForm.account_name,
|
||||
account_num: this.bookingForm.account_num,
|
||||
bank_name: this.bookingForm.bank_name,
|
||||
bank_branch: this.bookingForm.bank_branch,
|
||||
amount: this.booking.amount,
|
||||
term: this.term
|
||||
}
|
||||
console.log(newBooking);
|
||||
|
||||
console.log(newBooking)
|
||||
axios.post('api/booking', newBooking)
|
||||
.then((response) => {
|
||||
console.log(response);
|
||||
|
||||
//this code to insert the input data into the database (success)
|
||||
// this.Booking.amount = amount;
|
||||
// this.Booking.account_name = account_name;
|
||||
// this.Booking.bank_name = bank_name;
|
||||
// this.Booking.branch = bank_branch;
|
||||
// this.Booking.account_num = account_num;
|
||||
// this.term = term;
|
||||
|
||||
this.loading = false
|
||||
// push with return id
|
||||
this.$router.push({
|
||||
name: 'booking.user.upload',
|
||||
params: {id: response.data.id }
|
||||
})
|
||||
|
||||
// pass variable to another router
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
BookingList(){
|
||||
axios.get('api/booking')
|
||||
.then((response) => {
|
||||
console.log(response);
|
||||
this.list = response.data;
|
||||
console.log(error)
|
||||
return
|
||||
})
|
||||
},
|
||||
BookingStatus(status, booking_id) {
|
||||
console.log(status)
|
||||
// TODO : Get booking status from server
|
||||
this.status = status
|
||||
|
||||
switch (this.status) {
|
||||
case 1:
|
||||
this.$router.push({
|
||||
name: 'booking.user.upload',
|
||||
params: {id: booking_id }
|
||||
})
|
||||
|
||||
case 2:
|
||||
this.$router.push({
|
||||
name: 'booking.confirmation',
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break;
|
||||
case 3:
|
||||
this.$router.push({
|
||||
name: 'booking.transfer',
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break;
|
||||
case 4:
|
||||
this.$router.push({
|
||||
name: 'booking.user.uploadpo',
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break;
|
||||
|
||||
case 5:
|
||||
this.$router.push({
|
||||
name: 'booking.user.pocomplete',
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break;
|
||||
|
||||
case 6:
|
||||
this.$router.push({
|
||||
name: 'booking.complete',
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break;
|
||||
default:
|
||||
break
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -1,84 +0,0 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<!-- action="https://jsonplaceholder.typicode.com/posts/" -->
|
||||
<div align="center">
|
||||
<h3>Your order has been book</h3>
|
||||
<h3>Please upload the bank slip</h3>
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
Time Left :
|
||||
<vue-countdown label="Time Left :" v-on:time-expire="handleTimeExpire" :seconds="3600" v-bind:auto-start="false" ref="countdown"></vue-countdown>
|
||||
|
||||
<!-- <button v-on:click="startTimer">Start timer</button> -->
|
||||
</div><br>
|
||||
|
||||
|
||||
<!-- upload image -->
|
||||
<el-upload
|
||||
list-type="picture-card"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:on-remove="handleRemove" align="center">
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible">
|
||||
<img width="100%" :src="dialogImageUrl" alt="">
|
||||
</el-dialog><br>
|
||||
<!-- upload image end -->
|
||||
|
||||
<!-- <el-form label-width="300px">
|
||||
<el-form-item label="Amount (RM) :"> -->
|
||||
<div align="center">
|
||||
Amount (RM) : <el-input placeholder="Enter Amount" style="width: 20%"></el-input><br><br>
|
||||
</div>
|
||||
<!-- </el-form-item>
|
||||
</el-form> -->
|
||||
|
||||
<div align="center">
|
||||
<el-button type="submit">Submit</el-button>
|
||||
<el-button type="text">Upload Later</el-button>
|
||||
</div>
|
||||
|
||||
</el-main>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import VueCountdown from '@dmaksimovic/vue-countdown';
|
||||
|
||||
export default {
|
||||
name: 'my-component',
|
||||
data() {
|
||||
return {
|
||||
start: false,
|
||||
dialogImageUrl: '',
|
||||
dialogVisible: false
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.countdown.start();
|
||||
},
|
||||
components: {
|
||||
'vue-countdown': VueCountdown
|
||||
},
|
||||
methods: {
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleTimeExpire () {
|
||||
alert('Time is up!');
|
||||
},
|
||||
startTimer () {
|
||||
this.start = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,25 +6,30 @@ const PasswordReset = () => import('~/pages/auth/password/reset').then(m => m.de
|
||||
const NotFound = () => import('~/pages/errors/404').then(m => m.default || m)
|
||||
|
||||
const Home = () => import('~/pages/home').then(m => m.default || m)
|
||||
const Upload = () => import('~/pages/upload').then(m => m.default || m)
|
||||
const Settings = () => import('~/pages/settings/index').then(m => m.default || m)
|
||||
const SettingsProfile = () => import('~/pages/settings/profile').then(m => m.default || m)
|
||||
const SettingsPassword = () => import('~/pages/settings/password').then(m => m.default || m)
|
||||
|
||||
// const Admin = () => import('~/pages/admin/adminhome').then(m => m.default || m)
|
||||
const Admin = () => import('~/pages/admin/index').then(m => m.default || m)
|
||||
// Booking
|
||||
const Upload = () => import('~/pages/booking/uploadUserBankSlip').then(m => m.default || m)
|
||||
const Confirmation = () => import('~/pages/booking/confirmation').then(m => m.default || m)
|
||||
const Transfer = () => import('~/pages/booking/transfer').then(m => m.default || m)
|
||||
const UploadPo = () => import('~/pages/booking/uploadPo').then(m => m.default || m)
|
||||
const PoComplete = () => import('~/pages/booking/poComplete').then(m => m.default || m)
|
||||
const Completed = () => import('~/pages/booking/completed').then(m => m.default || m)
|
||||
|
||||
const AdminHome = () => import('~/pages/admin/home').then(m => m.default || m)
|
||||
|
||||
export default [
|
||||
{ path: '/', name: 'welcome', component: Welcome },
|
||||
|
||||
{ path: '/login', name: 'login', component: Login },
|
||||
{ path: '/register', name: 'register', component: Register },
|
||||
{ path: '/password/reset', name: 'password.request', component: PasswordEmail },
|
||||
{ path: '/password/reset/:token', name: 'password.reset', component: PasswordReset },
|
||||
|
||||
{ path: '/home', name: 'home', component: Home },
|
||||
{ path: '/upload', name: 'upload', component: Upload },
|
||||
{ path: '/settings',
|
||||
component: Settings,
|
||||
children: [
|
||||
@@ -33,6 +38,14 @@ export default [
|
||||
{ path: 'password', name: 'settings.password', component: SettingsPassword }
|
||||
] },
|
||||
|
||||
// Booking
|
||||
{ path: '/booking/:id/upload-user-bankslip', name: 'booking.user.upload', component: Upload },
|
||||
{ path: '/booking/:id/confirmation', name: 'booking.confirmation', component: Confirmation },
|
||||
{ path: '/booking/:id/transfer', name: 'booking.transfer', component: Transfer },
|
||||
{ path: '/booking/:id/upload-po', name: 'booking.user.uploadpo', component: UploadPo },
|
||||
{ path: '/booking/:id/po-complete', name: 'booking.user.pocomplete', component: PoComplete },
|
||||
{ path: '/booking/:id/complete', name: 'booking.complete', component: Completed },
|
||||
|
||||
{ path: '/admin',
|
||||
component: Admin,
|
||||
children: [
|
||||
@@ -41,5 +54,6 @@ export default [
|
||||
{ path: 'home', name: 'admin.home', component: AdminHome }
|
||||
] },
|
||||
|
||||
{ path: '*', component: NotFound }
|
||||
{ path: '/admin', name: 'admin.home', component: AdminHome },
|
||||
{ path: '*', name: 'notfound', component: NotFound }
|
||||
]
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
// import axios from 'axios'
|
||||
// import Cookies from 'js-cookie'
|
||||
// import * as types from '../mutation-types'
|
||||
|
||||
// // state
|
||||
// export const state = {
|
||||
// booking: null
|
||||
// }
|
||||
|
||||
// // getters
|
||||
// export const getters = {
|
||||
// booking: state => state.booking,
|
||||
// }
|
||||
|
||||
// // mutations
|
||||
// export const mutations = {
|
||||
// [types.FETCH_BOOKING_SUCCESS] (state, { booking }) {
|
||||
// state.booking = booking
|
||||
// },
|
||||
|
||||
// [types.FETCH_BOOKING_FAILURE] (state) {
|
||||
// state.booking = null
|
||||
// },
|
||||
|
||||
// }
|
||||
|
||||
// // actions
|
||||
// export const actions = {
|
||||
// async fetchBooking ({ commit }) {
|
||||
// try {
|
||||
// const { data } = await axios.get('/api/user')
|
||||
|
||||
// commit(types.FETCH_BOOKING_SUCCESS, { booking: data })
|
||||
// } catch (e) {
|
||||
// commit(types.FETCH_BOOKING_FAILURE)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -0,0 +1,47 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Reset Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('password.email') }}">
|
||||
@csrf
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required>
|
||||
|
||||
@if ($errors->has('email'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Send Password Reset Link') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,65 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Reset Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('password.request') }}">
|
||||
@csrf
|
||||
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ $email ?? old('email') }}" required autofocus>
|
||||
|
||||
@if ($errors->has('email'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>
|
||||
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('password') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Reset Password') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,77 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Register') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('register') }}">
|
||||
@csrf
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="name" type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" name="name" value="{{ old('name') }}" required autofocus>
|
||||
|
||||
@if ($errors->has('name'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('name') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required>
|
||||
|
||||
@if ($errors->has('email'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>
|
||||
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('password') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Register') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Dashboard</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
You are logged in!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- CSRF Token -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>{{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="{{ asset('js/app.js') }}" defer></script>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- Styles -->
|
||||
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<nav class="navbar navbar-expand-md navbar-light navbar-laravel">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{{ url('/') }}">
|
||||
{{ config('app.name', 'Laravel') }}
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<!-- Left Side Of Navbar -->
|
||||
<ul class="navbar-nav mr-auto">
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- Right Side Of Navbar -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<!-- Authentication Links -->
|
||||
@guest
|
||||
<li><a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a></li>
|
||||
<li><a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a></li>
|
||||
@else
|
||||
<li class="nav-item dropdown">
|
||||
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
|
||||
{{ Auth::user()->name }} <span class="caret"></span>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">
|
||||
{{ __('Logout') }}
|
||||
</a>
|
||||
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
|
||||
@csrf
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
@endguest
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="py-4">
|
||||
@yield('content')
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+61
-38
@@ -18,65 +18,88 @@ Use App\SettingSupplier;
|
||||
*/
|
||||
|
||||
Route::middleware('auth:api')->get('/user', function (Request $request) {
|
||||
return $request->user();
|
||||
return $request->user();
|
||||
});
|
||||
|
||||
/*Route for the booking */
|
||||
Route::get('/booking', 'BookingController@index');
|
||||
Route::get('/booking/{book_id}', 'BookingController@show');
|
||||
Route::post('/booking/', 'BookingController@store');
|
||||
Route::put('/booking/{book_id}', 'BookingController@update');
|
||||
Route::delete('/booking/{book_id}', 'BookingController@delete');
|
||||
|
||||
|
||||
//Route::middleware('auth:api')->get('/user', function (Request $request) {
|
||||
// return $request->user();
|
||||
//});
|
||||
Route::group(['middleware' => 'auth:api'], function () {
|
||||
Route::post('logout', 'Auth\LoginController@logout');
|
||||
|
||||
Route::get('/user', function (Request $request) {
|
||||
return $request->user();
|
||||
});
|
||||
|
||||
/*Route for the booking */
|
||||
Route::get('/booking/{book_id}', 'BookingController@show');
|
||||
Route::put('/booking/{book_id}', 'BookingController@update');
|
||||
Route::delete('/booking/{book_id}', 'BookingController@delete');
|
||||
Route::post('/booking', 'BookingController@store');
|
||||
Route::post('/booking/calculation', 'BookingController@calculation');
|
||||
Route::post('/booking/{book_id}/cancel', 'BookingController@cancel');
|
||||
Route::post('/booking/{id}/upload-user-bankslip', 'BookingController@uploadbankslip');
|
||||
Route::post('/booking/{id}/upload-po', 'BookingController@uploadPurchaseOrder');
|
||||
Route::post('/booking/{id}/confirm-po', 'BookingController@confirmPurchaseOrder');
|
||||
Route::patch('/booking/{id}/bankslip-amount', 'BookingController@updateBankSlipAmount');
|
||||
Route::post('booking/{book_id}/reject-bank-slip','BookingController@rejectBankSlip');
|
||||
Route::post('booking/{book_id}/approve-bank-slip','BookingController@approveBankSlip');
|
||||
Route::post('booking/{book_id}/cancel', 'BookingController@cancel');
|
||||
Route::get('/booking', 'BookingController@index');
|
||||
Route::get('/user', 'UserController@show');
|
||||
});
|
||||
|
||||
Route::patch('settings/profile', 'Settings\ProfileController@update');
|
||||
Route::patch('settings/password', 'Settings\PasswordController@update');
|
||||
Route::patch('settings/profile', 'Settings\ProfileController@update');
|
||||
Route::patch('settings/password', 'Settings\PasswordController@update');
|
||||
|
||||
|
||||
Route::group(['middleware' => 'guest:api'], function () {
|
||||
Route::post('login', 'Auth\LoginController@login');
|
||||
Route::post('register', 'Auth\RegisterController@register');
|
||||
Route::post('login', 'Auth\LoginController@login')->name('login');
|
||||
Route::post('register', 'Auth\RegisterController@create');
|
||||
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
|
||||
Route::post('password/reset', 'Auth\ResetPasswordController@reset');
|
||||
|
||||
Route::post('oauth/{driver}', 'Auth\OAuthController@redirectToProvider');
|
||||
Route::get('oauth/{driver}/callback', 'Auth\OAuthController@handleProviderCallback')->name('oauth.callback');
|
||||
Route::post('oauth/{driver}', 'Auth\OAuthController@redirectToProvider');
|
||||
Route::get('oauth/{driver}/callback', 'Auth\OAuthController@handleProviderCallback')->name('oauth.callback');
|
||||
});
|
||||
|
||||
Route::group(['middleware' => 'role:admin'], function() {
|
||||
|
||||
Route::post('booking/{id}/upload-invoice', 'BookingController@uploadInvoice');
|
||||
|
||||
Route::post('update-rate', 'RateController@store');
|
||||
Route::put('update-rate/{rate}', 'RateController@update');
|
||||
Route::delete('update-rate/{rate}', 'RateController@delete');
|
||||
|
||||
Route::get('setting-credit', 'SettingCreditController@index');
|
||||
Route::get('setting-credit/{credit}', 'SettingCreditController@show');
|
||||
Route::post('setting-credit', 'SettingCreditController@store');
|
||||
Route::put('setting-credit/{credit}', 'SettingCreditController@update');
|
||||
Route::delete('setting-credit/{credit}', 'SettingCreditController@delete');
|
||||
|
||||
Route::get('setting-supplier', 'SettingSupplierController@index');
|
||||
Route::get('setting-supplier/{supplier}', 'SettingSupplierController@show');
|
||||
Route::post('setting-supplier', 'SettingSupplierController@store');
|
||||
Route::put('setting-supplier/{supplier}', 'SettingSupplierController@update');
|
||||
Route::delete('setting-supplier/{supplier}', 'SettingSupplierController@delete');
|
||||
|
||||
Route::get('setting-beneficiary', 'SettingBeneficiaryController@index');
|
||||
Route::get('setting-beneficiary/{beneficiary}', 'SettingBeneficiaryController@show');
|
||||
Route::post('setting-beneficiary', 'SettingBeneficiaryController@store');
|
||||
Route::put('setting-beneficiary/{beneficiary}', 'SettingBeneficiaryController@update');
|
||||
Route::delete('setting-beneficiary/{beneficiary}', 'SettingBeneficiaryController@delete');
|
||||
|
||||
Route::get('marking', 'MarkingController@index');
|
||||
Route::post('marking', 'MarkingController@store');
|
||||
Route::get('marking/{beneficiary}', 'MarkingController@show');
|
||||
Route::put('marking/{beneficiary}', 'MarkingController@update');
|
||||
Route::delete('marking/{beneficiary}', 'MarkingController@delete');
|
||||
});
|
||||
|
||||
Route::get('update-rate', 'RateController@index');
|
||||
Route::get('update-rate/{rate}', 'RateController@show');
|
||||
Route::post('update-rate', 'RateController@store');
|
||||
Route::put('update-rate/{rate}', 'RateController@update');
|
||||
Route::delete('update-rate/{rate}', 'RateController@delete');
|
||||
|
||||
Route::get('setting-beneficiary', 'SettingBeneficiaryController@index');
|
||||
Route::get('setting-beneficiary/{beneficiary}', 'SettingBeneficiaryController@show');
|
||||
Route::post('setting-beneficiary', 'SettingBeneficiaryController@store');
|
||||
Route::put('setting-beneficiary/{beneficiary}', 'SettingBeneficiaryController@update');
|
||||
Route::delete('setting-beneficiary/{beneficiary}', 'SettingBeneficiaryController@delete');
|
||||
|
||||
Route::get('setting-credit', 'SettingCreditController@index');
|
||||
Route::get('setting-credit/{credit}', 'SettingCreditController@show');
|
||||
Route::post('setting-credit', 'SettingCreditController@store');
|
||||
Route::put('setting-credit/{credit}', 'SettingCreditController@update');
|
||||
Route::delete('setting-credit/{credit}', 'SettingCreditController@delete');
|
||||
|
||||
Route::get('setting-supplier', 'SettingSupplierController@index');
|
||||
Route::get('setting-supplier/{supplier}', 'SettingSupplierController@show');
|
||||
Route::post('setting-supplier', 'SettingSupplierController@store');
|
||||
Route::put('setting-supplier/{supplier}', 'SettingSupplierController@update');
|
||||
Route::delete('setting-supplier/{supplier}', 'SettingSupplierController@delete');
|
||||
|
||||
Route::post('upload-china-bankslip', 'ChinaBankSlipController@store');
|
||||
|
||||
|
||||
Route::post('booking/{id}/upload-user-bankslip', 'BookingController@uploadbankslip');
|
||||
Route::post('booking/{id}/upload-po', 'BookingController@uploadPurchaseOrder');
|
||||
|
||||
|
||||
+6
-21
@@ -10,26 +10,11 @@
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::get('/', function () {
|
||||
return view('index');
|
||||
});
|
||||
|
||||
/*Route for the booking */
|
||||
// Route::get('/booking', 'BookingController@index');
|
||||
|
||||
// Route::get('/booking/{booking}', 'BookingController@show');
|
||||
|
||||
// Route::post('/booking', 'BookingController@create');
|
||||
|
||||
// Route::post('/booking', 'BookingController@store');
|
||||
|
||||
// Route::put('/booking/{user-id}', 'BookingController@update');
|
||||
|
||||
// Route::delete('/booking/{user-id}', 'BookingController@delete');
|
||||
|
||||
Route::get('/', 'WelcomeController@index');
|
||||
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.request');
|
||||
Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('password.reset');
|
||||
Route::get('{path}', function () {
|
||||
return view('index');
|
||||
})->where('path', '(.*)');
|
||||
Route::get('{path}', 'WelcomeController@index')->where('path', '(.*)');
|
||||
|
||||
Auth::routes();
|
||||
|
||||
//Route::get('/home', 'WelcomeController@index')->name('home');
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider;
|
||||
use Auth;
|
||||
use Artisan;
|
||||
use App\User;
|
||||
use App\Booking;
|
||||
use App\UserBankSlip;
|
||||
use App\Role;
|
||||
|
||||
class BookingTest extends TestCase
|
||||
{
|
||||
protected $user;
|
||||
protected $booking;
|
||||
protected $userBankSlip;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
Artisan::call('db:seed');
|
||||
|
||||
$this->user = factory(User::class)->create();
|
||||
$this->booking = factory(Booking::class)->create([
|
||||
'user_id' => $this->user->id
|
||||
]);
|
||||
$this->userBankSlip = factory(UserBankSlip::class)->create([
|
||||
'booking_id' => $this->booking->id
|
||||
]);
|
||||
$this->user->attachRole(Role::Where('name','member')->first());
|
||||
}
|
||||
|
||||
public function testPost()
|
||||
{
|
||||
$response =
|
||||
$this->actingAs($this->user)
|
||||
->postJson('/api/booking/', [
|
||||
'account_name' => 'johnny',
|
||||
'account_num' => '1234567',
|
||||
'bank_name' => 'myabnak',
|
||||
'bank_branch' => 'banking',
|
||||
'company_name' => 'besaras',
|
||||
'company_address' => 'californina',
|
||||
'bank_address' => 'cyber',
|
||||
'swift_code' => '123wert',
|
||||
'cnap' => '2131rew',
|
||||
'term' => 'x2_cash',
|
||||
'amount' => '14000',
|
||||
'rmb_book_amount' => '2131',
|
||||
'rmb_book_pay_method' => '2131rea',
|
||||
'rmb_book_account_name' => '2131rew',
|
||||
'rmb_book_acc_no' => '2131',
|
||||
'rmb_book_bank_branch' => '2131rew',
|
||||
'usd_book_amount' => '2131',
|
||||
'usd_book_pay_method' => '2131rew',
|
||||
'usd_book_company_name' => '2131rew',
|
||||
'usd_book_company_address' => '2131rew',
|
||||
'usd_book_swift_code' => '2131rew',
|
||||
'usd_book_cnap' => '2131rew',
|
||||
'usd_book_bank_branch' => '2131rew',
|
||||
'verification_status' => '1'
|
||||
])
|
||||
->assertStatus(201);
|
||||
}
|
||||
|
||||
public function testuploadbankslip()
|
||||
{
|
||||
Storage::fake('file');
|
||||
$bankslip_path = UploadedFile::fake()->image('comp.jpg');
|
||||
|
||||
if(!file_exists($bankslip_path)){
|
||||
$response->assertStatus(400);
|
||||
}
|
||||
|
||||
$this->actingAs($this->user)
|
||||
->json('POST', '/api/booking/' . $this->booking->id . '/upload-user-bankslip', [
|
||||
'file' => $bankslip_path
|
||||
])
|
||||
->assertSuccessful();
|
||||
}
|
||||
|
||||
public function testUpdateBankslipAmount()
|
||||
{
|
||||
$this->actingAs($this->user)
|
||||
->json('PATCH', '/api/booking/' . $this->booking->id . '/bankslip-amount', [
|
||||
'transfer_amount' => '9000'
|
||||
])
|
||||
->assertSuccessful();
|
||||
}
|
||||
|
||||
public function testuploadPO()
|
||||
{
|
||||
Storage::fake('file');
|
||||
$image_path = UploadedFile::fake()->image('comp.jpg');
|
||||
|
||||
if(!file_exists($image_path)){
|
||||
$response->assertStatus(400);
|
||||
}
|
||||
|
||||
$this->actingAs($this->user)
|
||||
->json('POST', '/api/booking/' . $this->booking->id . '/upload-po', [
|
||||
'file' => $image_path,
|
||||
'amount' => '12345'
|
||||
])
|
||||
->assertSuccessful();
|
||||
}
|
||||
|
||||
public function testCancel()
|
||||
{
|
||||
$this->actingAs($this->user)
|
||||
->json('POST','/api/booking/' . $this->booking->id . '/cancel', [])
|
||||
->assertSuccessful();
|
||||
}
|
||||
|
||||
public function testApproveBankSlip()
|
||||
{
|
||||
$this->actingAs($this->user)
|
||||
->json('POST','/api/booking/' . $this->booking->id . '/approve-bank-slip', [])
|
||||
->assertSuccessful();
|
||||
}
|
||||
|
||||
public function testRejectBankSlip()
|
||||
{
|
||||
$this->actingAs($this->user)
|
||||
->json('POST','/api/booking/' . $this->booking->id . '/reject-bank-slip', [
|
||||
'reject_reason' => 'Amount no enough'
|
||||
])
|
||||
->assertSuccessful();
|
||||
}
|
||||
|
||||
// Only this is Admin permision required
|
||||
public function testUploadInvoice(){
|
||||
$this->user->roles()->sync([]);
|
||||
$this->user->attachRole(Role::Where('name','admin')->first());
|
||||
|
||||
Storage::fake('invoice_path');
|
||||
$invoice_path = UploadedFile::fake()->create('document.pdf');
|
||||
|
||||
if(!file_exists($invoice_path)){
|
||||
$response->assertStatus(400);
|
||||
}
|
||||
|
||||
$this->actingAs($this->user)
|
||||
->json('POST', '/api/booking/' . $this->booking->id . '/upload-invoice', [
|
||||
'invoice_path' => $invoice_path,
|
||||
'amount' => '12345'
|
||||
])
|
||||
->assertSuccessful();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use App\User;
|
||||
use App\Role;
|
||||
use Artisan;
|
||||
|
||||
class MarkingTest extends TestCase
|
||||
{
|
||||
protected $user;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
Artisan::call('db:seed');
|
||||
|
||||
$this->user = factory(User::class)->create();
|
||||
$this->user->attachRole(Role::Where('name','admin')->first());
|
||||
}
|
||||
|
||||
public function testStore(){
|
||||
$response =
|
||||
$this->actingAs($this->user)
|
||||
->postJson('/api/marking/',[
|
||||
'email' => 'user@example.com',
|
||||
'marking' => 'markingcode123'
|
||||
])
|
||||
->assertStatus(201);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use App\Role;
|
||||
use Artisan;
|
||||
use App\User;
|
||||
use App\Rate;
|
||||
|
||||
class RateTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
protected $user;
|
||||
protected $rate;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
Artisan::call('db:seed');
|
||||
|
||||
$this->user = factory(User::class)->create();
|
||||
$this->rate = factory(Rate::class)->create();
|
||||
$this->user->attachRole(Role::Where('name','admin')->first());
|
||||
}
|
||||
|
||||
public function testStore(){
|
||||
$response =
|
||||
$this->actingAs($this->user)
|
||||
->postJson('/api/update-rate/',[
|
||||
'x1_cash' => '1.2',
|
||||
'x1_cheque' => '1.2',
|
||||
'x1_ba' => '1.2',
|
||||
'x2_cash' => '1.2',
|
||||
'x2_cheque' => '1.2',
|
||||
'x2_ba' => '1.2'
|
||||
])
|
||||
->assertStatus(201);
|
||||
}
|
||||
|
||||
public function testUpdate(){
|
||||
$response =
|
||||
$this->actingAs($this->user)
|
||||
->json('PUT','/api/update-rate/' . $this->rate->id,[
|
||||
'x1_cash' => '1.2',
|
||||
'x1_cheque' => '1.2',
|
||||
'x1_ba' => '1.2',
|
||||
'x2_cash' => '1.2',
|
||||
'x2_cheque' => '1.2',
|
||||
'x2_ba' => '1.2'
|
||||
])
|
||||
->assertStatus(200);
|
||||
}
|
||||
}
|
||||
@@ -3,17 +3,30 @@
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use App\Marking;
|
||||
use Artisan;
|
||||
|
||||
class RegisterTest extends TestCase
|
||||
{
|
||||
protected $marking;
|
||||
|
||||
public function setUp(){
|
||||
parent::setUp();
|
||||
Artisan::call('db:seed');
|
||||
|
||||
$this->marking = factory(Marking::class)->create();
|
||||
}
|
||||
|
||||
|
||||
/** @test */
|
||||
public function can_register()
|
||||
{
|
||||
$this->postJson('/api/register', [
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@test.app',
|
||||
'email' => $this->marking->email,
|
||||
'password' => 'secret',
|
||||
'password_confirmation' => 'secret',
|
||||
'marking' => $this->marking->marking
|
||||
])
|
||||
->assertSuccessful()
|
||||
->assertJsonStructure(['id', 'name', 'email']);
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use App\User;
|
||||
use App\SettingCredit;
|
||||
use App\Role;
|
||||
use Artisan;
|
||||
|
||||
class SettingCreditTest extends TestCase
|
||||
{
|
||||
protected $user;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
Artisan::call('db:seed');
|
||||
|
||||
$this->user = factory(User::class)->create();
|
||||
$this->user->attachRole(Role::Where('name','admin')->first());
|
||||
}
|
||||
|
||||
public function testStore(){
|
||||
$this->actingAs($this->user)
|
||||
->postJson('/api/setting-credit/', [
|
||||
'rmb_credit_limit' => '5000',
|
||||
'usd_credit_limit' => '2000'
|
||||
])
|
||||
->assertStatus(201);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ namespace Tests\Feature;
|
||||
|
||||
use App\User;
|
||||
use Tests\TestCase;
|
||||
use App\Role;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class SettingsTest extends TestCase
|
||||
@@ -48,4 +49,5 @@ class SettingsTest extends TestCase
|
||||
|
||||
$this->assertTrue(Hash::check('updated', $this->user->password));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\BookingTest;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Artisan;
|
||||
use App\User;
|
||||
|
||||
class BookingTest extends TestCase
|
||||
{
|
||||
protected $user;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
Artisan::call('db:seed');
|
||||
$this->user = factory(User::class)->create();
|
||||
}
|
||||
|
||||
public function testPost()
|
||||
{
|
||||
$response =
|
||||
$this->actingAs($this->user)
|
||||
->postJson('/api/booking/', [
|
||||
'account_name' => 'johnny',
|
||||
'account_num' => '1234567',
|
||||
'bank_name' => 'myabnak',
|
||||
'bank_branch' => 'banking',
|
||||
'company_name' => 'besaras',
|
||||
'company_address' => 'californina',
|
||||
'bank_address' => 'cyber',
|
||||
'swift_code' => '123wert',
|
||||
'cnap' => '2131rew',
|
||||
'term' => 'x2_cash',
|
||||
'amount' => '14000'
|
||||
]);
|
||||
$response->assertStatus(500);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use Tests\TestCase;
|
||||
|
||||
class ExampleTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicTest()
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
-3951
File diff suppressed because it is too large
Load Diff
Vendored
-4368
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user