added sales person property into create new client
This commit is contained in:
parent
cf4c208eea
commit
e7d19da8f5
|
@ -20,13 +20,20 @@
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<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-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-horizontal>
|
||||||
</vn-vertical>
|
</vn-vertical>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
<vn-button-bar>
|
<vn-button-bar>
|
||||||
<vn-submit label="Create and edit"></vn-submit>
|
<vn-submit label="Create"></vn-submit>
|
||||||
<vn-button label="Create" ng-click="watcher.submitBack()"></vn-button>
|
|
||||||
</vn-button-bar>
|
</vn-button-bar>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -29,9 +29,9 @@ module.exports = function(Client) {
|
||||||
&& instance.dueDay == ctx.data.dueDay)
|
&& instance.dueDay == ctx.data.dueDay)
|
||||||
ctx.data.dueDay = 5;
|
ctx.data.dueDay = 5;
|
||||||
|
|
||||||
if (instance.fi && ctx.data.equalizationTax && !canMarkEqualizationTax(instance)){
|
if (instance.fi && ctx.data.equalizationTax && !canMarkEqualizationTax(instance)) {
|
||||||
next(generateErrorEqualizationTax());
|
next(generateErrorEqualizationTax());
|
||||||
} else if (instance.equalizationTax !== undefined && instance.equalizationTax && ctx.data.fi && canMarkEqualizationTax(ctx.data)){
|
} else if (instance.equalizationTax !== undefined && instance.equalizationTax && ctx.data.fi && canMarkEqualizationTax(ctx.data)) {
|
||||||
next(generateErrorEqualizationTax());
|
next(generateErrorEqualizationTax());
|
||||||
} else {
|
} else {
|
||||||
next();
|
next();
|
||||||
|
|
|
@ -38,7 +38,8 @@ module.exports = function(Client) {
|
||||||
fi: data.fi,
|
fi: data.fi,
|
||||||
socialName: data.socialName,
|
socialName: data.socialName,
|
||||||
id: account.id,
|
id: account.id,
|
||||||
email: data.email
|
email: data.email,
|
||||||
|
salesPersonFk: data.salesPersonFk
|
||||||
};
|
};
|
||||||
|
|
||||||
Client.create(client, {transaction}, (error, newClient) => {
|
Client.create(client, {transaction}, (error, newClient) => {
|
||||||
|
|
Loading…
Reference in New Issue