dev
Aji Kamaludin 1 year ago
parent 656d49cb4d
commit c21c1e1925
No known key found for this signature in database
GPG Key ID: 19058F67F0083AD3

@ -43,9 +43,13 @@ class HandleInertiaRequests extends Middleware
'csrf_token' => csrf_token(), 'csrf_token' => csrf_token(),
'notifications' => $notifications->limit(10)->get(), 'notifications' => $notifications->limit(10)->get(),
'count_unread_notifications' => $notifications->where('is_read', Notification::UNREAD)->count(), 'count_unread_notifications' => $notifications->where('is_read', Notification::UNREAD)->count(),
'deposit_notifications' => $notifications->where('type', Notification::TYPE_DEPOSIT) 'deposit_notifications' => Notification::where('entity_type', \App\Models\User::class)
->orderBy('created_at', 'desc')
->where('type', Notification::TYPE_DEPOSIT)
->where('is_read', Notification::UNREAD)->limit(10)->get(), ->where('is_read', Notification::UNREAD)->limit(10)->get(),
'stock_notifications' => $notifications->where('type', Notification::TYPE_VOUCHER_STOCK) 'stock_notifications' => Notification::where('entity_type', \App\Models\User::class)
->orderBy('created_at', 'desc')
->where('type', Notification::TYPE_VOUCHER_STOCK)
->where('is_read', Notification::UNREAD)->limit(10)->get(), ->where('is_read', Notification::UNREAD)->limit(10)->get(),
]); ]);
} }

@ -5,6 +5,7 @@ import { isEmpty } from 'lodash'
import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout' import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout'
import Button from '@/Components/Button' import Button from '@/Components/Button'
import FormInput from '@/Components/FormInput' import FormInput from '@/Components/FormInput'
import FormInputNumeric from '@/Components/FormInputNumeric'
export default function Form(props) { export default function Form(props) {
const { customer, levels } = props const { customer, levels } = props
@ -12,6 +13,7 @@ export default function Form(props) {
useForm({ useForm({
level: customer.level.key, level: customer.level.key,
paylater_limit: +customer.paylater?.limit, paylater_limit: +customer.paylater?.limit,
day_deadline: +customer?.paylater?.day_deadline,
}) })
const handleOnChange = (event) => { const handleOnChange = (event) => {
@ -102,8 +104,8 @@ export default function Form(props) {
</p> </p>
)} )}
</div> </div>
<div className="mb-4 mt-2"> <div className="mt-2">
<FormInput <FormInputNumeric
type="number" type="number"
label="Limit Hutang" label="Limit Hutang"
name="paylater_limit" name="paylater_limit"
@ -112,6 +114,16 @@ export default function Form(props) {
error={errors.paylater_limit} error={errors.paylater_limit}
/> />
</div> </div>
<div className="mb-4 mt-2">
<FormInputNumeric
type="number"
label="Tenor (Hari)"
name="day_deadline"
onChange={handleOnChange}
value={data.day_deadline}
error={errors.day_deadline}
/>
</div>
<div className="flex items-center"> <div className="flex items-center">
<Button <Button
onClick={handleSubmit} onClick={handleSubmit}

Loading…
Cancel
Save