Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode #1207

Open
wants to merge 76 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
e7301eb
Fix minor issues
harshjagad20-dev Mar 14, 2022
0e31f85
change company currency if it does not have any transaction.
Asif798 Mar 14, 2022
20c2502
added company slug
Asif798 Mar 14, 2022
586fb1a
fixed "Custom fields always set to default value"
Asif798 Mar 16, 2022
d130e20
Merge branch 'fix-default-custom-value' into 'master'
mohitpanjwani Mar 16, 2022
5c63770
added unique validation and help text for company slug field
Asif798 Mar 21, 2022
ef35293
update company slug help text
Asif798 Mar 21, 2022
a9e5498
Merge branch 'fix-minor-issues' into 'master'
mohitpanjwani Mar 21, 2022
7718f77
Merge branch 'master' of https://github.com/bytefury/crater
mohitpanjwani Mar 29, 2022
32949d1
added "Due Amount, Total Amount and PDF Link" new custom fields
Asif798 Mar 30, 2022
a7c1e12
Merge branch 'new-custom-fields' into 'master'
mohitpanjwani Mar 30, 2022
c4c0000
Fix invoice status issue
harshjagad20-dev Mar 30, 2022
adc5962
Merge branch 'fix-invoice-status-issue' into 'master'
mohitpanjwani Mar 30, 2022
3f3f83a
fix expense receipt issue
harshjagad20-dev Mar 30, 2022
ea41989
Merge branch 'fix-expense-receipt-issue' into 'master'
mohitpanjwani Mar 30, 2022
bba14bf
Merge branch 'master'
mohitpanjwani Apr 1, 2022
3331563
Fix expense receipt delete issue while update
harshjagad20-dev Apr 1, 2022
fd70ab9
Merge branch 'fix-expense-receipt-delete-issue' into 'master'
mohitpanjwani Apr 1, 2022
787619b
add v-calendar
Asif798 Apr 1, 2022
bd5f0fe
Merge branch 'v-calendar' into 'master'
mohitpanjwani Apr 1, 2022
189c51c
Merge branch 'master' of https://github.com/bytefury/crater
mohitpanjwani Jun 15, 2022
df04fd9
Merge branch 'master' of https://github.com/bytefury/crater
mohitpanjwani Oct 17, 2022
9819619
Merge branch 'master' of https://github.com/bytefury/crater
mohitpanjwani Dec 13, 2022
ca55221
add dark mode in sidebar and header
yashkanakiya Mar 17, 2023
2e93082
add dark theme in blade file
yashkanakiya Mar 20, 2023
15f3f56
Dark sidebar header (#1156)
yashkanakiya Mar 20, 2023
c61fbad
add dark base card and darkHighlight component
yashkanakiya Mar 20, 2023
18b5705
Merge branch 'dark-mode' of https://github.com/crater-invoice/crater …
yashkanakiya Mar 20, 2023
cac3582
add dark mode in button
yashkanakiya Mar 20, 2023
af2482a
fix white variant dark mode in base button
yashkanakiya Mar 23, 2023
04c7ae3
Merge pull request #1157 from crater-invoice/dark-card
yogesh-gohil Mar 25, 2023
2c8bb38
add disabled button class and loading right prop
yogesh-gohil Mar 25, 2023
e8d92cd
Merge pull request #1158 from crater-invoice/dark-button
yogesh-gohil Mar 25, 2023
80e2548
add base multiselect (#1163)
yashkanakiya Mar 25, 2023
43316da
add dark mode in BreadCrumb and PageHeader. (#1172)
yashkanakiya Mar 25, 2023
b4b00eb
add dark base switch & base switcher (#1173)
yashkanakiya Mar 25, 2023
bd34594
add dark mode in BaseContentPlaceholders (#1184)
yashkanakiya Mar 25, 2023
0321ca5
add dark mode in base dialog component (#1174)
yashkanakiya Mar 25, 2023
c5acf13
add dark mode in BaseFilterWrapper (#1189)
yashkanakiya Mar 25, 2023
f6639f5
add dark dropdown & company switch (#1167)
yashkanakiya Mar 28, 2023
d14ab01
add dark mode in GlobalSearchBar (#1197)
yashkanakiya Mar 28, 2023
8f2edc2
add dark mode in base tabGroup and tab (#1175)
yashkanakiya Mar 28, 2023
fb9fab6
add dark mode in baseFileUploader (#1176)
yashkanakiya Mar 28, 2023
1aceb2c
add dark-mode in BaseInput (#1169)
varshapun Mar 28, 2023
29a135a
add dark mode in base modal (#1171)
yashkanakiya Mar 28, 2023
0462ff6
add dark mode in baseListItem (#1177)
yashkanakiya Mar 28, 2023
1e6c3b2
add dark mode in base table (#1160)
yashkanakiya Mar 28, 2023
c36d259
add dark mode in dashboard stats & chart (#1161)
yashkanakiya Mar 28, 2023
f874b35
add dark mode in baseEditor (#1180)
yashkanakiya Mar 28, 2023
a32d363
Dark mode add in BaseSettingsCard & BaseHeading (#1183)
yashkanakiya Mar 28, 2023
ce88c77
add dark mode in table pagination (#1185)
yashkanakiya Mar 28, 2023
13557ea
add dark mode in BaseSelectInput (#1186)
yashkanakiya Mar 28, 2023
2adaa7a
add dark mode in base select action (#1188)
yashkanakiya Mar 28, 2023
826ef72
add dark mode in BaseItemSelect component. (#1191)
yashkanakiya Mar 28, 2023
82efad7
Add dark mode in BaseErrorAlert (#1192)
yashkanakiya Mar 28, 2023
ba7f619
add dark mode in BaseMoney and BaseTextArea (#1170)
varshapun Mar 28, 2023
5c67780
add dark-mode in checkbox (#1162)
varshapun Mar 28, 2023
5aa7dec
add dark-mode in BaseRadio component (#1182)
varshapun Mar 28, 2023
3d5732e
Add dark mode in BaseDivider & BaseDescriptionList (#1194)
yashkanakiya Mar 28, 2023
0c5adff
Dark customer address popup custominput (#1195)
yashkanakiya Mar 28, 2023
55bf70c
Add dark mode in NotificationItem (#1196)
yashkanakiya Mar 28, 2023
238cdb3
Add dark mode in BaseEmptyPlaceholder (#1193)
yashkanakiya Mar 28, 2023
9249105
Add dark mode in all StatusBadge (#1198)
yashkanakiya Mar 29, 2023
5440b0f
Add dark mode in customer dashboard (#1199)
yashkanakiya Mar 30, 2023
3b3da13
Dark label (#1203)
yogesh-gohil Mar 30, 2023
1a4309c
add dark mode for date-picker (#1205)
yogesh-gohil Mar 30, 2023
8a5632c
add dark mode in admin login layout (#1202)
yashkanakiya Mar 30, 2023
7e80bfb
add dark mode in est,inv,pay,rec view&create page (#1201)
yashkanakiya Mar 30, 2023
deb039b
add LightDark option for customer dashboard (#1204)
yashkanakiya Mar 30, 2023
18dc886
add dark mode in wizard steps (#1206)
PayalDholakiya Mar 30, 2023
de235a9
Dark cust light dark button (#1208)
yogesh-gohil Mar 30, 2023
ba76986
fix view sidebar and customer dropdown dark issue (#1210)
yashkanakiya Mar 31, 2023
f4bc78c
Dark mode fix issue (#1211)
yashkanakiya Mar 31, 2023
45aaee7
fix sidebar and table data link in dark mode color (#1259)
yashkanakiya Aug 22, 2023
d1ab4a8
fix password eye icon and minor fix in dark mode (#1261)
yashkanakiya Aug 22, 2023
7b9c7c3
fix switch problem in mobile and installation step (#1262)
yashkanakiya Aug 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
11 changes: 7 additions & 4 deletions app/Http/Requests/CompaniesRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -34,6 +33,10 @@ public function rules()
'currency' => [
'required'
],
'slug' => [
'required',
Rule::unique('companies')
],
'address.name' => [
'nullable',
],
Expand Down Expand Up @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Requests/CompanyRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/EstimateResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/PaymentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion app/Models/Estimate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
];
}

Expand Down
6 changes: 3 additions & 3 deletions app/Models/Expense.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
54 changes: 37 additions & 17 deletions app/Models/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down Expand Up @@ -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);
Expand All @@ -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'));
}
Expand Down Expand Up @@ -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)
];
}

Expand Down
3 changes: 2 additions & 1 deletion app/Models/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
];
}

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions resources/scripts/admin/components/CopyInputField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,6 +20,7 @@
text-sm
font-medium
text-black
dark:text-white
truncate
select-all select-color
"
Expand Down
17 changes: 15 additions & 2 deletions resources/scripts/admin/components/SelectNotePopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
"
>
<div
Expand All @@ -53,7 +59,7 @@
ring-1 ring-black ring-opacity-5
"
>
<div class="relative grid bg-white">
<div class="relative grid bg-white dark:bg-gray-800">
<div class="relative p-4">
<BaseInput
v-model="textSearch"
Expand All @@ -66,7 +72,7 @@

<div
v-if="filteredNotes.length > 0"
class="relative flex flex-col overflow-auto list max-h-36"
class="relative flex flex-col overflow-auto list max-h-36 dark:border-white/10"
>
<div
v-for="(note, index) in filteredNotes"
Expand All @@ -79,6 +85,8 @@
cursor-pointer
hover:bg-gray-100 hover:cursor-pointer
last:border-b-0
dark:border-gray-600
dark:border-white/10 dark:hover:bg-gray-700/30
"
@click="selectNote(index, close)"
>
Expand All @@ -91,6 +99,7 @@
leading-tight
text-gray-700
cursor-pointer
dark:text-gray-400
"
>
{{ note.name }}
Expand Down Expand Up @@ -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"
>
Expand Down
Loading