diff --git a/app/Http/Controllers/V1/Admin/Customer/CustomerStatsController.php b/app/Http/Controllers/V1/Admin/Customer/CustomerStatsController.php index 1d2c0415a..1bf91f38c 100644 --- a/app/Http/Controllers/V1/Admin/Customer/CustomerStatsController.php +++ b/app/Http/Controllers/V1/Admin/Customer/CustomerStatsController.php @@ -103,6 +103,7 @@ public function __invoke(Request $request, Customer $customer) ) ->whereCompany() ->whereCustomer($customer->id) + ->where('status', '<>', Invoice::STATUS_DRAFT) ->sum('total'); $totalReceipts = Payment::whereBetween( 'payment_date', diff --git a/app/Http/Controllers/V1/Admin/Dashboard/DashboardController.php b/app/Http/Controllers/V1/Admin/Dashboard/DashboardController.php index 4e1d96d22..a92fbc237 100644 --- a/app/Http/Controllers/V1/Admin/Dashboard/DashboardController.php +++ b/app/Http/Controllers/V1/Admin/Dashboard/DashboardController.php @@ -104,6 +104,7 @@ public function __invoke(Request $request) 'invoice_date', [$startDate->format('Y-m-d'), $start->format('Y-m-d')] ) + ->where('status', '<>', Invoice::STATUS_DRAFT) ->whereCompany() ->sum('base_total'); @@ -141,6 +142,7 @@ public function __invoke(Request $request) $recent_due_invoices = Invoice::with('customer') ->whereCompany() ->where('base_due_amount', '>', 0) + ->where('status', '<>', Invoice::STATUS_DRAFT) ->take(5) ->latest() ->get(); diff --git a/app/Http/Controllers/V1/Admin/Invoice/InvoicesController.php b/app/Http/Controllers/V1/Admin/Invoice/InvoicesController.php index 9aeefe518..3890d2899 100644 --- a/app/Http/Controllers/V1/Admin/Invoice/InvoicesController.php +++ b/app/Http/Controllers/V1/Admin/Invoice/InvoicesController.php @@ -24,6 +24,7 @@ public function index(Request $request) $limit = $request->has('limit') ? $request->limit : 10; $invoices = Invoice::whereCompany() + ->whereTabFilters($request->tab_status) ->join('customers', 'customers.id', '=', 'invoices.customer_id') ->applyFilters($request->all()) ->select('invoices.*', 'customers.name') diff --git a/app/Http/Requests/CompaniesRequest.php b/app/Http/Requests/CompaniesRequest.php index 5394592be..661d8777e 100644 --- a/app/Http/Requests/CompaniesRequest.php +++ b/app/Http/Requests/CompaniesRequest.php @@ -3,7 +3,6 @@ namespace Crater\Http\Requests; use Illuminate\Foundation\Http\FormRequest; -use Illuminate\Support\Str; use Illuminate\Validation\Rule; class CompaniesRequest extends FormRequest @@ -34,6 +33,10 @@ public function rules() 'currency' => [ 'required' ], + 'slug' => [ + 'required', + Rule::unique('companies') + ], 'address.name' => [ 'nullable', ], @@ -68,11 +71,11 @@ public function getCompanyPayload() { return collect($this->validated()) ->only([ - 'name' + 'name', + 'slug' ]) ->merge([ - 'owner_id' => $this->user()->id, - 'slug' => Str::slug($this->name) + 'owner_id' => $this->user()->id ]) ->toArray(); } diff --git a/app/Http/Requests/CompanyRequest.php b/app/Http/Requests/CompanyRequest.php index c86cd6457..dc22b1ae7 100644 --- a/app/Http/Requests/CompanyRequest.php +++ b/app/Http/Requests/CompanyRequest.php @@ -30,7 +30,8 @@ public function rules() Rule::unique('companies')->ignore($this->header('company'), 'id'), ], 'slug' => [ - 'nullable' + 'required', + Rule::unique('companies')->ignore($this->header('company'), 'id'), ], 'address.country_id' => [ 'required', diff --git a/app/Http/Resources/EstimateResource.php b/app/Http/Resources/EstimateResource.php index 46b69ea39..e7284bd7a 100644 --- a/app/Http/Resources/EstimateResource.php +++ b/app/Http/Resources/EstimateResource.php @@ -23,7 +23,7 @@ public function toArray($request) 'reference_number' => $this->reference_number, 'tax_per_item' => $this->tax_per_item, 'discount_per_item' => $this->discount_per_item, - 'notes' => $this->getNotes(), + 'notes' => $this->notes, 'discount' => $this->discount, 'discount_type' => $this->discount_type, 'discount_val' => $this->discount_val, diff --git a/app/Http/Resources/PaymentResource.php b/app/Http/Resources/PaymentResource.php index 0ac625f85..7350a9127 100644 --- a/app/Http/Resources/PaymentResource.php +++ b/app/Http/Resources/PaymentResource.php @@ -18,7 +18,7 @@ public function toArray($request) 'id' => $this->id, 'payment_number' => $this->payment_number, 'payment_date' => $this->payment_date, - 'notes' => $this->getNotes(), + 'notes' => $this->notes, 'amount' => $this->amount, 'unique_hash' => $this->unique_hash, 'invoice_id' => $this->invoice_id, diff --git a/app/Models/Company.php b/app/Models/Company.php index bf87820b1..a0d9fddbb 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -217,7 +217,7 @@ public function setupDefaultSettings() 'estimate_billing_address_format' => $billingAddressFormat, 'payment_company_address_format' => $companyAddressFormat, 'payment_from_customer_address_format' => $paymentFromCustomerAddress, - 'currency' => request()->currency ?? 13, + 'currency' => request()->currency ?? 1, 'time_zone' => 'Asia/Kolkata', 'language' => 'en', 'fiscal_year' => '1-12', diff --git a/app/Models/Estimate.php b/app/Models/Estimate.php index 5b7c3b8fd..8c916c6a8 100644 --- a/app/Models/Estimate.php +++ b/app/Models/Estimate.php @@ -483,7 +483,8 @@ public function getExtraFields() '{ESTIMATE_DATE}' => $this->formattedEstimateDate, '{ESTIMATE_EXPIRY_DATE}' => $this->formattedExpiryDate, '{ESTIMATE_NUMBER}' => $this->estimate_number, - '{ESTIMATE_REF_NUMBER}' => $this->reference_number, + '{PDF_LINK}' => $this->estimatePdfUrl, + '{TOTAL_AMOUNT}' => format_money_pdf($this->total, $this->customer->currency) ]; } diff --git a/app/Models/Expense.php b/app/Models/Expense.php index bd0aa1e35..01dd69a26 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -240,7 +240,7 @@ public static function createExpense($request) } if ($request->hasFile('attachment_receipt')) { - $expense->addMediaFromRequest('attachment_receipt')->toMediaCollection('receipts'); + $expense->addMediaFromRequest('attachment_receipt')->toMediaCollection('receipts', 'local'); } if ($request->customFields) { @@ -262,12 +262,12 @@ public function updateExpense($request) ExchangeRateLog::addExchangeRateLog($this); } - if (isset($request->is_attachment_receipt_removed) && (bool) $request->is_attachment_receipt_removed) { + if (isset($request->is_attachment_receipt_removed) && $request->is_attachment_receipt_removed == "true") { $this->clearMediaCollection('receipts'); } if ($request->hasFile('attachment_receipt')) { $this->clearMediaCollection('receipts'); - $this->addMediaFromRequest('attachment_receipt')->toMediaCollection('receipts'); + $this->addMediaFromRequest('attachment_receipt')->toMediaCollection('receipts', 'local'); } if ($request->customFields) { diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 39cd31659..eb973488e 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -187,16 +187,6 @@ public function getFormattedInvoiceDateAttribute($value) return Carbon::parse($this->invoice_date)->format($dateFormat); } - public function scopeWhereStatus($query, $status) - { - return $query->where('invoices.status', $status); - } - - public function scopeWherePaidStatus($query, $status) - { - return $query->where('invoices.paid_status', $status); - } - public function scopeWhereDueStatus($query, $status) { return $query->whereIn('invoices.paid_status', [ @@ -234,6 +224,40 @@ public function scopeWhereOrder($query, $orderByField, $orderBy) $query->orderBy($orderByField, $orderBy); } + public function scopeWhereStatus($query, $status) + { + return $query->where('invoices.status', $status); + } + + public function scopeWherePaidStatus($query, $status) + { + return $query->where('invoices.paid_status', $status); + } + + public function scopeWhereTabFilters($query, $status) + { + if ($status == "DRAFT") { + return $query->where('invoices.status', $status); + } + + if ($status == "SENT") { + return $query->whereIn('invoices.status', [ + self::STATUS_SENT, + self::STATUS_VIEWED, + self::STATUS_COMPLETED + ]); + } + + if ($status == 'DUE') { + return $query->whereIn('invoices.paid_status', [ + self::STATUS_UNPAID, + self::STATUS_PARTIALLY_PAID, + ]); + } + + return ; + } + public function scopeApplyFilters($query, array $filters) { $filters = collect($filters); @@ -249,17 +273,11 @@ public function scopeApplyFilters($query, array $filters) $filters->get('status') == self::STATUS_PAID ) { $query->wherePaidStatus($filters->get('status')); - } elseif ($filters->get('status') == 'DUE') { - $query->whereDueStatus($filters->get('status')); } else { $query->whereStatus($filters->get('status')); } } - if ($filters->get('paid_status')) { - $query->wherePaidStatus($filters->get('status')); - } - if ($filters->get('invoice_id')) { $query->whereInvoice($filters->get('invoice_id')); } @@ -651,7 +669,9 @@ public function getExtraFields() '{INVOICE_DATE}' => $this->formattedInvoiceDate, '{INVOICE_DUE_DATE}' => $this->formattedDueDate, '{INVOICE_NUMBER}' => $this->invoice_number, - '{INVOICE_REF_NUMBER}' => $this->reference_number, + '{PDF_LINK}' => $this->invoicePdfUrl, + '{DUE_AMOUNT}' => format_money_pdf($this->due_amount, $this->customer->currency), + '{TOTAL_AMOUNT}' => format_money_pdf($this->total, $this->customer->currency) ]; } diff --git a/app/Models/Payment.php b/app/Models/Payment.php index 83a17441d..68a6d6a35 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -435,7 +435,8 @@ public function getExtraFields() '{PAYMENT_DATE}' => $this->formattedPaymentDate, '{PAYMENT_MODE}' => $this->paymentMethod ? $this->paymentMethod->name : null, '{PAYMENT_NUMBER}' => $this->payment_number, - '{PAYMENT_AMOUNT}' => $this->reference_number, + '{PDF_LINK}' => $this->paymentPdfUrl, + '{PAYMENT_AMOUNT}' => format_money_pdf($this->amount, $this->customer->currency) ]; } diff --git a/package.json b/package.json index c8da7a6dc..ac8a14402 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "vite": "^2.6.1" }, "dependencies": { - "@headlessui/vue": "^1.4.0", + "@headlessui/vue": "^1.5.0", "@heroicons/vue": "^1.0.1", "@popperjs/core": "^2.9.2", "@stripe/stripe-js": "^1.21.2", @@ -48,7 +48,8 @@ "mini-svg-data-uri": "^1.3.3", "moment": "^2.29.1", "pinia": "^2.0.4", - "v-money3": "^3.13.5", + "v-calendar": "3.0.0-alpha.8", + "v-money3": "3.16.1", "v-tooltip": "^4.0.0-alpha.1", "vue": "^3.2.0-beta.5", "vue-flatpickr-component": "^9.0.3", diff --git a/resources/scripts/admin/components/CopyInputField.vue b/resources/scripts/admin/components/CopyInputField.vue index 851a0bc4e..66049440d 100644 --- a/resources/scripts/admin/components/CopyInputField.vue +++ b/resources/scripts/admin/components/CopyInputField.vue @@ -7,6 +7,7 @@ py-2 rounded-lg bg-opacity-40 bg-gray-300 + dark:bg-gray-700 dark:border-gray-600 whitespace-nowrap flex-col mt-1 @@ -19,6 +20,7 @@ text-sm font-medium text-black + dark:text-white truncate select-all select-color " diff --git a/resources/scripts/admin/components/SelectNotePopup.vue b/resources/scripts/admin/components/SelectNotePopup.vue index 822a8e2c6..bcc81cca0 100644 --- a/resources/scripts/admin/components/SelectNotePopup.vue +++ b/resources/scripts/admin/components/SelectNotePopup.vue @@ -43,6 +43,12 @@ max-w-full left-0 top-3 + bg-white + dark:border + dark:border-white/10 + dark:text-white + dark:bg-gray-800 + dark:shadow-glass " >
-
+
@@ -91,6 +99,7 @@ leading-tight text-gray-700 cursor-pointer + dark:text-gray-400 " > {{ note.name }} @@ -118,6 +127,10 @@ bg-gray-200 border-none outline-none + dark:bg-gray-600/70 + dark:backdrop-blur-xl + dark:shadow-glass + dark:hover:bg-gray-600/80 " @click="openNoteModal" > diff --git a/resources/scripts/admin/components/charts/LineChart.vue b/resources/scripts/admin/components/charts/LineChart.vue index f12c4d672..c56a6c053 100644 --- a/resources/scripts/admin/components/charts/LineChart.vue +++ b/resources/scripts/admin/components/charts/LineChart.vue @@ -6,8 +6,17 @@ diff --git a/resources/scripts/admin/components/currency-exchange-rate/ExchangeRateBulkUpdate.vue b/resources/scripts/admin/components/currency-exchange-rate/ExchangeRateBulkUpdate.vue index b30fa82c6..944abc7ae 100644 --- a/resources/scripts/admin/components/currency-exchange-rate/ExchangeRateBulkUpdate.vue +++ b/resources/scripts/admin/components/currency-exchange-rate/ExchangeRateBulkUpdate.vue @@ -50,21 +50,11 @@ -
+ {{ $t('general.save') }} -
+ diff --git a/resources/scripts/admin/components/custom-fields/CreateCustomFields.vue b/resources/scripts/admin/components/custom-fields/CreateCustomFields.vue index 70c9f059b..e319c81c5 100644 --- a/resources/scripts/admin/components/custom-fields/CreateCustomFields.vue +++ b/resources/scripts/admin/components/custom-fields/CreateCustomFields.vue @@ -64,7 +64,7 @@ function mergeExistingValues() { if (props.isEdit) { props.store[props.storeProp].fields.forEach((field) => { const existingIndex = props.store[props.storeProp].customFields.findIndex( - (f) => f.id === field.custom_field_id + (f) => f.id == field.custom_field_id ) if (existingIndex > -1) { diff --git a/resources/scripts/admin/components/custom-fields/types/DateTimeType.vue b/resources/scripts/admin/components/custom-fields/types/DateTimeType.vue index f29a01ab1..cf672c9c0 100644 --- a/resources/scripts/admin/components/custom-fields/types/DateTimeType.vue +++ b/resources/scripts/admin/components/custom-fields/types/DateTimeType.vue @@ -9,7 +9,7 @@ import { computed } from 'vue' const props = defineProps({ modelValue: { type: String, - default: moment().format('YYYY-MM-DD hh:MM'), + default: moment().format('YYYY-MM-DD HH:mm'), }, }) diff --git a/resources/scripts/admin/components/dropdowns/CustomFieldIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/CustomFieldIndexDropdown.vue index 964de2d6a..38814f572 100644 --- a/resources/scripts/admin/components/dropdowns/CustomFieldIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/CustomFieldIndexDropdown.vue @@ -7,11 +7,12 @@ {{ $t('general.edit') }} @@ -19,11 +20,12 @@ {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/CustomerIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/CustomerIndexDropdown.vue index cdc57333b..b557c5dcf 100644 --- a/resources/scripts/admin/components/dropdowns/CustomerIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/CustomerIndexDropdown.vue @@ -12,10 +12,10 @@ v-if="userStore.hasAbilities(abilities.EDIT_CUSTOMER)" :to="`/admin/customers/${row.id}/edit`" > - + {{ $t('general.edit') }} @@ -29,10 +29,10 @@ " :to="`customers/${row.id}/view`" > - + {{ $t('general.view') }} @@ -41,11 +41,12 @@ {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/EstimateIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/EstimateIndexDropdown.vue index 15bb3cebe..45df05e8b 100644 --- a/resources/scripts/admin/components/dropdowns/EstimateIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/EstimateIndexDropdown.vue @@ -10,11 +10,12 @@ {{ $t('general.copy_pdf_url') }} @@ -24,10 +25,10 @@ v-if="userStore.hasAbilities(abilities.EDIT_ESTIMATE)" :to="`/admin/estimates/${row.id}/edit`" > - + {{ $t('general.edit') }} @@ -36,11 +37,12 @@ {{ $t('general.delete') }} @@ -53,10 +55,10 @@ " :to="`estimates/${row.id}/view`" > - + {{ $t('general.view') }} @@ -65,11 +67,12 @@ {{ $t('estimates.convert_to_invoice') }} @@ -81,11 +84,12 @@ route.name !== 'estimates.view' && userStore.hasAbilities(abilities.SEND_ESTIMATE) " + v-slot="slotProps" @click="onMarkAsSent(row.id)" > {{ $t('estimates.mark_as_sent') }} @@ -97,20 +101,21 @@ route.name !== 'estimates.view' && userStore.hasAbilities(abilities.SEND_ESTIMATE) " + v-slot="slotProps" @click="sendEstimate(row)" > {{ $t('estimates.send_estimate') }} - + {{ $t('estimates.resend_estimate') }} @@ -121,11 +126,12 @@ row.status !== 'ACCEPTED' && userStore.hasAbilities(abilities.EDIT_ESTIMATE) " + v-slot="slotProps" @click="onMarkAsAccepted(row.id)" > {{ $t('estimates.mark_as_accepted') }} @@ -136,11 +142,12 @@ row.status !== 'REJECTED' && userStore.hasAbilities(abilities.EDIT_ESTIMATE) " + v-slot="slotProps" @click="onMarkAsRejected(row.id)" > {{ $t('estimates.mark_as_rejected') }} diff --git a/resources/scripts/admin/components/dropdowns/ExpenseCategoryIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/ExpenseCategoryIndexDropdown.vue index 3fd07d458..a1206eb86 100644 --- a/resources/scripts/admin/components/dropdowns/ExpenseCategoryIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/ExpenseCategoryIndexDropdown.vue @@ -13,11 +13,12 @@ {{ $t('general.edit') }} @@ -25,11 +26,12 @@ {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/ExpenseIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/ExpenseIndexDropdown.vue index d979e2b53..76a368692 100644 --- a/resources/scripts/admin/components/dropdowns/ExpenseIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/ExpenseIndexDropdown.vue @@ -12,10 +12,10 @@ v-if="userStore.hasAbilities(abilities.EDIT_EXPENSE)" :to="`/admin/expenses/${row.id}/edit`" > - + {{ $t('general.edit') }} @@ -24,11 +24,12 @@ {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/InvoiceIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/InvoiceIndexDropdown.vue index 35d8d9052..234d07757 100755 --- a/resources/scripts/admin/components/dropdowns/InvoiceIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/InvoiceIndexDropdown.vue @@ -12,20 +12,20 @@ v-if="userStore.hasAbilities(abilities.EDIT_INVOICE)" :to="`/admin/invoices/${row.id}/edit`" > - + {{ $t('general.edit') }} - + {{ $t('general.copy_pdf_url') }} @@ -38,29 +38,29 @@ " :to="`/admin/invoices/${row.id}/view`" > - + {{ $t('general.view') }} - + {{ $t('invoices.send_invoice') }} - + {{ $t('invoices.resend_invoice') }} @@ -69,20 +69,21 @@ {{ $t('invoices.record_payment') }} - + {{ $t('invoices.mark_as_sent') }} @@ -90,11 +91,12 @@ {{ $t('invoices.clone_invoice') }} @@ -102,11 +104,12 @@ {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/ItemIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/ItemIndexDropdown.vue index 5a51d172d..bd3679b69 100644 --- a/resources/scripts/admin/components/dropdowns/ItemIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/ItemIndexDropdown.vue @@ -12,11 +12,8 @@ v-if="userStore.hasAbilities(abilities.EDIT_ITEM)" :to="`/admin/items/${row.id}/edit`" > - - + + {{ $t('general.edit') }} @@ -24,12 +21,10 @@ - + {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/NoteIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/NoteIndexDropdown.vue index 569cfb08f..684c3ba0f 100644 --- a/resources/scripts/admin/components/dropdowns/NoteIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/NoteIndexDropdown.vue @@ -10,11 +10,12 @@ {{ $t('general.edit') }} @@ -22,11 +23,12 @@ {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/PaymentIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/PaymentIndexDropdown.vue index f23df97bd..42b403430 100644 --- a/resources/scripts/admin/components/dropdowns/PaymentIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/PaymentIndexDropdown.vue @@ -8,30 +8,31 @@ - {{ $t('general.copy_pdf_url') }} - + - + {{ $t('general.edit') }} @@ -45,10 +46,10 @@ " :to="`/admin/payments/${row.id}/view`" > - + {{ $t('general.view') }} @@ -61,11 +62,12 @@ route.name !== 'payments.view' && userStore.hasAbilities(abilities.SEND_PAYMENT) " + v-slot="slotProps" @click="sendPayment(row)" > {{ $t('payments.send_payment') }} @@ -73,11 +75,12 @@ {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/PaymentModeIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/PaymentModeIndexDropdown.vue index d4bf9187a..0a95fcc13 100644 --- a/resources/scripts/admin/components/dropdowns/PaymentModeIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/PaymentModeIndexDropdown.vue @@ -8,19 +8,19 @@ - + {{ $t('general.edit') }} - + {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/RecurringInvoiceIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/RecurringInvoiceIndexDropdown.vue index adaafb9d9..72b3eec4e 100644 --- a/resources/scripts/admin/components/dropdowns/RecurringInvoiceIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/RecurringInvoiceIndexDropdown.vue @@ -15,10 +15,10 @@ v-if="userStore.hasAbilities(abilities.EDIT_RECURRING_INVOICE)" :to="`/admin/recurring-invoices/${row.id}/edit`" > - + {{ $t('general.edit') }} @@ -32,10 +32,10 @@ " :to="`recurring-invoices/${row.id}/view`" > - + {{ $t('general.view') }} @@ -44,11 +44,12 @@ {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/RoleIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/RoleIndexDropdown.vue index 606c503c0..86028f0f0 100644 --- a/resources/scripts/admin/components/dropdowns/RoleIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/RoleIndexDropdown.vue @@ -10,11 +10,12 @@ {{ $t('general.edit') }} @@ -22,11 +23,12 @@ {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/TaxTypeIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/TaxTypeIndexDropdown.vue index 73897a232..a5e88e5e7 100644 --- a/resources/scripts/admin/components/dropdowns/TaxTypeIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/TaxTypeIndexDropdown.vue @@ -10,11 +10,12 @@ {{ $t('general.edit') }} @@ -22,11 +23,12 @@ {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/dropdowns/UserIndexDropdown.vue b/resources/scripts/admin/components/dropdowns/UserIndexDropdown.vue index 494d0bd74..1c789d6e9 100644 --- a/resources/scripts/admin/components/dropdowns/UserIndexDropdown.vue +++ b/resources/scripts/admin/components/dropdowns/UserIndexDropdown.vue @@ -9,20 +9,20 @@ - + {{ $t('general.edit') }} - + {{ $t('general.delete') }} diff --git a/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue b/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue index 8af4293f4..b425d7a11 100644 --- a/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue +++ b/resources/scripts/admin/components/estimate-invoice-common/CreateItemRow.vue @@ -1,5 +1,13 @@ diff --git a/resources/scripts/admin/components/modal-components/DeleteCompanyModal.vue b/resources/scripts/admin/components/modal-components/DeleteCompanyModal.vue index 661c972bc..eec7395da 100644 --- a/resources/scripts/admin/components/modal-components/DeleteCompanyModal.vue +++ b/resources/scripts/admin/components/modal-components/DeleteCompanyModal.vue @@ -38,7 +38,7 @@
-
+ {{ $t('general.delete') }} -
+ diff --git a/resources/scripts/admin/components/modal-components/ExchangeRateProviderModal.vue b/resources/scripts/admin/components/modal-components/ExchangeRateProviderModal.vue index b466ca64a..df3ce46b7 100644 --- a/resources/scripts/admin/components/modal-components/ExchangeRateProviderModal.vue +++ b/resources/scripts/admin/components/modal-components/ExchangeRateProviderModal.vue @@ -150,9 +150,7 @@ @Remove="removeUsedSelectedCurrencies" />
-
+ -
+ diff --git a/resources/scripts/admin/components/modal-components/FileDiskModal.vue b/resources/scripts/admin/components/modal-components/FileDiskModal.vue index 822742504..7ccb7cd3f 100644 --- a/resources/scripts/admin/components/modal-components/FileDiskModal.vue +++ b/resources/scripts/admin/components/modal-components/FileDiskModal.vue @@ -20,15 +20,7 @@ @submit="createNewDisk" >
diff --git a/resources/scripts/admin/components/modal-components/ItemModal.vue b/resources/scripts/admin/components/modal-components/ItemModal.vue index 5fd3f21d3..e2c186a33 100644 --- a/resources/scripts/admin/components/modal-components/ItemModal.vue +++ b/resources/scripts/admin/components/modal-components/ItemModal.vue @@ -89,9 +89,7 @@
-
+ {{ itemStore.isEdit ? $t('general.update') : $t('general.save') }} -
+
diff --git a/resources/scripts/admin/components/modal-components/ItemUnitModal.vue b/resources/scripts/admin/components/modal-components/ItemUnitModal.vue index b9584358c..e9738be0e 100644 --- a/resources/scripts/admin/components/modal-components/ItemUnitModal.vue +++ b/resources/scripts/admin/components/modal-components/ItemUnitModal.vue @@ -31,15 +31,7 @@ -
+ -
+ diff --git a/resources/scripts/admin/components/modal-components/MailTestModal.vue b/resources/scripts/admin/components/modal-components/MailTestModal.vue index c71d04231..e2a00f7ef 100644 --- a/resources/scripts/admin/components/modal-components/MailTestModal.vue +++ b/resources/scripts/admin/components/modal-components/MailTestModal.vue @@ -62,9 +62,7 @@ -
+ {{ $t('general.send') }} -
+ diff --git a/resources/scripts/admin/components/modal-components/NoteModal.vue b/resources/scripts/admin/components/modal-components/NoteModal.vue index aa5695aa3..baaade031 100644 --- a/resources/scripts/admin/components/modal-components/NoteModal.vue +++ b/resources/scripts/admin/components/modal-components/NoteModal.vue @@ -63,16 +63,7 @@ -
+ {{ noteStore.isEdit ? $t('general.update') : $t('general.save') }} -
+ diff --git a/resources/scripts/admin/components/modal-components/PaymentModeModal.vue b/resources/scripts/admin/components/modal-components/PaymentModeModal.vue index 88c017d70..14739f392 100644 --- a/resources/scripts/admin/components/modal-components/PaymentModeModal.vue +++ b/resources/scripts/admin/components/modal-components/PaymentModeModal.vue @@ -29,9 +29,7 @@ -
+ -
+ diff --git a/resources/scripts/admin/components/modal-components/RolesModal.vue b/resources/scripts/admin/components/modal-components/RolesModal.vue index 70ebd651f..81c02303e 100644 --- a/resources/scripts/admin/components/modal-components/RolesModal.vue +++ b/resources/scripts/admin/components/modal-components/RolesModal.vue @@ -40,6 +40,7 @@ px-4 md:px-8 py-1.5 + dark:text-gray-200 " > {{ $tc('settings.roles.permission', 2) }} @@ -72,7 +73,7 @@ -
+
-

+

{{ gIndex }}

-
+ {{ !roleStore.isEdit ? $t('general.save') : $t('general.update') }} -
+ diff --git a/resources/scripts/admin/components/modal-components/SelectTemplateModal.vue b/resources/scripts/admin/components/modal-components/SelectTemplateModal.vue index b7280c3fc..77cf21f5e 100644 --- a/resources/scripts/admin/components/modal-components/SelectTemplateModal.vue +++ b/resources/scripts/admin/components/modal-components/SelectTemplateModal.vue @@ -70,7 +70,7 @@
-
+ {{ $t('general.cancel') }} @@ -80,7 +80,7 @@ {{ $t('general.choose') }} -
+ diff --git a/resources/scripts/admin/components/modal-components/SendEstimateModal.vue b/resources/scripts/admin/components/modal-components/SendEstimateModal.vue index 795cdfebb..9140b99d1 100644 --- a/resources/scripts/admin/components/modal-components/SendEstimateModal.vue +++ b/resources/scripts/admin/components/modal-components/SendEstimateModal.vue @@ -62,9 +62,7 @@ -
+ {{ $t('general.preview') }} -
+
@@ -106,9 +104,7 @@ >
-
+ {{ $t('general.send') }} -
+
diff --git a/resources/scripts/admin/components/modal-components/SendInvoiceModal.vue b/resources/scripts/admin/components/modal-components/SendInvoiceModal.vue index 63e7e6af4..63856d2d9 100644 --- a/resources/scripts/admin/components/modal-components/SendInvoiceModal.vue +++ b/resources/scripts/admin/components/modal-components/SendInvoiceModal.vue @@ -65,9 +65,7 @@ -
+ {{ $t('general.preview') }} -
+
@@ -114,9 +112,7 @@ style="min-height: 500px" >
-
+ {{ $t('general.send') }} -
+
diff --git a/resources/scripts/admin/components/modal-components/SendPaymentModal.vue b/resources/scripts/admin/components/modal-components/SendPaymentModal.vue index 6c786312b..41f26f21a 100644 --- a/resources/scripts/admin/components/modal-components/SendPaymentModal.vue +++ b/resources/scripts/admin/components/modal-components/SendPaymentModal.vue @@ -65,9 +65,7 @@ -
+ {{ $t('general.preview') }} -
+
@@ -114,9 +112,7 @@ style="min-height: 500px" >
-
+ {{ $t('general.send') }} -
+
diff --git a/resources/scripts/admin/components/modal-components/TaxTypeModal.vue b/resources/scripts/admin/components/modal-components/TaxTypeModal.vue index e7c1d76a4..f09daaada 100644 --- a/resources/scripts/admin/components/modal-components/TaxTypeModal.vue +++ b/resources/scripts/admin/components/modal-components/TaxTypeModal.vue @@ -90,15 +90,7 @@ -
+ {{ taxTypeStore.isEdit ? $t('general.update') : $t('general.save') }} -
+ diff --git a/resources/scripts/admin/components/modal-components/TaxationAddressModal.vue b/resources/scripts/admin/components/modal-components/TaxationAddressModal.vue index 0afdd9949..f2dadfafd 100644 --- a/resources/scripts/admin/components/modal-components/TaxationAddressModal.vue +++ b/resources/scripts/admin/components/modal-components/TaxationAddressModal.vue @@ -87,9 +87,7 @@ -
+ {{ $t('general.save') }} -
+ diff --git a/resources/scripts/admin/components/modal-components/custom-fields/CustomFieldModal.vue b/resources/scripts/admin/components/modal-components/custom-fields/CustomFieldModal.vue index d1a1c78d3..6db7a14ae 100644 --- a/resources/scripts/admin/components/modal-components/custom-fields/CustomFieldModal.vue +++ b/resources/scripts/admin/components/modal-components/custom-fields/CustomFieldModal.vue @@ -172,15 +172,7 @@ -
+ -
+ diff --git a/resources/scripts/admin/components/modal-components/disks/DoSpacesDisk.vue b/resources/scripts/admin/components/modal-components/disks/DoSpacesDisk.vue index 0dd83e4c5..232036415 100644 --- a/resources/scripts/admin/components/modal-components/disks/DoSpacesDisk.vue +++ b/resources/scripts/admin/components/modal-components/disks/DoSpacesDisk.vue @@ -153,7 +153,7 @@
-

+

{{ $t('settings.disk.is_default') }}

diff --git a/resources/scripts/admin/components/modal-components/disks/DropboxDisk.vue b/resources/scripts/admin/components/modal-components/disks/DropboxDisk.vue index 75da1b9a0..063efb52e 100644 --- a/resources/scripts/admin/components/modal-components/disks/DropboxDisk.vue +++ b/resources/scripts/admin/components/modal-components/disks/DropboxDisk.vue @@ -132,7 +132,7 @@
-

+

{{ $t('settings.disk.is_default') }}

diff --git a/resources/scripts/admin/components/modal-components/disks/LocalDisk.vue b/resources/scripts/admin/components/modal-components/disks/LocalDisk.vue index 7d539ff66..2f15cb70b 100644 --- a/resources/scripts/admin/components/modal-components/disks/LocalDisk.vue +++ b/resources/scripts/admin/components/modal-components/disks/LocalDisk.vue @@ -63,7 +63,7 @@
-

+

{{ $t('settings.disk.is_default') }}

diff --git a/resources/scripts/admin/components/modal-components/disks/S3Disk.vue b/resources/scripts/admin/components/modal-components/disks/S3Disk.vue index 082c8e94b..9bdbdd691 100644 --- a/resources/scripts/admin/components/modal-components/disks/S3Disk.vue +++ b/resources/scripts/admin/components/modal-components/disks/S3Disk.vue @@ -134,7 +134,7 @@
-

+

{{ $t('settings.disk.is_default') }}

diff --git a/resources/scripts/admin/layouts/LayoutInstallation.vue b/resources/scripts/admin/layouts/LayoutInstallation.vue index 951367be8..d3a200251 100644 --- a/resources/scripts/admin/layouts/LayoutInstallation.vue +++ b/resources/scripts/admin/layouts/LayoutInstallation.vue @@ -1,8 +1,8 @@ diff --git a/resources/scripts/admin/views/installation/Step8CompanyPreferences.vue b/resources/scripts/admin/views/installation/Step8CompanyPreferences.vue index ad40e60ec..180100145 100644 --- a/resources/scripts/admin/views/installation/Step8CompanyPreferences.vue +++ b/resources/scripts/admin/views/installation/Step8CompanyPreferences.vue @@ -2,7 +2,6 @@
diff --git a/resources/scripts/admin/views/invoices/Index.vue b/resources/scripts/admin/views/invoices/Index.vue index c1b218749..bf76a9edb 100644 --- a/resources/scripts/admin/views/invoices/Index.vue +++ b/resources/scripts/admin/views/invoices/Index.vue @@ -56,7 +56,7 @@ - - - - - + + + + + - + {{ $t('general.delete') }} @@ -203,7 +220,7 @@ - + {{ $t('general.delete') }} @@ -153,7 +153,7 @@ - + {{ $t('general.delete') }} @@ -158,7 +158,7 @@ - + {{ $t('general.delete') }} @@ -203,7 +204,7 @@ :text="row.data.customer.name" :length="30" tag="span" - class="font-medium text-primary-500 flex flex-col" + class="font-medium text-primary-500 flex flex-col dark:text-primary-400" />
-

+

{{ $t('recurring_invoices.send_automatically') }}

{{ $t('recurring_invoices.send_automatically_desc') }} diff --git a/resources/scripts/admin/views/recurring-invoices/partials/RecurringInvoiceViewSidebar.vue b/resources/scripts/admin/views/recurring-invoices/partials/RecurringInvoiceViewSidebar.vue index 42445324c..d444fdfa8 100644 --- a/resources/scripts/admin/views/recurring-invoices/partials/RecurringInvoiceViewSidebar.vue +++ b/resources/scripts/admin/views/recurring-invoices/partials/RecurringInvoiceViewSidebar.vue @@ -152,6 +152,7 @@ onSearched = debounce(onSearched, 500) xl:ml-64 w-88 xl:block + dark:bg-gray-800 " >

@@ -192,9 +194,10 @@ onSearched = debounce(onSearched, 500) px-2 py-1 pb-2 - mb-1 mb-2 + mb-2 text-sm border-b border-gray-200 border-solid + dark:border-gray-600 " > {{ $t('general.sort_by') }} @@ -243,6 +246,7 @@ onSearched = debounce(onSearched, 500) overflow-y-scroll border-l border-gray-200 border-solid base-scroll + dark:border-gray-600 " >
@@ -251,9 +255,9 @@ onSearched = debounce(onSearched, 500) :id="'recurring-invoice-' + invoice.id" :to="`/admin/recurring-invoices/${invoice.id}/view`" :class="[ - 'flex justify-between side-invoice p-4 cursor-pointer hover:bg-gray-100 items-center border-l-4 border-transparent', + 'flex justify-between side-invoice p-4 cursor-pointer hover:bg-gray-100 items-center border-l-4 border-transparent dark:hover:bg-gray-700', { - 'bg-gray-100 border-l-4 border-primary-500 border-solid': + 'bg-gray-100 border-l-4 border-primary-500 border-solid dark:bg-gray-700': hasActiveUrl(invoice.id), }, ]" @@ -273,6 +277,7 @@ onSearched = debounce(onSearched, 500) text-black capitalize truncate + dark:text-white " /> @@ -285,6 +290,7 @@ onSearched = debounce(onSearched, 500) font-medium leading-5 text-gray-600 + dark:text-gray-400 " > {{ invoice.invoice_number }} @@ -307,6 +313,7 @@ onSearched = debounce(onSearched, 500) font-semibold leading-8 text-right text-gray-900 + dark:text-white " :amount="invoice.total" :currency="invoice.customer.currency" @@ -320,6 +327,7 @@ onSearched = debounce(onSearched, 500) leading-5 text-right text-gray-600 est-date + dark:text-gray-400 " > {{ invoice.formatted_starts_at }} @@ -332,7 +340,7 @@ onSearched = debounce(onSearched, 500)

{{ $t('invoices.no_matching_invoices') }}

diff --git a/resources/scripts/admin/views/settings/BackupSetting.vue b/resources/scripts/admin/views/settings/BackupSetting.vue index f62e348b5..f0a60d013 100644 --- a/resources/scripts/admin/views/settings/BackupSetting.vue +++ b/resources/scripts/admin/views/settings/BackupSetting.vue @@ -51,14 +51,14 @@
- - + + {{ $t('general.download') }} - - + + {{ $t('general.delete') }} diff --git a/resources/scripts/admin/views/settings/CompanyInfoSettings.vue b/resources/scripts/admin/views/settings/CompanyInfoSettings.vue index 357b7dd60..b3354fdd6 100644 --- a/resources/scripts/admin/views/settings/CompanyInfoSettings.vue +++ b/resources/scripts/admin/views/settings/CompanyInfoSettings.vue @@ -28,6 +28,19 @@ /> + + + + @@ -100,10 +113,10 @@
-

+

{{ $tc('settings.company_info.delete_company') }}

-
+

{{ $tc('settings.company_info.delete_company_description') }}

@@ -160,6 +173,7 @@ let isSaving = ref(false) const companyForm = reactive({ name: null, + slug: null, logo: null, address: { address_street_1: '', @@ -193,7 +207,14 @@ const rules = computed(() => { name: { required: helpers.withMessage(t('validation.required'), required), minLength: helpers.withMessage( - t('validation.name_min_length'), + t('validation.name_min_length', { count: 3 }), + minLength(3) + ), + }, + slug: { + required: helpers.withMessage(t('validation.required'), required), + minLength: helpers.withMessage( + t('validation.name_min_length', { count: 3 }), minLength(3) ), }, diff --git a/resources/scripts/admin/views/settings/CustomFieldsSetting.vue b/resources/scripts/admin/views/settings/CustomFieldsSetting.vue index 1cad62b00..bc39c082d 100644 --- a/resources/scripts/admin/views/settings/CustomFieldsSetting.vue +++ b/resources/scripts/admin/views/settings/CustomFieldsSetting.vue @@ -27,7 +27,7 @@ > diff --git a/resources/scripts/admin/views/settings/ExchangeRateProviderSetting.vue b/resources/scripts/admin/views/settings/ExchangeRateProviderSetting.vue index 8635058e1..dd37145d4 100644 --- a/resources/scripts/admin/views/settings/ExchangeRateProviderSetting.vue +++ b/resources/scripts/admin/views/settings/ExchangeRateProviderSetting.vue @@ -7,7 +7,7 @@ {{ $t('settings.menu_title.exchange_rate') }}

{{ $t('settings.exchange_rate.providers_description') }} diff --git a/resources/scripts/admin/views/settings/FileDiskSetting.vue b/resources/scripts/admin/views/settings/FileDiskSetting.vue index 5e5bda80b..99be2f420 100644 --- a/resources/scripts/admin/views/settings/FileDiskSetting.vue +++ b/resources/scripts/admin/views/settings/FileDiskSetting.vue @@ -45,27 +45,30 @@ - + {{ $t('settings.disk.set_default_disk') }} - + {{ $t('general.edit') }} - + {{ $t('general.delete') }} diff --git a/resources/scripts/admin/views/settings/PreferencesSetting.vue b/resources/scripts/admin/views/settings/PreferencesSetting.vue index 6c46f6453..531cb83dd 100644 --- a/resources/scripts/admin/views/settings/PreferencesSetting.vue +++ b/resources/scripts/admin/views/settings/PreferencesSetting.vue @@ -8,7 +8,11 @@ @@ -21,7 +25,7 @@ :searchable="true" track-by="name" :invalid="v$.currency.$error" - disabled + :disabled="isCurrencyDisabled" class="w-full" > @@ -187,6 +191,7 @@ const { t, tm } = useI18n() let isSaving = ref(false) let isDataSaving = ref(false) let isFetchingInitialData = ref(false) +let isCurrencyDisabled = ref(true) const settingsForm = reactive({ ...companyStore.selectedCompanySettings }) @@ -282,10 +287,14 @@ setInitialData() async function setInitialData() { isFetchingInitialData.value = true Promise.all([ + companyStore.checkCompanyHasCurrencyTransactions(), globalStore.fetchCurrencies(), globalStore.fetchDateFormats(), globalStore.fetchTimeZones(), ]).then(([res1]) => { + if (res1.data?.has_transactions == false) { + isCurrencyDisabled.value = false + } isFetchingInitialData.value = false }) } diff --git a/resources/scripts/admin/views/settings/UpdateAppSetting.vue b/resources/scripts/admin/views/settings/UpdateAppSetting.vue index 53a6c99c1..971f52694 100644 --- a/resources/scripts/admin/views/settings/UpdateAppSetting.vue +++ b/resources/scripts/admin/views/settings/UpdateAppSetting.vue @@ -4,23 +4,14 @@ :description="$t('settings.update_app.description')" >

-