Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/dev This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-05-16 14:07:42 +02:00
commit c7ad52f7b1
7 changed files with 24 additions and 14 deletions

View File

@ -10,11 +10,10 @@ class Controller {
} }
onSubmit() { onSubmit() {
if (this.aclService.hasAny(['salesAssistant'])) { this.$scope.watcher.submit().then(() => {
this.$scope.watcher.submit().then(() => { if (this.aclService.hasAny(['salesAssistant']))
this.$state.go('claim.card.detail'); this.$state.go('claim.card.detail');
}); });
}
} }
} }

View File

@ -4,7 +4,7 @@
filter="::$ctrl.filter" filter="::$ctrl.filter"
link="{clientFk: $ctrl.$stateParams.id}" link="{clientFk: $ctrl.$stateParams.id}"
limit="20" limit="20"
data="greuges" auto-load="false"> data="greuges" auto-load="true">
</vn-crud-model> </vn-crud-model>
<mg-ajax <mg-ajax
path="/client/api/greuges/{{$ctrl.$stateParams.id}}/sumAmount" path="/client/api/greuges/{{$ctrl.$stateParams.id}}/sumAmount"
@ -20,12 +20,12 @@
</div> </div>
</vn-horizontal> </vn-horizontal>
<vn-vertical> <vn-vertical>
<vn-table model="model"> <vn-table model="model" auto-load="false">
<vn-thead> <vn-thead>
<vn-tr> <vn-tr>
<vn-th field="shipped" default-order="DESC">Date</vn-th> <vn-th field="shipped" default-order="DESC">Date</vn-th>
<vn-th field="description">Comment</vn-th> <vn-th field="description">Comment</vn-th>
<vn-th field="amount">Amount</vn-th> <vn-th field="amount" >Amount</vn-th>
<vn-th field="greugeTypeFk">Type</vn-th> <vn-th field="greugeTypeFk">Type</vn-th>
</vn-tr> </vn-tr>
</vn-thead> </vn-thead>

View File

@ -6,12 +6,13 @@ class Controller {
this.filter = { this.filter = {
include: [ include: [
{ {
relation: "greugeType", relation: 'greugeType',
scope: { scope: {
fields: ["id", "name"] fields: ['id', 'name']
} }
} }
] ],
order: 'shipped DESC, amount'
}; };
} }
} }

View File

@ -31,7 +31,13 @@ module.exports = Self => {
if (!origin) if (!origin)
throw new UserError(`That item doesn't exists`); throw new UserError(`That item doesn't exists`);
origin.itemTag = undefined;
origin.description = undefined;
origin.image = undefined;
origin.comment = undefined;
const newItem = await Self.create(origin, options); const newItem = await Self.create(origin, options);
let promises = []; let promises = [];
await cloneTaxes(origin.id, newItem.id, promises, options); await cloneTaxes(origin.id, newItem.id, promises, options);

View File

@ -1,6 +1,6 @@
const app = require('vn-loopback/server/server'); const app = require('vn-loopback/server/server');
describe('item clone()', () => { fdescribe('item clone()', () => {
let nextItemId; let nextItemId;
beforeEach(async() => { beforeEach(async() => {
@ -17,6 +17,10 @@ describe('item clone()', () => {
let result = await app.models.Item.clone(itemFk); let result = await app.models.Item.clone(itemFk);
expect(result.id).toEqual(nextItemId); expect(result.id).toEqual(nextItemId);
expect(result.image).toBeUndefined();
expect(result.itemTag).toBeUndefined();
expect(result.comment).toBeUndefined();
expect(result.description).toBeUndefined();
}); });
it('should attempt to clone the given item but give an error as it doesnt exist', async() => { it('should attempt to clone the given item but give an error as it doesnt exist', async() => {

View File

@ -27,7 +27,7 @@ export default class Controller {
this.$http.get(`/api/TicketConfigs/findOne`).then(res => { this.$http.get(`/api/TicketConfigs/findOne`).then(res => {
if (res.data) { if (res.data) {
this.filter = { this.filter = {
scopeDays: res.data.scopeDays scopeDays: parseInt(res.data.scopeDays)
}; };
} }
}); });
@ -64,6 +64,7 @@ export default class Controller {
onSearch(params) { onSearch(params) {
if (params) { if (params) {
if (params.scopeDays) { if (params.scopeDays) {
params.scopeDays = parseInt(params.scopeDays);
this.scopeDays = params.scopeDays; this.scopeDays = params.scopeDays;
this.buildFilterDates(); this.buildFilterDates();
params = Object.assign(params, {from: this.today, to: this.daysOnward}); params = Object.assign(params, {from: this.today, to: this.daysOnward});

View File

@ -37,8 +37,7 @@
label="To" label="To"
model="filter.to"> model="filter.to">
</vn-date-picker> </vn-date-picker>
<vn-input-number <vn-input-number vn-one
vn-one
min="0" min="0"
step="1" step="1"
label="Days onward" label="Days onward"