-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af0f366
commit cbd9b81
Showing
4 changed files
with
172 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
|
||
class TravelperkConfig(AppConfig): | ||
name = 'travelperk' | ||
name = 'apps.travelperk' |
81 changes: 81 additions & 0 deletions
81
apps/travelperk/migrations/0005_invoice_invoicelineitem_travelperkcredential.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Generated by Django 3.1.14 on 2023-12-13 18:51 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('orgs', '0004_auto_20230627_1133'), | ||
('travelperk', '0004_travelperk_is_travel_perk_connected'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='InvoiceLineItem', | ||
fields=[ | ||
('id', models.UUIDField(editable=False, help_text='Unique identifier for the line item.', primary_key=True, serialize=False, unique=True)), | ||
('expense_date', models.DateField(help_text='Date of the expense for this line item.')), | ||
('description', models.CharField(help_text='Description of the product or service.', max_length=255)), | ||
('quantity', models.PositiveIntegerField(help_text='Quantity of the product or service.')), | ||
('unit_price', models.DecimalField(decimal_places=2, help_text='Unit price of the product or service.', max_digits=10)), | ||
('non_taxable_unit_price', models.DecimalField(decimal_places=2, help_text='Non-taxable unit price.', max_digits=10)), | ||
('tax_percentage', models.DecimalField(decimal_places=2, help_text='Tax percentage applied.', max_digits=5)), | ||
('tax_amount', models.DecimalField(decimal_places=2, help_text='Total tax amount for this line item.', max_digits=10)), | ||
('tax_regime', models.CharField(help_text='Tax regime for this line item.', max_length=20)), | ||
('total_amount', models.DecimalField(decimal_places=2, help_text='Total amount including taxes.', max_digits=10)), | ||
('trip_id', models.PositiveIntegerField(help_text='ID of the trip associated with this line item.')), | ||
('trip_name', models.CharField(help_text='Name of the trip associated with this line item.', max_length=255)), | ||
('service', models.CharField(help_text='Type of service (e.g., PREMIUM).', max_length=50)), | ||
('booker_name', models.CharField(help_text='Name of the person who booked the service.', max_length=100)), | ||
('booker_email', models.EmailField(help_text='Email address of the person who booked the service.', max_length=254)), | ||
('cost_center', models.CharField(help_text='Cost center associated with this line item.', max_length=20)), | ||
('credit_card_last_4_digits', models.CharField(help_text='Last 4 digits of the credit card used for payment.', max_length=4)), | ||
], | ||
options={ | ||
'db_table': 'invoice_line_items', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='TravelperkCredential', | ||
fields=[ | ||
('id', models.AutoField(help_text='Unique Id to indentify a Credentials', primary_key=True, serialize=False)), | ||
('refresh_token', models.CharField(help_text='Travelperk Refresh Token', max_length=255, null=True)), | ||
('created_at', models.DateTimeField(auto_now_add=True, help_text='Created at datetime')), | ||
('updated_at', models.DateTimeField(auto_now=True, help_text='Updated at datetime')), | ||
('org', models.OneToOneField(help_text='Reference to Org table', on_delete=django.db.models.deletion.PROTECT, to='orgs.org')), | ||
], | ||
options={ | ||
'db_table': 'travelperk_credentials', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='Invoice', | ||
fields=[ | ||
('id', models.UUIDField(editable=False, help_text='Unique identifier for the invoice.', primary_key=True, serialize=False, unique=True)), | ||
('billing_information', models.JSONField(help_text='Billing information associated with the invoice.')), | ||
('billing_period', models.CharField(help_text='Billing period type (e.g., instant).', max_length=20)), | ||
('currency', models.CharField(help_text='Currency code (e.g., GBP).', max_length=3)), | ||
('due_date', models.DateField(help_text='Due date for the invoice.')), | ||
('from_date', models.DateField(help_text='Start date for the billing period.')), | ||
('to_date', models.DateField(help_text='End date for the billing period.')), | ||
('issuing_date', models.DateField(help_text='Date when the invoice was issued.')), | ||
('mode', models.CharField(choices=[('reseller', 'Reseller'), ('direct', 'Direct')], help_text='Mode of the invoice, indicating whether it is a reseller or direct invoice.', max_length=20)), | ||
('pdf', models.URLField(help_text='URL to the PDF version of the invoice.')), | ||
('profile_id', models.UUIDField(help_text='ID of the profile associated with the invoice.')), | ||
('profile_name', models.CharField(help_text='Name of the profile associated with the invoice.', max_length=255)), | ||
('reference', models.CharField(help_text='Reference information for the invoice (e.g., Trip #9876543).', max_length=50)), | ||
('serial_number', models.CharField(help_text='Serial number of the invoice.', max_length=20)), | ||
('status', models.CharField(help_text='Status of the invoice (e.g., paid).', max_length=20)), | ||
('taxes_summary', models.JSONField(help_text='Summary of taxes applied to the invoice.')), | ||
('total', models.DecimalField(decimal_places=2, help_text='Total amount of the invoice.', max_digits=10)), | ||
('travelperk_bank_account', models.CharField(blank=True, help_text='TravelPerk bank account information if available.', max_length=50, null=True)), | ||
('exported_to_fyle', models.BooleanField(default=False, help_text='If the invoice is exported to Fyle')), | ||
('lines', models.ManyToManyField(help_text='Line items associated with the invoice.', to='travelperk.InvoiceLineItem')), | ||
], | ||
options={ | ||
'db_table': 'invoices', | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters