master booking done
parent
d5a3224bf1
commit
1a4da7b9e4
@ -1,66 +1 @@
|
||||
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||
</p>
|
||||
|
||||
## About Laravel
|
||||
|
||||
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||
|
||||
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
|
||||
## Learning Laravel
|
||||
|
||||
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
|
||||
|
||||
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
|
||||
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||
|
||||
## Laravel Sponsors
|
||||
|
||||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
|
||||
|
||||
### Premium Partners
|
||||
|
||||
- **[Vehikl](https://vehikl.com/)**
|
||||
- **[Tighten Co.](https://tighten.co)**
|
||||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||
- **[64 Robots](https://64robots.com)**
|
||||
- **[Cubet Techno Labs](https://cubettech.com)**
|
||||
- **[Cyber-Duck](https://cyber-duck.co.uk)**
|
||||
- **[Many](https://www.many.co.uk)**
|
||||
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
|
||||
- **[DevSquad](https://devsquad.com)**
|
||||
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
|
||||
- **[OP.GG](https://op.gg)**
|
||||
- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
|
||||
- **[Lendio](https://lendio.com)**
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||
|
||||
## License
|
||||
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
# Yamato Cash Management - Laravel Inertijs
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Models\Booking;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
|
||||
class BookingsExport implements FromView
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function view(): View
|
||||
{
|
||||
$query = Booking::query()->orderBy('departure', 'ASC');
|
||||
|
||||
if (request('ids')) {
|
||||
$bookingIds = request('ids');
|
||||
$query->whereIn('id', $bookingIds);
|
||||
}
|
||||
|
||||
$bookings = $query->get()->map(function ($item, $key) {
|
||||
$item->departure = Carbon::parse($item->departure)->format('Y-m-d');
|
||||
return $item;
|
||||
});
|
||||
|
||||
return view('exports.bookings_export', [
|
||||
'bookings' => $bookings,
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Models\Expense;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
|
||||
class ExpensesExport implements WithHeadings, FromView
|
||||
{
|
||||
public function view(): View
|
||||
{
|
||||
$this->begining_balance = 0;
|
||||
$expenses = Expense::all();
|
||||
$today = \Carbon\Carbon::now();
|
||||
|
||||
$query = Expense::query()->orderBy('date_expense', 'ASC');
|
||||
|
||||
if (request('start_date') && request('end_date')) {
|
||||
$startDate = Carbon::parse(request('start_date'));
|
||||
$endDate = Carbon::parse(request('end_date'));
|
||||
|
||||
$query->whereDate('date_expense', '<=', request('end_date'))
|
||||
->whereDate('date_expense', '>=', request('start_date'));
|
||||
}
|
||||
|
||||
if (!request('start_date')) {
|
||||
$endDate = Carbon::now();
|
||||
$startDate = $today->subDays(30);
|
||||
|
||||
$query->whereDate('date_expense', '<=', $endDate)
|
||||
->whereDate('date_expense', '>=', $startDate);
|
||||
}
|
||||
|
||||
if (request('ids')) {
|
||||
$expenseIds = request('ids');
|
||||
$query->whereIn('id', $expenseIds);
|
||||
}
|
||||
|
||||
$endBalanceDate = $startDate->subDay();
|
||||
$beginingBalance = Expense::select(['amount', 'isIncome'])->whereDate('date_expense', '<=', $endBalanceDate);
|
||||
|
||||
$this->begining_balance = $beginingBalance->get()->map(function ($expense, $key) {
|
||||
return (!$expense->isIncome) ? $expense->amount * -1 : $expense->amount;
|
||||
})->sum();
|
||||
|
||||
$beginingBalance = $this->begining_balance;
|
||||
|
||||
$expenseAndBalance = $query->get()->map(function ($item, $key) {
|
||||
if ($item->isIncome) {
|
||||
$item->subBalance = $this->begining_balance + $item->amount;
|
||||
$this->begining_balance = $item->subBalance;
|
||||
$item->date_expense = Carbon::parse($item->date_expense)->format('d - m - Y');
|
||||
return $item;
|
||||
}
|
||||
|
||||
$item->subBalance = $this->begining_balance - $item->amount;
|
||||
$this->begining_balance = $item->subBalance;
|
||||
$item->date_expense = Carbon::parse($item->date_expense)->format('d - m - Y');
|
||||
return $item;
|
||||
});
|
||||
|
||||
return view('exports.expense_export', [
|
||||
'expenses' => $expenseAndBalance,
|
||||
'beginingBalance' => $beginingBalance,
|
||||
'startDate' => $startDate->format('d/m/Y'),
|
||||
'endDate' => $endDate->format('d/m/Y'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'NO',
|
||||
'VOUCHER',
|
||||
'DATE',
|
||||
'NAME',
|
||||
'JOB NUMBER',
|
||||
'DESCRIPTION',
|
||||
'ESTIMATION',
|
||||
'DEBET',
|
||||
'KREDIT',
|
||||
'BALANCE',
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Imports;
|
||||
|
||||
use App\Models\Booking;
|
||||
use Maatwebsite\Excel\Concerns\ToModel;
|
||||
use Maatwebsite\Excel\Concerns\WithStartRow;
|
||||
use Maatwebsite\Excel\Concerns\WithUpserts;
|
||||
|
||||
class BookingsImport implements ToModel, WithStartRow, WithUpserts
|
||||
{
|
||||
/**
|
||||
* @param array $row
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Model|null
|
||||
*/
|
||||
public function model(array $row)
|
||||
{
|
||||
if (!isset($row[0])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$exists = Booking::where([
|
||||
['master_awb', '=', $row[0]],
|
||||
['flight_number', '=', $row[1]],
|
||||
['departure', '=', $row[2]],
|
||||
['destination', '=', $row[3]],
|
||||
['jumlah_koli', '=', $row[4]],
|
||||
['kemasan', '=', $row[5]],
|
||||
['booked', '=', $row[6]],
|
||||
['used', '=', $row[7]],
|
||||
])->count();
|
||||
|
||||
if ($exists > 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Booking([
|
||||
'master_awb' => $row[0],
|
||||
'flight_number' => $row[1],
|
||||
'departure' => $row[2],
|
||||
'destination' => $row[3],
|
||||
'jumlah_koli' => $row[4],
|
||||
'kemasan' => $row[5],
|
||||
'booked' => $row[6],
|
||||
'used' => $row[7],
|
||||
]);
|
||||
}
|
||||
|
||||
public function startRow(): int
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function uniqueBy()
|
||||
{
|
||||
return 'master_awb';
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
MASTER AWB,FLIGHT NUMBER,DEPARTURE,DESTINATION,JUMLAH KOLI,JENIS KEMASAN,BOOKED,USED
|
||||
YIF210200012.,NH836,2022-01-08,Jakarta,10,PK,10,8
|
|
@ -0,0 +1,37 @@
|
||||
import React from "react";
|
||||
|
||||
export default function ModalConfirm(props) {
|
||||
const { isOpen, toggle, onConfirm = () => {} } = props;
|
||||
|
||||
const handleConfirm = () => {
|
||||
onConfirm();
|
||||
toggle();
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className="modal"
|
||||
style={
|
||||
isOpen
|
||||
? {
|
||||
opacity: 1,
|
||||
pointerEvents: "auto",
|
||||
visibility: "visible",
|
||||
}
|
||||
: {}
|
||||
}
|
||||
>
|
||||
<div className="modal-box text-center m-auto">
|
||||
<h1 className="font-bold text-3xl py-8">Hapus Item ?</h1>
|
||||
<div className="modal-action">
|
||||
<div onClick={handleConfirm} className="btn btn-accent">
|
||||
Ya
|
||||
</div>
|
||||
<div onClick={toggle} className="btn btn-neutral">
|
||||
Batal
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
@ -0,0 +1,191 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { formatDate } from "@/Utils";
|
||||
|
||||
export default function DetailModal(props) {
|
||||
const { isOpen, toggle = () => {}, booking = null, title } = props;
|
||||
const [data, setData] = useState({});
|
||||
|
||||
const handleCancel = () => {
|
||||
toggle();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setData({
|
||||
booked: booking?.booked ? booking.booked : '',
|
||||
departure: booking?.departure
|
||||
? formatDate(booking.departure).format('yyyy-MM-DD')
|
||||
: '',
|
||||
destination: booking?.destination ? booking.destination : '',
|
||||
flight_number: booking?.flight_number ? booking.flight_number : '',
|
||||
jumlah_koli: booking?.jumlah_koli ? booking.jumlah_koli : '',
|
||||
kemasan: booking?.kemasan ? booking.kemasan : '',
|
||||
master_awb: booking?.master_awb ? booking.master_awb : '',
|
||||
used: booking?.used ? booking.used : '',
|
||||
is_available: booking?.is_available ? booking.is_available : '',
|
||||
})
|
||||
}, [booking]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className="modal"
|
||||
style={
|
||||
isOpen
|
||||
? {
|
||||
opacity: 1,
|
||||
pointerEvents: 'auto',
|
||||
visibility: 'visible',
|
||||
}
|
||||
: {}
|
||||
}
|
||||
>
|
||||
<div className="modal-box max-h-screen md:h-5/6 m-auto overflow-scroll">
|
||||
<h1 className="font-bold text-2xl pb-8">{title}</h1>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Master AWB</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Master AWB"
|
||||
className={`input input-bordered ${'input-error'}`}
|
||||
name="master_awb"
|
||||
value={data.master_awb}
|
||||
disabled={true}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Flight Number</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Flight Number"
|
||||
className={`input input-bordered ${'input-error'}`}
|
||||
name="flight_number"
|
||||
value={data.flight_number}
|
||||
disabled={true}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Departure</span>
|
||||
</label>
|
||||
<input
|
||||
type="date"
|
||||
placeholder="20/01/2022"
|
||||
className={`input input-bordered ${'input-error'}`}
|
||||
name="departure"
|
||||
value={data.departure}
|
||||
disabled={true}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Destination</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Jakarta"
|
||||
className={`input input-bordered ${'input-error'}`}
|
||||
name="destination"
|
||||
value={data.destination}
|
||||
disabled={true}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Jumlah Koli</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="0"
|
||||
className={`input input-bordered ${'input-error'}`}
|
||||
name="jumlah_koli"
|
||||
value={data.jumlah_koli}
|
||||
disabled={true}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Kemasan</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Pack"
|
||||
className={`input input-bordered ${'input-error'}`}
|
||||
name="kemasan"
|
||||
value={data.kemasan}
|
||||
disabled={true}
|
||||
/>
|
||||
<label className="label"></label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Booked</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="0"
|
||||
className={`input input-bordered ${'input-error'}`}
|
||||
name="booked"
|
||||
value={data.booked}
|
||||
disabled={true}
|
||||
/>
|
||||
<label className="label"></label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Used</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="0"
|
||||
className={`input input-bordered ${'input-error'}`}
|
||||
name="used"
|
||||
disabled={true}
|
||||
value={data.used}
|
||||
/>
|
||||
<label className="label"></label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Status</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="0"
|
||||
className={`input input-bordered ${'input-error'}`}
|
||||
name="used"
|
||||
disabled={true}
|
||||
value={+data.is_available === 0 ? 'Available' : 'Closed'}
|
||||
/>
|
||||
<label className="label"></label>
|
||||
</div>
|
||||
<div className="modal-action">
|
||||
<label
|
||||
htmlFor="my-modal-2"
|
||||
className="btn"
|
||||
onClick={handleCancel}
|
||||
>
|
||||
Tutup
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
};
|
@ -0,0 +1,270 @@
|
||||
import { useForm } from "@inertiajs/inertia-react";
|
||||
import React, { useEffect } from "react";
|
||||
import { formatDate } from "@/Utils";
|
||||
|
||||
export default function FormModal(props) {
|
||||
const { isOpen, toggle = () => {}, booking = null } = props;
|
||||
|
||||
const { data, setData, post, put, processing, errors, clearErrors } =
|
||||
useForm({
|
||||
booked: "",
|
||||
departure: "",
|
||||
destination: "",
|
||||
flight_number: "",
|
||||
jumlah_koli: 0,
|
||||
kemasan: "",
|
||||
master_awb: "",
|
||||
used: 0,
|
||||
is_available: 0,
|
||||
});
|
||||
|
||||
const handleOnChange = (event) => {
|
||||
setData(event.target.name, event.target.value);
|
||||
};
|
||||
|
||||
const handleReset = () => {
|
||||
setData({
|
||||
booked: '',
|
||||
departure: '',
|
||||
destination: '',
|
||||
flight_number: '',
|
||||
jumlah_koli: 0,
|
||||
kemasan: '',
|
||||
master_awb: '',
|
||||
used: 0,
|
||||
is_available: 0,
|
||||
})
|
||||
|
||||
clearErrors();
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
handleReset();
|
||||
toggle();
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (booking !== null) {
|
||||
put(route("monitoring-booking.update", booking), {
|
||||
onSuccess: () => Promise.all([handleReset(), toggle()]),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
post(route("monitoring-booking.store"), {
|
||||
onSuccess: () => Promise.all([handleReset(), toggle()]),
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setData({
|
||||
booked: booking?.booked ? booking.booked : '',
|
||||
departure: booking?.departure
|
||||
? formatDate(booking.departure).format('yyyy-MM-DD')
|
||||
: '',
|
||||
destination: booking?.destination ? booking.destination : '',
|
||||
flight_number: booking?.flight_number ? booking.flight_number : '',
|
||||
jumlah_koli: booking?.jumlah_koli ? booking.jumlah_koli : '',
|
||||
kemasan: booking?.kemasan ? booking.kemasan : '',
|
||||
master_awb: booking?.master_awb ? booking.master_awb : '',
|
||||
used: booking?.used ? booking.used : '',
|
||||
is_available: booking?.is_available ? booking.is_available : 0,
|
||||
})
|
||||
}, [booking]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className="modal"
|
||||
style={
|
||||
isOpen
|
||||
? {
|
||||
opacity: 1,
|
||||
pointerEvents: 'auto',
|
||||
visibility: 'visible',
|
||||
}
|
||||
: {}
|
||||
}
|
||||
>
|
||||
<div className="modal-box">
|
||||
<h1 className="font-bold text-2xl pb-8">
|
||||
Monitoring Booking Slot
|
||||
</h1>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Master AWB</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Master AWB"
|
||||
className={`input input-bordered ${
|
||||
errors.master_awb && 'input-error'
|
||||
}`}
|
||||
name="master_awb"
|
||||
value={data.master_awb}
|
||||
onChange={handleOnChange}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt">
|
||||
{errors.master_awb}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Flight Number</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Flight Number"
|
||||
className={`input input-bordered ${
|
||||
errors.flight_number && 'input-error'
|
||||
}`}
|
||||
name="flight_number"
|
||||
value={data.flight_number}
|
||||
onChange={handleOnChange}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt">
|
||||
{errors.flight_number}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Departure</span>
|
||||
</label>
|
||||
<input
|
||||
type="date"
|
||||
placeholder="20/01/2022"
|
||||
className={`input input-bordered ${
|
||||
errors.departure && 'input-error'
|
||||
}`}
|
||||
name="departure"
|
||||
value={data.departure}
|
||||
onChange={handleOnChange}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt">
|
||||
{errors.departure}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Destination</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Jakarta"
|
||||
className={`input input-bordered ${
|
||||
errors.destination && 'input-error'
|
||||
}`}
|
||||
name="destination"
|
||||
value={data.destination}
|
||||
onChange={handleOnChange}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt">
|
||||
{errors.destination}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Packaging</span>
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Pack"
|
||||
className={`input input-bordered ${
|
||||
errors.kemasan && 'input-error'
|
||||
}`}
|
||||
name="kemasan"
|
||||
value={data.kemasan}
|
||||
onChange={handleOnChange}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt">{errors.kemasan}</span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Booked</span>
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
placeholder="0"
|
||||
className={`input input-bordered ${
|
||||
errors.booked && 'input-error'
|
||||
}`}
|
||||
name="booked"
|
||||
value={data.booked}
|
||||
onChange={handleOnChange}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt">{errors.booked}</span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Used</span>
|
||||
</label>
|
||||
<input
|
||||
type="number"
|
||||
placeholder="0"
|
||||
className={`input input-bordered ${
|
||||
errors.used && 'input-error'
|
||||
}`}
|
||||
name="used"
|
||||
value={data.used}
|
||||
onChange={handleOnChange}
|
||||
/>
|
||||
<label className="label">
|
||||
<span className="label-text-alt">{errors.used}</span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="form-control">
|
||||
<label className="label">
|
||||
<span className="label-text">Status</span>
|
||||
</label>
|
||||
<select
|
||||
className="select select-bordered w-full"
|
||||
onChange={(e) =>
|
||||
setData('is_available', e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="0" selected={+data.is_available === 0}>
|
||||
Available
|
||||
</option>
|
||||
<option value="1" selected={+data.is_available === 1}>
|
||||
Closed
|
||||
</option>
|
||||
</select>
|
||||
<label className="label">
|
||||
<span className="label-text-alt">
|
||||
{errors.is_available}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="modal-action">
|
||||
<label
|
||||
htmlFor="my-modal-2"
|
||||
className="btn"
|
||||
onClick={handleSubmit}
|
||||
disabled={processing}
|
||||
>
|
||||
Simpan
|
||||
</label>
|
||||
<label
|
||||
htmlFor="my-modal-2"
|
||||
className="btn btn-secondary"
|
||||
onClick={handleCancel}
|
||||
disabled={processing}
|
||||
>
|
||||
Batal
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
import { useForm } from "@inertiajs/inertia-react";
|
||||
import React, { useRef } from "react";
|
||||
|
||||
export default function ImportModal(props) {
|
||||
const { isOpen, toggle = () => {}, booking = null } = props;
|
||||
|
||||
const { data, setData, post, progress, errors, clearErrors } = useForm({
|
||||
file_booking_import: null,
|
||||
});
|
||||
|
||||
const inputFileImport = useRef();
|
||||
|
||||
const handleReset = () => {
|
||||
setData({
|
||||
file_booking_import: "",
|
||||
});
|
||||
|
||||
clearErrors();
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
toggle();
|
||||
handleReset();
|
||||
};
|
||||
|
||||
function handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
post(route("monitoring-booking.import"), {
|
||||
forceFormData: false,
|
||||
onSuccess: () => Promise.all([handleReset(), toggle()]),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="modal"
|
||||
style={
|
||||
isOpen
|
||||
? {
|
||||
opacity: 1,
|
||||
pointerEvents: "auto",
|
||||
visibility: "visible",
|
||||
}
|
||||
: {}
|
||||
}
|
||||
>
|
||||
<div className="modal-box max-h-screen m-auto">
|
||||
<h1 className="font-bold text-2xl pb-8">Import File Booking</h1>
|
||||
<p>
|
||||
Unduh format file import{" "}
|
||||
<a
|
||||
className="underline text-blue-500"
|
||||
href="/awb-format.csv"
|
||||
>
|
||||
disini
|
||||
</a>
|
||||
</p>
|
||||
<form onSubmit={(e) => handleSubmit(e)}>
|
||||
<input
|
||||
ref={inputFileImport}
|
||||
type="file"
|
||||
name="file_booking_import"
|
||||
onChange={(e) =>
|
||||
setData("file_booking_import", e.target.files[0])
|
||||
}
|
||||
/>
|
||||
{progress && (
|
||||
<progress value={progress.percentage} max="100">
|
||||
{progress.percentage}%
|
||||
</progress>
|
||||
)}
|
||||
<div className="modal-action">
|
||||
<label
|
||||
htmlFor="my-modal-2"
|
||||
className="btn btn-accent"
|
||||
onClick={(e) => handleSubmit(e)}
|
||||
disabled={progress}
|
||||
>
|
||||
Import
|
||||
</label>
|
||||
<label
|
||||
htmlFor="my-modal-2"
|
||||
className="btn"
|
||||
onClick={handleCancel}
|
||||
disabled={progress}
|
||||
>
|
||||
Batal
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
@ -0,0 +1,28 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><strong>MASTER AWB</strong></th>
|
||||
<th><strong>FLIGHT NUMBER</strong></th>
|
||||
<th><strong>DEPARTURE</strong></th>
|
||||
<th><strong>DESTINATION</strong></th>
|
||||
<th><strong>JUMLAH KOLI</strong></th>
|
||||
<th><strong>JENIS KEMASAN</strong></th>
|
||||
<th><strong>BOOKED</strong></th>
|
||||
<th><strong>USED</strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($bookings as $booking)
|
||||
<tr>
|
||||
<td>{{ $booking->master_awb }}</td>
|
||||
<td>{{ $booking->flight_number }}</td>
|
||||
<td>{{ $booking->departure }}</td>
|
||||
<td>{{ $booking->destination }}</td>
|
||||
<td>{{ $booking->jumlah_koli }}</td>
|
||||
<td>{{ $booking->kemasan}}</td>
|
||||
<td>{{ $booking->booked}}</td>
|
||||
<td>{{ $booking->used }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
@ -0,0 +1,38 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Daily Report</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Periode : {{$startDate . ' to ' . $endDate}}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>NO</th>
|
||||
<th>VOUCHER</th>
|
||||
<th>DATE</th>
|
||||
<th>NAME</th>
|
||||
<th>JOB NUMBER</th>
|
||||
<th>DESCRIPTION</th>
|
||||
<th>ESTIMATION</th>
|
||||
<th>DEBET</th>
|
||||
<th>KREDIT</th>
|
||||
<th>BALANCE</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($expenses as $expense)
|
||||
<tr>
|
||||
<td>{{ $loop->index + 1 }}</td>
|
||||
<td>{{ $loop->index + 1 }}</td>
|
||||
<td>{{ $expense->date_expense }}</td>
|
||||
<td>{{ $expense->name }}</td>
|
||||
<td>{{ $expense->job_number }}</td>
|
||||
<td>{{ $expense->description }}</td>
|
||||
<td>{{ $expense->estimation }}</td>
|
||||
<td>{{ (!$expense->isIncome) ? $expense->amount : '' }}</td>
|
||||
<td>{{ ($expense->isIncome) ? $expense->amount : '' }}</td>
|
||||
<td>{{ $expense->subBalance }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
Loading…
Reference in New Issue