2016-11-17 11:56:35 +00:00
|
|
|
{
|
2018-10-16 11:06:58 +00:00
|
|
|
"name": "Client",
|
2023-12-05 06:48:56 +00:00
|
|
|
"base": "VnModel",
|
|
|
|
"mixins": {
|
|
|
|
"Loggable": true
|
|
|
|
},
|
2018-10-16 11:06:58 +00:00
|
|
|
"options": {
|
|
|
|
"mysql": {
|
|
|
|
"table": "client"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"properties": {
|
|
|
|
"id": {
|
2022-05-12 07:47:47 +00:00
|
|
|
"type": "number",
|
2018-10-16 11:06:58 +00:00
|
|
|
"id": true,
|
|
|
|
"description": "Identifier"
|
|
|
|
},
|
|
|
|
"name": {
|
|
|
|
"type": "string",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
"fi": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "Fiscal indentifier"
|
|
|
|
},
|
|
|
|
"socialName": {
|
|
|
|
"type": "string",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
"contact": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"street": {
|
2019-02-28 07:55:34 +00:00
|
|
|
"type": "string",
|
|
|
|
"required": true
|
2018-10-16 11:06:58 +00:00
|
|
|
},
|
|
|
|
"city": {
|
2019-02-28 07:55:34 +00:00
|
|
|
"type": "string",
|
|
|
|
"required": true
|
2018-10-16 11:06:58 +00:00
|
|
|
},
|
|
|
|
"postcode": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"email": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"phone": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"mobile": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"isActive": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"credit": {
|
2022-05-12 07:47:47 +00:00
|
|
|
"type": "number"
|
2018-10-16 11:06:58 +00:00
|
|
|
},
|
|
|
|
"creditInsurance": {
|
2022-05-12 07:47:47 +00:00
|
|
|
"type": "number"
|
2018-10-16 11:06:58 +00:00
|
|
|
},
|
|
|
|
"iban": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"dueDay": {
|
2022-05-12 07:47:47 +00:00
|
|
|
"type": "number"
|
2018-10-16 11:06:58 +00:00
|
|
|
},
|
|
|
|
"isEqualizated": {
|
|
|
|
"type": "boolean",
|
|
|
|
"description": "The client has equalization tax"
|
|
|
|
},
|
|
|
|
"isFreezed": {
|
|
|
|
"type": "boolean",
|
|
|
|
"description": "The client frozen"
|
|
|
|
},
|
|
|
|
"hasToInvoiceByAddress": {
|
|
|
|
"type": "boolean",
|
|
|
|
"description": "The client has to be invoiced by address"
|
|
|
|
},
|
|
|
|
"hasToInvoice": {
|
|
|
|
"type": "boolean",
|
|
|
|
"description": "Global invoicing enabled for the client"
|
|
|
|
},
|
|
|
|
"isToBeMailed": {
|
|
|
|
"type": "boolean",
|
|
|
|
"description": "Send invoices by email"
|
|
|
|
},
|
|
|
|
"hasSepaVnl": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"hasLcr": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"hasCoreVnl": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"hasCoreVnh": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
2022-05-26 14:14:10 +00:00
|
|
|
"hasIncoterms": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
2018-10-16 11:06:58 +00:00
|
|
|
"isTaxDataChecked":{
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"eypbc": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"quality": {
|
2022-05-12 07:47:47 +00:00
|
|
|
"type": "number"
|
2018-10-16 11:06:58 +00:00
|
|
|
},
|
|
|
|
"isVies": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"isRelevant": {
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"accountingAccount": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"created": {
|
2022-05-16 08:19:43 +00:00
|
|
|
"type": "date"
|
2020-10-15 09:53:01 +00:00
|
|
|
},
|
|
|
|
"sageTaxTypeFk": {
|
|
|
|
"type": "number",
|
|
|
|
"mysql": {
|
|
|
|
"columnName": "taxTypeSageFk"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"sageTransactionTypeFk": {
|
|
|
|
"type": "number",
|
|
|
|
"mysql": {
|
|
|
|
"columnName": "transactionTypeSageFk"
|
|
|
|
}
|
2021-11-12 12:10:11 +00:00
|
|
|
},
|
|
|
|
"businessTypeFk": {
|
|
|
|
"type": "string",
|
|
|
|
"mysql": {
|
|
|
|
"columnName": "businessTypeFk"
|
2021-11-16 14:23:54 +00:00
|
|
|
}
|
2022-05-31 10:23:56 +00:00
|
|
|
},
|
|
|
|
"salesPersonFk": {
|
|
|
|
"type": "number"
|
2022-10-07 06:33:45 +00:00
|
|
|
},
|
2022-11-23 07:55:44 +00:00
|
|
|
"hasElectronicInvoice": {
|
2022-10-07 06:33:45 +00:00
|
|
|
"type": "boolean"
|
2023-04-11 12:57:56 +00:00
|
|
|
},
|
|
|
|
"rating": {
|
|
|
|
"type": "number"
|
|
|
|
},
|
|
|
|
"recommendedCredit": {
|
|
|
|
"type": "number"
|
2018-10-16 11:06:58 +00:00
|
|
|
}
|
2022-10-07 06:33:45 +00:00
|
|
|
|
2018-10-16 11:06:58 +00:00
|
|
|
},
|
|
|
|
"relations": {
|
|
|
|
"account": {
|
|
|
|
"type": "belongsTo",
|
2023-01-24 08:04:43 +00:00
|
|
|
"model": "VnUser",
|
2018-10-16 11:06:58 +00:00
|
|
|
"foreignKey": "id"
|
|
|
|
},
|
2023-03-10 12:29:11 +00:00
|
|
|
"user": {
|
|
|
|
"type": "belongsTo",
|
2023-05-02 05:28:59 +00:00
|
|
|
"model": "VnUser",
|
2023-03-10 12:29:11 +00:00
|
|
|
"foreignKey": "id"
|
|
|
|
},
|
2018-10-16 11:06:58 +00:00
|
|
|
"payMethod": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "PayMethod",
|
|
|
|
"foreignKey": "payMethodFk"
|
|
|
|
},
|
2020-07-09 09:45:38 +00:00
|
|
|
"salesPersonUser": {
|
|
|
|
"type": "belongsTo",
|
2023-01-24 08:04:43 +00:00
|
|
|
"model": "VnUser",
|
2020-07-09 09:45:38 +00:00
|
|
|
"foreignKey": "salesPersonFk"
|
|
|
|
},
|
2018-10-16 11:06:58 +00:00
|
|
|
"province": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "Province",
|
|
|
|
"foreignKey": "provinceFk"
|
|
|
|
},
|
|
|
|
"country": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "Country",
|
|
|
|
"foreignKey": "countryFk"
|
|
|
|
},
|
2023-07-14 09:30:13 +00:00
|
|
|
"isSocialNameUnique": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "Country",
|
|
|
|
"foreignKey": "countryFk"
|
|
|
|
},
|
2018-10-16 11:06:58 +00:00
|
|
|
"contactChannel": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "ContactChannel",
|
|
|
|
"foreignKey": "contactChannelFk"
|
|
|
|
},
|
|
|
|
"type": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "ClientType",
|
2024-02-20 12:10:03 +00:00
|
|
|
"foreignKey": "clientTypeFk__"
|
2018-10-16 11:06:58 +00:00
|
|
|
},
|
2021-06-29 08:51:01 +00:00
|
|
|
"businessType": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "BusinessType",
|
|
|
|
"foreignKey": "businessTypeFk"
|
|
|
|
},
|
2018-10-16 11:06:58 +00:00
|
|
|
"addresses": {
|
|
|
|
"type": "hasMany",
|
|
|
|
"model": "Address",
|
|
|
|
"foreignKey": "clientFk"
|
|
|
|
},
|
|
|
|
"greuge": {
|
|
|
|
"type": "hasMany",
|
|
|
|
"model": "Greuge",
|
|
|
|
"foreignKey": "clientFk"
|
|
|
|
},
|
|
|
|
"classifications": {
|
|
|
|
"type": "hasMany",
|
|
|
|
"model": "CreditClassification",
|
|
|
|
"foreignKey": "client"
|
|
|
|
},
|
2019-02-06 13:56:36 +00:00
|
|
|
"defaultAddress": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "Address",
|
|
|
|
"foreignKey": "defaultAddressFk"
|
|
|
|
},
|
2018-10-16 11:06:58 +00:00
|
|
|
"contacts": {
|
|
|
|
"type": "hasMany",
|
|
|
|
"model": "ClientContact",
|
|
|
|
"foreignKey": "clientFk"
|
|
|
|
},
|
|
|
|
"bank": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "BankEntity",
|
|
|
|
"foreignKey": "bankEntityFk"
|
2018-10-16 11:32:58 +00:00
|
|
|
},
|
2019-02-06 15:37:59 +00:00
|
|
|
"defaulters": {
|
|
|
|
"type": "hasMany",
|
|
|
|
"model": "Defaulter",
|
|
|
|
"foreignKey": "clientFk"
|
|
|
|
},
|
|
|
|
"clientRisks": {
|
|
|
|
"type": "hasMany",
|
|
|
|
"model": "ClientRisk",
|
|
|
|
"foreignKey": "clientFk"
|
|
|
|
},
|
|
|
|
"claimsRatio": {
|
2019-07-02 10:12:15 +00:00
|
|
|
"type": "hasOne",
|
2019-02-06 15:37:59 +00:00
|
|
|
"model": "ClaimRatio",
|
|
|
|
"foreignKey": "clientFk"
|
2020-10-15 09:53:01 +00:00
|
|
|
},
|
|
|
|
"transferor": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "Client",
|
|
|
|
"foreignKey": "transferorFk"
|
2022-03-07 12:25:55 +00:00
|
|
|
},
|
|
|
|
"supplier": {
|
|
|
|
"type": "belongsTo",
|
|
|
|
"model": "Supplier",
|
|
|
|
"foreignKey": "fi",
|
|
|
|
"primaryKey": "nif"
|
|
|
|
}
|
2020-10-15 09:53:01 +00:00
|
|
|
},
|
|
|
|
"scopes": {
|
|
|
|
"isActive": {
|
|
|
|
"where": {
|
|
|
|
"isActive": {
|
|
|
|
"neq": false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-11 12:57:56 +00:00
|
|
|
}
|