This commit is contained in:
meusinfirmary
2025-06-12 01:13:36 +07:00
parent a38ebbb30f
commit bd78b881b5
18 changed files with 528 additions and 713 deletions

View File

@ -4,12 +4,12 @@
@endsection
@section('customcss')
<style>
.tepiBottom {
border-bottom: 1.5px groove #000;
padding-bottom: 15px;
}
</style>
<style>
.tepiBottom {
border-bottom: 1.5px groove #000;
padding-bottom: 15px;
}
</style>
@endsection
@section('content')
@ -22,13 +22,12 @@
<div class="row d-flex align-items-center">
<div class="col">
<p class="card-title text-bold mb-0">Detail Pesanan (#{{ $order->ord_code }})</p>
@if ($order->crt_type_order === \App\Models\Orders::CRT_TYPE_ORDER_ADMIN_SPECIAL)
@if ($order->crt_type_order === \App\Models\Orders::CRT_TYPE_ORDER_ADMIN_SPECIAL)
<span class="badge bg-warning text-dark">Pesanan Khusus</span>
@endif
</div>
<div class="col text-end">
<button class="btn btn-secondary btn-sm"
onclick="location.href='{{ route('view_keuangan_billing') }}'">Kembali</button>
<button class="btn btn-secondary btn-sm" onclick="location.href='{{ route('view_keuangan_billing') }}'">Kembali</button>
</div>
</div>
</div>
@ -215,14 +214,11 @@
<div class="accordion mb-3">
<div class="accordion-item border-0 radius-8">
<h2 class="accordion-header" id="panelsStayOpen-headingFive">
<button class="accordion-button radius-8 collapsed" type="button"
data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseFive"
aria-expanded="false" aria-controls="panelsStayOpen-collapseFive">
<button class="accordion-button radius-8 collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapseFive" aria-expanded="false" aria-controls="panelsStayOpen-collapseFive">
Berkas Driver
</button>
</h2>
<div id="panelsStayOpen-collapseFive" class="accordion-collapse collapse"
aria-labelledby="panelsStayOpen-headingFive">
<div id="panelsStayOpen-collapseFive" class="accordion-collapse collapse" aria-labelledby="panelsStayOpen-headingFive">
<div class="accordion-body pb-0">
<div class="row">
@php
@ -237,8 +233,7 @@
</div>
<div class="card bg-light border mb-0">
<div class="card-body p-0">
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
alt="" class="img-fluid img-report">
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
</div>
</div>
</div>
@ -250,8 +245,7 @@
</div>
<div class="card bg-light border mb-0">
<div class="card-body p-0">
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
alt="" class="img-fluid img-report">
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
</div>
</div>
</div>
@ -263,14 +257,13 @@
</div>
<div class="card bg-light border mb-0">
<div class="card-body p-0">
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
alt="" class="img-fluid img-report">
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
</div>
</div>
</div>
@elseif ($drvUp->stts === \App\Models\OrdersDriversUploads::STTS_UP_TRAVEL_DOCUMENT)
@php
$afterTravelDoc = 1;
$afterTravelDoc = 1;
@endphp
<div class="col-12 mb-3 tepiBottom">
<div class="d-flex justify-content-between">
@ -279,8 +272,7 @@
</div>
<div class="card bg-light border mb-0">
<div class="card-body p-0">
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
alt="" class="img-fluid img-report">
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
</div>
</div>
</div>
@ -292,8 +284,7 @@
</div>
<div class="card bg-light border mb-0">
<div class="card-body p-0">
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
alt="" class="img-fluid img-report">
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
</div>
</div>
</div>
@ -305,8 +296,7 @@
</div>
<div class="card bg-light border mb-0">
<div class="card-body p-0">
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
alt="" class="img-fluid img-report">
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
</div>
</div>
</div>
@ -318,8 +308,7 @@
</div>
<div class="card bg-light border mb-0">
<div class="card-body p-0">
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
alt="" class="img-fluid img-report">
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
</div>
</div>
</div>
@ -331,8 +320,7 @@
</div>
<div class="card bg-light border mb-0">
<div class="card-body p-0">
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
alt="" class="img-fluid img-report">
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
</div>
</div>
</div>
@ -344,8 +332,7 @@
</div>
<div class="card bg-light border mb-0">
<div class="card-body p-0">
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
alt="" class="img-fluid img-report">
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
</div>
</div>
</div>
@ -357,8 +344,7 @@
</div>
<div class="card bg-light border mb-0">
<div class="card-body p-0">
<img src="{{ isset($drvUp->img)? \App\Helper::changeIpToDomain($drvUp->img): 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}"
alt="" class="img-fluid img-report">
<img src="{{ isset($drvUp->img) ? \App\Helper::changeIpToDomain($drvUp->img) : 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQDVPuMlKfGrFErmCt6hCuECLbbhekJF-GCtAJvPIZpHX5upTT-hABFlp8qZY8rkgaZ0DE&usqp=CAU' }}" alt="" class="img-fluid img-report">
</div>
</div>
</div>
@ -379,13 +365,13 @@
@endif
{{-- invoicing termin 1 --}}
@php
$prev_yi = 0;
$prev_yi = 0;
@endphp
@foreach ($group_items_by_termin as $yi => $y)
@php
$result_is_enable_btn = App\Helper::viewBillFncIsEnableBtn(isset($group_items_by_termin[$prev_yi]) ? $group_items_by_termin[$prev_yi][0] : 0, $y[0]);
$sub_total = 0;
$invc_items = '';
$result_is_enable_btn = App\Helper::viewBillFncIsEnableBtn(isset($group_items_by_termin[$prev_yi]) ? $group_items_by_termin[$prev_yi][0] : 0, $y[0]);
$sub_total = 0;
$invc_items = '';
@endphp
<div class="card">
<div class="card-header">
@ -434,91 +420,78 @@
</thead>
<tbody>
@foreach ($y as $xi => $x)
@php
$amt_bill_base_flat = $x->amt_bill_base_flat;
$amt_bill_total_flat = $x->amt_bill_total_flat;
if ($y[0]->termin_tax_type === \App\Models\OrdersAItems::AMT_TAX_TYPE_INCLUDE) {
$before_ppn = round($amt_bill_base_flat / \App\Models\OrdersAItems::PPN_PERCENT_INCLUDE);
$ppn = round($amt_bill_base_flat - $before_ppn);
$amt_bill_base_flat = round($before_ppn);
$amt_bill_total_flat = round($amt_bill_base_flat * $x->unit_qty);
} else {
$amt_bill_total_flat = round($amt_bill_base_flat * $x->unit_qty);
}
@endphp
<tr class="">
<td class="small">{{ $xi + 1 }}</td>
<td class="small">
@if ($x->a_item_type != \App\Models\OrdersAItems::A_TYPE_PRIMARY)
@if ($result_is_enable_btn === 1 || $result_is_enable_btn === 2)
<a href="javascript:void(0)" class="text-primary btnDelItem"><span class="icon ion-trash-b fz-16"></span></a>
@endif
@endif
</td>
<td class="small" data-ord_a_item_id="{{ $x->ord_a_item_id }}">
{!! $x->desc !!}
</td>
<td class="small text-nowrap text-end">{{ $x->unit_qty }}</td>
<td class="small">{{ $x->unit_type_name }}</td>
<td class="small text-nowrap text-end">{{ number_format($amt_bill_base_flat, 0, ',', '.') }}</td>
<td class="small text-nowrap text-end">{{ number_format($amt_bill_total_flat, 0, ',', '.') }}</td>
@php
$sub_total += $amt_bill_total_flat;
$invc_items .= "$x->ord_a_item_id,";
$amt_bill_base_flat = $x->amt_bill_base_flat;
$amt_bill_total_flat = $x->amt_bill_total_flat;
if ($y[0]->termin_tax_type === \App\Models\OrdersAItems::AMT_TAX_TYPE_INCLUDE) {
$before_ppn = round($amt_bill_base_flat / \App\Models\OrdersAItems::PPN_PERCENT_INCLUDE);
$ppn = round($amt_bill_base_flat - $before_ppn);
$amt_bill_base_flat = round($before_ppn);
$amt_bill_total_flat = round($amt_bill_base_flat * $x->unit_qty);
} else {
$amt_bill_total_flat = round($amt_bill_base_flat * $x->unit_qty);
}
@endphp
</tr>
<tr class="">
<td class="small">{{ $xi + 1 }}</td>
<td class="small">
@if ($x->a_item_type != \App\Models\OrdersAItems::A_TYPE_PRIMARY)
@if ($result_is_enable_btn === 1 || $result_is_enable_btn === 2)
<a href="javascript:void(0)" class="text-primary btnDelItem"><span class="icon ion-trash-b fz-16"></span></a>
@endif
@endif
</td>
<td class="small" data-ord_a_item_id="{{ $x->ord_a_item_id }}">
{!! $x->desc !!}
</td>
<td class="small text-nowrap text-end">{{ $x->unit_qty }}</td>
<td class="small">{{ $x->unit_type_name }}</td>
<td class="small text-nowrap text-end">{{ number_format($amt_bill_base_flat, 0, ',', '.') }}</td>
<td class="small text-nowrap text-end">{{ number_format($amt_bill_total_flat, 0, ',', '.') }}</td>
@php
$sub_total += $amt_bill_total_flat;
$invc_items .= "$x->ord_a_item_id,";
@endphp
</tr>
@endforeach
</tbody>
<tfooter>
@php
$total = $sub_total;
$sign_tax = '';
if ($y[0]->termin_tax_type === \App\Models\OrdersAItems::AMT_TAX_TYPE_INCLUDE) {
$ppn_flat = round($sub_total * $y[0]->termin_tax_ppn_percent / 100);
$before_ppn = round($sub_total - $ppn_flat); // +
$pph_flat = round(0 * -1 * ($before_ppn * $y[0]->termin_tax_pph_percent / 100)); // -1 *
$before_ppn_pph = round($sub_total + $ppn_flat + $pph_flat); // + +
$tax_flat = round($ppn_flat + $pph_flat);
$total = round($before_ppn_pph);
// $sign_tax = '-';
}
// $disc_flat = round($x->invc_disc_flat) ?? 0; ngebug kalo diskon sudah ada tetapi ada item baru, kalkulasinya tidak terupdate tetapi ke yang lama
if ($x->invc_disc_type === \App\Models\OrdersAItems::AMT_TYPE_FLAT) {
$disc_flat = round($x->invc_disc_flat);
} else {
$disc_flat = round($total / 100 * $x->invc_disc_percent);
}
$pengurangan_disc = round($total - ($disc_flat ?? 0));
$total = $pengurangan_disc;
if ($y[0]->termin_tax_type === \App\Models\OrdersAItems::AMT_TAX_TYPE_EXCLUDE) {
$ppn_flat = round($total * $y[0]->termin_tax_ppn_percent / 100);
$after_ppn = round($total + $ppn_flat);
$pph_flat = round(0 * $after_ppn * $y[0]->termin_tax_pph_percent / 100);
$tax_flat = round($ppn_flat + $pph_flat);
$total += $tax_flat;
} else if ($y[0]->termin_tax_type === \App\Models\OrdersAItems::AMT_TAX_TYPE_WITHOUT) {
$ppn_flat = 0;
$pph_flat = 0;
$tax_flat = 0;
}
$total = $sub_total;
$sign_tax = '';
if ($y[0]->termin_tax_type === \App\Models\OrdersAItems::AMT_TAX_TYPE_INCLUDE) {
$ppn_flat = round(($sub_total * $y[0]->termin_tax_ppn_percent) / 100);
$before_ppn = round($sub_total - $ppn_flat); // +
$pph_flat = round(0 * -1 * (($before_ppn * $y[0]->termin_tax_pph_percent) / 100)); // -1 *
$before_ppn_pph = round($sub_total + $ppn_flat + $pph_flat); // + +
$tax_flat = round($ppn_flat + $pph_flat);
$total = round($before_ppn_pph);
// $sign_tax = '-';
}
// $disc_flat = round($x->invc_disc_flat) ?? 0; ngebug kalo diskon sudah ada tetapi ada item baru, kalkulasinya tidak terupdate tetapi ke yang lama
if ($x->invc_disc_type === \App\Models\OrdersAItems::AMT_TYPE_FLAT) {
$disc_flat = round($x->invc_disc_flat);
} else {
$disc_flat = round(($total / 100) * $x->invc_disc_percent);
}
$pengurangan_disc = round($total - ($disc_flat ?? 0));
$total = $pengurangan_disc;
if ($y[0]->termin_tax_type === \App\Models\OrdersAItems::AMT_TAX_TYPE_EXCLUDE) {
$ppn_flat = round(($total * $y[0]->termin_tax_ppn_percent) / 100);
$after_ppn = round($total + $ppn_flat);
$pph_flat = round((0 * $after_ppn * $y[0]->termin_tax_pph_percent) / 100);
$tax_flat = round($ppn_flat + $pph_flat);
$total += $tax_flat;
} elseif ($y[0]->termin_tax_type === \App\Models\OrdersAItems::AMT_TAX_TYPE_WITHOUT) {
$ppn_flat = 0;
$pph_flat = 0;
$tax_flat = 0;
}
@endphp
<tr class="border-0">
<td class="text-nowrap text-end border-0" colspan="6">Sub total</td>
@if ($result_is_enable_btn === 1 || $result_is_enable_btn === 2)
<td id="subTotal" class="text-nowrap text-end border-0"
data-items="{{ $invc_items }}"
data-subtotal="{{ round($sub_total) }}"
data-terminid="{{ $x->c_group_termin_id }}"
data-taxtype="{{ $y[0]->termin_tax_type }}"
data-ppnpercent="{{ $y[0]->termin_tax_ppn_percent }}"
data-ppnflat="{{ round($ppn_flat) }}"
data-pphpercent="{{ $y[0]->termin_tax_pph_percent * 0 }}"
data-pphflat="{{ round($pph_flat) }}"
data-taxflat="{{ round($tax_flat) }}"
data-disctype="{{ $x->invc_disc_type ?? 0 }}"
data-discpercent="{{ $x->invc_disc_percent ?? 0 }}"
data-discflat="{{ round(($disc_flat ?? 0)) }}"
data-total="{{ round($total) }}">
<td id="subTotal" class="text-nowrap text-end border-0" data-items="{{ $invc_items }}" data-subtotal="{{ round($sub_total) }}" data-terminid="{{ $x->c_group_termin_id }}" data-taxtype="{{ $y[0]->termin_tax_type }}" data-ppnpercent="{{ $y[0]->termin_tax_ppn_percent }}" data-ppnflat="{{ round($ppn_flat) }}" data-pphpercent="{{ $y[0]->termin_tax_pph_percent * 0 }}" data-pphflat="{{ round($pph_flat) }}" data-taxflat="{{ round($tax_flat) }}" data-disctype="{{ $x->invc_disc_type ?? 0 }}" data-discpercent="{{ $x->invc_disc_percent ?? 0 }}" data-discflat="{{ round($disc_flat ?? 0) }}" data-total="{{ round($total) }}">
@if ($y[0]->termin_tax_type === \App\Models\OrdersAItems::AMT_TAX_TYPE_EXCLUDE)
{{ number_format($sub_total, 0, ',', '.') }}
@elseif ($y[0]->termin_tax_type === \App\Models\OrdersAItems::AMT_TAX_TYPE_INCLUDE)
@ -549,15 +522,15 @@
Diskon
@endif
</td>
<td class="text-nowrap text-end border-0">{{ ($disc_flat > 0) ? '-'.number_format($disc_flat, 0, ',', '.') : $disc_flat }}</td>
<td class="text-nowrap text-end border-0">{{ $disc_flat > 0 ? '-' . number_format($disc_flat, 0, ',', '.') : $disc_flat }}</td>
<tr class="border-bottom">
<td class="text-nowrap text-end border-bottom" style="border-bottom: 1px solid !important;" colspan="6">PPN ({{ $y[0]->termin_tax_ppn_percent }}%)</td>
<td class="text-nowrap text-end border-bottom" style="border-bottom: 1px solid !important;">{{ $sign_tax.number_format($ppn_flat, 0, ',', '.') }}</td>
<td class="text-nowrap text-end border-bottom" style="border-bottom: 1px solid !important;">{{ $sign_tax . number_format($ppn_flat, 0, ',', '.') }}</td>
</tr>
@if ($pph_flat > 0)
<tr class="border-0">
<td class="text-nowrap text-end border-0" colspan="6">PPH ({{ $y[0]->termin_tax_pph_percent }}%)</td>
<td class="text-nowrap text-end border-0">{{ $sign_tax.number_format($pph_flat, 0, ',', '.') }}</td>
<td class="text-nowrap text-end border-0">{{ $sign_tax . number_format($pph_flat, 0, ',', '.') }}</td>
</tr>
@endif
@elseif ($y[0]->termin_tax_type === \App\Models\OrdersAItems::AMT_TAX_TYPE_INCLUDE)
@ -569,16 +542,16 @@
Diskon
@endif
</td>
<td class="text-nowrap text-end border-0">{{ ($disc_flat > 0) ? '-'.number_format($disc_flat, 0, ',', '.') : $disc_flat }}</td>
<td class="text-nowrap text-end border-0">{{ $disc_flat > 0 ? '-' . number_format($disc_flat, 0, ',', '.') : $disc_flat }}</td>
</tr>
<tr class="border-bottom">
<td class="text-nowrap text-end border-bottom" style="border-bottom: 1px solid !important;" colspan="6">PPN ({{ $y[0]->termin_tax_ppn_percent }}%)</td>
<td class="text-nowrap text-end border-bottom" style="border-bottom: 1px solid !important;">{{ $sign_tax.number_format($ppn_flat, 0, ',', '.') }}</td>
<td class="text-nowrap text-end border-bottom" style="border-bottom: 1px solid !important;">{{ $sign_tax . number_format($ppn_flat, 0, ',', '.') }}</td>
</tr>
@if ($pph_flat > 0)
<tr class="border-0">
<td class="text-nowrap text-end border-0" colspan="6">PPH ({{ $y[0]->termin_tax_pph_percent }}%)</td>
<td class="text-nowrap text-end border-0">{{ $sign_tax.number_format(-1*$pph_flat, 0, ',', '.') }}</td>
<td class="text-nowrap text-end border-0">{{ $sign_tax . number_format(-1 * $pph_flat, 0, ',', '.') }}</td>
</tr>
@endif
@else
@ -590,7 +563,7 @@
Diskon
@endif
</td>
<td class="text-nowrap text-end border-bottom" style="border-bottom: 1px solid !important;">{{ ($disc_flat > 0) ? '-'.number_format($disc_flat, 0, ',', '.') : $disc_flat }}</td>
<td class="text-nowrap text-end border-bottom" style="border-bottom: 1px solid !important;">{{ $disc_flat > 0 ? '-' . number_format($disc_flat, 0, ',', '.') : $disc_flat }}</td>
</tr>
@endif
</tfooter>
@ -615,7 +588,7 @@
@if ($result_is_enable_btn === 1 || $result_is_enable_btn === 2)
<div class="card-footer">
<div class="row d-flex align-items-center justify-content-between">
<div class="{{ ($x->invc_id === null) ? 'col-8' : 'col-lg-5 col-md-4' }}">
<div class="{{ $x->invc_id === null ? 'col-8' : 'col-lg-5 col-md-4' }}">
<p class="mb-0">
Apakah item diatas sudah seluruhnya di masukkan?
</p>
@ -623,9 +596,7 @@
<div class="col-auto text-end d-flex">
@if ($x->invc_id !== null && $x->is_gnrt_invc === \App\Models\OrdersInvoices::IS_GNRT_INVC_YES)
{{-- {{ asset('pdf/invoice.pdf') }} --}}
<button type="button" id="confirmInvc" class="btn btn-warning btn-block btn-sm text-nowrap"
data-bs-toggle="modal" data-bs-target="#mdlConfirmInvc"
data-id={{ $x->invc_id }} data-code={{ $x->invc_code }}>
<button type="button" id="confirmInvc" class="btn btn-warning btn-block btn-sm text-nowrap" data-bs-toggle="modal" data-bs-target="#mdlConfirmInvc" data-id={{ $x->invc_id }} data-code={{ $x->invc_code }}>
Konfirmasi Pembayaran</button>
@endif
{{-- {{ asset('pdf/invoice.pdf') }} --}}
@ -635,21 +606,21 @@
</div>
@else
@if ($y[0]->amt_bill_confirm !== 0)
<div class="card-footer">
<div class="row d-flex align-items-center justify-content-between">
<div class="col-8">
<p class="mb-0"><span class="fw-bold">Nilai yang diterima:</span> <span class="fw-bold">Rp{{ number_format($y[0]->amt_bill_confirm, 0, ',', '.') }}</span></p>
<p class="mb-0"><span class="fw-bold">Keterangan:</span></p>
<p class="mb-0"><span class="">{!! nl2br($y[0]->amt_bill_confirm_note) !!}</span></p>
<div class="card-footer">
<div class="row d-flex align-items-center justify-content-between">
<div class="col-8">
<p class="mb-0"><span class="fw-bold">Nilai yang diterima:</span> <span class="fw-bold">Rp{{ number_format($y[0]->amt_bill_confirm, 0, ',', '.') }}</span></p>
<p class="mb-0"><span class="fw-bold">Keterangan:</span></p>
<p class="mb-0"><span class="">{!! nl2br($y[0]->amt_bill_confirm_note) !!}</span></p>
</div>
</div>
</div>
</div>
@endif
@endif
</div>
@php
$prev_yi += $yi;
@endphp
@php
$prev_yi += $yi;
@endphp
@endforeach
</div>
</div>
@ -946,7 +917,7 @@
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Batal</button>
<button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button id="btnSubmitChangePICInvoice" type="button" class="btn btn-sm btn-danger">Ganti</button>
<div id="btnSubmitChangePICInvoiceSpinner" class="d-none">
<div class="spinner-border" role="status">
@ -979,25 +950,25 @@
// console.log(data)
// if(data == 99999999){
// let a = `
// <div id="addNewItemContent">
// <div class="mb-3">
// <label for="" class="form-label">Nama Item</label>
// <input type="text" class="form-control">
// </div>
// <div class="mb-3">
// <label for="" class="form-label">Satuan</label>
// <select name="" id="" class="select2 form-control" style="width: 100% !important">
// <option value="none" selected disabled>Belum ada satuan yang dipilih</option>
// <option value="">Paket</option>
// <option value="">Unit</option>
// <option value="">Pcs</option>
// </select>
// </div>
// <div class="mb-3">
// <label for="" class="form-label">Harga</label>
// <input type="number" class="form-control">
// </div>
// `
// <div id="addNewItemContent">
// <div class="mb-3">
// <label for="" class="form-label">Nama Item</label>
// <input type="text" class="form-control">
// </div>
// <div class="mb-3">
// <label for="" class="form-label">Satuan</label>
// <select name="" id="" class="select2 form-control" style="width: 100% !important">
// <option value="none" selected disabled>Belum ada satuan yang dipilih</option>
// <option value="">Paket</option>
// <option value="">Unit</option>
// <option value="">Pcs</option>
// </select>
// </div>
// <div class="mb-3">
// <label for="" class="form-label">Harga</label>
// <input type="number" class="form-control">
// </div>
// `
// $('#addNewItemWrapper').html(a)
// $('.select2').select2({
// dropdownParent: $('#mdlAddItem')
@ -1013,61 +984,61 @@
// // fixed
// if(data == 1){
// let a = `
// <div id="disFieldContent">
// <div class="mb-3">
// <label for="" class="form-label">Besaran Diskon (Rp)</label>
// <input class="form-control" type="number" id="">
// </div>
// </div>
// `
// <div id="disFieldContent">
// <div class="mb-3">
// <label for="" class="form-label">Besaran Diskon (Rp)</label>
// <input class="form-control" type="number" id="">
// </div>
// </div>
// `
// $('#disFieldContent').remove()
// $('#disFieldWrapper').html(a)
// } else if (data == 2) {
// let a = `
// <div id="disFieldContent">
// <div class="mb-3">
// <label for="" class="form-label">Masukkan Diskon (%)</label>
// <input class="form-control" type="number" min="1" max="100" id="">
// </div>
// <div class="mb-3">
// <label for="" class="form-label">Besaran Diskon (Rp)</label>
// <input class="form-control" type="number" id="" readonly>
// </div>
// </div>
// `
// <div id="disFieldContent">
// <div class="mb-3">
// <label for="" class="form-label">Masukkan Diskon (%)</label>
// <input class="form-control" type="number" min="1" max="100" id="">
// </div>
// <div class="mb-3">
// <label for="" class="form-label">Besaran Diskon (Rp)</label>
// <input class="form-control" type="number" id="" readonly>
// </div>
// </div>
// `
// $('#disFieldContent').remove()
// $('#disFieldWrapper').html(a)
// } else {
// $('#disFieldContent').remove()
// }
// if(data == 99999999){
// let a = `
// <div id="addNewItemContent">
// <div class="mb-3">
// <label for="" class="form-label">Nama Item</label>
// <input type="text" class="form-control">
// </div>
// <div class="mb-3">
// <label for="" class="form-label">Satuan</label>
// <select name="" id="" class="select2 form-control" style="width: 100% !important">
// <option value="none" selected disabled>Belum ada satuan yang dipilih</option>
// <option value="">Paket</option>
// <option value="">Unit</option>
// <option value="">Pcs</option>
// </select>
// </div>
// <div class="mb-3">
// <label for="" class="form-label">Harga</label>
// <input type="number" class="form-control">
// </div>
// `
// $('#addNewItemWrapper').html(a)
// $('.select2').select2({
// dropdownParent: $('#mdlAddItem')
// });
// } else {
// $('#addNewItemContent').remove()
// }
// if(data == 99999999){
// let a = `
// <div id="addNewItemContent">
// <div class="mb-3">
// <label for="" class="form-label">Nama Item</label>
// <input type="text" class="form-control">
// </div>
// <div class="mb-3">
// <label for="" class="form-label">Satuan</label>
// <select name="" id="" class="select2 form-control" style="width: 100% !important">
// <option value="none" selected disabled>Belum ada satuan yang dipilih</option>
// <option value="">Paket</option>
// <option value="">Unit</option>
// <option value="">Pcs</option>
// </select>
// </div>
// <div class="mb-3">
// <label for="" class="form-label">Harga</label>
// <input type="number" class="form-control">
// </div>
// `
// $('#addNewItemWrapper').html(a)
// $('.select2').select2({
// dropdownParent: $('#mdlAddItem')
// });
// } else {
// $('#addNewItemContent').remove()
// }
// })
</script>
<script>
@ -1194,7 +1165,7 @@
OrdView.event();
OrdView.initDateAdtPoints();
},
event: function() { },
event: function() {},
reqShowAItem: function(params) {
return new Promise((resolve, reject) => {
$.ajax({
@ -1272,7 +1243,7 @@
});
// input
$('#add-item_price').on('keyup', function() {
let price = $('#add-item_price').val().split('.').join('').replace(/[$,]+/g,".");
let price = $('#add-item_price').val().split('.').join('').replace(/[$,]+/g, ".");
$('#add-item_price').val((new Intl.NumberFormat('id-ID')).format(price));
});
// submit
@ -1287,7 +1258,7 @@
},
eventTax: function() {
// client
$('#add-item_bill_tax_type').on('change', function () {
$('#add-item_bill_tax_type').on('change', function() {
const val = $('#add-item_bill_tax_type').val();
if (val == State.tax_type.include) {
$('.groupTaxBill').removeClass('d-none');
@ -1361,10 +1332,9 @@
qty: Number($('#add-item_qty').val()),
};
let slcType = $('#slcItem option:selected');
if (slcType.val() === 'new') {
if (slcType.val() === 'new') {
calc.price = Number($('#add-item_price').val().split('.').join(''));
} else if (slcType.val() === '') {
} else {
} else if (slcType.val() === '') {} else {
calc.price = Number(slcType.data('price'));
}
}
@ -1392,19 +1362,18 @@
const data = {};
let slcType = $('#slcItem option:selected');
if (slcType.val() === 'new') {
if (slcType.val() === 'new') {
data.a_id = '00';
data.a_name = $('#add-item_name').val();
data.a_type = $('#add-item_type').val();
data.a_price = $('#add-item_price').val().split('.').join('').replace(/[$,]+/g,".");
data.a_invc_price = $('#add-item_price').val().split('.').join('').replace(/[$,]+/g,".");
if($('#add-item_isAdmPrice').prop('checked')) {
data.a_price = $('#add-item_price').val().split('.').join('').replace(/[$,]+/g, ".");
data.a_invc_price = $('#add-item_price').val().split('.').join('').replace(/[$,]+/g, ".");
if ($('#add-item_isAdmPrice').prop('checked')) {
data.is_adm_price = State.is_adm_price.yes
} else {
data.is_adm_price = State.is_adm_price.no
}
} else if (slcType.val() === '') {
} else {
} else if (slcType.val() === '') {} else {
data.a_id = slcType.val(); // id
data.a_name = slcType.data('name');
data.a_type = slcType.data('type');
@ -1565,7 +1534,7 @@
$('#discFlat').val((new Intl.NumberFormat('id-ID')).format($('#subTotal').data('discflat')));
// input
$('#discFlat').on('keyup', function() {
let price = $('#discFlat').val().split('.').join('').replace(/[$,]+/g,".");
let price = $('#discFlat').val().split('.').join('').replace(/[$,]+/g, ".");
if (Number(price) < 1) {
Helper.toast('Warning', 'just now', 'Besaran diskon wajib diisi');
}
@ -1622,7 +1591,7 @@
},
getData: function(type = 'save_disc') {
const data = {};
data.ord_id = State.ord_id;
data.ord_code = State.ord_code;
data.termin_id = $('#subTotal').data('terminid');
@ -1642,11 +1611,11 @@
if (type === 'save_disc') {
let discType = $('#addDisc option:selected');
data.disc_type = discType.val();
if (data.disc_type == State.invc_amt_type.flat || data.disc_type == State.invc_amt_type.percent) { } else {
if (data.disc_type == State.invc_amt_type.flat || data.disc_type == State.invc_amt_type.percent) {} else {
data.disc_type = 0;
}
data.disc_percent = Number($('#discPercent').val());
data.disc_flat = Number($('#discFlat').val().split('.').join('').replace(/[$,]+/g,"."));
data.disc_flat = Number($('#discFlat').val().split('.').join('').replace(/[$,]+/g, "."));
} else {
data.disc_type = Number($('#subTotal').data('disctype'));
data.disc_percent = Number($('#subTotal').data('discpercent'));
@ -1786,7 +1755,7 @@
dropdownParent: $('#mdlTax')
});
// event select
$('#add-invc_tax_type').on('change', function () {
$('#add-invc_tax_type').on('change', function() {
const val = $('#add-invc_tax_type').val();
if (val == State.tax_type.include) {
$('.groupTaxTax').removeClass('d-none');
@ -1823,7 +1792,7 @@
},
getData: function() {
const data = {};
data.ord_id = State.ord_id;
data.ord_code = State.ord_code;
data.termin_id = $('#subTotal').data('terminid');
@ -1838,10 +1807,7 @@
return data;
},
checkData: function(data, isAlert = false) {
if (data.invc_tax_type == State.tax_type.without) {}
else if (data.invc_tax_type == State.tax_type.include) {}
else if (data.invc_tax_type == State.tax_type.exclude) {}
else {
if (data.invc_tax_type == State.tax_type.without) {} else if (data.invc_tax_type == State.tax_type.include) {} else if (data.invc_tax_type == State.tax_type.exclude) {} else {
if (isAlert) Helper.toast('Warning', 'just now', 'Perpajakan tidak valid');
return false;
}
@ -1924,7 +1890,7 @@
})
// input
$('#amt_bill_confirm').on('keyup', function() {
let price = $('#amt_bill_confirm').val().split('.').join('').replace(/[$,]+/g,".");
let price = $('#amt_bill_confirm').val().split('.').join('').replace(/[$,]+/g, ".");
$('#amt_bill_confirm').val((new Intl.NumberFormat('id-ID')).format(price));
});
// submit
@ -1940,7 +1906,7 @@
data.invc_id = $('#confirmInvc').data('id');
data.invc_code = $('#confirmInvc').data('code');
data.amt_invoicing = Number($('#subTotal').data('total'));
data.amt_bill_confirm = Number($('#amt_bill_confirm').val().split('.').join('').replace(/[$,]+/g,"."));
data.amt_bill_confirm = Number($('#amt_bill_confirm').val().split('.').join('').replace(/[$,]+/g, "."));
data.amt_bill_confirm_note = $('#amt_bill_confirm_note').val();
return data;
@ -2078,11 +2044,11 @@
const ChangePICInvoice = {
activate: function() {
$('#btnChangePICInvoice').on('click', function () {
$('#btnChangePICInvoice').on('click', function() {
$('#mdlChangePICInvoice').modal('show');
});
$('#btnSubmitChangePICInvoice').on('click', function () {
$('#btnSubmitChangePICInvoice').on('click', function() {
const data = ChangePICInvoice.getData();
let isValid = ChangePICInvoice.checkData(data, true);
if (!isValid) return false;