diff --git a/app/Http/Controllers/Invoices/DraftsController.php b/app/Http/Controllers/Invoices/DraftsController.php index 65323f0..4c1073f 100644 --- a/app/Http/Controllers/Invoices/DraftsController.php +++ b/app/Http/Controllers/Invoices/DraftsController.php @@ -89,6 +89,8 @@ class DraftsController extends Controller $this->draftCollection->updateDraftItem($draftKey, $itemData['item_key'], $itemData); + flash(trans('invoice.item_updated'), 'success'); + return back(); } @@ -96,6 +98,8 @@ class DraftsController extends Controller { $this->draftCollection->removeItemFromDraft($draftKey, $request->item_index); + flash(trans('invoice.item_removed'), 'warning'); + return back(); } diff --git a/app/Services/InvoiceDraft/InvoiceDraft.php b/app/Services/InvoiceDraft/InvoiceDraft.php index ee0554e..af4b59c 100644 --- a/app/Services/InvoiceDraft/InvoiceDraft.php +++ b/app/Services/InvoiceDraft/InvoiceDraft.php @@ -115,7 +115,7 @@ class InvoiceDraft /** * Update an invoice item. * - * @param int $itemKey The item key + * @param int $itemKey The item key * @param array $newItemData The item attributes. * * @return null|\App\Services\InvoiceDrafts\Item diff --git a/app/Services/InvoiceDraft/InvoiceDraftCollection.php b/app/Services/InvoiceDraft/InvoiceDraftCollection.php index 9c619d3..e5adf6e 100644 --- a/app/Services/InvoiceDraft/InvoiceDraftCollection.php +++ b/app/Services/InvoiceDraft/InvoiceDraftCollection.php @@ -204,9 +204,9 @@ class InvoiceDraftCollection /** * Update invoice draft item attributes. * - * @param string $draftKey Invoice draft key. - * @param string $itemKey Invoice item key. - * @param array $newItemData Array of item attribute. + * @param string $draftKey Invoice draft key. + * @param string $itemKey Invoice item key. + * @param array $newItemData Array of item attribute. * * @return void */ @@ -247,7 +247,7 @@ class InvoiceDraftCollection /** * Check if current invoice draft is empty. * - * @return boolean + * @return bool */ public function isEmpty() { @@ -257,7 +257,7 @@ class InvoiceDraftCollection /** * Check if current invoice draft has content. * - * @return boolean + * @return bool */ public function hasContent() { diff --git a/resources/lang/en/invoice.php b/resources/lang/en/invoice.php index 4400839..688d56a 100644 --- a/resources/lang/en/invoice.php +++ b/resources/lang/en/invoice.php @@ -34,8 +34,10 @@ return [ 'add_item' => 'Add Item', 'item_added' => 'Item added.', 'item_updated' => 'Item updated.', - 'item_removed' => 'Item deleted.', + 'item_remove' => 'Remove Item', + 'item_removed' => 'Item removed.', 'confirm_instruction' => 'Please check this Invoice detail, hit :back_link to edit the detail.', + 'draft_del_confirm' => 'Are you sure to remove this Invoice Draft?', // Attributes 'number' => 'Invocie No.', diff --git a/resources/lang/id/invoice.php b/resources/lang/id/invoice.php index 537bfba..db4fd17 100644 --- a/resources/lang/id/invoice.php +++ b/resources/lang/id/invoice.php @@ -34,8 +34,10 @@ return [ 'add_item' => 'Tambah Item', 'item_added' => 'Item berhasil ditambahkan.', 'item_updated' => 'Item berhasil diupdate.', + 'item_remove' => 'Hapus Item', 'item_removed' => 'Item berhasil dihapus.', 'confirm_instruction' => 'Silakan periksa rincian di bawah ini, jika belum sesuai, silakan klik :back_link.', + 'draft_del_confirm' => 'Yakin ingin menghapus Draft Invoice ini?', // Attributes 'number' => 'No. Invoice', diff --git a/resources/views/invoice-drafts/partials/draft-item-list.blade.php b/resources/views/invoice-drafts/partials/draft-item-list.blade.php index 7eaf9f8..65f8217 100644 --- a/resources/views/invoice-drafts/partials/draft-item-list.blade.php +++ b/resources/views/invoice-drafts/partials/draft-item-list.blade.php @@ -8,10 +8,10 @@
| # | -Deskripsi | -Biaya | -Action | +{{ __('app.table_no') }} | +{{ __('app.description') }} | +{{ __('invoice.item_amount') }} | +{{ __('app.action') }} | {!! FormField::delete([ 'route' => ['invoice-drafts.remove-draft-item', $draft->draftKey], - 'onsubmit' => 'Yakin ingin menghapus Item ini?', 'class' => '', - ], 'x', ['id' => 'remove-item-'.$key, 'class' => 'btn btn-danger btn-xs show-on-hover','title' => 'Hapus item ini'], ['item_index' => $key]) !!} + ], 'x', ['id' => 'remove-item-'.$key, 'class' => 'btn btn-danger btn-xs show-on-hover', 'title' => __('invoice.item_remove')], ['item_index' => $key]) !!} | @endforeach
|---|---|---|---|---|---|---|---|
| Tambah Item Invoice | +{{ trans('invoice.amount') }} : | +{{ formatRp($draft->getTotal()) }} | ++ | ||||
| {{ __('app.add') }} {{ __('invoice.items') }} | |||||||
| {{ trans('invoice.amount') }} : | -{{ formatRp($draft->getTotal()) }} | -- | |||||