Skip to content

Commit c867b38

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 0bd3f4c + 524ee37 commit c867b38

File tree

4 files changed

+41
-108
lines changed

4 files changed

+41
-108
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 4.1.7 on 2024-01-31 08:15
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("backend", "0008_receiptdownloadtoken"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="invoice",
14+
name="sort_code",
15+
field=models.CharField(blank=True, max_length=8, null=True),
16+
),
17+
]

backend/models.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import smtplib
2-
from django.utils import timezone
2+
from uuid import uuid4
3+
34
from django.contrib import messages
45
from django.contrib.auth.models import User, UserManager, AbstractUser
56
from django.core.mail import EmailMessage
67
from django.db import models
7-
from settings import settings
8+
from django.utils import timezone
89
from django.utils.crypto import get_random_string
910
from shortuuid.django_fields import ShortUUIDField
10-
from uuid import uuid4
11+
12+
from settings import settings
1113

1214

1315
class CustomUserManager(UserManager):
@@ -203,7 +205,7 @@ class Invoice(models.Model):
203205
self_county = models.CharField(max_length=100, blank=True, null=True)
204206
self_country = models.CharField(max_length=100, blank=True, null=True)
205207

206-
sort_code = models.CharField(max_length=100, blank=True, null=True)
208+
sort_code = models.CharField(max_length=8, blank=True, null=True) # 12-34-56
207209
account_holder_name = models.CharField(max_length=100, blank=True, null=True)
208210
account_number = models.CharField(max_length=100, blank=True, null=True)
209211
reference = models.CharField(max_length=100, blank=True, null=True)

frontend/static/src/output.css

Lines changed: 9 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,20 +1572,6 @@ html {
15721572
padding: 1rem;
15731573
}
15741574

1575-
.indicator {
1576-
position: relative;
1577-
display: inline-flex;
1578-
width: -moz-max-content;
1579-
width: max-content;
1580-
}
1581-
1582-
.indicator :where(.indicator-item) {
1583-
z-index: 1;
1584-
position: absolute;
1585-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1586-
white-space: nowrap;
1587-
}
1588-
15891575
.input {
15901576
flex-shrink: 1;
15911577
-webkit-appearance: none;
@@ -3624,78 +3610,6 @@ html {
36243610
visibility: visible;
36253611
}
36263612

3627-
.indicator :where(.indicator-item) {
3628-
bottom: auto;
3629-
inset-inline-end: 0px;
3630-
inset-inline-start: auto;
3631-
top: 0px;
3632-
--tw-translate-y: -50%;
3633-
--tw-translate-x: 50%;
3634-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3635-
}
3636-
3637-
:is([dir="rtl"] .indicator :where(.indicator-item)) {
3638-
--tw-translate-x: -50%;
3639-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3640-
}
3641-
3642-
.indicator :where(.indicator-item.indicator-start) {
3643-
inset-inline-end: auto;
3644-
inset-inline-start: 0px;
3645-
--tw-translate-x: -50%;
3646-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3647-
}
3648-
3649-
:is([dir="rtl"] .indicator :where(.indicator-item.indicator-start)) {
3650-
--tw-translate-x: 50%;
3651-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3652-
}
3653-
3654-
.indicator :where(.indicator-item.indicator-center) {
3655-
inset-inline-end: 50%;
3656-
inset-inline-start: 50%;
3657-
--tw-translate-x: -50%;
3658-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3659-
}
3660-
3661-
:is([dir="rtl"] .indicator :where(.indicator-item.indicator-center)) {
3662-
--tw-translate-x: 50%;
3663-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3664-
}
3665-
3666-
.indicator :where(.indicator-item.indicator-end) {
3667-
inset-inline-end: 0px;
3668-
inset-inline-start: auto;
3669-
--tw-translate-x: 50%;
3670-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3671-
}
3672-
3673-
:is([dir="rtl"] .indicator :where(.indicator-item.indicator-end)) {
3674-
--tw-translate-x: -50%;
3675-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3676-
}
3677-
3678-
.indicator :where(.indicator-item.indicator-bottom) {
3679-
bottom: 0px;
3680-
top: auto;
3681-
--tw-translate-y: 50%;
3682-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3683-
}
3684-
3685-
.indicator :where(.indicator-item.indicator-middle) {
3686-
bottom: 50%;
3687-
top: 50%;
3688-
--tw-translate-y: -50%;
3689-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3690-
}
3691-
3692-
.indicator :where(.indicator-item.indicator-top) {
3693-
bottom: auto;
3694-
top: 0px;
3695-
--tw-translate-y: -50%;
3696-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3697-
}
3698-
36993613
.join.join-vertical {
37003614
flex-direction: column;
37013615
}
@@ -4468,7 +4382,7 @@ html {
44684382
}
44694383

44704384
.w-1\/3 {
4471-
width: 33.333333%;
4385+
width: 33.333333%;
44724386
}
44734387

44744388
.w-10 {
@@ -4488,7 +4402,7 @@ html {
44884402
}
44894403

44904404
.w-2\/3 {
4491-
width: 66.666667%;
4405+
width: 66.666667%;
44924406
}
44934407

44944408
.w-3 {
@@ -4540,7 +4454,7 @@ html {
45404454
}
45414455

45424456
.w-\[100\%\] {
4543-
width: 100%;
4457+
width: 100%;
45444458
}
45454459

45464460
.w-\[150px\] {
@@ -4556,7 +4470,7 @@ html {
45564470
}
45574471

45584472
.w-\[50\%\] {
4559-
width: 50%;
4473+
width: 50%;
45604474
}
45614475

45624476
.w-\[60\%\] {
@@ -4740,13 +4654,13 @@ html {
47404654
column-gap: 0.75rem;
47414655
}
47424656

4743-
.gap-y-1 {
4744-
row-gap: 0.25rem;
4657+
.gap-x-4 {
4658+
-moz-column-gap: 1rem;
4659+
column-gap: 1rem;
47454660
}
47464661

4747-
.gap-x-4 {
4748-
-moz-column-gap: 1rem;
4749-
column-gap: 1rem;
4662+
.gap-y-1 {
4663+
row-gap: 0.25rem;
47504664
}
47514665

47524666
.space-x-4 > :not([hidden]) ~ :not([hidden]) {

frontend/templates/pages/invoices/create/create.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ <h3 class="text-sm text-natural font-semibold hidden lg:block text-end me-6">To<
9090
<div class="card-body">
9191
<div class="form-control w-full max-w-xs">
9292
<label class="label">Sort Code</label>
93-
<input onkeyup="this.value = validate_sort_code(this.value);" pattern="[0-9]{3}-[0-9]{3}-[0-9]{3}"
94-
name="sort_code" name="sort_code" placeholder="1234-1234-1234" type="text"
93+
<input onkeyup="this.value = validate_sort_code(this.value);" pattern="[0-9]{2}-[0-9]{2}-[0-9]{2}"
94+
name="sort_code" name="sort_code" placeholder="12-34-56" type="text"
9595
class="peer input-bordered input input-block">
9696
<label class="label peer-[&amp;:not(:placeholder-shown):not(:focus):invalid]:block hidden ">
9797
<span class="label-text-alt text-error">Please enter a valid sort code.</span>
@@ -182,16 +182,16 @@ <h3 class="text-sm text-natural font-semibold hidden lg:block text-end me-6">To<
182182
value = value.replace(/\D/g, '');
183183

184184
// Ensure the value is no longer than 9 characters (123-123-123)
185-
if (value.length > 9) {
186-
value = value.slice(0, 9);
185+
if (value.length > 6) {
186+
value = value.slice(0, 6);
187187
}
188188

189-
// Format the value as "123-123-123"
190-
if (value.length >= 3) {
191-
value = value.slice(0, 3) + "-" + value.slice(3);
189+
// Format the value as "12-34-56"
190+
if (value.length >= 2) {
191+
value = value.slice(0, 2) + "-" + value.slice(2);
192192
}
193-
if (value.length >= 7) {
194-
value = value.slice(0, 7) + "-" + value.slice(7);
193+
if (value.length >= 5) {
194+
value = value.slice(0, 5) + "-" + value.slice(5);
195195
}
196196

197197
return value;

0 commit comments

Comments
 (0)