814 lines
30 KiB
Python
814 lines
30 KiB
Python
# This is an auto-generated Django model module.
|
|
# You'll have to do the following manually to clean this up:
|
|
# * Rearrange models' order
|
|
# * Make sure each model has one field with primary_key=True
|
|
# * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior
|
|
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
|
|
# Feel free to rename the models, but don't rename db_table values or field names.
|
|
from django.db import models
|
|
|
|
|
|
class Country(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
currency_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'countries'
|
|
|
|
class State(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
shortform = models.CharField(max_length=255, db_comment='NSW, ACT etc.')
|
|
enqform = models.CharField(max_length=3, db_comment='1 / 2 char for enquiry register')
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'states'
|
|
|
|
|
|
class Customer(models.Model):
|
|
name = models.CharField(max_length=400, db_comment='Company Name')
|
|
trading_name = models.CharField(max_length=400)
|
|
abn = models.CharField(max_length=255, blank=True, null=True)
|
|
created = models.DateTimeField()
|
|
notes = models.TextField()
|
|
discount_pricing_policies = models.TextField()
|
|
payment_terms = models.CharField(max_length=255)
|
|
customer_category_id = models.IntegerField()
|
|
url = models.CharField(max_length=300)
|
|
country_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'customers'
|
|
|
|
|
|
class Address(models.Model):
|
|
name = models.CharField(max_length=255, db_comment='Descriptive Name for this address')
|
|
address = models.TextField(db_comment='street or unit number and street name')
|
|
city = models.CharField(max_length=255, db_comment='Suburb / City')
|
|
state_id = models.ForeignKey(State, on_delete=models.DO_NOTHING, db_comment='State foreign Key')
|
|
country_id = models.ForeignKey(Country, on_delete=models.DO_NOTHING, db_comment='Country foreign Key')
|
|
customer_id = models.ForeignKey(Customer, on_delete=models.DO_NOTHING, db_comment='Customer foreign Key')
|
|
type = models.CharField(max_length=255, db_comment='either bill / ship / both')
|
|
postcode = models.CharField(max_length=50)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'addresses'
|
|
|
|
|
|
|
|
|
|
class Attachment(models.Model):
|
|
principle_id = models.IntegerField()
|
|
created = models.DateTimeField()
|
|
modified = models.DateTimeField()
|
|
name = models.CharField(max_length=255)
|
|
filename = models.CharField(max_length=255)
|
|
file = models.CharField(max_length=255)
|
|
type = models.CharField(max_length=255)
|
|
size = models.IntegerField()
|
|
description = models.TextField()
|
|
archived = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'attachments'
|
|
|
|
class Box(models.Model):
|
|
shipment_id = models.IntegerField()
|
|
length = models.DecimalField(max_digits=5, decimal_places=1)
|
|
width = models.DecimalField(max_digits=5, decimal_places=1)
|
|
height = models.DecimalField(max_digits=5, decimal_places=1)
|
|
weight = models.DecimalField(max_digits=5, decimal_places=1)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'boxes'
|
|
|
|
|
|
class ContactCategory(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'contact_categories'
|
|
|
|
|
|
class Contact(models.Model):
|
|
customer_id = models.IntegerField()
|
|
name = models.CharField(max_length=255)
|
|
first_name = models.CharField(max_length=255)
|
|
last_name = models.CharField(max_length=255)
|
|
email = models.CharField(max_length=255)
|
|
phone = models.CharField(max_length=255)
|
|
fax = models.CharField(max_length=255)
|
|
notes = models.TextField()
|
|
mobile = models.CharField(max_length=255)
|
|
contact_category_id = models.IntegerField()
|
|
phone_extension = models.CharField(max_length=30)
|
|
direct_phone = models.CharField(max_length=255)
|
|
job_title = models.CharField(max_length=255)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'contacts'
|
|
|
|
|
|
class Costing(models.Model):
|
|
created = models.DateTimeField()
|
|
product_id = models.IntegerField(blank=True, null=True, db_comment='Will only be one of quote_product, order, invoice ')
|
|
line_item_id = models.IntegerField(blank=True, null=True)
|
|
purchase_currency_id = models.IntegerField(db_comment='Cost Price Currency')
|
|
sale_currency_id = models.IntegerField()
|
|
quantity = models.DecimalField(max_digits=10, decimal_places=2)
|
|
unit_cost_price = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
exchange_rate = models.DecimalField(max_digits=10, decimal_places=3, blank=True, null=True)
|
|
our_discount_percent = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
packing = models.DecimalField(max_digits=10, decimal_places=2)
|
|
fob_sale_currency = models.DecimalField(max_digits=10, decimal_places=2)
|
|
shipping_weight = models.DecimalField(max_digits=10, decimal_places=2)
|
|
shipping_cost = models.DecimalField(max_digits=10, decimal_places=2)
|
|
duty_percent = models.DecimalField(max_digits=10, decimal_places=2)
|
|
duty_percent_amount = models.DecimalField(max_digits=10, decimal_places=2)
|
|
customs = models.DecimalField(max_digits=10, decimal_places=2)
|
|
finance_percent = models.DecimalField(max_digits=10, decimal_places=2)
|
|
finance_percent_amount = models.DecimalField(max_digits=10, decimal_places=2)
|
|
misc_costs = models.DecimalField(max_digits=10, decimal_places=2)
|
|
total_landed_cost = models.DecimalField(max_digits=10, decimal_places=2)
|
|
gross_sell_price = models.DecimalField(max_digits=10, decimal_places=2)
|
|
sale_discount_percent = models.DecimalField(max_digits=10, decimal_places=2)
|
|
net_sell_price = models.DecimalField(max_digits=10, decimal_places=2)
|
|
sale_discount_amount = models.DecimalField(max_digits=10, decimal_places=2)
|
|
gross_gp_prior_to_discount = models.DecimalField(max_digits=10, decimal_places=2)
|
|
net_gp_percent = models.DecimalField(max_digits=10, decimal_places=2)
|
|
net_gp_amount = models.DecimalField(max_digits=10, decimal_places=2)
|
|
gross_sell_price_each = models.DecimalField(max_digits=10, decimal_places=2)
|
|
net_sell_price_each = models.DecimalField(max_digits=10, decimal_places=2)
|
|
archived = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'costings'
|
|
|
|
|
|
|
|
|
|
class Currency(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
symbol = models.CharField(max_length=10, db_comment='Currency Symbol ($, Euro etc)')
|
|
iso4217 = models.CharField(max_length=3, db_comment='AUD, USD, etc')
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'currencies'
|
|
|
|
|
|
class CustomerCategory(models.Model):
|
|
name = models.CharField(max_length=255, db_comment='Name of the Category')
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'customer_categories'
|
|
|
|
|
|
|
|
|
|
class DocPage(models.Model):
|
|
page_number = models.IntegerField()
|
|
content = models.TextField()
|
|
document_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'doc_pages'
|
|
|
|
|
|
class DocumentAttachment(models.Model):
|
|
document_id = models.IntegerField()
|
|
attachment_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'document_attachments'
|
|
|
|
|
|
class Document(models.Model):
|
|
type = models.CharField(max_length=13)
|
|
created = models.DateTimeField()
|
|
user_id = models.IntegerField()
|
|
doc_page_count = models.IntegerField()
|
|
cmc_reference = models.CharField(max_length=255, db_comment='Either the Enquiry number, Invoice no, order ack. Convient place to store this to save on queries')
|
|
pdf_filename = models.CharField(max_length=255)
|
|
pdf_created_at = models.DateTimeField()
|
|
pdf_created_by_user_id = models.IntegerField()
|
|
shipping_details = models.TextField(blank=True, null=True)
|
|
revision = models.IntegerField()
|
|
bill_to = models.TextField(blank=True, null=True)
|
|
ship_to = models.TextField(blank=True, null=True)
|
|
email_sent_at = models.DateTimeField()
|
|
email_sent_by_user_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'documents'
|
|
|
|
|
|
class EmailAttachment(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
type = models.CharField(max_length=255)
|
|
size = models.IntegerField()
|
|
created = models.DateTimeField()
|
|
email_id = models.IntegerField()
|
|
filename = models.CharField(max_length=255)
|
|
is_message_body = models.IntegerField(db_comment='If this attachment is a the body of the email. Vault makes a guess, can be modified by the user')
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'email_attachments'
|
|
|
|
|
|
class EmailRecipient(models.Model):
|
|
email_id = models.IntegerField()
|
|
user_id = models.IntegerField()
|
|
type = models.CharField(max_length=2)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'email_recipients'
|
|
|
|
|
|
class Email(models.Model):
|
|
user_id = models.IntegerField(db_comment='From User ID')
|
|
udate = models.IntegerField()
|
|
created = models.DateTimeField()
|
|
subject = models.CharField(max_length=500)
|
|
email_attachment_count = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'emails'
|
|
|
|
|
|
class EmailsEnquiries(models.Model):
|
|
email_id = models.IntegerField()
|
|
enquiry_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'emails_enquiries'
|
|
|
|
|
|
class EmailsInvoices(models.Model):
|
|
invoice_id = models.IntegerField()
|
|
email_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'emails_invoices'
|
|
|
|
|
|
class EmailsJobs(models.Model):
|
|
email_id = models.IntegerField()
|
|
job_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'emails_jobs'
|
|
|
|
|
|
class EmailsPurchaseOrders(models.Model):
|
|
purchase_order_id = models.IntegerField()
|
|
email_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'emails_purchase_orders'
|
|
|
|
|
|
class Enquiry(models.Model):
|
|
created = models.DateTimeField()
|
|
submitted = models.DateField(blank=True, null=True)
|
|
title = models.CharField(max_length=255, db_comment='enquirynumber')
|
|
user_id = models.IntegerField()
|
|
customer_id = models.IntegerField()
|
|
contact_id = models.IntegerField()
|
|
contact_user_id = models.IntegerField()
|
|
state_id = models.IntegerField()
|
|
country_id = models.IntegerField()
|
|
principle_id = models.IntegerField()
|
|
status_id = models.IntegerField()
|
|
comments = models.TextField()
|
|
principle_code = models.IntegerField(db_comment='Numeric Principle Code')
|
|
gst = models.IntegerField(db_comment='GST applicable on this enquiry')
|
|
billing_address_id = models.IntegerField(blank=True, null=True)
|
|
shipping_address_id = models.IntegerField(blank=True, null=True)
|
|
posted = models.IntegerField(db_comment='has the enquired been posted')
|
|
email_count = models.IntegerField()
|
|
invoice_count = models.IntegerField()
|
|
job_count = models.IntegerField()
|
|
quote_count = models.IntegerField()
|
|
archived = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'enquiries'
|
|
|
|
|
|
|
|
class FreightForwarder(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'freight_forwarders'
|
|
|
|
|
|
class FreightService(models.Model):
|
|
freight_forwarder_id = models.IntegerField()
|
|
name = models.CharField(max_length=255)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'freight_services'
|
|
|
|
|
|
class Groups(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'groups'
|
|
|
|
|
|
class Industry(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
parent_id = models.IntegerField(blank=True, null=True)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'industries'
|
|
|
|
|
|
class IndustriesCustomers(models.Model):
|
|
customer_id = models.IntegerField()
|
|
industry_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'industries_customers'
|
|
|
|
|
|
class Invoice(models.Model):
|
|
id = models.AutoField(unique=True)
|
|
currency_id = models.IntegerField(blank=True, null=True)
|
|
created = models.DateTimeField()
|
|
issue_date = models.DateField()
|
|
due_date = models.DateField()
|
|
title = models.CharField(max_length=255, db_comment='CMC Invoice Number String')
|
|
paid = models.IntegerField(db_comment='PAID or UNPAID')
|
|
payment_received_date = models.DateField()
|
|
ship_via = models.CharField(max_length=255)
|
|
fob = models.CharField(max_length=255)
|
|
enquiry_id = models.IntegerField()
|
|
job_id = models.IntegerField()
|
|
user_id = models.IntegerField()
|
|
document_id = models.IntegerField(blank=True, null=True)
|
|
customer_id = models.IntegerField()
|
|
amount_invoiced = models.DecimalField(max_digits=10, decimal_places=2)
|
|
amount_received = models.DecimalField(max_digits=10, decimal_places=2)
|
|
comments = models.TextField(blank=True, null=True)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'invoices'
|
|
|
|
|
|
class JobProducts(models.Model):
|
|
quoted_product_id = models.IntegerField()
|
|
job_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'job_products'
|
|
|
|
|
|
class Job(models.Model):
|
|
created = models.DateTimeField()
|
|
deleted = models.IntegerField()
|
|
title = models.CharField(max_length=255, db_comment='Job Number')
|
|
state_id = models.IntegerField()
|
|
customer_id = models.IntegerField()
|
|
enquiry_id = models.IntegerField()
|
|
contact_id = models.IntegerField()
|
|
comments = models.TextField()
|
|
date_order_received = models.DateField()
|
|
date_scheduled_ex_works = models.DateField()
|
|
date_order_sent_to_customer = models.DateField()
|
|
customer_order_number = models.CharField(max_length=255)
|
|
all_sent = models.IntegerField()
|
|
all_paid = models.IntegerField()
|
|
job_status = models.CharField(max_length=50)
|
|
domestic_freight_paid_by = models.CharField(max_length=8, db_comment='CMC or Customer')
|
|
sale_category = models.IntegerField()
|
|
job_type = models.CharField(max_length=10)
|
|
shipment_category = models.IntegerField()
|
|
company_gross_sales_aud = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True, db_comment='COMPANY TOTAL GROSS SALES PRIOR TO ANY CUST. DISCOUNT (excluding commissions) A$')
|
|
net_sales_aud = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True, db_comment='NET SALES AUSTRALIAN CUSTOMER A$')
|
|
gross_profit_aud = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
ato_exchange_rate = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True, db_comment='ATO Listed Exchange rate day of payment received')
|
|
gst = models.IntegerField()
|
|
currency_id = models.IntegerField()
|
|
gst_amount = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
gross_commisions = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
invoiced_amount_inc_gst = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
net_export_sales_aud = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
gross_profit_exports_aud = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
gp_percent = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
gross_australian_sales_foreign_currency = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
net_australian_sales_foreign_currency = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
gross_profit_value_australian_sales_foreign_currency = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
gross_export_sales_foreign_currency = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
net_export_sales_foreign_currency = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
gross_profit_value_after_discount_exports_foreign_currency = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
gross_commissions = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
net_commissions = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'jobs'
|
|
|
|
|
|
class JobsPurchaseOrders(models.Model):
|
|
job_id = models.IntegerField()
|
|
purchase_order_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'jobs_purchase_orders'
|
|
|
|
|
|
class Jobstatus(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'jobstatus'
|
|
|
|
|
|
class LineItem(models.Model):
|
|
item_number = models.DecimalField(max_digits=10, decimal_places=2)
|
|
option = models.IntegerField()
|
|
quantity = models.DecimalField(max_digits=10, decimal_places=2)
|
|
title = models.CharField(max_length=500)
|
|
description = models.TextField()
|
|
document_id = models.IntegerField()
|
|
product_id = models.IntegerField(blank=True, null=True)
|
|
has_text_prices = models.IntegerField()
|
|
has_price = models.IntegerField()
|
|
unit_price_string = models.CharField(max_length=255, blank=True, null=True)
|
|
gross_price_string = models.CharField(max_length=255, blank=True, null=True)
|
|
costing_id = models.IntegerField(blank=True, null=True)
|
|
gross_unit_price = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True, db_comment='Either fill this in or have a costing_id associated with this record')
|
|
net_unit_price = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
discount_percent = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
discount_amount_unit = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
discount_amount_total = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
gross_price = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
net_price = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'line_items'
|
|
|
|
|
|
class OrderAcknowledgement(models.Model):
|
|
created = models.DateTimeField()
|
|
modified = models.DateTimeField()
|
|
issue_date = models.DateField()
|
|
ship_via = models.CharField(max_length=255)
|
|
job_id = models.IntegerField()
|
|
fob = models.CharField(max_length=255)
|
|
estimated_delivery = models.CharField(max_length=255)
|
|
document_id = models.IntegerField()
|
|
enquiry_id = models.IntegerField()
|
|
currency_id = models.IntegerField()
|
|
signature_required = models.IntegerField(blank=True, null=True)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'order_acknowledgements'
|
|
|
|
|
|
class PackingList(models.Model):
|
|
id = models.AutoField(unique=True)
|
|
currency_id = models.IntegerField(blank=True, null=True)
|
|
created = models.DateTimeField()
|
|
issue_date = models.DateField()
|
|
due_date = models.DateField()
|
|
title = models.CharField(max_length=255, db_comment='CMC Invoice Number String')
|
|
paid = models.IntegerField(db_comment='PAID or UNPAID')
|
|
payment_received_date = models.DateField()
|
|
ship_via = models.CharField(max_length=255)
|
|
fob = models.CharField(max_length=255)
|
|
enquiry_id = models.IntegerField()
|
|
job_id = models.IntegerField()
|
|
user_id = models.IntegerField()
|
|
document_id = models.IntegerField(blank=True, null=True)
|
|
customer_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'packing_lists'
|
|
|
|
|
|
class Page(models.Model):
|
|
page_number = models.IntegerField()
|
|
contentpage = models.IntegerField(db_column='contentPage', db_comment='is this a page with HTML content? 0 or 1.') # Field name made lowercase.
|
|
content = models.TextField()
|
|
document_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'pages'
|
|
|
|
|
|
class PrincipleAddress(models.Model):
|
|
address = models.TextField(db_comment='street or unit number and street name')
|
|
city = models.CharField(max_length=255, db_comment='Suburb / City')
|
|
state = models.CharField(max_length=255, db_comment='State')
|
|
country_id = models.IntegerField(db_comment='Country foreign Key')
|
|
principle_id = models.IntegerField(db_comment='Customer foreign key')
|
|
type = models.CharField(max_length=255, db_comment='either bill / ship / both')
|
|
postcode = models.CharField(max_length=50)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'principle_addresses'
|
|
|
|
|
|
class PrincipleContact(models.Model):
|
|
principle_id = models.IntegerField()
|
|
first_name = models.CharField(max_length=255)
|
|
last_name = models.CharField(max_length=255)
|
|
job_title = models.CharField(max_length=255)
|
|
email = models.CharField(max_length=255)
|
|
phone = models.CharField(max_length=255)
|
|
fax = models.CharField(max_length=255)
|
|
notes = models.TextField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'principle_contacts'
|
|
|
|
|
|
class Principle(models.Model):
|
|
name = models.CharField(max_length=255, db_comment='Principle Name')
|
|
code = models.IntegerField(db_comment='Principle code')
|
|
address = models.TextField()
|
|
city = models.CharField(max_length=255)
|
|
state = models.CharField(max_length=255)
|
|
postcode = models.CharField(max_length=255)
|
|
country_id = models.IntegerField(db_comment='Country Foreign Key')
|
|
currency_id = models.IntegerField()
|
|
short_name = models.CharField(max_length=255)
|
|
url = models.CharField(max_length=300)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'principles'
|
|
|
|
|
|
class ProductAttachment(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
type = models.CharField(max_length=255)
|
|
size = models.IntegerField()
|
|
data = models.TextField()
|
|
created = models.DateTimeField()
|
|
product_id = models.IntegerField()
|
|
description = models.TextField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'product_attachments'
|
|
|
|
|
|
class ProductCategory(models.Model):
|
|
name = models.CharField(max_length=255, db_comment='short name for the category')
|
|
description = models.CharField(max_length=500, blank=True, null=True, db_comment='a longer description if needed')
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'product_categories'
|
|
|
|
|
|
class ProductOptions(models.Model):
|
|
id = models.IntegerField(primary_key=True)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'product_options'
|
|
|
|
|
|
class ProductOptionsCategories(models.Model):
|
|
product_id = models.IntegerField()
|
|
name = models.CharField(max_length=255)
|
|
location = models.IntegerField(db_comment='Its place in the model number. 1 starts from after the Model number of the Product. ie 120-A , A is in location 1.')
|
|
exclusive = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'product_options_categories'
|
|
|
|
|
|
class Product(models.Model):
|
|
principle_id = models.IntegerField(db_comment='Principle FK')
|
|
product_category_id = models.IntegerField()
|
|
title = models.CharField(max_length=255, db_comment='This must match the Title in the Excel Costing File')
|
|
description = models.TextField()
|
|
model_number = models.CharField(max_length=255, blank=True, null=True, db_comment='Part or model number principle uses to identify this product')
|
|
model_number_format = models.CharField(max_length=255, blank=True, null=True, db_comment='%1% - first item, %2% , second item etc ')
|
|
notes = models.TextField(blank=True, null=True, db_comment='Any notes about this product. Note displayed on quotes')
|
|
stock = models.IntegerField(db_comment='Stock or Ident')
|
|
item_code = models.CharField(max_length=255)
|
|
item_description = models.CharField(max_length=255)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'products'
|
|
|
|
|
|
class PurchaseOrder(models.Model):
|
|
issue_date = models.DateField()
|
|
dispatch_date = models.DateField()
|
|
date_arrived = models.DateField()
|
|
title = models.CharField(max_length=255, db_comment='CMC PONumber')
|
|
principle_id = models.IntegerField()
|
|
principle_reference = models.CharField(max_length=255)
|
|
document_id = models.IntegerField()
|
|
currency_id = models.IntegerField(blank=True, null=True)
|
|
ordered_from = models.TextField()
|
|
description = models.TextField()
|
|
dispatch_by = models.CharField(max_length=255)
|
|
deliver_to = models.TextField()
|
|
shipping_instructions = models.TextField()
|
|
jobs_text = models.CharField(max_length=512)
|
|
freight_forwarder_text = models.TextField()
|
|
parent_purchase_order_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'purchase_orders'
|
|
|
|
|
|
class QuotePages(models.Model):
|
|
page_number = models.IntegerField()
|
|
content = models.TextField()
|
|
quote_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'quote_pages'
|
|
|
|
class Quote(models.Model):
|
|
created = models.DateTimeField()
|
|
modified = models.DateTimeField()
|
|
enquiry_id = models.IntegerField()
|
|
currency_id = models.IntegerField()
|
|
revision = models.IntegerField(db_comment="limited at 5 digits. Really, you're not going to have more revisions of a single quote than that")
|
|
delivery_time = models.CharField(max_length=400, db_comment='estimated delivery time for quote')
|
|
delivery_time_frame = models.CharField(max_length=100)
|
|
payment_terms = models.CharField(max_length=400)
|
|
days_valid = models.IntegerField()
|
|
date_issued = models.DateField()
|
|
valid_until = models.DateField()
|
|
delivery_point = models.CharField(max_length=400)
|
|
exchange_rate = models.CharField(max_length=255)
|
|
customs_duty = models.CharField(max_length=255)
|
|
document_id = models.IntegerField()
|
|
commercial_comments = models.TextField(blank=True, null=True)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'quotes'
|
|
|
|
|
|
class ShipmentCategories(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'shipment_categories'
|
|
db_table_comment = 'despite the name. This is for jobs. Specs changed, again'
|
|
|
|
|
|
class ShipmentInvoices(models.Model):
|
|
created = models.DateTimeField()
|
|
modified = models.DateTimeField()
|
|
shipment_id = models.IntegerField()
|
|
principle_id = models.IntegerField(blank=True, null=True)
|
|
currency_id = models.IntegerField()
|
|
freight_forwarder_id = models.IntegerField(blank=True, null=True)
|
|
date_issued = models.DateField()
|
|
invoice_number = models.CharField(max_length=255, blank=True, null=True)
|
|
invoice_amount = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
gst_amount = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
deferred_gst = models.IntegerField(blank=True, null=True)
|
|
deferred_gst_amount = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
|
|
approved = models.IntegerField()
|
|
paid = models.IntegerField()
|
|
date_paid = models.DateField(blank=True, null=True)
|
|
invoice_type = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'shipment_invoices'
|
|
|
|
|
|
class Shipments(models.Model):
|
|
box_count = models.IntegerField()
|
|
shipment_invoice_count = models.IntegerField()
|
|
freight_forwarder_id = models.IntegerField(blank=True, null=True)
|
|
freight_service_id = models.IntegerField(blank=True, null=True)
|
|
address_id = models.IntegerField(blank=True, null=True)
|
|
customer_id = models.IntegerField(blank=True, null=True)
|
|
user_id = models.IntegerField(db_comment='the user adding the shipment')
|
|
type = models.IntegerField()
|
|
created = models.DateTimeField()
|
|
date_arrived = models.DateField(blank=True, null=True)
|
|
date_dispatched = models.DateField(blank=True, null=True)
|
|
airway_bill = models.CharField(max_length=255)
|
|
total_weight = models.DecimalField(max_digits=5, decimal_places=2)
|
|
comments = models.TextField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'shipments'
|
|
|
|
|
|
class ShipmentsJobs(models.Model):
|
|
shipment_id = models.IntegerField()
|
|
job_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'shipments_jobs'
|
|
|
|
|
|
class ShipmentsPrinciples(models.Model):
|
|
shipment_id = models.IntegerField()
|
|
principle_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'shipments_principles'
|
|
|
|
|
|
class ShipmentsPurchaseOrders(models.Model):
|
|
shipment_id = models.IntegerField()
|
|
purchase_order_id = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'shipments_purchase_orders'
|
|
|
|
|
|
|
|
|
|
class Status(models.Model):
|
|
name = models.CharField(max_length=255)
|
|
class_field = models.CharField(db_column='class', max_length=50) # Field renamed because it was a Python reserved word.
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'statuses'
|
|
|
|
|
|
class Users(models.Model):
|
|
principle_id = models.IntegerField()
|
|
customer_id = models.IntegerField()
|
|
type = models.CharField(max_length=9)
|
|
access_level = models.CharField(max_length=7)
|
|
username = models.CharField(max_length=50)
|
|
password = models.CharField(max_length=60)
|
|
first_name = models.CharField(max_length=255)
|
|
last_name = models.CharField(max_length=255)
|
|
email = models.CharField(max_length=255)
|
|
job_title = models.CharField(max_length=255)
|
|
phone = models.CharField(max_length=255)
|
|
mobile = models.CharField(max_length=255)
|
|
fax = models.CharField(max_length=255)
|
|
phone_extension = models.CharField(max_length=255)
|
|
direct_phone = models.CharField(max_length=255)
|
|
notes = models.TextField()
|
|
by_vault = models.IntegerField(db_comment='Added by Vault. May or may not be a real person.')
|
|
blacklisted = models.IntegerField(db_comment='Disregard emails from this address in future.')
|
|
enabled = models.IntegerField()
|
|
archived = models.IntegerField(blank=True, null=True)
|
|
primary_contact = models.IntegerField()
|
|
|
|
class Meta:
|
|
managed = False
|
|
db_table = 'users'
|