Skip to content

Commit 062e88d

Browse files
committed
Replace old project with new Django version
1 parent 91ffbc3 commit 062e88d

File tree

88 files changed

+4455
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+4455
-0
lines changed

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Python
2+
*.pyc
3+
__pycache__/
4+
*.pyo
5+
*.pyd
6+
7+
# Env
8+
.venv/
9+
env/
10+
venv/
11+
12+
# Django
13+
db.sqlite3
14+
staticfiles/
15+
media/
16+
17+
# VSCode
18+
.vscode/
19+
20+
# OS
21+
.DS_Store

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn pbhms.wsgi

pbhms/billing/__init__.py

Whitespace-only changes.

pbhms/billing/admin.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from django.contrib import admin
2+
from .models import Billing
3+
4+
class Guest_Billing(admin.ModelAdmin):
5+
list_display = ('check_in', 'check_out', 'room_bill', 'room_service', 'food', 'bottles', 'in_room_facilities', 'miscellaneous', 'date', 'total')
6+
search_fields = ('check_in__name', 'check_in__aadhaar_card')
7+
list_filter = ('date',)
8+
readonly_fields = ('room_bill', 'total')
9+
10+
admin.site.register(Billing, Guest_Billing)

pbhms/billing/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class BillingConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'billing'

pbhms/billing/forms.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from django import forms
2+
from django.utils import timezone
3+
from .models import Billing
4+
5+
class billing_form(forms.ModelForm):
6+
class Meta:
7+
model = Billing
8+
fields = "__all__"
9+
widgets = {
10+
'check_in': forms.Select(attrs={'class': 'bg-black w-full focus:outline-none'}),
11+
'check_out': forms.Select(attrs={'class': 'bg-black w-full focus:outline-none'}),
12+
'room_service': forms.TextInput(attrs={'placeholder': 'Enter total bill of Room service if taken', 'class': 'w-full focus:outline-none'}),
13+
'food': forms.TextInput(attrs={'placeholder': 'Enter total food bill if ordered', 'class': 'w-full focus:outline-none'}),
14+
'room_bill': forms.TextInput(attrs={'readonly': 'readonly', 'class': 'w-full focus:outline-none'}),
15+
'bottles': forms.TextInput(attrs={'placeholder': 'Enter the water bill if taken', 'class': 'w-full focus:outline-none'}),
16+
'in_room_facilities': forms.TextInput(attrs={'placeholder': 'Enter the bill for room facilities', 'class': 'w-full focus:outline-none'}),
17+
'total': forms.TextInput(attrs={'readonly': 'readonly', 'class': 'w-full focus:outline-none'}),
18+
'miscellaneous': forms.TextInput(attrs={'placeholder': 'Enter any miscellaneous bill', 'class': 'w-full focus:outline-none'}),
19+
'date': forms.DateTimeInput(attrs={'value': timezone.now().strftime('%Y-%m-%d %H:%M:%S'), 'class': 'focus:outline-none' ,'readonly': 'readonly', 'class': 'w-full'})
20+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Generated by Django 5.2.7 on 2025-11-05 11:26
2+
3+
import django.db.models.deletion
4+
import django.utils.timezone
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
initial = True
11+
12+
dependencies = [
13+
('guests', '0004_alter_checkin_aadhaar_card_alter_checkin_mobile_and_more'),
14+
]
15+
16+
operations = [
17+
migrations.CreateModel(
18+
name='Billing',
19+
fields=[
20+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21+
('room_service', models.DecimalField(decimal_places=2, max_digits=10)),
22+
('food', models.DecimalField(decimal_places=2, max_digits=10)),
23+
('bottles', models.DecimalField(decimal_places=2, max_digits=10)),
24+
('inroom_facilities', models.DecimalField(decimal_places=2, max_digits=10)),
25+
('miscellaneous', models.DecimalField(decimal_places=2, max_digits=10)),
26+
('total', models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=12)),
27+
('date', models.DateTimeField(default=django.utils.timezone.now)),
28+
('check_in', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bills', to='guests.checkin')),
29+
('check_out', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='bill', to='guests.checkout')),
30+
],
31+
),
32+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.2.7 on 2025-11-05 11:27
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('billing', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.RenameField(
14+
model_name='billing',
15+
old_name='inroom_facilities',
16+
new_name='in_room_facilities',
17+
),
18+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 5.2.7 on 2025-11-05 11:32
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('billing', '0002_rename_inroom_facilities_billing_in_room_facilities'),
11+
('guests', '0004_alter_checkin_aadhaar_card_alter_checkin_mobile_and_more'),
12+
]
13+
14+
operations = [
15+
migrations.AlterField(
16+
model_name='billing',
17+
name='check_out',
18+
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='bill', to='guests.checkout'),
19+
),
20+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 5.2.7 on 2025-11-05 12:58
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('billing', '0003_alter_billing_check_out'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='billing',
15+
name='room_bill',
16+
field=models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=10),
17+
),
18+
]

0 commit comments

Comments
 (0)