# 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.
import string
from oasis.lib import managers
from zibanu.django.db import models


class TypeClient(models.Model):
    # Set default db
    use_db = "oasis"
    # Set default manager
    objects = managers.TypeClient()
    # Fields list
    companyid = models.IntegerField(primary_key=True)
    typeclientid = models.CharField(max_length=1)
    typeclientname = models.CharField(max_length=100, blank=True, null=True)
    taxentity = models.IntegerField(blank=True, null=True)
    typedocumentid = models.CharField(max_length=2, blank=True, null=True)
    updated = models.DateField(blank=True, null=True)
    updatedby = models.IntegerField(blank=True, null=True)
    typeclient = models.CharField(max_length=1, blank=True, null=True)
    typeexternal = models.CharField(max_length=10, blank=True, null=True)
    typeclient1 = models.CharField(max_length=1, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'typeclient'
        unique_together = (('companyid', 'typeclientid'),)


class Classification(models.Model):
    # Set default database
    use_db = "oasis"
    # Set fields
    companyid = models.IntegerField(primary_key=True)
    classificationid = models.BigIntegerField()
    classificationname = models.CharField(max_length=100, blank=True, null=True)
    level = models.IntegerField(blank=True, null=True)
    parent = models.BigIntegerField(blank=True, null=True)
    taxtypeid = models.IntegerField(blank=True, null=True)
    groupid = models.IntegerField(blank=True, null=True)
    tax = models.BooleanField(blank=True, null=True)
    taxpercentage = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    taxcapitalized = models.BooleanField(blank=True, null=True)
    depreciation = models.CharField(max_length=2, blank=True, null=True)
    minimum = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    maximum = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    lifespan = models.IntegerField(blank=True, null=True)
    locationid = models.IntegerField(blank=True, null=True)
    rent = models.IntegerField(blank=True, null=True)
    businessid = models.IntegerField(blank=True, null=True)
    impute = models.BooleanField(blank=True, null=True)
    accountdevolution = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    budget = models.BooleanField(blank=True, null=True)
    budgetquantity = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    budgetvalue = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    positiontariff = models.CharField(max_length=20, blank=True, null=True)
    bonus = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    bonus1 = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    bonus2 = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    prefix = models.CharField(max_length=1, blank=True, null=True)
    inventory = models.CharField(max_length=1, blank=True, null=True)
    blight = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    blightcost = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    adjustmentcostvalue = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    manpower = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    indirect = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    changeprice = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    expenseobjectid = models.IntegerField(blank=True, null=True)
    costcenterid = models.IntegerField(blank=True, null=True)
    oldcode = models.CharField(max_length=20, blank=True, null=True)
    adjustmentcost = models.CharField(max_length=1, blank=True, null=True)
    guarantee = models.IntegerField(blank=True, null=True)
    guaranteevalue = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    grouporder = models.IntegerField(blank=True, null=True)
    typeasset = models.CharField(max_length=2, blank=True, null=True)
    costmethod = models.CharField(max_length=1, blank=True, null=True)
    updated = models.DateField(blank=True, null=True)
    finite = models.BooleanField(blank=True, null=True)
    depreciate = models.BooleanField(blank=True, null=True)
    expiration = models.IntegerField(blank=True, null=True)
    type = models.CharField(max_length=1, blank=True, null=True)
    ambulatory = models.BooleanField(blank=True, null=True)
    hospitable = models.BooleanField(blank=True, null=True)
    mobile = models.BooleanField(blank=True, null=True)
    domicile = models.BooleanField(blank=True, null=True)
    other = models.BooleanField(blank=True, null=True)
    gender = models.CharField(max_length=1, blank=True, null=True)
    groupageid = models.IntegerField(blank=True, null=True)
    cr = models.BooleanField(blank=True, null=True)
    ir = models.BooleanField(blank=True, null=True)
    low = models.BooleanField(blank=True, null=True)
    medium = models.BooleanField(blank=True, null=True)
    high = models.BooleanField(blank=True, null=True)
    factor = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    recuperation = models.BooleanField(blank=True, null=True)
    pyp = models.BooleanField(blank=True, null=True)
    urgency = models.BooleanField(blank=True, null=True)
    updatedby = models.IntegerField(blank=True, null=True)
    flatratecost = models.BooleanField(blank=True, null=True)
    judgment = models.IntegerField(blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'classification'
        unique_together = (('companyid', 'classificationid'),)


class GeographicLocation(models.Model):
    """
    Model representation of Geographic location table
    Database: OASIS4
    Table: Geographiclocation
    """
    # Set default db
    use_db = "oasis"
    # Set default manager
    objects = managers.GeographicLocation()
    # Set fields
    companyid = models.IntegerField(primary_key=True)
    geographiclocationid = models.IntegerField()
    geographiclocationname = models.CharField(max_length=100, blank=True, null=True)
    parent = models.IntegerField(blank=True, null=True)
    locationid = models.IntegerField(blank=True, null=True)
    population = models.IntegerField(blank=True, null=True)
    countryid = models.IntegerField(blank=True, null=True)
    type = models.CharField(max_length=1, blank=True, null=True)
    exempt = models.BooleanField(blank=True, null=True)
    alternatecode = models.IntegerField(blank=True, null=True)
    groupid = models.IntegerField(blank=True, null=True)
    iatacode = models.CharField(max_length=3, blank=True, null=True)
    clientid = models.BigIntegerField(blank=True, null=True)
    updated = models.DateField(blank=True, null=True)
    typeupc = models.CharField(max_length=30, blank=True, null=True)
    updatedby = models.IntegerField(blank=True, null=True)
    phonecode = models.CharField(max_length=10, blank=True, null=True)
    latitude = models.CharField(max_length=30, blank=True, null=True)
    longitude = models.CharField(max_length=30, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'geographiclocation'
        unique_together = (('companyid', 'geographiclocationid'),)


class Client(models.Model):
    """
    Model representation of Client table
    Database: OASIS4
    Table: Client
    """
    # Set default manager
    objects = managers.Client()
    # Set default db
    use_db = "oasis"
    # Set fields
    companyid = models.OneToOneField('GeographicLocation', models.DO_NOTHING, db_column='companyid', primary_key=True,
                                     related_name="clients")
    clientid = models.BigIntegerField()
    clientname = models.CharField(max_length=100, blank=True, null=True)
    clienttype = models.CharField(max_length=1, blank=True, null=True)
    clientcode = models.CharField(max_length=20, blank=True, null=True)
    national = models.BooleanField(blank=True, null=True)
    representative = models.CharField(max_length=100, blank=True, null=True)
    address = models.CharField(max_length=100, blank=True, null=True)
    phone = models.CharField(max_length=30, blank=True, null=True)
    celphone = models.CharField(max_length=30, blank=True, null=True)
    fax = models.CharField(max_length=30, blank=True, null=True)
    zipcode = models.CharField(max_length=20, blank=True, null=True)
    email = models.CharField(max_length=200, blank=True, null=True)
    geographiclocationid = models.IntegerField(db_column='geographiclocationid', blank=True, null=True)
    checkdigit = models.IntegerField(blank=True, null=True)
    groupid = models.IntegerField(blank=True, null=True)
    vendorid = models.BigIntegerField(blank=True, null=True)
    locationid = models.IntegerField(blank=True, null=True)
    discount = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    conditionpaymentid = models.IntegerField(blank=True, null=True)
    pricetypeid = models.IntegerField(blank=True, null=True)
    tax = models.BooleanField(blank=True, null=True)
    client_class = models.CharField(db_column='class', max_length=1, blank=True,
                                    null=True)  # Field renamed because it was a Python reserved word.
    segmentid = models.IntegerField(blank=True, null=True)
    remissioninvoice = models.CharField(max_length=1, blank=True, null=True)
    deliverybill = models.CharField(max_length=1, blank=True, null=True)
    deliverybilldirectionid = models.IntegerField(blank=True, null=True)
    deliverystatement = models.CharField(max_length=1, blank=True, null=True)
    deliverystatementdirectionid = models.IntegerField(blank=True, null=True)
    customer = models.BooleanField(blank=True, null=True)
    taxtypeid = models.IntegerField(blank=True, null=True)
    userid = models.IntegerField(blank=True, null=True)
    alternatecode = models.CharField(max_length=15, blank=True, null=True)
    matrixid = models.BigIntegerField(blank=True, null=True)
    limit = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    lastpurchase = models.DateField(blank=True, null=True)
    specialityid = models.IntegerField(blank=True, null=True)
    programid = models.IntegerField(blank=True, null=True)
    purchasepaymentconditionid = models.IntegerField(blank=True, null=True)
    purchasediscount = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    taxprice = models.CharField(max_length=1, blank=True, null=True)
    supplier = models.BooleanField(blank=True, null=True)
    salescontact = models.CharField(max_length=100, blank=True, null=True)
    paymentcontact = models.CharField(max_length=100, blank=True, null=True)
    purchasecontact = models.CharField(max_length=100, blank=True, null=True)
    entrydate = models.DateField(blank=True, null=True)
    retirementdate = models.DateField(blank=True, null=True)
    paymentformid = models.IntegerField(blank=True, null=True)
    area = models.CharField(max_length=1, blank=True, null=True)
    bankaccount = models.CharField(max_length=20, blank=True, null=True)
    socialinsurance = models.CharField(max_length=20, blank=True, null=True)
    medicalinsurance = models.CharField(max_length=20, blank=True, null=True)
    turnid = models.IntegerField(blank=True, null=True)
    employee = models.BooleanField(blank=True, null=True)
    vendor = models.BooleanField(blank=True, null=True)
    shareholder = models.BooleanField(blank=True, null=True)
    partner = models.BooleanField(blank=True, null=True)
    state = models.CharField(max_length=1, blank=True, null=True)
    industrialactivity = models.IntegerField(blank=True, null=True)
    industrialtax = models.BooleanField(blank=True, null=True)
    retention = models.BooleanField(blank=True, null=True)
    deductibleretention = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    birthdate = models.DateField(blank=True, null=True)
    birthlocationid = models.IntegerField(blank=True, null=True)
    civilstatus = models.CharField(max_length=1, blank=True, null=True)
    education = models.CharField(max_length=1, blank=True, null=True)
    professionid = models.IntegerField(blank=True, null=True)
    currentcompany = models.CharField(max_length=40, blank=True, null=True)
    currentcompanycode = models.CharField(max_length=20, blank=True, null=True)
    ingress = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    entrycompanydate = models.DateField(blank=True, null=True)
    house = models.CharField(max_length=1, blank=True, null=True)
    housevalue = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    car = models.CharField(max_length=1, blank=True, null=True)
    carvalue = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    spouse = models.CharField(max_length=100, blank=True, null=True)
    spousecode = models.CharField(max_length=20, blank=True, null=True)
    child = models.IntegerField(blank=True, null=True)
    distributortax = models.CharField(max_length=1, blank=True, null=True)
    firstlastname = models.CharField(max_length=20, blank=True, null=True)
    secondlastname = models.CharField(max_length=30, blank=True, null=True)
    firstfirstname = models.CharField(max_length=20, blank=True, null=True)
    secondfirstname = models.CharField(max_length=30, blank=True, null=True)
    sex = models.CharField(max_length=1, blank=True, null=True)
    additionalupc = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    specialrate = models.DecimalField(max_digits=6, decimal_places=4, blank=True, null=True)
    beneficiaryid = models.BigIntegerField(blank=True, null=True)
    bankid = models.IntegerField(blank=True, null=True)
    governmental = models.BooleanField(blank=True, null=True)
    abbreviation = models.CharField(max_length=60, blank=True, null=True)
    bankaccounttype = models.CharField(max_length=1, blank=True, null=True)
    delaytolerance = models.IntegerField(blank=True, null=True)
    partialdispatch = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    partialdispatchproduct = models.BooleanField(blank=True, null=True)
    separation = models.CharField(max_length=1, blank=True, null=True)
    billing = models.CharField(max_length=1, blank=True, null=True)
    currencyid = models.IntegerField(blank=True, null=True)
    languageid = models.IntegerField(blank=True, null=True)
    zoneid = models.IntegerField(blank=True, null=True)
    tagid = models.IntegerField(blank=True, null=True)
    incoterms = models.CharField(max_length=3, blank=True, null=True)
    abc = models.CharField(max_length=1, blank=True, null=True)
    quotacollection = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    quotatype = models.CharField(max_length=1, blank=True, null=True)
    bond = models.CharField(max_length=1, blank=True, null=True)
    quotavalue = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    qualification = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    collectorid = models.BigIntegerField(blank=True, null=True)
    authorizedid = models.BigIntegerField(blank=True, null=True)
    conditiondirection = models.BooleanField(blank=True, null=True)
    channelid = models.IntegerField(blank=True, null=True)
    supervisorid = models.IntegerField(blank=True, null=True)
    priority = models.IntegerField(blank=True, null=True)
    promptpaymentid = models.IntegerField(blank=True, null=True)
    rotation = models.IntegerField(blank=True, null=True)
    dispatchminimun = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    plan = models.IntegerField(blank=True, null=True)
    creditdata = models.CharField(max_length=1, blank=True, null=True)
    declarant = models.BooleanField(blank=True, null=True)
    replication = models.CharField(max_length=30, blank=True, null=True)
    beneficiary = models.BooleanField(blank=True, null=True)
    contracttype = models.CharField(max_length=1, blank=True, null=True)
    contractdate = models.DateField(blank=True, null=True)
    frequent = models.BooleanField(blank=True, null=True)
    educationaldegree = models.CharField(max_length=2, blank=True, null=True)
    occupation = models.CharField(max_length=1, blank=True, null=True)
    occupied = models.CharField(max_length=1, blank=True, null=True)
    occupiedcode = models.IntegerField(blank=True, null=True)
    lastdate = models.DateField(blank=True, null=True)
    lastproduct = models.IntegerField(blank=True, null=True)
    lastlocation = models.IntegerField(blank=True, null=True)
    healthfee = models.IntegerField(blank=True, null=True)
    affiliate = models.BooleanField(blank=True, null=True)
    neighborhoodid = models.IntegerField(blank=True, null=True)
    oldentity = models.CharField(max_length=12, blank=True, null=True)
    asuranceaffiliationdate = models.DateField(blank=True, null=True)
    disability = models.CharField(max_length=1, blank=True, null=True)
    ethnicgroup = models.CharField(max_length=2, blank=True, null=True)
    totalpoints = models.IntegerField(blank=True, null=True)
    family = models.CharField(max_length=1, blank=True, null=True)
    sisbenfile = models.IntegerField(blank=True, null=True)
    sisbennucleus = models.IntegerField(blank=True, null=True)
    sisbennumber = models.IntegerField(blank=True, null=True)
    sisbendate = models.DateField(blank=True, null=True)
    sisbenlevel = models.IntegerField(blank=True, null=True)
    sisbenpoints = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    affiliatetype = models.CharField(max_length=1, blank=True, null=True)
    matrixclienttype = models.CharField(max_length=1, blank=True, null=True)
    populationgroup = models.CharField(max_length=2, blank=True, null=True)
    affiliatestatus = models.CharField(max_length=1, blank=True, null=True)
    locality = models.CharField(max_length=40, blank=True, null=True)
    zone = models.CharField(max_length=1, blank=True, null=True)
    highcost = models.BooleanField(blank=True, null=True)
    authorizationlevel = models.IntegerField(blank=True, null=True)
    credit = models.BooleanField(blank=True, null=True)
    documentlocationid = models.IntegerField(blank=True, null=True)
    retentionvalue = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    food = models.CharField(max_length=2, blank=True, null=True)
    foodprime = models.CharField(max_length=1, blank=True, null=True)
    foodprimeextra = models.CharField(max_length=1, blank=True, null=True)
    clock = models.BooleanField(blank=True, null=True)
    employeestate = models.CharField(max_length=1, blank=True, null=True)
    positionid = models.IntegerField(blank=True, null=True)
    height = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    weight = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    rh = models.CharField(max_length=3, blank=True, null=True)
    laborlocationid = models.IntegerField(blank=True, null=True)
    time = models.IntegerField(blank=True, null=True)
    paymentlocationid = models.IntegerField(blank=True, null=True)
    expeditiondocumentdate = models.DateField(blank=True, null=True)
    expirationdocumentdate = models.DateField(blank=True, null=True)
    expirationdocument = models.CharField(max_length=10, blank=True, null=True)
    expirationentity = models.CharField(max_length=1, blank=True, null=True)
    duplicateentity = models.CharField(max_length=10, blank=True, null=True)
    motive = models.CharField(max_length=3, blank=True, null=True)
    revised = models.DateField(blank=True, null=True)
    idunumber = models.CharField(max_length=15, blank=True, null=True)
    land = models.CharField(max_length=60, blank=True, null=True)
    farm = models.CharField(max_length=60, blank=True, null=True)
    ciiuid = models.IntegerField(blank=True, null=True)
    replydays = models.IntegerField(blank=True, null=True)
    voucherinitial = models.DateField(blank=True, null=True)
    voucherfinal = models.DateField(blank=True, null=True)
    vouchercomply = models.CharField(max_length=1, blank=True, null=True)
    fiscaldocument = models.CharField(max_length=3, blank=True, null=True)
    image = models.BinaryField(blank=True, null=True)
    individual = models.CharField(max_length=1, blank=True, null=True)
    paymentdays = models.IntegerField(blank=True, null=True)
    birthday = models.DateField(blank=True, null=True)
    marked = models.BooleanField(blank=True, null=True)
    voucher = models.CharField(max_length=3, blank=True, null=True)
    costcenterid = models.IntegerField(blank=True, null=True)
    coffeelimit = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    coffeelimitused = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    signature = models.BinaryField(blank=True, null=True)
    partnerstate = models.CharField(max_length=1, blank=True, null=True)
    updated = models.DateField(blank=True, null=True)
    typedocumentid = models.CharField(max_length=2, blank=True, null=True)
    headid = models.BigIntegerField(blank=True, null=True)
    kinshipid = models.IntegerField(blank=True, null=True)
    grouppopulationid = models.IntegerField(blank=True, null=True)
    condition = models.CharField(max_length=1, blank=True, null=True)
    affiliation = models.DateField(blank=True, null=True)
    consecutive = models.CharField(max_length=20, blank=True, null=True)
    stateaffiliate = models.CharField(max_length=2, blank=True, null=True)
    activationdate = models.DateField(blank=True, null=True)
    suspensiondate = models.DateField(blank=True, null=True)
    report = models.CharField(max_length=2, blank=True, null=True)
    neighborhood = models.CharField(max_length=30, blank=True, null=True)
    datereport = models.DateField(blank=True, null=True)
    translation = models.CharField(max_length=2, blank=True, null=True)
    epsidanterior = models.IntegerField(blank=True, null=True)
    epsidcross = models.IntegerField(blank=True, null=True)
    ingressvalidity = models.CharField(max_length=1, blank=True, null=True)
    registerduria = models.CharField(max_length=10, blank=True, null=True)
    epsidscross = models.IntegerField(blank=True, null=True)
    locationidcross = models.IntegerField(blank=True, null=True)
    resolution = models.CharField(max_length=20, blank=True, null=True)
    core = models.CharField(max_length=1, blank=True, null=True)
    home = models.CharField(max_length=2, blank=True, null=True)
    bdua = models.CharField(max_length=2, blank=True, null=True)
    locationidcross1 = models.IntegerField(blank=True, null=True)
    datepoll = models.DateField(blank=True, null=True)
    datechangestate = models.DateField(blank=True, null=True)
    type = models.CharField(max_length=1, blank=True, null=True)
    gloss = models.CharField(max_length=10, blank=True, null=True)
    statecross = models.CharField(max_length=2, blank=True, null=True)
    groupinadequate = models.BooleanField(blank=True, null=True)
    cellular = models.CharField(max_length=20, blank=True, null=True)
    cellular2 = models.CharField(max_length=20, blank=True, null=True)
    charingress = models.CharField(max_length=1, blank=True, null=True)
    evolution = models.IntegerField(blank=True, null=True)
    numberbirth = models.IntegerField(blank=True, null=True)
    coverdate = models.DateField(blank=True, null=True)
    validatebdua = models.BooleanField(blank=True, null=True)
    glossbdua = models.CharField(max_length=400, blank=True, null=True)
    statebdua = models.CharField(max_length=2, blank=True, null=True)
    criterionvalidate = models.IntegerField(blank=True, null=True)
    biometria = models.BooleanField(blank=True, null=True)
    groupageid = models.IntegerField(blank=True, null=True)
    upc = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    portability = models.BooleanField(blank=True, null=True)
    regimen = models.CharField(max_length=1, blank=True, null=True)
    levelemployery = models.IntegerField(blank=True, null=True)
    typeemployery = models.IntegerField(blank=True, null=True)
    sisbenmethodology = models.IntegerField(blank=True, null=True)
    alfanet = models.BigIntegerField(blank=True, null=True)
    geographiclocationidactual = models.IntegerField(blank=True, null=True)
    multiaffiliatecross = models.CharField(max_length=1, blank=True, null=True)
    kinshipemployery = models.CharField(max_length=2, blank=True, null=True)
    actuaphone = models.BooleanField(blank=True, null=True)
    actuaaddress = models.BooleanField(blank=True, null=True)
    statetenebit = models.CharField(max_length=1, blank=True, null=True)
    fum = models.DateField(blank=True, null=True)
    pertaintenebit = models.BooleanField(blank=True, null=True)
    numberidinform = models.IntegerField(blank=True, null=True)
    clientidant = models.BigIntegerField(blank=True, null=True)
    upcadditional = models.BooleanField(blank=True, null=True)
    initiationupcadditional = models.DateField(blank=True, null=True)
    employerid = models.BigIntegerField(blank=True, null=True)
    formpaymentid = models.IntegerField(blank=True, null=True)
    scene = models.IntegerField(blank=True, null=True)
    locationaccessid = models.IntegerField(blank=True, null=True)
    compromisetext = models.CharField(max_length=4000, blank=True, null=True)
    dispatchtext = models.CharField(max_length=4000, blank=True, null=True)
    processbiometric = models.IntegerField(blank=True, null=True)
    fingerright = models.IntegerField(blank=True, null=True)
    fingerprintr1 = models.BinaryField(blank=True, null=True)
    fingerprintr2 = models.BinaryField(blank=True, null=True)
    fingerleft = models.IntegerField(blank=True, null=True)
    fingerprintl1 = models.BinaryField(blank=True, null=True)
    fingerprintl2 = models.BinaryField(blank=True, null=True)
    imagedocument = models.BinaryField(blank=True, null=True)
    datebiometric = models.DateField(blank=True, null=True)
    typeprocessbiometric = models.IntegerField(blank=True, null=True)
    imagedocument1 = models.BinaryField(blank=True, null=True)
    institutional = models.BooleanField(blank=True, null=True)
    levelcontributory = models.IntegerField(blank=True, null=True)
    typecontributory = models.IntegerField(blank=True, null=True)
    typeeducationid = models.IntegerField(blank=True, null=True)
    epsid = models.BigIntegerField(blank=True, null=True)
    eps = models.BooleanField(blank=True, null=True)
    pension = models.BooleanField(blank=True, null=True)
    funeralsecure = models.BooleanField(blank=True, null=True)
    phonecompany = models.CharField(max_length=40, blank=True, null=True)
    egress = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    stratum = models.CharField(max_length=1, blank=True, null=True)
    assets = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    passives = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    patrimony = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    updatedby = models.IntegerField(blank=True, null=True)
    typemediaid = models.IntegerField(blank=True, null=True)
    projectid = models.IntegerField(blank=True, null=True)
    genreid = models.IntegerField(blank=True, null=True)
    automaticpayment = models.BooleanField(blank=True, null=True)
    associateentrydate = models.DateField(blank=True, null=True)
    associateretirementdate = models.DateField(blank=True, null=True)
    cardreference = models.CharField(max_length=30, blank=True, null=True)
    pep = models.BooleanField(blank=True, null=True)
    observation = models.CharField(max_length=4000, blank=True, null=True)
    risk = models.CharField(max_length=1, blank=True, null=True)
    typemedicineid = models.IntegerField(blank=True, null=True)
    commercialregistration = models.CharField(max_length=25, blank=True, null=True)
    contractor = models.BooleanField(blank=True, null=True)
    liquidatorbase = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    salary = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    typereference = models.CharField(max_length=5, blank=True, null=True)
    network = models.BooleanField(blank=True, null=True)
    isebill = models.BooleanField(blank=True, null=True)
    lastsale = models.DateField(blank=True, null=True)
    typecontactid = models.IntegerField(blank=True, null=True)
    habeasdata = models.BooleanField(blank=True, null=True)
    coffeefreight = models.CharField(max_length=1, blank=True, null=True)
    ean = models.BigIntegerField(blank=True, null=True)
    typeemployee = models.CharField(max_length=3, blank=True, null=True)
    formliquidationid = models.IntegerField(blank=True, null=True)
    timezone = models.CharField(max_length=30, blank=True, null=True)
    populationgroupmethodology = models.CharField(max_length=2, blank=True, null=True)
    subgroupsisbeniv = models.CharField(max_length=3, blank=True, null=True)
    dispersion = models.CharField(max_length=2, blank=True, null=True)
    solidaritycontribution = models.BooleanField(blank=True, null=True)

    @property
    def is_valid(self):
        return self._is_valid

    @is_valid.setter
    def is_valid(self, value: bool):
        self._is_valid = value

    @property
    def customer_type(self) -> int:
        """
        Property that represent a valid customer type
        :return:
        """
        return self._customer_type

    @customer_type.setter
    def customer_type(self, value: int):
        self._customer_type = value

    @property
    def first_name(self):
        first_name = self.firstfirstname.strip()
        if self.secondfirstname is not None:
            first_name += " " + self.secondfirstname.strip()
        return string.capwords(first_name)

    @property
    def last_name(self):
        last_name = self.firstlastname.strip()
        if self.secondlastname is not None:
            last_name = " " + self.secondlastname.strip().capitalize()
        return string.capwords(last_name)

    @property
    def location(self):
        try:
            qs_location = GeographicLocation.objects.get_by_pk(self.geographiclocationid)
            location = qs_location.first().geographiclocationname
        except Exception as exc:
            location = ""
        finally:
            return location

    class Meta:
        managed = False
        db_table = 'client'
        unique_together = (('companyid', 'clientid'),)


class Discount(models.Model):
    """
    Model representation of Discoun table
    Database: OASIS4
    Table: Discount
    """
    # Set default manager
    objects = managers.Discount()
    # Set default database
    use_db = "oasis"
    # Set fields
    companyid = models.IntegerField(primary_key=True)
    discountid = models.IntegerField()
    discountname = models.CharField(max_length=100, blank=True, null=True)
    typediscountid = models.IntegerField(blank=True, null=True)
    locationid = models.IntegerField(blank=True, null=True)
    geographiclocationid = models.IntegerField(blank=True, null=True)
    clientid = models.BigIntegerField(blank=True, null=True)
    directionid = models.IntegerField(blank=True, null=True)
    segmentid = models.IntegerField()
    abcclient = models.CharField(max_length=1)
    vendorid = models.BigIntegerField(blank=True, null=True)
    dateinitial = models.DateTimeField(blank=True, null=True)
    datefinal = models.DateTimeField(blank=True, null=True)
    typeapplies = models.CharField(max_length=1, blank=True, null=True)
    typepriceid = models.IntegerField(blank=True, null=True)
    currencyid = models.IntegerField(blank=True, null=True)
    exchangerate = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    businessid = models.IntegerField(blank=True, null=True)
    classificationid = models.IntegerField(blank=True, null=True)
    productid = models.BigIntegerField(blank=True, null=True)
    brandid = models.IntegerField(blank=True, null=True)
    lineid = models.IntegerField(blank=True, null=True)
    abcproduct = models.CharField(max_length=1)
    price = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    discountpercentage = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    expirationinitial = models.DateField(blank=True, null=True)
    expirationfinal = models.DateField(blank=True, null=True)
    value = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    bondpercentage = models.FloatField(blank=True, null=True)
    bondvalue = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    image = models.BinaryField(blank=True, null=True)
    format = models.IntegerField(blank=True, null=True)
    tariff = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    tariffsubstraction = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    cost = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    typecampaign = models.CharField(max_length=1, blank=True, null=True)
    state = models.CharField(max_length=1, blank=True, null=True)
    updated = models.DateField(blank=True, null=True)
    description = models.CharField(max_length=4000, blank=True, null=True)
    updatedby = models.IntegerField(blank=True, null=True)
    documentid = models.CharField(max_length=3, blank=True, null=True)
    numberid = models.IntegerField(blank=True, null=True)
    codeexternal = models.CharField(max_length=10, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'discount'
        unique_together = (('companyid', 'discountid'),)


class OasisProduct(models.Model):
    """
    Model representation of Product table
    Database: OASIS4
    """
    # Set default manager
    objects = managers.OasisProduct()
    # Set default database
    use_db = "oasis"
    # Set fields
    companyid = models.OneToOneField(Classification, models.DO_NOTHING, db_column='companyid', primary_key=True,
                                     related_name="company_products")
    productid = models.BigIntegerField()
    productname = models.CharField(max_length=1000, blank=True, null=True)
    classificationid = models.IntegerField(blank=True, null=True)
    service = models.BooleanField(blank=True, null=True)
    inventory = models.CharField(max_length=1, blank=True, null=True)
    price = models.CharField(max_length=1, blank=True, null=True)
    individual = models.BooleanField(blank=True, null=True)
    ingress = models.DateField(blank=True, null=True)
    discount = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    measureunitid = models.IntegerField(blank=True, null=True)
    taxtypeid = models.IntegerField(blank=True, null=True)
    groupid = models.IntegerField(blank=True, null=True)
    tax = models.BooleanField(blank=True, null=True)
    taxpercentage = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    unitalternate = models.IntegerField(blank=True, null=True)
    factorconversion = models.FloatField(blank=True, null=True)
    depreciation = models.CharField(max_length=2, blank=True, null=True)
    lifespan = models.IntegerField(blank=True, null=True)
    taxcapitalized = models.BooleanField(blank=True, null=True)
    substitute = models.BigIntegerField(blank=True, null=True)
    locationid = models.IntegerField(blank=True, null=True)
    localizationid = models.CharField(max_length=20, blank=True, null=True)
    clientid = models.BigIntegerField(blank=True, null=True)
    oldcode = models.CharField(max_length=100, blank=True, null=True)
    balance = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    inventoried = models.BooleanField(blank=True, null=True)
    random = models.BigIntegerField(blank=True, null=True)
    cycle = models.IntegerField(blank=True, null=True)
    characteristic = models.BooleanField(blank=True, null=True)
    characteristicid = models.IntegerField(blank=True, null=True)
    presentation = models.BooleanField(blank=True, null=True)
    presentationvalue = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    expiration = models.BooleanField(blank=True, null=True)
    control = models.BooleanField(blank=True, null=True)
    lot = models.BooleanField(blank=True, null=True)
    minimum = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    standard = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    maximum = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    dynamic = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    costproduction = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    averageactual = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    averageanterior = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    logo = models.IntegerField(blank=True, null=True)
    level = models.IntegerField(blank=True, null=True)
    abcnumber = models.IntegerField(blank=True, null=True)
    production = models.BooleanField(blank=True, null=True)
    state = models.CharField(max_length=1, blank=True, null=True)
    rent = models.IntegerField(blank=True, null=True)
    surtax = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    surtaxcapitalized = models.BooleanField(blank=True, null=True)
    taxica = models.IntegerField(blank=True, null=True)
    taxicap = models.IntegerField(blank=True, null=True)
    taxdistributor = models.BooleanField(blank=True, null=True)
    unitpurchase = models.IntegerField(blank=True, null=True)
    unitsale = models.IntegerField(blank=True, null=True)
    ean = models.BigIntegerField(blank=True, null=True)
    generic = models.BooleanField(blank=True, null=True)
    genericid = models.BigIntegerField(blank=True, null=True)
    colorid = models.IntegerField(blank=True, null=True)
    sizeid = models.IntegerField(blank=True, null=True)
    genreid = models.IntegerField(blank=True, null=True)
    materialid = models.IntegerField(blank=True, null=True)
    gammaid = models.IntegerField(blank=True, null=True)
    quality = models.BooleanField(blank=True, null=True)
    origin = models.CharField(max_length=1, blank=True, null=True)
    height = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    length = models.DecimalField(db_column="long", max_digits=19, decimal_places=4, blank=True, null=True)
    width = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    weight = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    volume = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    stock = models.BooleanField(blank=True, null=True)
    budget = models.BooleanField(blank=True, null=True)
    tolerancebudget = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    budgetorder = models.BooleanField(blank=True, null=True)
    planexportation = models.IntegerField(blank=True, null=True)
    positiontariff = models.CharField(max_length=20, blank=True, null=True)
    packing = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    box = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    businessid = models.IntegerField(blank=True, null=True)
    combo = models.BooleanField(blank=True, null=True)
    initials = models.CharField(max_length=50, blank=True, null=True)
    daysdose = models.IntegerField(blank=True, null=True)
    special = models.BooleanField(blank=True, null=True)
    checked = models.BooleanField(blank=True, null=True)
    pos = models.BooleanField(blank=True, null=True)
    recovery = models.BooleanField(blank=True, null=True)
    depth = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    designid = models.IntegerField(blank=True, null=True)
    brandid = models.IntegerField(blank=True, null=True)
    functionid = models.IntegerField(blank=True, null=True)
    collectionid = models.IntegerField(blank=True, null=True)
    codealternate = models.CharField(max_length=20, blank=True, null=True)
    lineid = models.IntegerField(blank=True, null=True)
    importation = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    materialraw = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    materialrawind = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    manpower = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    manpowerind = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    direct = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    indirect = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    sex = models.CharField(max_length=1, blank=True, null=True)
    ageinitial = models.IntegerField(blank=True, null=True)
    agefinal = models.IntegerField(blank=True, null=True)
    rangeage = models.CharField(max_length=1, blank=True, null=True)
    levelattention = models.IntegerField(blank=True, null=True)
    levelcomplexity = models.IntegerField(blank=True, null=True)
    gruousurgical = models.IntegerField(blank=True, null=True)
    type = models.CharField(max_length=3, blank=True, null=True)
    quantity = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    quantitymaximum = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    elaborated = models.BigIntegerField(blank=True, null=True)
    revised = models.BigIntegerField(blank=True, null=True)
    approved = models.BigIntegerField(blank=True, null=True)
    tokendate = models.DateField(blank=True, null=True)
    producname1 = models.CharField(max_length=100, blank=True, null=True)
    productiondate = models.DateField(blank=True, null=True)
    countryid = models.IntegerField(blank=True, null=True)
    costdate = models.DateField(blank=True, null=True)
    costproductiondate = models.DateField(blank=True, null=True)
    lastpurchase = models.DateField(blank=True, null=True)
    lastsupplier = models.BigIntegerField(blank=True, null=True)
    lastprice = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    coststandard = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    activityica = models.IntegerField(blank=True, null=True)
    eanchar = models.CharField(max_length=30, blank=True, null=True)
    tariffhealth = models.IntegerField(blank=True, null=True)
    finance = models.BooleanField(blank=True, null=True)
    abc = models.CharField(max_length=1, blank=True, null=True)
    capacity = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    localization2 = models.CharField(max_length=20, blank=True, null=True)
    descriptiontariff = models.CharField(max_length=50, blank=True, null=True)
    margin = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    additionalprice1 = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    additionalprice2 = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    taxvalue = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    marginminimum = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    marginmaximum = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    fund = models.IntegerField(blank=True, null=True)
    factor = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    sourceid = models.IntegerField(blank=True, null=True)
    entryid = models.BigIntegerField(blank=True, null=True)
    expenseobjectid = models.IntegerField(blank=True, null=True)
    returnable = models.BooleanField(blank=True, null=True)
    growth = models.IntegerField(blank=True, null=True)
    marked = models.BooleanField(blank=True, null=True)
    invimadate = models.DateField(blank=True, null=True)
    bpmdate = models.DateField(blank=True, null=True)
    namegeneric = models.CharField(max_length=100, blank=True, null=True)
    namecommercial = models.CharField(max_length=100, blank=True, null=True)
    field1 = models.CharField(max_length=10, blank=True, null=True)
    field2 = models.CharField(max_length=10, blank=True, null=True)
    field3 = models.CharField(max_length=10, blank=True, null=True)
    emission = models.DateField(blank=True, null=True)
    expirationdate = models.DateField(blank=True, null=True)
    interestrate = models.DateField(blank=True, null=True)
    periodicity = models.CharField(max_length=2, blank=True, null=True)
    lastcoupondate = models.DateField(blank=True, null=True)
    currencyid = models.IntegerField(blank=True, null=True)
    performance = models.CharField(max_length=1, blank=True, null=True)
    consignment = models.BooleanField(blank=True, null=True)
    serial = models.BooleanField(blank=True, null=True)
    requireean128 = models.BooleanField(blank=True, null=True)
    ean128 = models.CharField(max_length=128, blank=True, null=True)
    costcenterid = models.IntegerField(blank=True, null=True)
    projectid = models.IntegerField(blank=True, null=True)
    costcenterid1 = models.IntegerField(blank=True, null=True)
    seal = models.IntegerField(blank=True, null=True)
    bonus = models.BooleanField(blank=True, null=True)
    image = models.BinaryField(blank=True, null=True)
    updated = models.DateField(blank=True, null=True)
    valuenominal = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    class_field = models.CharField(db_column='class', max_length=1, blank=True,
                                   null=True)  # Field renamed because it was a Python reserved word.
    codeinvima = models.CharField(max_length=20, blank=True, null=True)
    partial = models.BooleanField(blank=True, null=True)
    groupsurgicalid = models.IntegerField(blank=True, null=True)
    copayment = models.BooleanField(blank=True, null=True)
    parturition = models.BooleanField(blank=True, null=True)
    highcost = models.IntegerField(blank=True, null=True)
    upc = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    grouppharmacologicalid = models.IntegerField(blank=True, null=True)
    principleactiveid = models.IntegerField(blank=True, null=True)
    formpharmaceuticalid = models.IntegerField(blank=True, null=True)
    concentrationid = models.IntegerField(blank=True, null=True)
    homologous = models.BooleanField(blank=True, null=True)
    concentration = models.CharField(max_length=100, blank=True, null=True)
    codehomologous = models.CharField(max_length=100, blank=True, null=True)
    cups = models.BooleanField(blank=True, null=True)
    levelauthorization = models.IntegerField(blank=True, null=True)
    classificationidalternate = models.BigIntegerField(blank=True, null=True)
    automatic = models.BooleanField(blank=True, null=True)
    quantitytime = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    nounification = models.BooleanField(blank=True, null=True)
    quantitymonth = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    quantityyear = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    valueminimum = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    valuemaximum = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    quotamoderator = models.BooleanField(blank=True, null=True)
    highcostcontrib = models.IntegerField(blank=True, null=True)
    capitated = models.BooleanField(blank=True, null=True)
    print = models.BooleanField(blank=True, null=True)
    atcpos = models.CharField(max_length=20, blank=True, null=True)
    typegeneric = models.CharField(max_length=20, blank=True, null=True)
    health = models.BooleanField(blank=True, null=True)
    description = models.CharField(max_length=4000, blank=True, null=True)
    updatedby = models.IntegerField(blank=True, null=True)
    codeium = models.CharField(max_length=30, blank=True, null=True)
    codeium1 = models.CharField(max_length=30, blank=True, null=True)
    codeium2 = models.CharField(max_length=30, blank=True, null=True)
    coldchain = models.BooleanField(blank=True, null=True)
    regulated = models.BooleanField(blank=True, null=True)
    valuerecovery = models.DecimalField(max_digits=19, decimal_places=4, blank=True, null=True)
    temperature = models.BooleanField(blank=True, null=True)
    judgment = models.IntegerField(blank=True, null=True)
    diagnostic = models.IntegerField(blank=True, null=True)
    retentionbyproduct = models.BooleanField(blank=True, null=True)
    coffeefreight = models.CharField(max_length=1, blank=True, null=True)
    combomodel = models.CharField(max_length=1, blank=True, null=True)
    productcurve = models.BooleanField(blank=True, null=True)
    coverid = models.IntegerField(blank=True, null=True)

    class Meta:
        managed = False
        db_table = "product"
        unique_together = (("companyid", "productid"),)
