diff --git a/app/Http/Controllers/TransactionsController.php b/app/Http/Controllers/TransactionsController.php index 3219825..f621fb5 100644 --- a/app/Http/Controllers/TransactionsController.php +++ b/app/Http/Controllers/TransactionsController.php @@ -32,6 +32,11 @@ class TransactionsController extends Controller return view('transactions.show', compact('transaction')); } + public function receipt(Transaction $transaction) + { + return view('transactions.receipt', compact('transaction')); + } + public function pdf(Transaction $transaction) { // return view('transactions.pdf', compact('transaction')); diff --git a/public/css/pdf.css b/public/css/pdf.css index f7b9027..254ea8d 100755 --- a/public/css/pdf.css +++ b/public/css/pdf.css @@ -59,7 +59,7 @@ div { .strong { font-weight: bold; } .border-bottom { - border-bottom: 1px solid #333; + border-bottom: 1px solid #777; } .page-break { diff --git a/resources/lang/id/master.php b/resources/lang/id/master.php deleted file mode 100644 index 517a03c..0000000 --- a/resources/lang/id/master.php +++ /dev/null @@ -1,28 +0,0 @@ - 'Master', - 'list' => 'Daftar Master', - 'search' => 'Cari Master', - 'not_found' => 'Master tidak ditemukan', - 'empty' => 'Belum ada Master', - 'back_to_index' => 'Kembali ke daftar Master', - - // Actions - 'create' => 'Input Master Baru', - 'created' => 'Input Master baru telah berhasil.', - 'show' => 'Detail Master', - 'edit' => 'Edit Master', - 'update' => 'Update Master', - 'updated' => 'Update data Master telah berhasil.', - 'delete' => 'Hapus Master', - 'delete_confirm' => 'Anda yakin akan menghapus Master ini?', - 'deleted' => 'Hapus data Master telah berhasil.', - 'undeleted' => 'Data Master gagal dihapus.', - 'undeleteable' => 'Data Master tidak dapat dihapus.', - - // Attributes - 'name' => 'Nama Master', - 'description' => 'Deskripsi Master', -]; diff --git a/resources/lang/id/transaction.php b/resources/lang/id/transaction.php index ce1fd57..1787b38 100644 --- a/resources/lang/id/transaction.php +++ b/resources/lang/id/transaction.php @@ -30,7 +30,8 @@ return [ 'item_list_empty' => 'Masukkan setidaknya 1 item produk.', 'save' => 'Simpan Transaksi', 'created' => 'Transaksi berhasil disimpan, No. Invoice: :invoice_no', - 'invoice_print' => 'Cetak Invoice', + 'invoice_print' => 'Cetak Nota', + 'invoice_pdf' => 'Cetak PDF', // Attributes 'invoice_no' => 'No. Invoice', diff --git a/resources/views/layouts/pdf.blade.php b/resources/views/layouts/pdf.blade.php index e486b45..bb86c51 100644 --- a/resources/views/layouts/pdf.blade.php +++ b/resources/views/layouts/pdf.blade.php @@ -8,6 +8,7 @@
{{ config('store.name') }} | ||
|
+ {{ config('store.address') }} | Telp: {{ config('store.phone') }} + |
+ ||
| {{ trans('transaction.invoice_no') }} | +: {{ $transaction->invoice_no }} | +{{ $transaction->created_at->format('d/m/Y') }} | +
| {{ trans('transaction.cashier') }} | +: {{ $transaction->user->name }} | +{{ $transaction->created_at->format('H:i:s') }} | +
| {{ trans('transaction.customer') }} | : {{ $transaction->customer['name'] }} | |
| {{ trans('transaction.customer_phone') }} | : {{ $transaction->customer['phone'] }} | |
| {{ trans('transaction.items') }} | ||
|---|---|---|
| {{ trans('product.item_qty') }} | +{{ trans('product.price') }} ({{ trans('product.item_discount') }}) | +{{ trans('product.item_subtotal') }} | +
| {{ $key + 1 }}) {{ $item['name'] }} ({{ $item['unit'] }}) | +||
| {{ $item['qty'] }} | ++ {{ formatRp($item['price']) }} ({{ formatRp($item['item_discount']) }}) + | +{{ formatRp($item['subtotal']) }} | +
| {{ trans('transaction.subtotal') }} : | +{{ formatRp($transaction['total'] + $discountTotal) }} | +|
| {{ trans('transaction.discount_total') }} : | +{{ formatRp($discountTotal) }} | +|
| {{ trans('transaction.total') }} : | +{{ formatRp($transaction['total']) }} | +|
| {{ trans('transaction.payment') }} : | +{{ formatRp($transaction->payment) }} | +|
| {{ trans('transaction.exchange') }} : | +{{ formatRp($transaction->getExchange()) }} | +|