12 changed files with 240 additions and 18 deletions
-
10app/Cart/Item.php
-
11app/Cart/TransactionDraft.php
-
6app/Http/Controllers/CartController.php
-
37resources/lang/id/app.php
-
28resources/lang/id/transaction.php
-
13resources/views/cart/index.blade.php
-
73resources/views/cart/partials/draft-confirm.blade.php
-
9resources/views/cart/partials/draft-item-list.blade.php
-
10resources/views/cart/partials/form-draft-detail.blade.php
-
1routes/web.php
-
32tests/Feature/TransactionEntryTest.php
-
28tests/Unit/Integration/TransactionDraftTest.php
@ -0,0 +1,37 @@ |
|||
<?php |
|||
|
|||
return [ |
|||
// Labels
|
|||
'table_no' => '#', |
|||
'name' => 'Nama', |
|||
'submit' => 'Submit', |
|||
'update' => 'Update', |
|||
'delete' => 'Hapus', |
|||
'add' => 'Tambah', |
|||
'back' => 'Kembali', |
|||
'cancel' => 'Batal', |
|||
'reset' => 'Reset', |
|||
'show' => 'Lihat Detail', |
|||
'label' => 'Label', |
|||
'edit' => 'Edit', |
|||
'print' => 'Print', |
|||
'search' => 'Cari', |
|||
'filter' => 'Filter', |
|||
'close' => 'Tutup', |
|||
'action' => 'Action', |
|||
'notes' => 'Catatan', |
|||
'delete_confirm_button' => 'Ya, silakan hapus!', |
|||
'delete_confirm' => 'Anda yakin akan menghapus?', |
|||
'description' => 'Deskripsi', |
|||
'code' => 'Kode', |
|||
'active' => 'Status', |
|||
'status' => 'Status', |
|||
'date' => 'Tanggal', |
|||
'time' => 'Waktu', |
|||
'created_at' => 'Dibuat Pada', |
|||
'created_by' => 'Oleh', |
|||
'total' => 'Total', |
|||
'count' => 'Jumlah', |
|||
'welcome' => 'Selamat datang', |
|||
'export-pdf' => 'Export PDF', |
|||
]; |
|||
@ -0,0 +1,73 @@ |
|||
<div class="row"> |
|||
<div class="col-md-8"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading"><h3 class="panel-title">{{ trans('transaction.confirm') }}</h3></div> |
|||
<div class="panel-body"> |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th>#</th>
|
|||
<th>Nama Item</th> |
|||
<th>Harga Satuan</th> |
|||
<th>Diskon per Item</th> |
|||
<th>Qty</th> |
|||
<th class="text-right">Subtotal</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
@forelse($draft->items() as $key => $item) |
|||
<tr> |
|||
<td>{{ $key + 1 }}</td> |
|||
<td>{{ $item->name }}</td> |
|||
<td>{{ formatRp($item->price) }}</td> |
|||
<td>{{ formatRp($item->item_discount) }}</td> |
|||
<td>{{ $item->qty }}</td> |
|||
<td class="text-right">{{ formatRp($item->subtotal) }}</td> |
|||
</tr> |
|||
@empty |
|||
@endforelse |
|||
</tbody> |
|||
<tfoot> |
|||
<tr> |
|||
|
|||
|
|||
<th colspan="5" class="text-right">{{ trans('transaction.subtotal') }} :</th> |
|||
<th class="text-right">{{ formatRp($draft->getSubtotal()) }}</th> |
|||
</tr> |
|||
<tr> |
|||
<th colspan="5" class="text-right">{{ trans('transaction.discount_total') }} :</th> |
|||
<th class="text-right">{{ formatRp($draft->getDiscountTotal()) }}</th> |
|||
</tr> |
|||
<tr> |
|||
<th colspan="5" class="text-right">{{ trans('transaction.total') }} :</th> |
|||
<th class="text-right">{{ formatRp($draft->getTotal()) }}</th> |
|||
</tr> |
|||
</tfoot> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-md-4"> |
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading"><h3 class="panel-title">{{ trans('transaction.detail') }}</h3></div> |
|||
<div class="panel-body"> |
|||
<table class="table table-condensed"> |
|||
<tbody> |
|||
<tr><td>{{ trans('transaction.customer_name') }}</td><td>{{ $draft->customer['name'] }}</td></tr> |
|||
<tr><td>{{ trans('transaction.customer_phone') }}</td><td>{{ $draft->customer['phone'] }}</td></tr> |
|||
<tr><td>{{ trans('transaction.payment') }}</td><th class="text-right">{{ formatRp($draft->payment) }}</th></tr> |
|||
<tr><td>{{ trans('transaction.total') }}</td><th class="text-right">{{ formatRp($draft->getTotal()) }}</th></tr> |
|||
<tr><td>{{ trans('transaction.exchange') }}</td><th class="text-right">{{ formatRp($draft->getExchange()) }}</th></tr> |
|||
<tr><td>{{ trans('transaction.notes') }}</td><td>{{ $draft->notes }}</td></tr> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
<div class="panel-footer"> |
|||
{{ Form::open() }} |
|||
{{ Form::submit(trans('transaction.save'), ['id' => 'save-transaction-draft', 'class' => 'btn btn-success']) }} |
|||
{{ link_to_route('cart.show', trans('app.back'), $draft->draftKey, ['class' => 'btn btn-default']) }} |
|||
{{ Form::close() }} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,10 @@ |
|||
<legend>{{ trans('transaction.detail') }}</legend> |
|||
{{ Form::open(['route' => ['cart.draft-proccess', $draft->draftKey], 'method' => 'patch']) }} |
|||
{!! FormField::text('customer[name]', ['label' => trans('transaction.customer_name'), 'value' => $draft->customer['name']]) !!} |
|||
<div class="row"> |
|||
<div class="col-md-6">{!! FormField::text('customer[phone]', ['label' => trans('transaction.customer_phone'), 'value' => $draft->customer['phone']]) !!}</div> |
|||
<div class="col-md-6">{!! FormField::price('payment', ['label' => trans('transaction.payment'), 'value' => $draft->payment]) !!}</div> |
|||
</div> |
|||
{!! FormField::textarea('notes', ['label' => trans('transaction.notes'), 'value' => $draft->notes]) !!} |
|||
{{ Form::submit(trans('transaction.proccess'), ['class' => 'btn btn-info']) }} |
|||
{{ Form::close() }} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue