Skip to content

Commit 8933843

Browse files
committed
feat: add logo inclusion option to invoice and update sidebar by removing 404 link
1 parent 7518720 commit 8933843

File tree

3 files changed

+33
-24
lines changed

3 files changed

+33
-24
lines changed

resources/js/components/shared/AppSidebar.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import NavUser from '@/components/shared/NavUser.vue';
55
import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';
66
import { SharedData, type NavItem } from '@/types';
77
import { Link, usePage } from '@inertiajs/vue3';
8-
import { BarChart3, Calendar1, Currency, LayoutGrid, Link2Off, Notebook, Receipt, Settings2, SunMoon, Tags } from 'lucide-vue-next';
8+
import { BarChart3, Calendar1, Currency, LayoutGrid, Notebook, Receipt, Settings2, SunMoon, Tags } from 'lucide-vue-next';
99
import AppLogo from './AppLogo.vue';
1010
import TeamSwitcher from './TeamSwitcher.vue';
1111
@@ -45,11 +45,6 @@ const mainNavItems: NavItem[] = [
4545
href: route('notes.index'),
4646
icon: Notebook,
4747
},
48-
{
49-
title: '404',
50-
href: '/errors/404',
51-
icon: Link2Off,
52-
},
5348
];
5449
5550
const footerNavItems: NavItem[] = [

resources/js/pages/Bills/Invoice.vue

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { Button } from '@/components/ui/button';
33
import { Input } from '@/components/ui/input';
44
import { Label } from '@/components/ui/label';
5+
import { Switch } from '@/components/ui/switch';
56
import { Textarea } from '@/components/ui/textarea';
67
import { useLocalStorage } from '@/composables/useLocalStorage';
78
import AppLayout from '@/layouts/AppLayout.vue';
@@ -35,6 +36,7 @@ interface InvoiceFormData {
3536
to_email: string;
3637
to_phone: string;
3738
to_address: string;
39+
include_logo: boolean;
3840
items: InvoiceItem[];
3941
tax_rate: number;
4042
discount: number;
@@ -56,6 +58,7 @@ const getDefaultFormData = (): InvoiceFormData => ({
5658
to_email: '',
5759
to_phone: '',
5860
to_address: '',
61+
include_logo: true,
5962
items: [
6063
{
6164
description: bill.title || '',
@@ -172,17 +175,25 @@ function formatDate(date: string) {
172175
<h3 class="mb-4 text-lg font-semibold">Invoice Details</h3>
173176
<div class="grid gap-4 sm:grid-cols-2">
174177
<div>
175-
<Label for="invoice_number">Invoice Number *</Label>
178+
<Label class="mb-2" for="invoice_number">Invoice Number *</Label>
176179
<Input id="invoice_number" v-model="formData.invoice_number" required />
177180
</div>
178181
<div>
179-
<Label for="invoice_date">Invoice Date *</Label>
182+
<Label class="mb-2" for="invoice_date">Invoice Date *</Label>
180183
<Input id="invoice_date" v-model="formData.invoice_date" type="date" required />
181184
</div>
182185
<div>
183-
<Label for="due_date">Due Date</Label>
186+
<Label class="mb-2" for="due_date">Due Date</Label>
184187
<Input id="due_date" v-model="formData.due_date" type="date" />
185188
</div>
189+
<div>
190+
<Label class="mb-2" for="include_logo">Include Logo</Label>
191+
<Label for="include_logo" class="flex items-center gap-4 pt-2">
192+
<Switch id="include_logo" v-model="formData.include_logo" />
193+
194+
Include your company logo on the invoice.
195+
</Label>
196+
</div>
186197
</div>
187198
</div>
188199

@@ -191,19 +202,19 @@ function formatDate(date: string) {
191202
<h3 class="mb-4 text-lg font-semibold">From (Your Information)</h3>
192203
<div class="grid gap-4 sm:grid-cols-2">
193204
<div>
194-
<Label for="from_name">Name *</Label>
205+
<Label class="mb-2" for="from_name">Name *</Label>
195206
<Input id="from_name" v-model="formData.from_name" required />
196207
</div>
197208
<div>
198-
<Label for="from_email">Email</Label>
209+
<Label class="mb-2" for="from_email">Email</Label>
199210
<Input id="from_email" v-model="formData.from_email" type="email" />
200211
</div>
201212
<div>
202-
<Label for="from_phone">Phone</Label>
213+
<Label class="mb-2" for="from_phone">Phone</Label>
203214
<Input id="from_phone" v-model="formData.from_phone" />
204215
</div>
205216
<div class="sm:col-span-2">
206-
<Label for="from_address">Address</Label>
217+
<Label class="mb-2" for="from_address">Address</Label>
207218
<Textarea id="from_address" v-model="formData.from_address" rows="2" />
208219
</div>
209220
</div>
@@ -214,19 +225,19 @@ function formatDate(date: string) {
214225
<h3 class="mb-4 text-lg font-semibold">To (Customer Information)</h3>
215226
<div class="grid gap-4 sm:grid-cols-2">
216227
<div>
217-
<Label for="to_name">Name *</Label>
228+
<Label class="mb-2" for="to_name">Name *</Label>
218229
<Input id="to_name" v-model="formData.to_name" required />
219230
</div>
220231
<div>
221-
<Label for="to_email">Email</Label>
232+
<Label class="mb-2" for="to_email">Email</Label>
222233
<Input id="to_email" v-model="formData.to_email" type="email" />
223234
</div>
224235
<div>
225-
<Label for="to_phone">Phone</Label>
236+
<Label class="mb-2" for="to_phone">Phone</Label>
226237
<Input id="to_phone" v-model="formData.to_phone" />
227238
</div>
228239
<div class="sm:col-span-2">
229-
<Label for="to_address">Address</Label>
240+
<Label class="mb-2" for="to_address">Address</Label>
230241
<Textarea id="to_address" v-model="formData.to_address" rows="2" />
231242
</div>
232243
</div>
@@ -248,11 +259,11 @@ function formatDate(date: string) {
248259
class="grid gap-4 rounded-lg border p-4 sm:grid-cols-12"
249260
>
250261
<div class="sm:col-span-5">
251-
<Label :for="`item_desc_${index}`">Description *</Label>
262+
<Label class="mb-2" :for="`item_desc_${index}`">Description *</Label>
252263
<Input :id="`item_desc_${index}`" v-model="item.description" required />
253264
</div>
254265
<div class="sm:col-span-2">
255-
<Label :for="`item_qty_${index}`">Quantity *</Label>
266+
<Label class="mb-2" :for="`item_qty_${index}`">Quantity *</Label>
256267
<Input
257268
:id="`item_qty_${index}`"
258269
v-model.number="item.quantity"
@@ -263,7 +274,7 @@ function formatDate(date: string) {
263274
/>
264275
</div>
265276
<div class="sm:col-span-3">
266-
<Label :for="`item_price_${index}`">Unit Price *</Label>
277+
<Label class="mb-2" :for="`item_price_${index}`">Unit Price *</Label>
267278
<Input
268279
:id="`item_price_${index}`"
269280
v-model.number="item.unit_price"
@@ -303,11 +314,11 @@ function formatDate(date: string) {
303314
<h3 class="mb-4 text-lg font-semibold">Additional Charges</h3>
304315
<div class="grid gap-4 sm:grid-cols-2">
305316
<div>
306-
<Label for="tax_rate">Tax Rate (%)</Label>
317+
<Label class="mb-2" for="tax_rate">Tax Rate (%)</Label>
307318
<Input id="tax_rate" v-model.number="formData.tax_rate" type="number" min="0" step="0.01" />
308319
</div>
309320
<div>
310-
<Label for="discount">Discount ({{ $page.props?.team?.current?.currency_symbol }})</Label>
321+
<Label class="mb-2" for="discount">Discount ({{ $page.props?.team?.current?.currency_symbol }})</Label>
311322
<Input id="discount" v-model.number="formData.discount" type="number" min="0" step="0.01" />
312323
</div>
313324
</div>
@@ -367,6 +378,9 @@ function formatDate(date: string) {
367378
>
368379
<!-- Header -->
369380
<div class="mb-8 border-b pb-8">
381+
<div v-if="formData.include_logo" class="mb-4 flex items-center justify-center">
382+
<img :src="$page.props?.team?.current?.icon_url" alt="Company Logo" class="h-12 w-auto dark:invert" />
383+
</div>
370384
<div class="flex items-start justify-between">
371385
<div>
372386
<h1 class="text-4xl font-bold text-gray-900 dark:text-white">INVOICE</h1>

resources/js/pages/Transactions/Receipt.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function formatTime(date: string) {
5151
<Head title="Payment Receipt" />
5252

5353
<div class="py-6">
54-
<div class="mx-auto max-w-xl px-4 sm:px-6 lg:px-8">
54+
<div class="mx-auto max-w-2xl px-4 sm:px-6 lg:px-8">
5555
<!-- Action Buttons (hidden when printing) -->
5656
<div class="mb-6 flex items-center justify-between print:hidden">
5757
<Button variant="ghost" @click="goBack">
@@ -60,7 +60,7 @@ function formatTime(date: string) {
6060
</Button>
6161
<Button @click="printReceipt">
6262
<Printer class="mr-2 h-4 w-4" />
63-
Print / Save as PDF
63+
Print
6464
</Button>
6565
</div>
6666

0 commit comments

Comments
 (0)