model expense create and added into Item's basic data view

This commit is contained in:
Daniel Herrero 2018-01-17 14:28:06 +01:00
parent 78e5dd3109
commit c4ff568ec8
5 changed files with 121 additions and 47 deletions

View File

@ -34,16 +34,71 @@
"description": "Basic data",
"icon": "folder"
}
}, {
"url" : "/image",
"state": "item.card.image",
"component": "vn-item-image",
},{
"url" : "/tags",
"state": "item.card.tags",
"component": "vn-item-tags",
"params": {
"item": "$ctrl.item"
},
"menu": {
"description": "Images",
"icon": "image"
"description": "Tags",
"icon": "folder"
}
},{
"url" : "/historic",
"state": "item.card.historic",
"component": "vn-item-historic",
"params": {
"item": "$ctrl.item"
},
"menu": {
"description": "Historic",
"icon": "folder"
}
},{
"url" : "/niche",
"state": "item.card.niche",
"component": "vn-item-niche",
"params": {
"item": "$ctrl.item"
},
"menu": {
"description": "Niche",
"icon": "folder"
}
},{
"url" : "/botanical",
"state": "item.card.botanical",
"component": "vn-item-botanical",
"params": {
"item": "$ctrl.item"
},
"menu": {
"description": "Botanical",
"icon": "folder"
}
},{
"url" : "/picture",
"state": "item.card.picture",
"component": "vn-item-picture",
"params": {
"item": "$ctrl.item"
},
"menu": {
"description": "Picture",
"icon": "folder"
}
}, {
"url" : "/barcode",
"state": "item.card.barcode",
"component": "vn-item-barcode",
"params": {
"item": "$ctrl.item"
},
"menu": {
"description": "Barcode",
"icon": "folder"
}
}
]

View File

@ -16,46 +16,32 @@
<vn-vertical pad-large>
<vn-title>Basic data</vn-title>
<vn-horizontal>
<vn-textfield vn-three label="Name" field="$ctrl.item.name" vn-focus></vn-textfield>
<vn-textfield vn-one label="Size" field="$ctrl.item.size"></vn-textfield>
<vn-textfield vn-one label="Stems" field="$ctrl.item.stems"></vn-textfield>
<vn-textfield vn-one label="Category" field="$ctrl.item.category"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Description" field="$ctrl.item.description"></vn-textfield>
<vn-autocomplete vn-one
url="/item/api/Intrastats"
label="Intrastat"
show-field="description"
value-field="id"
field="$ctrl.item.intrastatFk"
initial-data="$ctrl.item.intrastat"
order = "description DESC"
filter-search="{where: {description: {regexp: 'search'}}}"
>
<tpl-item>{{$parent.$parent.item.description}}</tpl-item>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Name" field="$ctrl.item.name" vn-focus></vn-textfield>
<vn-autocomplete vn-one
url="/item/api/ItemTypes"
label="Type"
show-field="name"
value-field="id"
field="$ctrl.item.typeFk"
initial-data="$ctrl.item.itemType"
>
</vn-autocomplete>
<vn-autocomplete vn-one
url="/item/api/Inks"
label="Ink"
show-field="name"
value-field="id"
field="$ctrl.item.inkFk"
initial-data="$ctrl.item.ink"
>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
url="/item/api/Intrastats"
label="Intrastat"
show-field="description"
value-field="id"
field="$ctrl.item.intrastatFk"
order="description ASC"
filter-search="{where: {description: {regexp: 'search'}} }"
>
<tpl-item>{{$parent.$parent.item.description}}</tpl-item>
</vn-autocomplete>
<vn-textfield vn-one label="Relevancy" field="$ctrl.item.relevancy" type="number"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
url="/item/api/Origins"
@ -63,17 +49,12 @@
show-field="name"
value-field="id"
field="$ctrl.item.originFk"
initial-data="$ctrl.item.origin"
>
</vn-autocomplete>
></vn-autocomplete>
<vn-autocomplete vn-one
url="/item/api/Producers"
label="Producer"
show-field="name"
value-field="id"
field="$ctrl.item.producer"
>
</vn-autocomplete>
url="/item/api/Expences"
label="Expence"
field="$ctrl.item.expenceFk"
></vn-autocomplete>
</vn-horizontal>
</vn-vertical>
</vn-card>

View File

@ -0,0 +1,30 @@
{
"name": "Expence",
"base": "VnModel",
"options": {
"mysql": {
"table": "expence",
"database": "vn"
}
},
"properties": {
"id": {
"id": true,
"type": "Number",
"description": "Identifier"
},
"name": {
"type": "String"
},
"isWithheld": {
"type": "Number"
}
},
"relations": {
"taxType": {
"type": "belongsTo",
"model": "TaxType",
"foreignKey": "taxTypeFk"
}
}
}

View File

@ -70,6 +70,11 @@
"type": "belongsTo",
"model": "Intrastat",
"foreignKey": "intrastatFk"
},
"expence": {
"type": "belongsTo",
"model": "Expence",
"foreignKey": "expenceFk"
}
}
}

View File

@ -51,6 +51,9 @@
"TaxType": {
"dataSource": "vn"
},
"Expence": {
"dataSource": "vn"
},
"Country": {
"dataSource": "salix"
}