mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 12:24:09 +00:00
chinese encoding
This commit is contained in:
@@ -283,6 +283,7 @@ class InvoiceController extends Controller
|
||||
}
|
||||
|
||||
// Change Status to 7 if approve
|
||||
// Add email event here
|
||||
if ($validatedData['status'] === 'approve') {
|
||||
$booking = Booking::find($id);
|
||||
$booking->status = 7;
|
||||
@@ -310,9 +311,9 @@ class InvoiceController extends Controller
|
||||
}
|
||||
|
||||
// Ensure Invoice Status is Approve
|
||||
if ($this->invoiceStatus($id) !== 'approve') {
|
||||
return response()->json(['message' => 'Invoice must and exist and approve status.'], 403);
|
||||
}
|
||||
// if ($this->invoiceStatus($id) !== 'approve') {
|
||||
// return response()->json(['message' => 'Invoice must and exist and approve status.'], 403);
|
||||
// }
|
||||
|
||||
// Generate PO
|
||||
|
||||
@@ -342,6 +343,7 @@ class InvoiceController extends Controller
|
||||
'lines' => $lines,
|
||||
'amount' => $invoice->amount
|
||||
];
|
||||
PDF::setOptions(['dpi' => 150, 'defaultFont' => 'courier']);
|
||||
$pdf = PDF::loadView('pdf/po', $data);
|
||||
|
||||
|
||||
@@ -350,6 +352,73 @@ class InvoiceController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function showpo() {
|
||||
|
||||
$booking = Booking::where('id', 2018)->first();
|
||||
$invoice = Invoice::where('booking_id', $booking['id'])->first();
|
||||
$lines = InvoiceDetails::where('invoice_id', $invoice->id)->get();
|
||||
|
||||
$data = [
|
||||
'title' => 'Delivery Order',
|
||||
'buyer' => [
|
||||
'buyer_company' => $invoice->buyer_company,
|
||||
'reg_no' => $invoice->reg_no,
|
||||
'address' => $invoice->address,
|
||||
'gst' => '',
|
||||
'phone' => $invoice->contact_no
|
||||
],
|
||||
'seller' => [
|
||||
'seller_company' => 'CIEF Worldwide Sdn Bhd',
|
||||
'address' => 'Malaysia Global Innovation & Creativity Centre,
|
||||
Level 1 CWS, Block 3730,
|
||||
Persiaran APEC 63000 Cyberjaya.',
|
||||
'phone' => '018 2909252',
|
||||
'date' => $invoice->updated_at,
|
||||
'po_number' => $invoice->po_number,
|
||||
'order_number' => $booking->order_no
|
||||
],
|
||||
'lines' => $lines,
|
||||
'amount' => $invoice->amount
|
||||
];
|
||||
|
||||
// Send
|
||||
return view('pdf/po', $data);
|
||||
|
||||
}
|
||||
|
||||
public function showdo() {
|
||||
|
||||
$booking = Booking::where('id', 2018)->first();
|
||||
$invoice = Invoice::where('booking_id', $booking['id'])->first();
|
||||
$lines = InvoiceDetails::where('invoice_id', $invoice->id)->get();
|
||||
|
||||
$data = [
|
||||
'title' => 'Delivery Order',
|
||||
'buyer' => [
|
||||
'buyer_company' => $invoice->buyer_company,
|
||||
'reg_no' => $invoice->reg_no,
|
||||
'address' => $invoice->address,
|
||||
'gst' => '',
|
||||
'phone' => $invoice->contact_no
|
||||
],
|
||||
'seller' => [
|
||||
'seller_company' => 'CIEF Worldwide Sdn Bhd',
|
||||
'address' => 'Malaysia Global Innovation & Creativity Centre, Level
|
||||
1 CWS, Block 3730, Persiaran APEC 63000 Cyberjaya.',
|
||||
'phone' => '018 2909252',
|
||||
'date' => $invoice->updated_at,
|
||||
'po_number' => $invoice->po_number,
|
||||
'order_number' => $booking->order_no
|
||||
],
|
||||
'lines' => $lines,
|
||||
'amount' => $invoice->amount
|
||||
];
|
||||
|
||||
// Send
|
||||
return view('pdf/do', $data);
|
||||
|
||||
}
|
||||
|
||||
public function getDO(Request $request, $id)
|
||||
{
|
||||
// Booking Exist and Belongs to User or is Admin
|
||||
@@ -360,9 +429,9 @@ class InvoiceController extends Controller
|
||||
}
|
||||
|
||||
// Ensure Invoice Status is Approve
|
||||
if ($this->invoiceStatus($id) !== 'approve') {
|
||||
return response()->json(['message' => 'Invoice must and exist and approve status.'], 403);
|
||||
}
|
||||
// if ($this->invoiceStatus($id) !== 'approve') {
|
||||
// return response()->json(['message' => 'Invoice must and exist and approve status.'], 403);
|
||||
// }
|
||||
|
||||
// Generate PO
|
||||
|
||||
|
||||
Reference in New Issue
Block a user