mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
commit before pull
This commit is contained in:
@@ -36,8 +36,22 @@ class Booking extends Model
|
||||
return $this->belongsTo('app\BookingSupplier ');
|
||||
}
|
||||
|
||||
public function chinaBankSlip(){
|
||||
return $this->hasOne(ChinaBankSlip::class);
|
||||
}
|
||||
|
||||
public function userBankSlip(){
|
||||
return $this->hasOne(UserBankSlip::class);
|
||||
}
|
||||
|
||||
public function purchaseOrder(){
|
||||
return $this->hasOne(PurchaseOrder::class);
|
||||
}
|
||||
|
||||
public function invoice(){
|
||||
return $this->hasOne(Invoice::class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,4 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class ChinaBankSlip extends Model
|
||||
{
|
||||
protected $fillable = ['actual_transfer_amount','date','details','china_bank_slip_path'];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,11 +19,12 @@ class BookingController extends Controller
|
||||
{
|
||||
|
||||
public function index(){
|
||||
$user = Auth::user();
|
||||
$user = Auth::user();
|
||||
$bookings = Booking::select('id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
->where('user_id', $user->id)
|
||||
->get();
|
||||
|
||||
->where('user_id', $user->id)
|
||||
->paginate(10);
|
||||
|
||||
|
||||
// reformat to fit frontend structure
|
||||
foreach ($bookings as $booking) {
|
||||
// set timeout
|
||||
@@ -40,7 +41,7 @@ class BookingController extends Controller
|
||||
// TODO : transfer_amount change name to bia
|
||||
$booking->transfer_amount = $booking->bia;
|
||||
|
||||
$booking->track_status = "(". $booking->status ."/6)";
|
||||
$booking->track_status = "(". $booking->status ."/7)";
|
||||
switch ($booking->status) {
|
||||
case 1:
|
||||
$status_desc = "Order in progress";
|
||||
@@ -60,6 +61,9 @@ class BookingController extends Controller
|
||||
case 6:
|
||||
$status_desc = "Processing invoice";
|
||||
break;
|
||||
case 7:
|
||||
$status_desc = "Order Completed";
|
||||
break;
|
||||
default:
|
||||
$status_desc = "";
|
||||
}
|
||||
@@ -91,28 +95,31 @@ class BookingController extends Controller
|
||||
// TODO : transfer_amount change name to bia
|
||||
$booking->transfer_amount = $booking->bia;
|
||||
|
||||
$booking->track_status = "(". $booking->admin_status ."/6)";
|
||||
$booking->track_status = "(". $booking->admin_status ."/8)";
|
||||
switch ($booking->admin_status) {
|
||||
case 0:
|
||||
$status_desc = "Waiting user to upload bankin slip";
|
||||
break;
|
||||
case 1:
|
||||
$status_desc = "Waiting for verification";
|
||||
$status_desc = "Waiting customer upload bank slip";
|
||||
break;
|
||||
case 2:
|
||||
$status_desc = "Bookg with supplier";
|
||||
$status_desc = "Verify user bank slip";
|
||||
break;
|
||||
case 3:
|
||||
$status_desc = "Supplier booking report. Please confirm with your booking.";
|
||||
$status_desc = "Generate supplier booking report";
|
||||
break;
|
||||
case 4:
|
||||
$status_desc = "Please update supplier booking status.";
|
||||
$status_desc = "Supplier booking report. Please confirm with your booking.";
|
||||
break;
|
||||
case 5:
|
||||
$status_desc = "Customer has uploaded the invoice, please upload purchase order";
|
||||
$status_desc = "Please, upload China Bankslip";
|
||||
break;
|
||||
case 6:
|
||||
$status_desc = "Booking completed";
|
||||
$status_desc = "Waiting customer to upload purchase order";
|
||||
break;
|
||||
case 7:
|
||||
$status_desc = "Customer has uploaded purchase order, please upload invoice";
|
||||
break;
|
||||
case 8:
|
||||
$status_desc = "Booking Completed";
|
||||
break;
|
||||
default:
|
||||
$status_desc = "";
|
||||
@@ -127,6 +134,12 @@ class BookingController extends Controller
|
||||
public function show($id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id', $id)->first();
|
||||
// just added to try
|
||||
$user_bankslip = $booking->userBankSlip()->first();
|
||||
|
||||
if ($user_bankslip){
|
||||
$booking->user_bankslip_path = Storage::url($user_bankslip->bankslip_path);
|
||||
}
|
||||
|
||||
if($booking){
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
@@ -140,8 +153,8 @@ class BookingController extends Controller
|
||||
}
|
||||
return $booking;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function adminShow($id)
|
||||
{
|
||||
$booking = Booking::where('id', $id)->first();
|
||||
@@ -318,43 +331,33 @@ class BookingController extends Controller
|
||||
return response()->json(['message'=>'Image too large, upload files up to 3 MB'], 400);
|
||||
}
|
||||
|
||||
if(!$bankslip_file = $request->file('file'))
|
||||
if($bankslip_file = $request->file('file'))
|
||||
{
|
||||
$bankslip_file = $request->file('file');
|
||||
/* End Validation */
|
||||
$filename = $bankslip_file->getClientOriginalName();
|
||||
$unique_name = 'bank_slip_' . md5($filename. time());
|
||||
$ext = $bankslip_file->getClientOriginalExtension();
|
||||
|
||||
$file = $request->file('file');
|
||||
$ext = $file->getClientOriginalExtension();
|
||||
$input['bankslip_file'] = $filename;
|
||||
Storage::putFileAs(
|
||||
'bankslip_file',/*folder name*/ $file, $unique_name. '.' .$ext
|
||||
);
|
||||
$user_bankslip->bankslip_file = $unique_name. '.' .$ext; //update database
|
||||
} //end if
|
||||
|
||||
$unique_name = 'bank_slip_' . md5($filename. time()); // probably not a good idea
|
||||
$unique_image_path = $unique_name. '.' .$ext;
|
||||
|
||||
$upload_path = Storage::disk('public')->putFileAs(
|
||||
'user_bankslip', $bankslip_file, $unique_image_path
|
||||
);
|
||||
|
||||
$user_bankslip = new UserBankSlip;
|
||||
$user_bankslip->booking_id = $booking->id;
|
||||
$user_bankslip->bankslip_path = $upload_path;
|
||||
$user_bankslip->transfer_amount = $request->input('transfer_amount');
|
||||
$user_bankslip->save();
|
||||
|
||||
|
||||
return response()->json(['message'=>"Success"],200);
|
||||
}
|
||||
else {
|
||||
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;
|
||||
|
||||
$upload_path = Storage::disk('public')->putFileAs(
|
||||
'user_bankslip', $bankslip_file, $unique_image_path
|
||||
);
|
||||
|
||||
$user_bankslip = new UserBankSlip;
|
||||
$user_bankslip->booking_id = $booking->id;
|
||||
$user_bankslip->bankslip_path = $upload_path;
|
||||
$user_bankslip->transfer_amount = $request->input('transfer_amount');
|
||||
$user_bankslip->save();
|
||||
|
||||
|
||||
return response()->json(['message'=>"Success"],200);
|
||||
|
||||
}
|
||||
|
||||
public function updateBankSlipAmount(Request $request, $id){
|
||||
@@ -421,17 +424,26 @@ class BookingController extends Controller
|
||||
|
||||
$user_po = new PurchaseOrder;
|
||||
$user_po->image_path = $upload_path;
|
||||
$user_po->book_id = $booking->id;
|
||||
$user_po->booking_id = $booking->id;
|
||||
$user_po->save();
|
||||
|
||||
$booking->status = 6;
|
||||
$booking->admin_status = 7;
|
||||
$booking->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 showPurchaseOrder($id){
|
||||
$booking = Booking::where('id',$id)->first();
|
||||
$user_po = $booking->purchaseOrder()->first();
|
||||
|
||||
if($user_po){
|
||||
return response()->json(['user_po_path'=> $user_po->image_path ],200);
|
||||
}
|
||||
|
||||
return response()->json(['message'=> 'waiting customer to upload their po'],400);
|
||||
}
|
||||
|
||||
public function delete(Booking $book_id)
|
||||
@@ -583,7 +595,7 @@ class BookingController extends Controller
|
||||
//upload
|
||||
public function uploadInvoice(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
$booking = Booking::where('id',$id)->first();
|
||||
|
||||
/* Validation */
|
||||
if (!$booking)
|
||||
@@ -609,7 +621,7 @@ class BookingController extends Controller
|
||||
return response()->json(['message'=>'Image too large, upload files up to 3 MB'], 400);
|
||||
}
|
||||
|
||||
if(!$input_file = $request->file('invoice_path'))
|
||||
if(!$input_file = $request->file('file'))
|
||||
{
|
||||
return response()->json(['message'=>'No file detected'], 400);
|
||||
}
|
||||
@@ -618,20 +630,63 @@ class BookingController extends Controller
|
||||
$filename = $input_file->getClientOriginalName();
|
||||
$ext = $input_file->getClientOriginalExtension();
|
||||
|
||||
$input['invoice_path'] = $filename;
|
||||
$unique_name = 'invoice' . md5($filename. time());
|
||||
$unique_file_url = $unique_name. '.' .$ext;
|
||||
$upload_path = Storage::disk('public')->putFileAs(
|
||||
'invoice',/*folder name*/ $input_file, $unique_file_url, 'public'
|
||||
'invoice', $input_file, $unique_file_url, 'public'
|
||||
);
|
||||
|
||||
$invoice = new Invoice;
|
||||
$invoice->invoice_path = $upload_path;
|
||||
$invoice->amount = $request->input('amount');
|
||||
// TODO : amount
|
||||
$invoice->amount = 0;
|
||||
$invoice->booking_id = $booking->id;
|
||||
$invoice->save();
|
||||
|
||||
return response()->json(['message'=>"Success"],200);
|
||||
}
|
||||
|
||||
public function confirmSupplier(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('id', $id)->firstOrFail();
|
||||
$booking->status = 4; // processing transfer
|
||||
$booking->admin_status = 5; // upload china bankslip
|
||||
|
||||
if($booking->save()){
|
||||
return response()->json(['message'=>"Success"],200);
|
||||
}
|
||||
}
|
||||
|
||||
public function confirmPurchaseOrder($id){
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
|
||||
$purchase_order = $booking->purchaseOrder()->first();
|
||||
|
||||
if(!$purchase_order){
|
||||
return response()->json(["message"=> "Please upload your purchase order"],400);
|
||||
}
|
||||
|
||||
$booking->status = 6;
|
||||
$booking->save();
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
|
||||
public function confirmInvoice(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('id', $id)->firstOrFail();
|
||||
|
||||
$invoice = $booking->invoice()->first();
|
||||
|
||||
if(!$invoice){
|
||||
return response()->json(["message"=> "Please upload your invoice"],400);
|
||||
}
|
||||
|
||||
$booking->status = 7; // completed
|
||||
$booking->admin_status = 7; // completed
|
||||
|
||||
if($booking->save()){
|
||||
return response()->json(['message'=>"Success"],200);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\BookingSupplier;
|
||||
use Auth;
|
||||
use App\SupplierBooking;
|
||||
use App\Booking;
|
||||
use App\Rate;
|
||||
use App\User;
|
||||
use App\UserBankSlip;
|
||||
use App\SettingBeneficiary;
|
||||
use App\SupplierBookingItem;
|
||||
use App\SettingSupplier;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class BookingSupplierController extends Controller
|
||||
@@ -16,7 +18,7 @@ class BookingSupplierController extends Controller
|
||||
|
||||
public function index()
|
||||
{
|
||||
$bookingsupplier = BookingSupplier::all();
|
||||
$bookingsupplier = SupplierBooking::all();
|
||||
|
||||
$response = [
|
||||
'supplier-booking' => $bookingsupplier
|
||||
@@ -27,7 +29,7 @@ class BookingSupplierController extends Controller
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$bookingsupplier = BookingSupplier::has('supplier-booking')->findOrFail($id);
|
||||
$bookingsupplier = SupplierBooking::has('supplier-booking')->findOrFail($id);
|
||||
|
||||
$response = [
|
||||
'supplier-booking' => $bookingsupplier
|
||||
@@ -38,71 +40,59 @@ class BookingSupplierController extends Controller
|
||||
|
||||
// Only for single booking
|
||||
// TODO : Multiple booking
|
||||
public function store(Request $request, $id)
|
||||
public function store(Request $request)
|
||||
{
|
||||
$payment_amount = $request->input("payment_amount");
|
||||
$rate = $request->input("rate");
|
||||
$rebate = $request->input("rebate");
|
||||
|
||||
$transfer_amount = $request->input("transfer_amount");
|
||||
$supplier_id = $request->input("supplier_id");
|
||||
$booking_id = $request->input("booking_id");
|
||||
$rate = $request->input('rate');
|
||||
$rebate = $request->input('rebate');
|
||||
|
||||
if ($supplierbooking = SupplierBooking::where('book_id', $booking_id)->first()){
|
||||
return response()->json(['success'=>false, 'message'=>'Bad request, please contact support'], 400);
|
||||
}
|
||||
|
||||
|
||||
// Calculation
|
||||
$amountInRMB = $payment_amount * $rate;
|
||||
$billing = 0.015 * $payment_amount;
|
||||
$sales_tax = 0.10 * $payment_amount;
|
||||
$gst = 0 * $payment_amount; // do we still need this ?
|
||||
$customerBankInAmount = round($payment_amount + $gst + $sales_tax + $billing,2);
|
||||
$amountInRMB = $transfer_amount * $rate;
|
||||
$billing = 0.015 * $transfer_amount;
|
||||
$sales_tax = 0.10 * $transfer_amount;
|
||||
$gst = 0 * $transfer_amount; // do we still need this ?
|
||||
$customerBankInAmount = round($transfer_amount + $gst + $sales_tax + $billing,2);
|
||||
$rmbBankAmount = $customerBankInAmount + $rebate;
|
||||
|
||||
$user = Auth::user();
|
||||
$supplier = SettingSupplier::find($supplier_id);
|
||||
$booking = Booking::find($id);
|
||||
$booking = Booking::find($booking_id);
|
||||
|
||||
$bookingsupplier = new BookingSupplier();
|
||||
$bookingsupplier = new SupplierBooking();
|
||||
$bookingsupplier->supplier_id = $supplier->id;
|
||||
$bookingsupplier->payment_method = $request->input('payment_method');
|
||||
$bookingsupplier->payment_amount = $request->input('payment_amount');
|
||||
$bookingsupplier->rate = $request->input('rate');
|
||||
$bookingsupplier->rebate = $request->input('rebate');
|
||||
$bookingsupplier->user()->associate($user);
|
||||
$bookingsupplier->transfer_amount = $transfer_amount;
|
||||
$bookingsupplier->rate = $rate;
|
||||
$bookingsupplier->rebate = $rebate;
|
||||
$bookingsupplier->amountInRMB = $amountInRMB;
|
||||
$bookingsupplier->rmbBankAmount = $rmbBankAmount;
|
||||
$bookingsupplier->booking()->associate($booking);
|
||||
$bookingsupplier->book_id = $booking->id;
|
||||
$bookingsupplier->save();
|
||||
|
||||
// update booking status
|
||||
$booking->status = 4;
|
||||
$booking->admin_status = 3;
|
||||
$booking->save();
|
||||
$booking->admin_status = 4;
|
||||
$booking->save();
|
||||
|
||||
// TODO : generate a jpg version of report and save the path
|
||||
|
||||
//// one bookingsupplier has many booking
|
||||
// $bookings = $request->input("booking");
|
||||
// foreach ($bookings as $booking)
|
||||
// {
|
||||
// $bookingsupplierbooking = new Booking(array(
|
||||
// 'book_id' => $booking->id,
|
||||
// 'supplierbooking_id' => $supplier->id
|
||||
// ));
|
||||
// $bookingsupplierbooking->save();
|
||||
|
||||
// $new_supplierbooking = new SupplierBookingItem(array(
|
||||
// 'book_id' => $booking->id,
|
||||
// 'bank_in_amount'=>$booking['bank_in_amount'],
|
||||
// 'date'=>$booking['date'],
|
||||
// 'details'=>$booking['details'],
|
||||
// 'supplierbooking_id' => $supplier->id
|
||||
// ));
|
||||
// $new_supplierbooking->save();
|
||||
|
||||
// }
|
||||
return response()->json($bookingsupplier, 201);
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$bookingsupplier = BookingSupplier::find($id);
|
||||
$bookingsupplier = BSupplierBooking::find($id);
|
||||
$bookingsupplier->payment_method = $request->input('payment_method');
|
||||
$bookingsupplier->payment_amount = $request->input('payment_amount');
|
||||
$bookingsupplier->transfer_amount = $request->input('transfer_amount');
|
||||
$bookingsupplier->rate = $request->input('rate');
|
||||
$bookingsupplier->rebate = $request->input('rebate');
|
||||
// calculation
|
||||
@@ -141,4 +131,6 @@ class BookingSupplierController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,118 +3,85 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\ChinaBankSlip;
|
||||
use App\Booking;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Validator;
|
||||
|
||||
class ChinaBankSlipController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
public function store(Request $request, $id)
|
||||
{
|
||||
$booking = Booking::where('id',$id)->firstOrFail();
|
||||
|
||||
// TODO : put this after check file exist
|
||||
// validate file format
|
||||
$validator = Validator::make($request->all(), [
|
||||
'file' => 'image|mimes:jpg,jpeg,bmp,png'
|
||||
]);
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
// Handle File Upload
|
||||
if($request->hasFile('china_bank_slips')){
|
||||
// Get filename with the extension
|
||||
$filenameWithExt = $request->file('china_bank_slips')->getClientOriginalName();
|
||||
// Get just filename
|
||||
$filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
|
||||
// Get just ext
|
||||
$extension = $request->file('china_bank_slips')->getClientOriginalExtension();
|
||||
// Filename to store
|
||||
$fileNameToStore= $filename.'_'.time().'.'.$extension;
|
||||
|
||||
// File size checking
|
||||
$validator = Validator::make($request->all(), [
|
||||
'china_bank_slips' => 'max:3072'
|
||||
]);
|
||||
|
||||
if($validator->fails())
|
||||
{
|
||||
return response()->json(['message'=>'Image too large, upload files up to 3 MB'], 400);
|
||||
}
|
||||
// Upload Image
|
||||
$path = $request->file('china_bank_slips')->storeAs('public/bankslip', $fileNameToStore);
|
||||
} else {
|
||||
$fileNameToStore = 'hello.jpg';
|
||||
if($validator->fails())
|
||||
{
|
||||
return response()->json(['message'=>'Incorrect format'],200);
|
||||
}
|
||||
// Create Post
|
||||
$post = new ChinaBankSlip;
|
||||
$post->actual_transfer_amount = $request->input('actual_transfer_amount');
|
||||
$post->date = $request->input('date');
|
||||
$post->details = $request->input('details');
|
||||
$post->china_bank_slip_path = $fileNameToStore;
|
||||
$post->save();
|
||||
return response()->json(['message'=>$post], 200);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\ChinaBankSlip $chinaBankSlip
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(ChinaBankSlip $chinaBankSlip)
|
||||
{
|
||||
//
|
||||
$validator = Validator::make($request->all(), [
|
||||
'china_bank_slips' => 'max:3072'
|
||||
]);
|
||||
|
||||
if($validator->fails())
|
||||
{
|
||||
return response()->json(['message'=>'Image too large, upload files up to 3 MB'], 400);
|
||||
}
|
||||
|
||||
|
||||
if($bankslip_file = $request->file('file')){
|
||||
|
||||
$filename = $bankslip_file->getClientOriginalName();
|
||||
$ext = $bankslip_file->getClientOriginalExtension();
|
||||
$unique_name = 'cnbank_slip_' . md5($filename. time()); // probably not a good idea
|
||||
$unique_image_path = $unique_name. '.' .$ext;
|
||||
|
||||
// Upload Image
|
||||
$upload_path = Storage::disk('public')->putFileAs(
|
||||
'china_bank_slip', $bankslip_file, $unique_image_path
|
||||
);
|
||||
|
||||
|
||||
} else {
|
||||
return response()->json(['message'=>'file not found'],200);
|
||||
}
|
||||
|
||||
$china_bankslip = new ChinaBankSlip;
|
||||
$china_bankslip->booking_id = $booking->id;
|
||||
$china_bankslip->china_bank_slip_path = $upload_path;
|
||||
$china_bankslip->save();
|
||||
|
||||
return response()->json(['message'=>'success'], 201);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\ChinaBankSlip $chinaBankSlip
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(ChinaBankSlip $chinaBankSlip)
|
||||
{
|
||||
//
|
||||
public function update(Request $request, $id){
|
||||
$booking = Booking::where('id',$id)->first();
|
||||
$china_bankslip = $booking->chinaBankSlip()->first();
|
||||
|
||||
// TODO: first or fail
|
||||
if(!$china_bankslip){
|
||||
return response()->json(["message"=> "China bankslip not found. Please upload first."],400);
|
||||
}
|
||||
|
||||
$china_bankslip->actual_transfer_amount = $request->input('actual_transfer_amount');
|
||||
$china_bankslip->date = $request->input('date');
|
||||
$china_bankslip->details = $request->input('details');
|
||||
$china_bankslip->save();
|
||||
|
||||
// update booking status
|
||||
$booking->status = 5;
|
||||
$booking->admin_status = 6;
|
||||
$booking->save();
|
||||
|
||||
return response()->json(["message"=> "Success"],200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\ChinaBankSlip $chinaBankSlip
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, ChinaBankSlip $chinaBankSlip)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\ChinaBankSlip $chinaBankSlip
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(ChinaBankSlip $chinaBankSlip)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class SettingSupplierController extends Controller
|
||||
$suppliers = SettingSupplier::all();
|
||||
|
||||
foreach ($suppliers as $supplier) {
|
||||
$supplier->value = $supplier->company_name;
|
||||
$supplier->value = $supplier->id;
|
||||
$supplier->label = $supplier->company_name;
|
||||
}
|
||||
return $suppliers;
|
||||
|
||||
@@ -7,4 +7,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Invoice extends Model
|
||||
{
|
||||
protected $fillable = ['invoice_url','amount','booking_id'];
|
||||
|
||||
public function booking(){
|
||||
return $this->hasOne('App\Booking');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class PurchaseOrder extends Model
|
||||
{
|
||||
protected $fillable = ['image_url','amount','booking_id'];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class BookingSupplier extends Model
|
||||
class SupplierBooking extends Model
|
||||
{
|
||||
// protected $guarded = [];
|
||||
protected $fillable = ['rate','rebate','payment_amount','payment_method'];
|
||||
@@ -4,6 +4,10 @@ use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\SettingSupplier::class, function (Faker $faker) {
|
||||
return [
|
||||
//
|
||||
'company_name' => $faker->name,
|
||||
'gst_no' => $faker->unique()->randomDigit,
|
||||
'supplier_reg_no' => $faker->unique()->randomDigit,
|
||||
'bank_name' => $faker->name,
|
||||
'acc_no' => $faker->unique()->randomDigit
|
||||
];
|
||||
});
|
||||
|
||||
@@ -30,6 +30,6 @@ class CreateUsersTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,6 @@ class CreateRatesTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('rates');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class CreateBookingsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('bookings');
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,6 @@ class SupplierBookingTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('booking_suppliers');
|
||||
Schema::dropIfExists('supplier_bookings');
|
||||
}
|
||||
}
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class MakePaymentmethodNulltableInSupplierbookingTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('supplier_bookings', function($table)
|
||||
{
|
||||
$table->string('payment_method')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddBookingidForeignkeyToChinabankslipTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('china_bank_slips', function($table)
|
||||
{
|
||||
$table->integer('booking_id')->unsigned();
|
||||
$table->foreign('booking_id')->references('id')->on('bookings');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 RenameBookingForeignkeyInPoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('purchase_orders', function($table)
|
||||
{
|
||||
$table->dropForeign(['book_id']);
|
||||
$table->dropColumn('book_id');
|
||||
$table->integer('booking_id')->unsigned();
|
||||
$table->foreign('booking_id')->references('id')->on('bookings');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -18,5 +18,9 @@ class DatabaseSeeder extends Seeder
|
||||
$this->call(RateTableSeeder::class);
|
||||
$this->call(BookTableSeeder::class);
|
||||
$this->call(SettingCreditSeeder::class);
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
$this->call(SuppliersTableSeeder::class);
|
||||
>>>>>>> 722dbacd00523cf1ab207f77a3538f31199de32f
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SuppliersTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('setting_suppliers')->insert([
|
||||
'company_name' => 'WongKok PLT',
|
||||
'gst_no' => 'GTS12232123',
|
||||
'bank_name' => 'HSBC',
|
||||
'acc_no' => '86774723848593'
|
||||
]);
|
||||
}
|
||||
}
|
||||
Generated
+1999
-316
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -33,7 +33,8 @@
|
||||
"vue-meta": "^1.4.4",
|
||||
"vue-router": "^3.0.1",
|
||||
"vuex": "^3.0.1",
|
||||
"vuex-router-sync": "^5.0.0"
|
||||
"vuex-router-sync": "^5.0.0",
|
||||
"webpack": "^3.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-eslint": "^3.0.0-beta.6",
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<el-step title="Supplier Booking"/>
|
||||
<el-step title="Supplier Report"/>
|
||||
<el-step title="Upload China Bankslip To Booking"/>
|
||||
<el-step title="Waiting Purchase Order"/>
|
||||
<el-step title="Invoice"/>
|
||||
<el-step title="Completed"/>
|
||||
</el-steps>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- <li class="nav-item dropdown">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{{ locales[locale] }}
|
||||
@@ -12,12 +12,57 @@
|
||||
{{ value }}
|
||||
</a>
|
||||
</div>
|
||||
</li> -->
|
||||
<li v-if="(user && role == 'admin')"><a class="nav-link" href="#" role="button">Update Rate</a></li>
|
||||
<li v-if="(user && role == 'admin')"><a class="nav-link" href="#" role="button">Complete Order</a></li>
|
||||
<li v-if="(user && role == 'admin')"><a class="nav-link" href="#" role="button">Transaction History</a></li>
|
||||
<li v-if="(user && role == 'admin')"><a class="nav-link" href="#" role="button">Upload Supplier Bank Slip to System</a></li>
|
||||
</li>
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li v-if="(user && role == 'admin')" class="nav-item">
|
||||
<el-popover placement="top" width="300" v-model="UpdateRatePopoverVisible">
|
||||
<div align="center">
|
||||
<p>Today's Rate</p>
|
||||
<p>X1 : Cash: {{x1_cash}} Cheque: {{x1_cheque}} BA: {{x1_ba}}</p>
|
||||
<p>X2 : Cash: {{x2_cash}} Cheque: {{x2_cheque}} BA: {{x2_ba}}</p>
|
||||
</div>
|
||||
<div style="text-align: center; margin: 0">
|
||||
<el-button type="primary" size="mini" @click="UpdateRatePopoverVisible = false; UpdateRateDialogVisible = true">Update rate</el-button>
|
||||
</div>
|
||||
<a class="nav-link" href="#" role="button" slot="reference">Update Rate</a>
|
||||
</el-popover>
|
||||
</li></ul>
|
||||
<li v-if="(user && role == 'admin')" class="nav-item"><router-link :to="{ name: 'admin.complete-order' }" class="nav-link">{{ $t('Complete Order') }}</router-link></li>
|
||||
<li v-if="(user && role == 'admin')" class="nav-item"><router-link :to="{ name: 'admin.transaction-history' }" class="nav-link">{{ $t('Transaction History') }}</router-link></li>
|
||||
<li v-if="(user && role == 'admin')" class="nav-item"><router-link :to="{ name: 'admin.upload-supplier-bank-slip' }" class="nav-link">{{ $t('Upload Supplier Bank Slip to System') }}</router-link></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- update rate dialog -->
|
||||
<el-dialog align="center" :visible.sync="UpdateRateDialogVisible">
|
||||
<el-form :inline="true" align="center">
|
||||
<el-form-item>X1 :
|
||||
Cash : <el-input style=width:10% ></el-input>
|
||||
Cheque : <el-input style=width:10%></el-input>
|
||||
BA : <el-input style=width:10%></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form :inline="true" align="center">
|
||||
<el-form-item>X2 :
|
||||
Cash : <el-input style=width:10% ></el-input>
|
||||
Cheque : <el-input style=width:10%></el-input>
|
||||
BA : <el-input style=width:10%></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div align="center">
|
||||
<el-button type="text" @click="UpdateRateDialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="UpdateRateDialogVisible = false; DoneUpdateRateDialogVisible = true">Save</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- update rate dialog end -->
|
||||
<!-- update rate dialog done -->
|
||||
<el-dialog align="center" :visible.sync="DoneUpdateRateDialogVisible" width="30%">
|
||||
<span>Rate Successfully Updated</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DoneUpdateRateDialogVisible = false">OK</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- update rate dialog done end -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -26,6 +71,19 @@ import { mapGetters } from 'vuex'
|
||||
import { loadMessages } from '~/plugins/i18n'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
UpdateRatePopoverVisible: false,
|
||||
UpdateRateDialogVisible: false,
|
||||
DoneUpdateRateDialogVisible: false,
|
||||
x1_cash: '1.56',
|
||||
x1_cheque: '1.63',
|
||||
x1_ba: '1.66',
|
||||
x2_cash: '1.61',
|
||||
x2_cheque: '1.70',
|
||||
x2_ba: '1.72',
|
||||
};
|
||||
},
|
||||
computed: mapGetters({
|
||||
locale: 'lang/locale',
|
||||
locales: 'lang/locales',
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<el-step title="Order Confirmation"/>
|
||||
<el-step title="Processing Transfer"/>
|
||||
<el-step title="Transfer Complete"/>
|
||||
<el-step title="Processing Invoice"/>
|
||||
<el-step title="Order Complete"/>
|
||||
</el-steps>
|
||||
</el-row>
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<progress-track v-model="status"/>
|
||||
|
||||
<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 :gutter="12" type="flex">
|
||||
<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 :gutter="12" type="flex">
|
||||
<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 :gutter="12" type="flex">
|
||||
<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" :show-header="false" align="center">
|
||||
<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" :show-header="false" align="center">
|
||||
<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/AdminProgressTrack'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
status: 8,
|
||||
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>
|
||||
@@ -219,7 +219,7 @@
|
||||
<el-input v-model="supplierBookingForm.rebate" type="text" placeholder="Rebate" style="width: 80%" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="transfer_amount">
|
||||
<el-input v-model="supplierBookingForm.payment_amount" type="text" placeholder="Payment Amount" style="width: 80%" />
|
||||
<el-input v-model="supplierBookingForm.transfer_amount" type="text" placeholder="Payment Amount" style="width: 80%" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :loading="loading_btn" type="primary" @click="generateReport('supplierBookingForm')">Generate Report</el-button>
|
||||
@@ -260,6 +260,7 @@
|
||||
supplierBookingForm: {
|
||||
supplier: null,
|
||||
amount: null,
|
||||
rebate: null,
|
||||
rate: null,
|
||||
transfer_amount: null,
|
||||
},
|
||||
@@ -329,27 +330,33 @@
|
||||
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let newSupplierBooking = this.supplierBookingForm
|
||||
let newReport = {
|
||||
booking_id: this.$route.params.id,
|
||||
supplier_id: this.supplierBookingForm.supplier,
|
||||
amount: this.supplierBookingForm.amount,
|
||||
rebate: this.supplierBookingForm.rebate,
|
||||
rate: this.supplierBookingForm.rate,
|
||||
transfer_amount: this.supplierBookingForm.transfer_amount,
|
||||
}
|
||||
|
||||
// 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)
|
||||
// })
|
||||
axios.post('/api/supplier-booking', newReport)
|
||||
.then((response) => {
|
||||
this.loading_btn = false
|
||||
|
||||
this.$router.push({
|
||||
name: 'booking.admin.supplier.report',
|
||||
params: {id: this.$route.params.id }
|
||||
})
|
||||
// redirect to supplier report
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
this.loading_btn = false
|
||||
console.log(error)
|
||||
|
||||
// TODO : Show error message
|
||||
|
||||
})
|
||||
|
||||
} else {
|
||||
this.loading_btn = false
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<progress-track v-model="status"/>
|
||||
<progress-track v-model="status" />
|
||||
|
||||
<div align="center">
|
||||
<h4 style="margin-top:5%;">Transfer In Progress</h4>
|
||||
<h4 style="margin-top:5%;"></h4>
|
||||
<br>
|
||||
<h5> ETA : 3 days 14 Hours </h5>
|
||||
<h5> Supplier Report</h5>
|
||||
<br>
|
||||
<el-button type="primary" @click="$router.go(-1)">Go Back</el-button>
|
||||
<!-- <el-button type="primary" @click="$router.go(-1)">Go Back</el-button> -->
|
||||
</div>
|
||||
<br>
|
||||
<el-row justify="center" align="center">
|
||||
@@ -16,7 +16,165 @@
|
||||
<span>Order Details</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<div class="el-row" style="margin-left: -6px; margin-right: -6px;">
|
||||
<div class="el-col el-col-12" style="padding-left: 6px; padding-right: 6px;">
|
||||
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" align="center">
|
||||
|
||||
<div class="el-table__body-wrapper is-scrolling-none">
|
||||
<table class="el-table__body" style="width: 400px;" cellspacing="0" cellpadding="0" border="0">
|
||||
<colgroup>
|
||||
<col name="el-table_2_column_9" width="200">
|
||||
<col name="el-table_2_column_10" width="200">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Order Number :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.id }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Date :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.created_at }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Term :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.term }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<!---->
|
||||
</tbody>
|
||||
</table>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="el-table__column-resize-proxy" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="el-col el-col-12" style="padding-left: 6px; padding-right: 6px;">
|
||||
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" align="center">
|
||||
<div class="hidden-columns">
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<!---->
|
||||
<div class="el-table__body-wrapper is-scrolling-none">
|
||||
<table class="el-table__body" style="width: 400px;" cellspacing="0" cellpadding="0" border="0">
|
||||
<colgroup>
|
||||
<col name="el-table_3_column_11" width="200">
|
||||
<col name="el-table_3_column_12" width="200">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">CNY/RMB :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">CNY {{ booking_details.amount }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">+ Service Charge :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">CNY {{ booking_details.service_charge }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">/ RATE :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">{{ booking_details.rate }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">MYR {{ booking_details.bia }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">+ GST 6% :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">MYR 4,430.88</div>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">
|
||||
<b>MYR {{ booking_details.bia }}</b>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<!---->
|
||||
</tbody>
|
||||
</table>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="el-table__column-resize-proxy" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable" :show-header="false" align="center">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
@@ -29,7 +187,7 @@
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
</el-card>
|
||||
</el-row>
|
||||
<br>
|
||||
@@ -37,12 +195,34 @@
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>BankinSlip</span>
|
||||
<span>Supplier Report</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12" style="text-align:center">
|
||||
<el-col :span="20" style="text-align:center">
|
||||
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<br>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>User 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">
|
||||
<img v-bind:src="booking_details.user_bankslip_path" class="image">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<br>
|
||||
<el-card class="box-card">
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="22" style="text-align:center">
|
||||
<el-button :loading="loading_btn" @click="editReport" type="primary">Edit</el-button>
|
||||
<el-button :loading="loading_btn" @click="completeReport" type="success">Done</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
@@ -55,20 +235,88 @@
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import VueCountdown from '@dmaksimovic/vue-countdown'
|
||||
import ProgressTrack from '~/components/AdminProgressTrack'
|
||||
import ProgressTrack from '~/components/AdminProgressTrack'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 4,
|
||||
loading_btn: false,
|
||||
booking_details: {
|
||||
id: null,
|
||||
amount: null,
|
||||
bia: null,
|
||||
user_bankslip_path: null,
|
||||
},
|
||||
supplier: null,
|
||||
supplier_options: null,
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Please wait..',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
axios
|
||||
.get('/api/admin/booking/' + this.$route.params.id)
|
||||
.then((response) => {
|
||||
loading.close()
|
||||
this.booking_details = response.data
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
loading.close()
|
||||
this.$router.push({
|
||||
name: 'notfound'
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
completeReport(){
|
||||
// TODO : send request to change status
|
||||
this.loading_btn = true
|
||||
axios
|
||||
.post('/api/booking/' + this.$route.params.id + '/confirm-supplier')
|
||||
.then((response) => {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Success, please comeback after getting china bankslip',
|
||||
type: 'success',
|
||||
duration: 5000
|
||||
})
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
})
|
||||
//this.booking_details = response.data
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Suceess',
|
||||
type: 'success',
|
||||
duration: 5000
|
||||
})
|
||||
})
|
||||
|
||||
this.loading_btn = false
|
||||
|
||||
this.$router.push({
|
||||
name: 'booking.admin.cnslip',
|
||||
params: {id: this.$route.params.id }
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
status: 4
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<progress-track v-model="status"/>
|
||||
<progress-track v-model="status" />
|
||||
|
||||
<div align="center">
|
||||
<h4 style="margin-top:5%;">Transfer In Progress</h4>
|
||||
<h4 style="margin-top:5%;"></h4>
|
||||
<br>
|
||||
<h5> ETA : 3 days 14 Hours </h5>
|
||||
<h5> Upload China Bankslip To Customer </h5>
|
||||
<br>
|
||||
<el-button type="primary" @click="$router.go(-1)">Go Back</el-button>
|
||||
<!-- <el-button type="primary" @click="$router.go(-1)">Go Back</el-button> -->
|
||||
</div>
|
||||
<br>
|
||||
<el-row justify="center" align="center">
|
||||
@@ -16,7 +16,165 @@
|
||||
<span>Order Details</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<div class="el-row" style="margin-left: -6px; margin-right: -6px;">
|
||||
<div class="el-col el-col-12" style="padding-left: 6px; padding-right: 6px;">
|
||||
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" align="center">
|
||||
|
||||
<div class="el-table__body-wrapper is-scrolling-none">
|
||||
<table class="el-table__body" style="width: 400px;" cellspacing="0" cellpadding="0" border="0">
|
||||
<colgroup>
|
||||
<col name="el-table_2_column_9" width="200">
|
||||
<col name="el-table_2_column_10" width="200">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Order Number :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.id }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Date :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.created_at }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Term :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.term }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<!---->
|
||||
</tbody>
|
||||
</table>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="el-table__column-resize-proxy" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="el-col el-col-12" style="padding-left: 6px; padding-right: 6px;">
|
||||
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" align="center">
|
||||
<div class="hidden-columns">
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<!---->
|
||||
<div class="el-table__body-wrapper is-scrolling-none">
|
||||
<table class="el-table__body" style="width: 400px;" cellspacing="0" cellpadding="0" border="0">
|
||||
<colgroup>
|
||||
<col name="el-table_3_column_11" width="200">
|
||||
<col name="el-table_3_column_12" width="200">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">CNY/RMB :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">CNY {{ booking_details.amount }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">+ Service Charge :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">CNY {{ booking_details.service_charge }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">/ RATE :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">{{ booking_details.rate }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">MYR {{ booking_details.bia }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">+ GST 6% :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">MYR 4,430.88</div>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">
|
||||
<b>MYR {{ booking_details.bia }}</b>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<!---->
|
||||
</tbody>
|
||||
</table>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="el-table__column-resize-proxy" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable" :show-header="false" align="center">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
@@ -29,7 +187,7 @@
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
</el-card>
|
||||
</el-row>
|
||||
<br>
|
||||
@@ -37,12 +195,40 @@
|
||||
<el-row justify="center" align="center">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>BankinSlip</span>
|
||||
<span>Upload China Bankslip</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-row :gutter="12" style="text-align:center">
|
||||
<el-col :span="20" style="text-align:center">
|
||||
|
||||
<el-form ref="chinaSlipForm" :model="chinaSlipForm" :rules="rules">
|
||||
<div align="center">
|
||||
|
||||
<!-- upload image -->
|
||||
<el-upload class="upload-demo" :action="'/api/booking/' + booking_id + '/upload-china-bankslip'" :on-preview="handlePreview"
|
||||
:on-remove="handleRemove" :multiple="false" list-type="picture">
|
||||
<el-button size="small" type="primary">Click to upload</el-button>
|
||||
<div slot="tip" class="el-upload__tip">jpg/png files with a size less than 3mb</div>
|
||||
</el-upload>
|
||||
|
||||
<br>
|
||||
<!-- upload image end -->
|
||||
<el-form-item prop="date">
|
||||
<el-date-picker v-model="chinaSlipForm.date" type="date" placeholder="Pick a day" :picker-options="pickerOptions1">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="actual_transfer_amount">
|
||||
<el-input v-model="chinaSlipForm.actual_transfer_amount" type="text" placeholder="Amount" style="width: 80%" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="details">
|
||||
<el-input v-model="chinaSlipForm.details" type="text" placeholder="Details" style="width: 80%" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :loading="loading_btn" type="primary" @click="submitChinaSlip('chinaSlipForm')">Submit</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
@@ -55,20 +241,161 @@
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import VueCountdown from '@dmaksimovic/vue-countdown'
|
||||
import ProgressTrack from '~/components/AdminProgressTrack'
|
||||
import ProgressTrack from '~/components/AdminProgressTrack'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
status: 4
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 5,
|
||||
loading_btn: false,
|
||||
booking_id: this.$route.params.id,
|
||||
booking_details: {
|
||||
id: null,
|
||||
amount: null,
|
||||
bia: null,
|
||||
user_bankslip_path: null,
|
||||
},
|
||||
supplier: null,
|
||||
supplier_options: null,
|
||||
chinaSlipForm: {
|
||||
actual_transfer_amount: null,
|
||||
date: null,
|
||||
details: null,
|
||||
},
|
||||
rules: {
|
||||
actual_transfer_amount: [{
|
||||
required: true,
|
||||
message: 'Please input amount',
|
||||
trigger: 'change'
|
||||
}],
|
||||
date: [{
|
||||
required: true,
|
||||
message: 'Please input bank name',
|
||||
trigger: 'change'
|
||||
}],
|
||||
details: [{
|
||||
required: true,
|
||||
message: 'Please input details',
|
||||
trigger: 'change'
|
||||
}]
|
||||
},
|
||||
pickerOptions1: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() > Date.now();
|
||||
},
|
||||
shortcuts: [{
|
||||
text: 'Today',
|
||||
onClick(picker) {
|
||||
picker.$emit('pick', new Date());
|
||||
}
|
||||
}, {
|
||||
text: 'Yesterday',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
||||
picker.$emit('pick', date);
|
||||
}
|
||||
}, {
|
||||
text: 'A week ago',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', date);
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Please wait..',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
axios
|
||||
.get('/api/admin/booking/' + this.$route.params.id)
|
||||
.then((response) => {
|
||||
loading.close()
|
||||
this.booking_details = response.data
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
loading.close()
|
||||
this.$router.push({
|
||||
name: 'notfound'
|
||||
})
|
||||
})
|
||||
|
||||
axios
|
||||
.get('/api/setting-supplier/')
|
||||
.then((response) => {
|
||||
loading.close()
|
||||
this.supplier_options = response.data
|
||||
}).catch((error) => {
|
||||
loading.close()
|
||||
console.log(error)
|
||||
this.$router.push({
|
||||
name: 'notfound'
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
submitChinaSlip(formName) {
|
||||
this.loading_btn = true
|
||||
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let newChinaSlip = {
|
||||
date: this.chinaSlipForm.date,
|
||||
actual_transfer_amount: this.chinaSlipForm.actual_transfer_amount,
|
||||
details: this.chinaSlipForm.details,
|
||||
}
|
||||
|
||||
axios.patch('/api/booking/' + this.booking_id +'/update-china-bankslip', newChinaSlip)
|
||||
.then((response) => {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Your bankinslip has been submitted, please wait customer to upload their purchase order.',
|
||||
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)
|
||||
this.loading_btn = false
|
||||
})
|
||||
|
||||
} else {
|
||||
this.loading_btn = false
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,13 +1,20 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<progress-track v-model="status"/>
|
||||
<progress-track v-model="status" />
|
||||
|
||||
<div align="center">
|
||||
<h4 style="margin-top:5%;">Transfer In Progress</h4>
|
||||
<h4 style="margin-top:5%;"></h4>
|
||||
<br>
|
||||
<h5> ETA : 3 days 14 Hours </h5>
|
||||
<div v-if="user_po_path !== null">
|
||||
<h4>Upload Invoice</h4>
|
||||
</div>
|
||||
<div v-else>
|
||||
<h4>Waiting for User to Upload Purchase Order </h4>
|
||||
<br>
|
||||
<el-button type="primary" @click="$router.go(-1)">Go Back</el-button>
|
||||
</div>
|
||||
<br>
|
||||
<el-button type="primary" @click="$router.go(-1)">Go Back</el-button>
|
||||
<!-- <el-button type="primary" @click="$router.go(-1)">Go Back</el-button> -->
|
||||
</div>
|
||||
<br>
|
||||
<el-row justify="center" align="center">
|
||||
@@ -16,36 +23,208 @@
|
||||
<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" :show-header="false" align="center">
|
||||
<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" :show-header="false" align="center">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="el-row" style="margin-left: -6px; margin-right: -6px;">
|
||||
<div class="el-col el-col-12" style="padding-left: 6px; padding-right: 6px;">
|
||||
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" align="center">
|
||||
|
||||
<div class="el-table__body-wrapper is-scrolling-none">
|
||||
<table class="el-table__body" style="width: 400px;" cellspacing="0" cellpadding="0" border="0">
|
||||
<colgroup>
|
||||
<col name="el-table_2_column_9" width="200">
|
||||
<col name="el-table_2_column_10" width="200">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Order Number :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.id }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Date :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.created_at }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Term :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.term }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<!---->
|
||||
</tbody>
|
||||
</table>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="el-table__column-resize-proxy" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="el-col el-col-12" style="padding-left: 6px; padding-right: 6px;">
|
||||
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" align="center">
|
||||
<div class="hidden-columns">
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<!---->
|
||||
<div class="el-table__body-wrapper is-scrolling-none">
|
||||
<table class="el-table__body" style="width: 400px;" cellspacing="0" cellpadding="0" border="0">
|
||||
<colgroup>
|
||||
<col name="el-table_3_column_11" width="200">
|
||||
<col name="el-table_3_column_12" width="200">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">CNY/RMB :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">CNY {{ booking_details.amount }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">+ Service Charge :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">CNY {{ booking_details.service_charge }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">/ RATE :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">{{ booking_details.rate }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">MYR {{ booking_details.bia }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">+ GST 6% :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">MYR 4,430.88</div>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">
|
||||
<b>MYR {{ booking_details.bia }}</b>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<!---->
|
||||
</tbody>
|
||||
</table>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<div class="el-table__column-resize-proxy" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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 v-if="user_po_path !== null" :gutter="12" justify="center" align="center">
|
||||
<el-col :span="12">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>Upload Invoice</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
|
||||
<!-- upload image -->
|
||||
<el-upload :action="'/api/booking/' + booking_id + '/upload-invoice'" :on-exceed="handleExceed" :on-preview="handlePreview"
|
||||
:on-remove="handleRemove"
|
||||
class="upload-demo"
|
||||
drag
|
||||
multiple>
|
||||
<i class="el-icon-upload"/>
|
||||
<div class="el-upload__text">Drop file here or
|
||||
<em>click to upload</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__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 :loading="loading_btn" type="primary" @click="confirmInvoice">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>Customer Purchase Order</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12" type="flex">
|
||||
<el-col :span="12">
|
||||
<img v-bind:src="user_po_path" width="100%" height="100%">
|
||||
<img v-bind:src="booking_details.user_bankslip_path" class="image">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-main>
|
||||
</template>
|
||||
@@ -55,20 +234,143 @@
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import VueCountdown from '@dmaksimovic/vue-countdown'
|
||||
import ProgressTrack from '~/components/AdminProgressTrack'
|
||||
import ProgressTrack from '~/components/AdminProgressTrack'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
status: 4
|
||||
export default {
|
||||
components: {
|
||||
'progress-track': ProgressTrack
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
status: 6,
|
||||
loading_btn: false,
|
||||
booking_id: this.$route.params.id,
|
||||
user_po_path: null,
|
||||
booking_details: {
|
||||
id: null,
|
||||
amount: null,
|
||||
bia: null,
|
||||
user_bankslip_path: null,
|
||||
},
|
||||
supplier: null,
|
||||
supplier_options: null,
|
||||
chinaSlipForm: {
|
||||
actual_transfer_amount: null,
|
||||
date: null,
|
||||
details: null,
|
||||
},
|
||||
rules: {
|
||||
actual_transfer_amount: [{
|
||||
required: true,
|
||||
message: 'Please input amount',
|
||||
trigger: 'change'
|
||||
}],
|
||||
date: [{
|
||||
required: true,
|
||||
message: 'Please input bank name',
|
||||
trigger: 'change'
|
||||
}],
|
||||
details: [{
|
||||
required: true,
|
||||
message: 'Please input details',
|
||||
trigger: 'change'
|
||||
}]
|
||||
},
|
||||
pickerOptions1: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() > Date.now();
|
||||
},
|
||||
shortcuts: [{
|
||||
text: 'Today',
|
||||
onClick(picker) {
|
||||
picker.$emit('pick', new Date());
|
||||
}
|
||||
}, {
|
||||
text: 'Yesterday',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
||||
picker.$emit('pick', date);
|
||||
}
|
||||
}, {
|
||||
text: 'A week ago',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', date);
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Please wait..',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
|
||||
axios
|
||||
.get('/api/admin/booking/' + this.$route.params.id)
|
||||
.then((response) => {
|
||||
this.booking_details = response.data
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
loading.close()
|
||||
this.$router.push({
|
||||
name: 'notfound'
|
||||
})
|
||||
})
|
||||
|
||||
axios
|
||||
.get('/api/booking/'+ this.$route.params.id +'/po')
|
||||
.then((response) => {
|
||||
loading.close()
|
||||
this.user_po_path = response.user_po_path
|
||||
}).catch((error) => {
|
||||
loading.close()
|
||||
console.log(error)
|
||||
this.$router.push({
|
||||
name: 'notfound'
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
confirmInvoice () {
|
||||
this.loading_btn = true
|
||||
axios
|
||||
.post('/api/booking/' + this.$route.params.id + '/confirm-invoice')
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Your invoice has been uploaded. Order completed !',
|
||||
type: 'success',
|
||||
duration: 5000
|
||||
})
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
})
|
||||
this.loading_btn = false
|
||||
}).catch((error) => {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Please upload invoice',
|
||||
type: 'error',
|
||||
duration: 30000
|
||||
})
|
||||
this.loading_btn = false
|
||||
})
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<div>
|
||||
<span align="center"><h2>Complete Order</h2></span><br>
|
||||
<el-table :data="tableData" stripe style="width: 100%">
|
||||
<el-table-column prop="order_no" label="Order No" sortable></el-table-column>
|
||||
<el-table-column prop="cust_marking" label="Customer Marking" sortable></el-table-column>
|
||||
<el-table-column prop="order_date" label="Order Date" sortable></el-table-column>
|
||||
<el-table-column prop="transfer_amount" label="Transfer Amount (RMB)" sortable></el-table-column>
|
||||
<el-table-column prop="status" label="Status"></el-table-column>
|
||||
</el-table><br><br>
|
||||
<div align="right">
|
||||
<el-pagination background layout="prev, pager, next" :total="30"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [{
|
||||
order_no: '001',
|
||||
cust_marking: 'CIEF/155ECE',
|
||||
order_date: '27/6/2018',
|
||||
transfer_amount: '1200',
|
||||
status: 'Complete',
|
||||
}, {
|
||||
order_no: '002',
|
||||
cust_marking: 'CIEF/143EDR',
|
||||
order_date: '23/6/2018',
|
||||
transfer_amount: '14000',
|
||||
status: 'Complete',
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -124,7 +124,7 @@ export default {
|
||||
|
||||
case 7:
|
||||
this.$router.push({
|
||||
name: 'booking.complete',
|
||||
name: 'booking.admin.complete',
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div>
|
||||
<span align="center"><h2>Transaction History</h2></span><br>
|
||||
<el-table :data="tableData" stripe style="width: 100%">
|
||||
<el-table-column prop="transaction_date" label="Transaction Date" sortable></el-table-column>
|
||||
<el-table-column prop="booking_no" label="Booking No" sortable></el-table-column>
|
||||
<el-table-column prop="marking" label="Marking" sortable></el-table-column>
|
||||
<el-table-column prop="debit_in" label="Debit In"></el-table-column>
|
||||
<el-table-column prop="credit_out" label="Credit Out"></el-table-column>
|
||||
<el-table-column prop="balance" label="Balance"></el-table-column>
|
||||
<el-table-column prop="bank_recon" label="Bank Recon"></el-table-column>
|
||||
</el-table><br><br>
|
||||
<div align="right">
|
||||
<el-button>Export to Excel</el-button><el-button>Print</el-button><br><br>
|
||||
<el-pagination background layout="prev, pager, next" :total="30"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<div>
|
||||
<span align="center"><h2>Uploaded Supplier Bank Slip</h2></span><br>
|
||||
<div align="right">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="AddNewDialogVisible = true">Add New</el-button>
|
||||
</div><br>
|
||||
<el-table :data="tableData" stripe style="width: 100%">
|
||||
<el-table-column label="Order No" sortable></el-table-column>
|
||||
<el-table-column label="Amount (RMB)" sortable></el-table-column>
|
||||
<el-table-column label="Date" sortable></el-table-column>
|
||||
<el-table-column label="Bank Slip File"></el-table-column>
|
||||
</el-table><br><br>
|
||||
|
||||
<!-- popup add new dialog -->
|
||||
<el-dialog align="center" :visible.sync="AddNewDialogVisible">
|
||||
<el-form :label-position="right" label-width="150px">
|
||||
<el-form-item label="Select bank slip : " align="left">
|
||||
<el-upload class="upload-slip" action="https://jsonplaceholder.typicode.com/posts/" :on-preview="handlePreview" :on-remove="handleRemove" list-type="picture">
|
||||
<el-button size="small" type="primary">Click to upload</el-button></el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="For Order No : "><el-input></el-input></el-form-item>
|
||||
<el-form-item label="Amount : "><el-input></el-input></el-form-item>
|
||||
<el-form-item label="Date : " align="left"><el-date-picker v-model="date" type="date" placeholder="Pick a date"></el-date-picker></el-form-item>
|
||||
</el-form>
|
||||
<div align="center">
|
||||
<el-button type="text" @click="AddNewDialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="AddNewDialogVisible = false; DoneAddNewDialogVisible = true">Submit</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup add new dialog end -->
|
||||
<!-- popup done upload -->
|
||||
<el-dialog align="center" :visible.sync="DoneAddNewDialogVisible" width="30%">
|
||||
<span>Bank Slip Successfully Updated</span><br><br>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="DoneAddNewDialogVisible = false">Close</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- popup done upload end -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
AddNewDialogVisible: false,
|
||||
DoneAddNewDialogVisible: false,
|
||||
date: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -14,7 +14,7 @@
|
||||
<span>Order Details</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<!-- <el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable" :show-header="false" align="center">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
@@ -27,7 +27,177 @@
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
<div class="el-row" style="margin-left: -6px; margin-right: -6px;">
|
||||
<div class="el-col el-col-12" style="padding-left: 6px; padding-right: 6px;">
|
||||
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" align="center">
|
||||
|
||||
<div class="el-table__body-wrapper is-scrolling-none">
|
||||
<table class="el-table__body" style="width: 400px;" cellspacing="0" cellpadding="0" border="0">
|
||||
<colgroup>
|
||||
<col name="el-table_2_column_9" width="200">
|
||||
<col name="el-table_2_column_10" width="200">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Order Number :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.id }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Date :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.created_at }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Term :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.term }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<!---->
|
||||
</tbody>
|
||||
</table>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="el-table__column-resize-proxy" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="el-col el-col-12" style="padding-left: 6px; padding-right: 6px;">
|
||||
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" align="center">
|
||||
<div class="hidden-columns">
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<!---->
|
||||
<div class="el-table__body-wrapper is-scrolling-none">
|
||||
<table class="el-table__body" style="width: 400px;" cellspacing="0" cellpadding="0" border="0">
|
||||
<colgroup>
|
||||
<col name="el-table_3_column_11" width="200">
|
||||
<col name="el-table_3_column_12" width="200">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">CNY/RMB :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">CNY {{ booking_details.amount }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">+ Service Charge :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">CNY {{ booking_details.service_charge }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">/ RATE :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">{{ booking_details.rate }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">MYR {{ booking_details.bia }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">+ GST 6% :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">MYR 4,430.88</div>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell"><b>MYR {{ booking_details.bia }}</b></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<!---->
|
||||
</tbody>
|
||||
</table>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="el-table__column-resize-proxy" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable" :show-header="false" align="center">
|
||||
<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" :show-header="false" align="center">
|
||||
<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>
|
||||
@@ -40,7 +210,7 @@
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="22" style="text-align:center">
|
||||
<img src="http://via.placeholder.com/600x400" class="image">
|
||||
<img v-bind:src="booking_details.user_bankslip_path" class="image">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
@@ -55,6 +225,7 @@
|
||||
<script>
|
||||
import VueCountdown from '@dmaksimovic/vue-countdown'
|
||||
import ProgressTrack from '~/components/ProgressTrack'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -63,50 +234,37 @@ export default {
|
||||
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: ''
|
||||
}
|
||||
]
|
||||
loading_btn: false,
|
||||
booking_details:{
|
||||
id: null,
|
||||
amount: null,
|
||||
bia: null,
|
||||
user_bankslip_path: null,
|
||||
}
|
||||
}
|
||||
},
|
||||
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) => {
|
||||
this.booking_details = response.data
|
||||
loading.close()
|
||||
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
loading.close()
|
||||
this.$router.push({
|
||||
name: 'notfound'
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<el-main>
|
||||
<progress-track v-model="status"/>
|
||||
|
||||
<div align="center">
|
||||
<h4 style="margin-top:5%;">Processing Invoice</h4>
|
||||
<br>
|
||||
<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" :show-header="false" align="center">
|
||||
<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" :show-header="false" align="center">
|
||||
<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: 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>
|
||||
@@ -16,7 +16,7 @@
|
||||
<span>Order Details</span>
|
||||
<!-- <el-button style="float: right; padding: 3px 0" type="text">Operation button</el-button> -->
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<!-- <el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable" :show-header="false" align="center">
|
||||
<el-table-column prop="data1" align="right" width="200" />
|
||||
@@ -29,7 +29,177 @@
|
||||
<el-table-column prop="data2" align="left" width="200" />
|
||||
</el-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row> -->
|
||||
<div class="el-row" style="margin-left: -6px; margin-right: -6px;">
|
||||
<div class="el-col el-col-12" style="padding-left: 6px; padding-right: 6px;">
|
||||
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" align="center">
|
||||
|
||||
<div class="el-table__body-wrapper is-scrolling-none">
|
||||
<table class="el-table__body" style="width: 400px;" cellspacing="0" cellpadding="0" border="0">
|
||||
<colgroup>
|
||||
<col name="el-table_2_column_9" width="200">
|
||||
<col name="el-table_2_column_10" width="200">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Order Number :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.id }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Date :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.created_at }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Customer Marking :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">CIEF/150ECE</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell">Term :</div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell">{{ booking_details.term }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_2_column_9 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_2_column_10 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<!---->
|
||||
</tbody>
|
||||
</table>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="el-table__column-resize-proxy" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="el-col el-col-12" style="padding-left: 6px; padding-right: 6px;">
|
||||
<div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" align="center">
|
||||
<div class="hidden-columns">
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<!---->
|
||||
<div class="el-table__body-wrapper is-scrolling-none">
|
||||
<table class="el-table__body" style="width: 400px;" cellspacing="0" cellpadding="0" border="0">
|
||||
<colgroup>
|
||||
<col name="el-table_3_column_11" width="200">
|
||||
<col name="el-table_3_column_12" width="200">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">CNY/RMB :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">CNY {{ booking_details.amount }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">+ Service Charge :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">CNY {{ booking_details.service_charge }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">/ RATE :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">{{ booking_details.rate }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">MYR {{ booking_details.bia }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell">+ GST 6% :</div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell">MYR 4,430.88</div>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell"><b>MYR {{ booking_details.bia }}</b></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="el-table__row">
|
||||
<td class="el-table_3_column_11 is-right ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
<td class="el-table_3_column_12 is-left ">
|
||||
<div class="cell"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<!---->
|
||||
</tbody>
|
||||
</table>
|
||||
<!---->
|
||||
<!---->
|
||||
</div>
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<!---->
|
||||
<div class="el-table__column-resize-proxy" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-table :data="bookingConfirmTable" :show-header="false" align="center">
|
||||
<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" :show-header="false" align="center">
|
||||
<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>
|
||||
@@ -42,7 +212,7 @@
|
||||
</div>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="22" style="text-align:center">
|
||||
<img src="http://via.placeholder.com/600x400" class="image">
|
||||
<img v-bind:src="booking_details.user_bankslip_path" class="image">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
@@ -57,6 +227,7 @@
|
||||
<script>
|
||||
import VueCountdown from '@dmaksimovic/vue-countdown'
|
||||
import ProgressTrack from '~/components/ProgressTrack'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -65,50 +236,37 @@ export default {
|
||||
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: ''
|
||||
}
|
||||
]
|
||||
loading_btn: false,
|
||||
booking_details:{
|
||||
id: null,
|
||||
amount: null,
|
||||
bia: null,
|
||||
user_bankslip_path: null,
|
||||
}
|
||||
}
|
||||
},
|
||||
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) => {
|
||||
this.booking_details = response.data
|
||||
loading.close()
|
||||
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
loading.close()
|
||||
this.$router.push({
|
||||
name: 'notfound'
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<div align="center">
|
||||
<h4 style="margin-top:5%;">Transfer Completed</h4>
|
||||
<h5> Please upload your PO </h5>
|
||||
<h5> Please upload your purchase order </h5>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<br>
|
||||
|
||||
<div class="bottom clearfix" style="text-align:right;">
|
||||
<el-button :loading="loading" type="primary" @click="uploadPo">Submit</el-button>
|
||||
<el-button :loading="loading_btn" type="primary" @click="uploadPo">Submit</el-button>
|
||||
</div>
|
||||
<!-- upload image end -->
|
||||
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
return {
|
||||
booking_id: this.$route.params.id,
|
||||
status: 5,
|
||||
loading: false,
|
||||
loading_btn: false,
|
||||
bookingConfirmTable: [{
|
||||
data1: 'Order Number :',
|
||||
data2: '001'
|
||||
@@ -162,7 +162,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
uploadPo () {
|
||||
this.loading = true
|
||||
this.loading_btn = true
|
||||
axios
|
||||
.post('/api/booking/' + this.$route.params.id + '/confirm-po')
|
||||
.then((response) => {
|
||||
@@ -176,14 +176,15 @@ export default {
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
})
|
||||
this.loading = false
|
||||
this.loading_btn = false
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
loading.close()
|
||||
this.$router.push({
|
||||
name: 'notfound'
|
||||
})
|
||||
this.loading = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Please upload purchase order',
|
||||
type: 'error',
|
||||
duration: 30000
|
||||
})
|
||||
this.loading_btn = false
|
||||
})
|
||||
},
|
||||
handleRemove (file, fileList) {
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<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>
|
||||
<div class="grid-content bg-purple" align="center">1.70</div>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<div class="grid-content bg-purple" align="center">1.64</div>
|
||||
@@ -373,11 +373,9 @@ export default {
|
||||
.get('/api/booking/')
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
this.bookingTable = response.data
|
||||
|
||||
this.bookingTable = response.data.data
|
||||
// loading.close()
|
||||
}).catch((error) => {
|
||||
// console.log(error)
|
||||
// loading.close()
|
||||
// this.$router.push({
|
||||
// name: 'notfound'
|
||||
@@ -515,11 +513,19 @@ export default {
|
||||
break
|
||||
|
||||
case 6:
|
||||
this.$router.push({
|
||||
name: 'booking.user.po',
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break
|
||||
|
||||
case 7:
|
||||
this.$router.push({
|
||||
name: 'booking.user.complete',
|
||||
params: {id: booking_id }
|
||||
})
|
||||
break
|
||||
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
@@ -7,28 +7,28 @@
|
||||
<el-input size="mini" style=width:7% ></el-input>Hours
|
||||
<el-input size="mini" style=width:7% ></el-input>Minutes
|
||||
<el-input size="mini" style=width:7% ></el-input>Seconds
|
||||
<el-button type="primary" size="mini" @click="dialogVisible = true">Update Time Limit</el-button>
|
||||
<el-button type="primary" size="mini" @click="TimeLimitDialogVisible = true">Update Time Limit</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-dialog title="Time Limit" align="center" :visible.sync="dialogVisible" width="30%">
|
||||
<el-dialog title="Time Limit" align="center" :visible.sync="TimeLimitDialogVisible" width="30%">
|
||||
<span>Time limit for customer bank slip submission is updated</span>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">OK</el-button>
|
||||
<el-button @click="TimeLimitDialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="TimeLimitDialogVisible = false">OK</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-form>
|
||||
<el-form-item align="center">
|
||||
Credit Limit for RMB :
|
||||
<el-input placeholder="Amount" size="mini" style=width:10%></el-input>
|
||||
<el-button type="primary" size="mini" @click="dialogVisible1 = true">Update Credit Limit</el-button>
|
||||
<el-button type="primary" size="mini" @click="CreditLimitDialogVisible = true">Update Credit Limit</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-dialog title="Credit Limit" align="center" :visible.sync="dialogVisible1" width="30%">
|
||||
<el-dialog title="Credit Limit" align="center" :visible.sync="CreditLimitDialogVisible" width="30%">
|
||||
<span>Credit limit for Customer Booking is updated</span>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible1 = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="dialogVisible1 = false">OK</el-button>
|
||||
<el-button @click="CreditLimitDialogVisible = false">Cancel</el-button>
|
||||
<el-button type="primary" @click="CreditLimitDialogVisible = false">OK</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -38,8 +38,8 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dialogVisible1: false
|
||||
TimeLimitDialogVisible: false,
|
||||
CreditLimitDialogVisible: false
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
<card :title="$t('settings')" class="settings-card">
|
||||
<ul class="nav flex-column nav-pills">
|
||||
<li v-for="tab in tabs" :key="tab.route" class="nav-item">
|
||||
<router-link :to="{ name: tab.route }" class="nav-link" active-class="active">
|
||||
<fa :icon="tab.icon" fixed-width/>
|
||||
{{ tab.name }}
|
||||
<router-link v-if="(role == tab.role)" :to="{ name: tab.route }" class="nav-link" active-class="active">
|
||||
<fa :icon="tab.icon" fixed-width/> {{ tab.name }}
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -22,50 +21,63 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
middleware: 'auth',
|
||||
import {
|
||||
mapGetters
|
||||
} from 'vuex'
|
||||
export default {
|
||||
middleware: 'auth',
|
||||
|
||||
computed: {
|
||||
tabs () {
|
||||
return [
|
||||
{
|
||||
icon: 'user',
|
||||
name: this.$t('profile'),
|
||||
route: 'settings.profile'
|
||||
},
|
||||
{
|
||||
icon: 'lock',
|
||||
name: this.$t('password'),
|
||||
route: 'settings.password'
|
||||
},
|
||||
{
|
||||
icon: 'user',
|
||||
name: this.$t('Supplier'),
|
||||
route: 'settings.admin-supplier'
|
||||
},
|
||||
{
|
||||
icon: 'cog',
|
||||
name: this.$t('Credit Setting'),
|
||||
route: 'settings.admin-credit-setting'
|
||||
},
|
||||
{
|
||||
icon: 'flag',
|
||||
name: this.$t('CIEF China Bank'),
|
||||
route: 'settings.admin-china-bank'
|
||||
},
|
||||
{
|
||||
icon: 'building',
|
||||
name: this.$t('Bank Setting'),
|
||||
route: 'settings.admin-bank-setting'
|
||||
},
|
||||
]
|
||||
computed: {
|
||||
role() {
|
||||
return this.$store.getters['auth/role']
|
||||
},
|
||||
tabs() {
|
||||
return [{
|
||||
icon: 'user',
|
||||
name: this.$t('profile'),
|
||||
route: 'settings.profile',
|
||||
role: 'member'
|
||||
},
|
||||
{
|
||||
icon: 'lock',
|
||||
name: this.$t('password'),
|
||||
route: 'settings.password',
|
||||
role: 'member'
|
||||
},
|
||||
{
|
||||
icon: 'user',
|
||||
name: this.$t('Supplier'),
|
||||
route: 'settings.admin-supplier',
|
||||
role: 'admin'
|
||||
},
|
||||
{
|
||||
icon: 'cog',
|
||||
name: this.$t('Credit Setting'),
|
||||
route: 'settings.admin-credit-setting',
|
||||
role: 'admin'
|
||||
},
|
||||
{
|
||||
icon: 'flag',
|
||||
name: this.$t('CIEF China Bank'),
|
||||
route: 'settings.admin-china-bank',
|
||||
role: 'admin'
|
||||
},
|
||||
{
|
||||
icon: 'building',
|
||||
name: this.$t('Bank Setting'),
|
||||
route: 'settings.admin-bank-setting',
|
||||
role: 'admin'
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.settings-card .card-body {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
.settings-card .card-body {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -14,8 +14,6 @@ const SettingsAdminCreditSetting = () => import('~/pages/settings/admin-credit-s
|
||||
const SettingsAdminChinaBank = () => import('~/pages/settings/admin-china-bank').then(m => m.default || m)
|
||||
const SettingsAdminBankSetting = () => import('~/pages/settings/admin-bank-setting').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)
|
||||
@@ -23,6 +21,7 @@ const Transfer = () => import('~/pages/booking/transfer').then(m => m.default ||
|
||||
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 PurchaseOrder = () => import('~/pages/booking/po').then(m => m.default || m)
|
||||
|
||||
// Admin booking
|
||||
const Verification = () => import('~/pages/admin/booking/verification').then(m => m.default || m)
|
||||
@@ -30,9 +29,14 @@ const Supplier = () => import('~/pages/admin/booking/supplierBooking').then(m =>
|
||||
const SupplierReport = () => import('~/pages/admin/booking/supplierReport').then(m => m.default || m)
|
||||
const UploadCNSlip = () => import('~/pages/admin/booking/uploadChinaBankslip').then(m => m.default || m)
|
||||
const UploadInvoice = () => import('~/pages/admin/booking/uploadInvoice').then(m => m.default || m)
|
||||
const adminCompleted = () => import('~/pages/admin/booking/completed').then(m => m.default || m)
|
||||
// const Completed = () => import('~/pages/booking/uploadUserBankSlip').then(m => m.default || m)
|
||||
|
||||
// Admin pages
|
||||
const AdminHome = () => import('~/pages/admin/home').then(m => m.default || m)
|
||||
const CompleteOrder = () => import('~/pages/admin/complete-order').then(m => m.default || m)
|
||||
const TransactionHistory = () => import('~/pages/admin/transaction-history').then(m => m.default || m)
|
||||
const UploadSupplierBankSlip = () => import('~/pages/admin/upload-supplier-bank-slip').then(m => m.default || m)
|
||||
|
||||
export default [
|
||||
{ path: '/', name: 'welcome', component: Welcome },
|
||||
@@ -60,23 +64,21 @@ export default [
|
||||
{ path: '/booking/:id/transfer', name: 'booking.user.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: '/booking/:id/po', name: 'booking.user.po', component: PurchaseOrder },
|
||||
{ path: '/booking/:id/complete', name: 'booking.user.complete', component: Completed },
|
||||
|
||||
// { path: '/admin',
|
||||
// component: Admin,
|
||||
// children: [
|
||||
// { path: '', redirect: { name: 'admin.index' } },
|
||||
// { path: 'index', name: 'admin.index', component: Admin },
|
||||
// { path: 'home', name: 'admin.home', component: AdminHome }
|
||||
// ] },
|
||||
// Admin booking
|
||||
{ path: '/booking/:id/verification', name: 'booking.admin.verification', component: Verification },
|
||||
{ path: '/booking/:id/supplier', name: 'booking.admin.supplier', component: Supplier },
|
||||
{ path: '/booking/:id/supplier-report', name: 'booking.admin.supplier.report', component: SupplierReport },
|
||||
{ path: '/booking/:id/upload-cn-bankslip', name: 'booking.admin.cnslip', component: UploadCNSlip },
|
||||
{ path: '/booking/:id/upload-invoice', name: 'booking.admin.invoice', component: UploadInvoice },
|
||||
// { path: '/booking/:id/complete', name: 'booking.complete', component: Completed },
|
||||
{ path: '/booking/:id/admin/complete', name: 'booking.admin.complete', component: adminCompleted },
|
||||
|
||||
// Admin pages
|
||||
{ path: '/admin', name: 'admin.home', component: AdminHome },
|
||||
{ path: '/admin/complete-order', name: 'admin.complete-order', component: CompleteOrder },
|
||||
{ path: '/admin/transaction-history', name: 'admin.transaction-history', component: TransactionHistory },
|
||||
{ path: '/admin/upload-supplier-bank-slip', name: 'admin.upload-supplier-bank-slip', component: UploadSupplierBankSlip },
|
||||
{ path: '*', name: 'notfound', component: NotFound }
|
||||
]
|
||||
|
||||
+14
-12
@@ -42,12 +42,13 @@ Route::group(['middleware' => 'auth:api'], function () {
|
||||
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('/booking', 'BookingController@index');
|
||||
Route::get('/user', 'UserController@show');
|
||||
});
|
||||
|
||||
Route::patch('settings/profile', 'Settings\ProfileController@update');
|
||||
Route::patch('settings/password', 'Settings\PasswordController@update');
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::group(['middleware' => 'guest:api'], function () {
|
||||
@@ -63,11 +64,13 @@ Route::group(['middleware' => 'guest:api'], function () {
|
||||
Route::group(['middleware' => ['role:admin']], function() {
|
||||
Route::get('admin/booking/', 'BookingController@adminIndex');
|
||||
Route::get('admin/booking/{id}', 'BookingController@adminShow');
|
||||
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('update-rate', 'RateController@index');
|
||||
Route::get('update-rate/{rate}', 'RateController@show');
|
||||
|
||||
|
||||
Route::get('setting-credit', 'SettingCreditController@index');
|
||||
Route::get('setting-credit/{credit}', 'SettingCreditController@show');
|
||||
@@ -97,15 +100,14 @@ Route::group(['middleware' => ['role:admin']], function() {
|
||||
Route::get('supplier-booking/{id}', 'BookingSupplierController@show');
|
||||
Route::post('supplier-booking', 'BookingSupplierController@store');
|
||||
Route::put('supplier-booking/{id}', 'BookingSupplierController@update');
|
||||
Route::post('/booking/{id}/confirm-supplier', 'BookingController@confirmSupplier');
|
||||
|
||||
Route::post('/booking/{id}/upload-china-bankslip','ChinaBankSlipController@store');
|
||||
Route::patch('/booking/{id}/update-china-bankslip','ChinaBankSlipController@update');
|
||||
Route::get('/booking/{id}/po', 'BookingController@showPurchaseOrder');
|
||||
Route::post('booking/{id}/upload-invoice', 'BookingController@uploadInvoice');
|
||||
Route::post('booking/{id}/confirm-invoice', 'BookingController@confirmInvoice');
|
||||
|
||||
});
|
||||
|
||||
Route::get('update-rate', 'RateController@index');
|
||||
Route::get('update-rate/{rate}', 'RateController@show');
|
||||
|
||||
|
||||
Route::post('upload-china-bankslip', 'ChinaBankSlipController@store');
|
||||
//customer booking
|
||||
Route::post('booking/{id}/upload-user-bankslip', 'BookingController@uploadbankslip');
|
||||
Route::post('booking/{id}/upload-po', 'BookingController@uploadPurchaseOrder');
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use App\User;
|
||||
use App\SettingSupplier;
|
||||
use App\Role;
|
||||
use Artisan;
|
||||
|
||||
class SettingSupplierTest extends TestCase
|
||||
{
|
||||
protected $user;
|
||||
protected $settingSupplier;
|
||||
|
||||
public function setUp(){
|
||||
parent::setUp();
|
||||
Artisan::call('db:seed');
|
||||
|
||||
$this->user = factory(User::class)->create();
|
||||
$this->settingSupplier = factory(SettingSupplier::class)->create();
|
||||
$this->user->attachRole(Role::Where('name','admin')->first());
|
||||
}
|
||||
|
||||
public function testStore(){
|
||||
$this->actingAs($this->user)
|
||||
->postJson('api/setting-supplier',[
|
||||
'company_name' => "CompanyABC",
|
||||
'gst_no' => "123321",
|
||||
'supplier_reg_no' => "12332123",
|
||||
'bank_name' => "maybank",
|
||||
'acc_no' => "1231522334"
|
||||
])
|
||||
->assertStatus(201);
|
||||
|
||||
$this->assertDatabaseHas('setting_suppliers', [
|
||||
'acc_no' => '1231522334'
|
||||
]);
|
||||
}
|
||||
|
||||
public function testUpdate(){
|
||||
$this->actingAs($this->user)
|
||||
->json('PUT','api/setting-supplier/' . $this->settingSupplier->id,[
|
||||
'company_name' => "CompanyDDEDED",
|
||||
'gst_no' => "gstgstgstgst",
|
||||
'supplier_reg_no' => "ABC12332123",
|
||||
'bank_name' => "Cimb bank",
|
||||
'acc_no' => "7030303030"
|
||||
])
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testDelete(){
|
||||
$id = $this->settingSupplier->id;
|
||||
$this->actingAs($this->user)
|
||||
->json('DELETE','api/setting-supplier/' . $this->settingSupplier->id,[
|
||||
'id' => $this->settingSupplier->id
|
||||
])
|
||||
->assertStatus(204);
|
||||
|
||||
$this->assertDatabaseMissing('setting_suppliers',[
|
||||
'id' => $id
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
+3
-1
@@ -7,7 +7,6 @@ $baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'App\\Booking' => $baseDir . '/app/Booking.php',
|
||||
'App\\BookingSupplier' => $baseDir . '/app/BookingSupplier.php',
|
||||
'App\\ChinaBankSlip' => $baseDir . '/app/ChinaBankSlip.php',
|
||||
'App\\Console\\Kernel' => $baseDir . '/app/Console/Kernel.php',
|
||||
'App\\Exceptions\\EmailTakenException' => $baseDir . '/app/Exceptions/EmailTakenException.php',
|
||||
@@ -55,6 +54,7 @@ return array(
|
||||
'App\\SettingBeneficiary' => $baseDir . '/app/SettingBeneficiary.php',
|
||||
'App\\SettingCredit' => $baseDir . '/app/SettingCredit.php',
|
||||
'App\\SettingSupplier' => $baseDir . '/app/SettingSupplier.php',
|
||||
'App\\SupplierBooking' => $baseDir . '/app/SupplierBooking.php',
|
||||
'App\\SupplierBookingItem' => $baseDir . '/app/SupplierBookingItem.php',
|
||||
'App\\User' => $baseDir . '/app/User.php',
|
||||
'App\\UserBankSlip' => $baseDir . '/app/UserBankSlip.php',
|
||||
@@ -3551,6 +3551,7 @@ return array(
|
||||
'SebastianBergmann\\Timer\\Timer' => $vendorDir . '/phpunit/php-timer/src/Timer.php',
|
||||
'SebastianBergmann\\Version' => $vendorDir . '/sebastian/version/src/Version.php',
|
||||
'SettingCreditSeeder' => $baseDir . '/database/seeds/SettingCreditSeeder.php',
|
||||
'SuppliersTableSeeder' => $baseDir . '/database/seeds/SuppliersTableSeeder.php',
|
||||
'Symfony\\Component\\Console\\Application' => $vendorDir . '/symfony/console/Application.php',
|
||||
'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => $vendorDir . '/symfony/console/CommandLoader/CommandLoaderInterface.php',
|
||||
'Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => $vendorDir . '/symfony/console/CommandLoader/ContainerCommandLoader.php',
|
||||
@@ -4145,6 +4146,7 @@ return array(
|
||||
'Tests\\Feature\\RateTest' => $baseDir . '/tests/Feature/RateTest.php',
|
||||
'Tests\\Feature\\RegisterTest' => $baseDir . '/tests/Feature/RegisterTest.php',
|
||||
'Tests\\Feature\\SettingCreditTest' => $baseDir . '/tests/Feature/SettingCreditTest.php',
|
||||
'Tests\\Feature\\SettingSupplierTest' => $baseDir . '/tests/Feature/SettingSupplierTest.php',
|
||||
'Tests\\Feature\\SettingsTest' => $baseDir . '/tests/Feature/SettingsTest.php',
|
||||
'Tests\\TestCase' => $baseDir . '/tests/TestCase.php',
|
||||
'Text_Template' => $vendorDir . '/phpunit/php-text-template/src/Template.php',
|
||||
|
||||
Vendored
+3
-1
@@ -435,7 +435,6 @@ class ComposerStaticInite450fcd5b0627496bb38e1386c9a81ad
|
||||
|
||||
public static $classMap = array (
|
||||
'App\\Booking' => __DIR__ . '/../..' . '/app/Booking.php',
|
||||
'App\\BookingSupplier' => __DIR__ . '/../..' . '/app/BookingSupplier.php',
|
||||
'App\\ChinaBankSlip' => __DIR__ . '/../..' . '/app/ChinaBankSlip.php',
|
||||
'App\\Console\\Kernel' => __DIR__ . '/../..' . '/app/Console/Kernel.php',
|
||||
'App\\Exceptions\\EmailTakenException' => __DIR__ . '/../..' . '/app/Exceptions/EmailTakenException.php',
|
||||
@@ -483,6 +482,7 @@ class ComposerStaticInite450fcd5b0627496bb38e1386c9a81ad
|
||||
'App\\SettingBeneficiary' => __DIR__ . '/../..' . '/app/SettingBeneficiary.php',
|
||||
'App\\SettingCredit' => __DIR__ . '/../..' . '/app/SettingCredit.php',
|
||||
'App\\SettingSupplier' => __DIR__ . '/../..' . '/app/SettingSupplier.php',
|
||||
'App\\SupplierBooking' => __DIR__ . '/../..' . '/app/SupplierBooking.php',
|
||||
'App\\SupplierBookingItem' => __DIR__ . '/../..' . '/app/SupplierBookingItem.php',
|
||||
'App\\User' => __DIR__ . '/../..' . '/app/User.php',
|
||||
'App\\UserBankSlip' => __DIR__ . '/../..' . '/app/UserBankSlip.php',
|
||||
@@ -3979,6 +3979,7 @@ class ComposerStaticInite450fcd5b0627496bb38e1386c9a81ad
|
||||
'SebastianBergmann\\Timer\\Timer' => __DIR__ . '/..' . '/phpunit/php-timer/src/Timer.php',
|
||||
'SebastianBergmann\\Version' => __DIR__ . '/..' . '/sebastian/version/src/Version.php',
|
||||
'SettingCreditSeeder' => __DIR__ . '/../..' . '/database/seeds/SettingCreditSeeder.php',
|
||||
'SuppliersTableSeeder' => __DIR__ . '/../..' . '/database/seeds/SuppliersTableSeeder.php',
|
||||
'Symfony\\Component\\Console\\Application' => __DIR__ . '/..' . '/symfony/console/Application.php',
|
||||
'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => __DIR__ . '/..' . '/symfony/console/CommandLoader/CommandLoaderInterface.php',
|
||||
'Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => __DIR__ . '/..' . '/symfony/console/CommandLoader/ContainerCommandLoader.php',
|
||||
@@ -4573,6 +4574,7 @@ class ComposerStaticInite450fcd5b0627496bb38e1386c9a81ad
|
||||
'Tests\\Feature\\RateTest' => __DIR__ . '/../..' . '/tests/Feature/RateTest.php',
|
||||
'Tests\\Feature\\RegisterTest' => __DIR__ . '/../..' . '/tests/Feature/RegisterTest.php',
|
||||
'Tests\\Feature\\SettingCreditTest' => __DIR__ . '/../..' . '/tests/Feature/SettingCreditTest.php',
|
||||
'Tests\\Feature\\SettingSupplierTest' => __DIR__ . '/../..' . '/tests/Feature/SettingSupplierTest.php',
|
||||
'Tests\\Feature\\SettingsTest' => __DIR__ . '/../..' . '/tests/Feature/SettingsTest.php',
|
||||
'Tests\\TestCase' => __DIR__ . '/../..' . '/tests/TestCase.php',
|
||||
'Text_Template' => __DIR__ . '/..' . '/phpunit/php-text-template/src/Template.php',
|
||||
|
||||
Reference in New Issue
Block a user