added sales person property into create new client

This commit is contained in:
Daniel Herrero 2017-11-21 14:53:09 +01:00
parent cf4c208eea
commit e7d19da8f5
3 changed files with 14 additions and 6 deletions

View File

@ -20,13 +20,20 @@
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Email" field="$ctrl.client.email" info="You can save multiple emails by chaining them using comma without spaces, example: user@domain.com,user2@domain.com the first email will be considered as the main"></vn-textfield>
<vn-one></vn-one>
<vn-autocomplete vn-one
field="$ctrl.client.salesPersonFk"
url="/client/api/Clients/activeSalesPerson"
show-field="name"
value-field="id"
select-fields="surname"
label="Salesperson"
filter-search="{where: {or: [{name: {regexp: 'search'}}, {surname: {regexp: 'search'}}]}}"
></vn-autocomplete>
</vn-horizontal>
</vn-vertical>
</vn-card>
<vn-button-bar>
<vn-submit label="Create and edit"></vn-submit>
<vn-button label="Create" ng-click="watcher.submitBack()"></vn-button>
<vn-submit label="Create"></vn-submit>
</vn-button-bar>
</div>
</form>

View File

@ -38,7 +38,8 @@ module.exports = function(Client) {
fi: data.fi,
socialName: data.socialName,
id: account.id,
email: data.email
email: data.email,
salesPersonFk: data.salesPersonFk
};
Client.create(client, {transaction}, (error, newClient) => {