425 lines
8.8 KiB
TypeScript
425 lines
8.8 KiB
TypeScript
import { TEntityQuery } from 'core/types/Entities/query';
|
|
import { currentDate } from 'client/tools/date';
|
|
|
|
const initialOptionsQuery: TEntityQuery[] = [
|
|
{
|
|
alias: 'selectSupplier',
|
|
entityName: 'account',
|
|
where: {
|
|
evo_account_type: 100000001,
|
|
statecode: 0,
|
|
evo_legal_form: 100000001,
|
|
},
|
|
fields: ['accountid', 'name', 'evo_fin_department_accountid'],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectSupplierCurrency',
|
|
entityName: 'transactioncurrency',
|
|
where: {
|
|
statecode: 0,
|
|
},
|
|
fields: ['transactioncurrencyid', 'isocurrencycode'],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectClientRisk',
|
|
entityName: 'evo_client_risk',
|
|
where: {
|
|
statecode: 0,
|
|
},
|
|
fields: ['statecode', 'evo_name', 'evo_client_riskid'],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectClientType',
|
|
entityName: 'evo_client_type',
|
|
where: {
|
|
statecode: 0,
|
|
},
|
|
fields: ['evo_name', 'evo_client_typeid'],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectDealer',
|
|
entityName: 'account',
|
|
where: {
|
|
evo_account_type: 100000001,
|
|
statecode: 0,
|
|
evo_legal_form: 100000001,
|
|
},
|
|
fields: ['accountid', 'name'],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectGPSBrand',
|
|
entityName: 'evo_gps_brand',
|
|
where: {
|
|
statecode: 0,
|
|
},
|
|
fields: ['evo_gps_brandid', 'evo_name'],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectRegionRegistration',
|
|
entityName: 'evo_region',
|
|
where: {
|
|
statecode: 0,
|
|
},
|
|
fields: ['evo_name', 'evo_regionid'],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
|
|
{
|
|
alias: 'selectAccount',
|
|
entityName: 'account',
|
|
where: {
|
|
evo_account_type: 100000000,
|
|
statecode: 0,
|
|
},
|
|
fields: ['accountid', 'name', 'evo_client_riskid'],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectBrand',
|
|
entityName: 'evo_brand',
|
|
where: {
|
|
statecode: 0,
|
|
},
|
|
fields: [
|
|
'evo_name',
|
|
'evo_brandid',
|
|
'evo_importer_reward_perc',
|
|
'evo_importer_reward_rub',
|
|
],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectProduct',
|
|
entityName: 'evo_baseproduct',
|
|
where: {
|
|
evo_relation: 100000000,
|
|
statecode: 0,
|
|
},
|
|
whereCmp: {
|
|
evo_datefrom_param: {
|
|
lte: currentDate,
|
|
},
|
|
evo_dateto_param: {
|
|
gte: currentDate,
|
|
},
|
|
},
|
|
fields: ['evo_name', 'evo_baseproductid', 'evo_id'],
|
|
relatedEntities: [
|
|
{
|
|
entityName: 'evo_leasingobject_type',
|
|
fields: ['evo_name', 'evo_leasingobject_typeid', 'evo_id'],
|
|
many: true,
|
|
},
|
|
{
|
|
entityName: 'evo_brand',
|
|
fields: ['evo_brandid', 'evo_name'],
|
|
many: true,
|
|
},
|
|
],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectRegistration',
|
|
entityName: 'evo_addproduct_type',
|
|
where: {
|
|
statecode: 0,
|
|
evo_product_type: 100000001,
|
|
},
|
|
whereCmp: {
|
|
evo_datefrom_param: {
|
|
lte: currentDate,
|
|
},
|
|
evo_dateto_param: {
|
|
gte: currentDate,
|
|
},
|
|
},
|
|
fields: [
|
|
'evo_id',
|
|
'evo_name',
|
|
'evo_addproduct_typeid',
|
|
'evo_accountid',
|
|
'evo_graph_price_withoutnds',
|
|
'evo_cost_service_provider_withoutnds',
|
|
'evo_retro_bonus_withoutnds',
|
|
'evo_prime_cost',
|
|
'evo_graph_price',
|
|
'evo_max_period',
|
|
'evo_min_period',
|
|
'evo_controls_program',
|
|
],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectInsNSIB',
|
|
entityName: 'evo_addproduct_type',
|
|
where: {
|
|
statecode: 0,
|
|
evo_product_type: 100000002,
|
|
},
|
|
whereCmp: {
|
|
evo_datefrom_param: {
|
|
lte: currentDate,
|
|
},
|
|
evo_dateto_param: {
|
|
gte: currentDate,
|
|
},
|
|
},
|
|
fields: [
|
|
'evo_id',
|
|
'evo_name',
|
|
'evo_addproduct_typeid',
|
|
'evo_accountid',
|
|
'evo_graph_price_withoutnds',
|
|
'evo_cost_service_provider_withoutnds',
|
|
'evo_retro_bonus_withoutnds',
|
|
'evo_prime_cost',
|
|
'evo_graph_price',
|
|
'evo_max_period',
|
|
'evo_min_period',
|
|
'evo_controls_program',
|
|
],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectTracker',
|
|
entityName: 'evo_addproduct_type',
|
|
where: {
|
|
statecode: 0,
|
|
evo_product_type: 100000003,
|
|
},
|
|
whereCmp: {
|
|
evo_datefrom_param: {
|
|
lte: currentDate,
|
|
},
|
|
evo_dateto_param: {
|
|
gte: currentDate,
|
|
},
|
|
},
|
|
fields: [
|
|
'evo_id',
|
|
'evo_name',
|
|
'evo_addproduct_typeid',
|
|
'evo_accountid',
|
|
'evo_graph_price_withoutnds',
|
|
'evo_cost_service_provider_withoutnds',
|
|
'evo_retro_bonus_withoutnds',
|
|
'evo_prime_cost',
|
|
'evo_graph_price',
|
|
'evo_max_period',
|
|
'evo_min_period',
|
|
'evo_controls_program',
|
|
],
|
|
relatedEntities: [
|
|
{
|
|
entityName: 'evo_planpayment',
|
|
fields: [
|
|
'evo_name',
|
|
'evo_cost_equipment_withoutnds',
|
|
'evo_cost_price_telematics_withoutnds',
|
|
'evo_cost_telematics_withoutnds',
|
|
],
|
|
many: true,
|
|
},
|
|
],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectTelematic',
|
|
entityName: 'evo_addproduct_type',
|
|
where: {
|
|
statecode: 0,
|
|
evo_product_type: 100000004,
|
|
},
|
|
whereCmp: {
|
|
evo_datefrom_param: {
|
|
lte: currentDate,
|
|
},
|
|
evo_dateto_param: {
|
|
gte: currentDate,
|
|
},
|
|
},
|
|
fields: [
|
|
'evo_id',
|
|
'evo_name',
|
|
'evo_addproduct_typeid',
|
|
'evo_accountid',
|
|
'evo_graph_price_withoutnds',
|
|
'evo_cost_service_provider_withoutnds',
|
|
'evo_retro_bonus_withoutnds',
|
|
'evo_prime_cost',
|
|
'evo_graph_price',
|
|
'evo_max_period',
|
|
'evo_min_period',
|
|
'evo_controls_program',
|
|
],
|
|
relatedEntities: [
|
|
{
|
|
entityName: 'evo_planpayment',
|
|
fields: [
|
|
'evo_name',
|
|
'evo_cost_equipment_withoutnds',
|
|
'evo_cost_price_telematics_withoutnds',
|
|
'evo_cost_telematics_withoutnds',
|
|
],
|
|
many: true,
|
|
},
|
|
],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectTechnicalCard',
|
|
entityName: 'evo_addproduct_type',
|
|
where: {
|
|
statecode: 0,
|
|
evo_product_type: 100000000,
|
|
},
|
|
whereCmp: {
|
|
evo_datefrom_param: {
|
|
lte: currentDate,
|
|
},
|
|
evo_dateto_param: {
|
|
gte: currentDate,
|
|
},
|
|
},
|
|
fields: [
|
|
'evo_id',
|
|
'evo_name',
|
|
'evo_addproduct_typeid',
|
|
'evo_accountid',
|
|
'evo_graph_price_withoutnds',
|
|
'evo_cost_service_provider_withoutnds',
|
|
'evo_retro_bonus_withoutnds',
|
|
'evo_prime_cost',
|
|
'evo_graph_price',
|
|
'evo_max_period',
|
|
'evo_min_period',
|
|
'evo_controls_program',
|
|
],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectTarif',
|
|
entityName: 'evo_tarif',
|
|
where: {
|
|
statecode: 0,
|
|
},
|
|
whereCmp: {
|
|
evo_datefrom_param: {
|
|
lte: currentDate,
|
|
},
|
|
evo_dateto_param: {
|
|
gte: currentDate,
|
|
},
|
|
},
|
|
fields: [
|
|
'evo_id',
|
|
'evo_name',
|
|
'evo_tarifid',
|
|
'evo_baseproductid',
|
|
'evo_irr',
|
|
'evo_max_irr',
|
|
'evo_min_profit',
|
|
'evo_min_irr',
|
|
'evo_irr_plan',
|
|
'evo_ins_type',
|
|
'evo_min_period',
|
|
'evo_max_period',
|
|
],
|
|
relatedEntities: [
|
|
{
|
|
entityName: 'evo_client_risk',
|
|
fields: ['evo_client_riskid', 'evo_name'],
|
|
many: true,
|
|
},
|
|
{
|
|
entityName: 'evo_client_type',
|
|
fields: ['evo_client_typeid', 'evo_name'],
|
|
many: true,
|
|
},
|
|
{
|
|
entityName: 'evo_leasingobject_type',
|
|
fields: ['evo_leasingobject_typeid', 'evo_name', 'evo_id'],
|
|
many: true,
|
|
},
|
|
],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectRate',
|
|
entityName: 'evo_rate',
|
|
where: {
|
|
statecode: 0,
|
|
},
|
|
//TODO:
|
|
// whereCmp: {
|
|
// evo_datefrom_param: {
|
|
// lte: currentDate,
|
|
// },
|
|
// evo_dateto_param: {
|
|
// gte: currentDate,
|
|
// },
|
|
// },
|
|
fields: [
|
|
'evo_id',
|
|
'evo_rateid',
|
|
'evo_name',
|
|
'evo_base_rate',
|
|
'evo_coeff_12_23',
|
|
'evo_coeff_24_35',
|
|
'evo_coeff_36_47',
|
|
'evo_coeff_7_11',
|
|
'evo_coeff_48_60',
|
|
],
|
|
relatedEntities: [
|
|
{
|
|
entityName: 'evo_tarif',
|
|
fields: ['evo_tarifid', 'evo_name'],
|
|
many: true,
|
|
},
|
|
],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
{
|
|
alias: 'selectLeaseObjectType',
|
|
entityName: 'evo_leasingobject_type',
|
|
where: { statecode: 0 },
|
|
fields: [
|
|
'evo_name',
|
|
'evo_id',
|
|
'evo_leasingobject_typeid',
|
|
'evo_depreciation_rate1',
|
|
'evo_depreciation_rate2',
|
|
'evo_expluatation_period1',
|
|
'evo_expluatation_period2',
|
|
'evo_type_code',
|
|
],
|
|
many: true,
|
|
toOption: true,
|
|
},
|
|
];
|
|
|
|
export default initialOptionsQuery;
|