Merge pull request '4223-claim_observations' (#1012) from 4223-claim_observations into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1012
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Carlos Jimenez Ruiz 2022-06-28 09:00:22 +00:00
commit f9dd4f19d0
23 changed files with 420 additions and 94 deletions

View File

@ -1,4 +1,6 @@
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId) INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES VALUES
('ClaimObservation','*','WRITE','ALLOW','ROLE','salesPerson'),
('ClaimObservation','*','READ','ALLOW','ROLE','salesPerson'),
('Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'), ('Client','setPassword','WRITE','ALLOW','ROLE','salesPerson'),
('Client','updateUser','WRITE','ALLOW','ROLE','salesPerson'); ('Client','updateUser','WRITE','ALLOW','ROLE','salesPerson');

View File

@ -0,0 +1,13 @@
CREATE TABLE `vn`.`claimObservation` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`claimFk` int(10) unsigned NOT NULL,
`workerFk` int(10) unsigned DEFAULT NULL,
`text` text COLLATE utf8_unicode_ci NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `worker_key` (`workerFk`),
KEY `claim_key` (`claimFk`),
KEY `claimObservation_created_IDX` (`created`) USING BTREE,
CONSTRAINT `claimObservation_ibfk_1` FOREIGN KEY (`claimFk`) REFERENCES `vn`.`claim` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `claimObservation_ibfk_2` FOREIGN KEY (`workerFk`) REFERENCES `vn`.`worker` (`id`) ON UPDATE CASCADE
) COMMENT='Todas las observaciones referentes a una reclamación'

View File

@ -0,0 +1,2 @@
INSERT INTO `vn`.`claimObservation` (`claimFk`, `text`, `created`)
SELECT `id`, `observation`, `created` FROM `vn`.`claim`

View File

@ -1729,12 +1729,19 @@ INSERT INTO `vn`.`claimState`(`id`, `code`, `description`, `roleFk`, `priority`,
( 6, 'mana', 'Mana', 1, 4, 0), ( 6, 'mana', 'Mana', 1, 4, 0),
( 7, 'lack', 'Faltas', 1, 2, 0); ( 7, 'lack', 'Faltas', 1, 2, 0);
INSERT INTO `vn`.`claim`(`id`, `ticketCreated`, `claimStateFk`, `observation`, `clientFk`, `workerFk`, `responsibility`, `isChargedToMana`, `created`, `packages`) INSERT INTO `vn`.`claim`(`id`, `ticketCreated`, `claimStateFk`, `clientFk`, `workerFk`, `responsibility`, `isChargedToMana`, `created`, `packages`)
VALUES VALUES
(1, util.VN_CURDATE(), 1, 'Cu nam labores lobortis definiebas, ei aliquyam salutatus persequeris quo, cum eu nemore fierent dissentiunt. Per vero dolor id, vide democritum scribentur eu vim, pri erroribus temporibus ex.', 1101, 18, 3, 0, util.VN_CURDATE(), 0), (1, util.VN_CURDATE(), 1, 1101, 18, 3, 0, util.VN_CURDATE(), 0),
(2, util.VN_CURDATE(), 2, 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.', 1101, 18, 3, 0, util.VN_CURDATE(), 1), (2, util.VN_CURDATE(), 2, 1101, 18, 3, 0, util.VN_CURDATE(), 1),
(3, util.VN_CURDATE(), 3, 'An vim commodo dolorem volutpat, cu expetendis voluptatum usu, et mutat consul adversarium his. His natum numquam legimus an, diam fabulas mei ut. Melius fabellas sadipscing vel id. Partem diceret mandamus mea ne, has te tempor nostrud. Aeque nostro eum no.', 1101, 18, 1, 1, util.VN_CURDATE(), 5), (3, util.VN_CURDATE(), 3, 1101, 18, 1, 1, util.VN_CURDATE(), 5),
(4, util.VN_CURDATE(), 3, 'Wisi forensibus mnesarchum in cum. Per id impetus abhorreant, his no magna definiebas, inani rationibus in quo. Ut vidisse dolores est, ut quis nominavi mel. Ad pri quod apeirian concludaturque.', 1104, 18, 5, 0, util.VN_CURDATE(), 10); (4, util.VN_CURDATE(), 3, 1104, 18, 5, 0, util.VN_CURDATE(), 10);
INSERT INTO `vn`.`claimObservation` (`claimFk`, `workerFk`, `text`, `created`)
VALUES
(1, 18, 'Cu nam labores lobortis definiebas, ei aliquyam salutatus persequeris quo, cum eu nemore fierent dissentiunt. Per vero dolor id, vide democritum scribentur eu vim, pri erroribus temporibus ex.', util.VN_CURDATE()),
(2, 18, 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.', util.VN_CURDATE()),
(3, 18, 'An vim commodo dolorem volutpat, cu expetendis voluptatum usu, et mutat consul adversarium his. His natum numquam legimus an, diam fabulas mei ut. Melius fabellas sadipscing vel id. Partem diceret mandamus mea ne, has te tempor nostrud. Aeque nostro eum no.', util.VN_CURDATE()),
(4, 18, 'Wisi forensibus mnesarchum in cum. Per id impetus abhorreant, his no magna definiebas, inani rationibus in quo. Ut vidisse dolores est, ut quis nominavi mel. Ad pri quod apeirian concludaturque.', util.VN_CURDATE());
INSERT INTO `vn`.`claimBeginning`(`id`, `claimFk`, `saleFk`, `quantity`) INSERT INTO `vn`.`claimBeginning`(`id`, `claimFk`, `saleFk`, `quantity`)
VALUES VALUES

View File

@ -730,7 +730,7 @@ export default {
claimSummary: { claimSummary: {
header: 'vn-claim-summary > vn-card > h5', header: 'vn-claim-summary > vn-card > h5',
state: 'vn-claim-summary vn-label-value[label="State"] > section > span', state: 'vn-claim-summary vn-label-value[label="State"] > section > span',
observation: 'vn-claim-summary vn-textarea[ng-model="$ctrl.summary.claim.observation"]', observation: 'vn-claim-summary vn-horizontal.text',
firstSaleItemId: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(5) vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(1) > span', firstSaleItemId: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(5) vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(1) > span',
firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img', firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img',
itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor', itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor',
@ -742,7 +742,6 @@ export default {
}, },
claimBasicData: { claimBasicData: {
claimState: 'vn-claim-basic-data vn-autocomplete[ng-model="$ctrl.claim.claimStateFk"]', claimState: 'vn-claim-basic-data vn-autocomplete[ng-model="$ctrl.claim.claimStateFk"]',
observation: 'vn-textarea[ng-model="$ctrl.claim.observation"]',
packages: 'vn-input-number[ng-model="$ctrl.claim.packages"]', packages: 'vn-input-number[ng-model="$ctrl.claim.packages"]',
hasToPickUpCheckbox: 'vn-claim-basic-data vn-check[ng-model="$ctrl.claim.hasToPickUp"]', hasToPickUpCheckbox: 'vn-claim-basic-data vn-check[ng-model="$ctrl.claim.hasToPickUp"]',
saveButton: `button[type=submit]` saveButton: `button[type=submit]`
@ -772,6 +771,12 @@ export default {
secondClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]', secondClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
saveDevelopmentButton: 'button[type=submit]' saveDevelopmentButton: 'button[type=submit]'
}, },
claimNote: {
addNoteFloatButton: 'vn-float-button',
note: 'vn-textarea[ng-model="$ctrl.note.text"]',
saveButton: 'button[type=submit]',
firstNoteText: 'vn-claim-note .text'
},
claimAction: { claimAction: {
importClaimButton: 'vn-claim-action vn-button[label="Import claim"]', importClaimButton: 'vn-claim-action vn-button[label="Import claim"]',
anyLine: 'vn-claim-action vn-tbody > vn-tr', anyLine: 'vn-claim-action vn-tbody > vn-tr',

View File

@ -22,8 +22,6 @@ describe('Claim edit basic data path', () => {
it(`should edit claim state and observation fields`, async() => { it(`should edit claim state and observation fields`, async() => {
await page.autocompleteSearch(selectors.claimBasicData.claimState, 'Gestionado'); await page.autocompleteSearch(selectors.claimBasicData.claimState, 'Gestionado');
await page.clearTextarea(selectors.claimBasicData.observation);
await page.write(selectors.claimBasicData.observation, 'edited observation');
await page.clearInput(selectors.claimBasicData.packages); await page.clearInput(selectors.claimBasicData.packages);
await page.write(selectors.claimBasicData.packages, '2'); await page.write(selectors.claimBasicData.packages, '2');
await page.waitToClick(selectors.claimBasicData.saveButton); await page.waitToClick(selectors.claimBasicData.saveButton);
@ -59,13 +57,6 @@ describe('Claim edit basic data path', () => {
expect(hasToPickUpCheckbox).toBe('checked'); expect(hasToPickUpCheckbox).toBe('checked');
}); });
it('should confirm the claim observation was edited', async() => {
const result = await page
.waitToGetProperty(selectors.claimBasicData.observation, 'value');
expect(result).toEqual('edited observation');
});
it('should confirm the claim packages was edited', async() => { it('should confirm the claim packages was edited', async() => {
const result = await page const result = await page
.waitToGetProperty(selectors.claimBasicData.packages, 'value'); .waitToGetProperty(selectors.claimBasicData.packages, 'value');
@ -75,8 +66,6 @@ describe('Claim edit basic data path', () => {
it(`should edit the claim to leave it untainted`, async() => { it(`should edit the claim to leave it untainted`, async() => {
await page.autocompleteSearch(selectors.claimBasicData.claimState, 'Pendiente'); await page.autocompleteSearch(selectors.claimBasicData.claimState, 'Pendiente');
await page.clearTextarea(selectors.claimBasicData.observation);
await page.write(selectors.claimBasicData.observation, 'Observation one');
await page.clearInput(selectors.claimBasicData.packages); await page.clearInput(selectors.claimBasicData.packages);
await page.write(selectors.claimBasicData.packages, '0'); await page.write(selectors.claimBasicData.packages, '0');
await page.waitToClick(selectors.claimBasicData.saveButton); await page.waitToClick(selectors.claimBasicData.saveButton);

View File

@ -37,7 +37,7 @@ describe('Claim summary path', () => {
}); });
it('should display the observation', async() => { it('should display the observation', async() => {
const result = await page.waitToGetProperty(selectors.claimSummary.observation, 'value'); const result = await page.waitToGetProperty(selectors.claimSummary.observation, 'innerText');
expect(result).toContain('Wisi forensibus mnesarchum in cum. Per id impetus abhorreant'); expect(result).toContain('Wisi forensibus mnesarchum in cum. Per id impetus abhorreant');
}); });

View File

@ -0,0 +1,46 @@
import selectors from '../../helpers/selectors';
import getBrowser from '../../helpers/puppeteer';
describe('Claim Add note path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('salesPerson', 'claim');
await page.accessToSearchResult('2');
await page.accessToSection('claim.card.note.index');
});
afterAll(async() => {
await browser.close();
});
it(`should reach the claim note index`, async() => {
await page.waitForState('claim.card.note.index');
});
it(`should click on the add new note button`, async() => {
await page.waitToClick(selectors.claimNote.addNoteFloatButton);
await page.waitForState('claim.card.note.create');
});
it(`should create a new note`, async() => {
await page.waitForSelector(selectors.claimNote.note);
await page.type(`${selectors.claimNote.note} textarea`, 'The delivery was unsuccessful');
await page.waitToClick(selectors.claimNote.saveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should redirect back to the claim notes page`, async() => {
await page.waitForState('claim.card.note.index');
});
it('should confirm the note was created', async() => {
const result = await page.waitToGetProperty(selectors.claimNote.firstNoteText, 'innerText');
expect(result).toEqual('The delivery was unsuccessful');
});
});

View File

@ -84,6 +84,20 @@ module.exports = Self => {
}; };
promises.push(Self.app.models.ClaimBeginning.find(filter, myOptions)); promises.push(Self.app.models.ClaimBeginning.find(filter, myOptions));
// Claim observations
filter = {
where: {claimFk: id},
include: [
{
relation: 'worker',
scope: {
fields: ['id', 'firstName', 'lastName']
}
}
]
};
promises.push(Self.app.models.ClaimObservation.find(filter, myOptions));
// Claim developments // Claim developments
filter = { filter = {
where: {claimFk: id}, where: {claimFk: id},
@ -138,8 +152,9 @@ module.exports = Self => {
summary.isEditable = await Self.isEditable(ctx, id, myOptions); summary.isEditable = await Self.isEditable(ctx, id, myOptions);
[summary.claim] = res[0]; [summary.claim] = res[0];
summary.salesClaimed = res[1]; summary.salesClaimed = res[1];
summary.developments = res[2]; summary.observations = res[2];
summary.actions = res[3]; summary.developments = res[3];
summary.actions = res[4];
return summary; return summary;
}; };

View File

@ -19,6 +19,7 @@ describe('claim getSummary()', () => {
expect(keys).toContain('claim'); expect(keys).toContain('claim');
expect(keys).toContain('salesClaimed'); expect(keys).toContain('salesClaimed');
expect(keys).toContain('developments'); expect(keys).toContain('developments');
expect(keys).toContain('observations');
expect(keys).toContain('actions'); expect(keys).toContain('actions');
expect(keys).toContain('isEditable'); expect(keys).toContain('isEditable');

View File

@ -38,6 +38,9 @@
"ClaimLog": { "ClaimLog": {
"dataSource": "vn" "dataSource": "vn"
}, },
"ClaimObservation": {
"dataSource": "vn"
},
"ClaimContainer": { "ClaimContainer": {
"dataSource": "claimStorage" "dataSource": "claimStorage"
} }

View File

@ -0,0 +1,43 @@
{
"name": "ClaimObservation",
"base": "Loggable",
"log": {
"model": "ClaimLog",
"relation": "claim"
},
"options": {
"mysql": {
"table": "claimObservation"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"claimFk": {
"type": "number",
"required": true
},
"text": {
"type": "string",
"required": true
},
"created": {
"type": "date"
}
},
"relations": {
"worker": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
},
"claim": {
"type": "belongsTo",
"model": "Claim",
"foreignKey": "claimFk"
}
}
}

View File

@ -51,15 +51,6 @@
label="Packages received" label="Packages received"
ng-model="$ctrl.claim.packages"> ng-model="$ctrl.claim.packages">
</vn-input-number> </vn-input-number>
</vn-horizontal>
<vn-horizontal>
<vn-textarea
label="Observation"
ng-model="$ctrl.claim.observation"
rule>
</vn-textarea>
</vn-horizontal>
<vn-horizontal>
<vn-check <vn-check
class="vn-mr-md" class="vn-mr-md"
label="Pick up" label="Pick up"

View File

@ -12,3 +12,5 @@ import './search-panel';
import './summary'; import './summary';
import './photos'; import './photos';
import './log'; import './log';
import './note/index';
import './note/create';

View File

@ -6,6 +6,7 @@ Client Id: Id cliente
Claimed ticket: Ticket reclamado Claimed ticket: Ticket reclamado
Delete claim: Eliminar reclamación Delete claim: Eliminar reclamación
Observation: Observación Observation: Observación
Observations: Observaciones
Responsible: Responsable Responsible: Responsable
Remove sale: Eliminar linea Remove sale: Eliminar linea
Claim Id: Id reclamación Claim Id: Id reclamación

View File

@ -0,0 +1,30 @@
<vn-watcher
vn-id="watcher"
url="claimObservations"
id-field="id"
data="$ctrl.note"
insert-mode="true"
form="form">
</vn-watcher>
<form name="form" ng-submit="watcher.submitGo('claim.card.note.index')" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-textarea
vn-one
label="Note"
ng-model="$ctrl.note.text"
vn-focus>
</vn-textarea>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit
ng-if="watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
ng-click="$ctrl.cancel()"
label="Cancel">
</vn-button>
</vn-button-bar>
</form>

View File

@ -0,0 +1,22 @@
import ngModule from '../../module';
import Section from 'salix/components/section';
export default class Controller extends Section {
constructor($element, $) {
super($element, $);
this.note = {
claimFk: parseInt(this.$params.id),
workerFk: window.localStorage.currentUserWorkerId,
text: null
};
}
cancel() {
this.$state.go('claim.card.note.index', {id: this.$params.id});
}
}
ngModule.vnComponent('vnClaimNoteCreate', {
template: require('./index.html'),
controller: Controller
});

View File

@ -0,0 +1,32 @@
<vn-crud-model
vn-id="model"
url="ClaimObservations"
filter="$ctrl.filter"
where="{claimFk: $ctrl.$params.id}"
include="$ctrl.include"
data="notes"
auto-load="true">
</vn-crud-model>
<vn-data-viewer
model="model"
class="vn-w-md">
<vn-card class="vn-pa-md">
<div
ng-repeat="note in notes"
class="note vn-pa-sm border-solid border-radius vn-mb-md">
<vn-horizontal class="vn-mb-sm" style="color: #666">
<vn-one>{{::note.worker.firstName}} {{::note.worker.lastName}}</vn-one>
<vn-auto>{{::note.created | date:'dd/MM/yyyy HH:mm'}}</vn-auto>
</vn-horizontal>
<vn-horizontal class="text">
{{::note.text}}
</vn-horizontal>
</div>
</vn-card>
</vn-data-viewer>
<a vn-tooltip="New note"
ui-sref="claim.card.note.create({id: $ctrl.$params.id})"
vn-bind="+"
fixed-bottom-right>
<vn-float-button icon="add"></vn-float-button>
</a>

View File

@ -0,0 +1,25 @@
import ngModule from '../../module';
import Section from 'salix/components/section';
import './style.scss';
export default class Controller extends Section {
constructor($element, $) {
super($element, $);
this.filter = {
order: 'created DESC',
};
this.include = {
relation: 'worker',
scope: {
fields: ['id', 'firstName', 'lastName']
}
};
}
}
Controller.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnClaimNote', {
template: require('./index.html'),
controller: Controller,
});

View File

@ -0,0 +1,5 @@
vn-client-note {
.note:last-child {
margin-bottom: 0;
}
}

View File

@ -12,6 +12,7 @@
{"state": "claim.card.basicData", "icon": "settings"}, {"state": "claim.card.basicData", "icon": "settings"},
{"state": "claim.card.detail", "icon": "icon-details"}, {"state": "claim.card.detail", "icon": "icon-details"},
{"state": "claim.card.photos", "icon": "image"}, {"state": "claim.card.photos", "icon": "image"},
{"state": "claim.card.note.index", "icon": "insert_drive_file"},
{"state": "claim.card.development", "icon": "icon-traceability"}, {"state": "claim.card.development", "icon": "icon-traceability"},
{"state": "claim.card.action", "icon": "icon-actions"}, {"state": "claim.card.action", "icon": "icon-actions"},
{"state": "claim.card.log", "icon": "history"} {"state": "claim.card.log", "icon": "history"}
@ -27,17 +28,20 @@
"abstract": true, "abstract": true,
"component": "vn-claim", "component": "vn-claim",
"description": "Claims" "description": "Claims"
}, { },
{
"url": "/index?q", "url": "/index?q",
"state": "claim.index", "state": "claim.index",
"component": "vn-claim-index", "component": "vn-claim-index",
"description": "Claims" "description": "Claims"
}, { },
{
"url": "/:id", "url": "/:id",
"state": "claim.card", "state": "claim.card",
"abstract": true, "abstract": true,
"component": "vn-claim-card" "component": "vn-claim-card"
}, { },
{
"url": "/summary", "url": "/summary",
"state": "claim.card.summary", "state": "claim.card.summary",
"component": "vn-claim-summary", "component": "vn-claim-summary",
@ -45,7 +49,8 @@
"params": { "params": {
"claim": "$ctrl.claim" "claim": "$ctrl.claim"
} }
}, { },
{
"url": "/basic-data", "url": "/basic-data",
"state": "claim.card.basicData", "state": "claim.card.basicData",
"component": "vn-claim-basic-data", "component": "vn-claim-basic-data",
@ -54,7 +59,8 @@
"claim": "$ctrl.claim" "claim": "$ctrl.claim"
}, },
"acl": ["salesPerson"] "acl": ["salesPerson"]
}, { },
{
"url": "/detail", "url": "/detail",
"state": "claim.card.detail", "state": "claim.card.detail",
"component": "vn-claim-detail", "component": "vn-claim-detail",
@ -63,7 +69,32 @@
"claim": "$ctrl.claim" "claim": "$ctrl.claim"
}, },
"acl": ["salesPerson"] "acl": ["salesPerson"]
}, { },
{
"url": "/note",
"state": "claim.card.note",
"component": "ui-view",
"abstract": true,
"acl": ["salesPerson"]
},
{
"url": "/index",
"state": "claim.card.note.index",
"component": "vn-claim-note",
"description": "Notes",
"params": {
"claim": "$ctrl.claim"
},
"acl": ["salesPerson"]
},
{
"url": "/create",
"state": "claim.card.note.create",
"component": "vn-claim-note-create",
"description": "New note",
"acl": ["salesPerson"]
},
{
"url": "/development", "url": "/development",
"state": "claim.card.development", "state": "claim.card.development",
"component": "vn-claim-development", "component": "vn-claim-development",
@ -72,7 +103,8 @@
"claim": "$ctrl.claim" "claim": "$ctrl.claim"
}, },
"acl": ["claimManager"] "acl": ["claimManager"]
}, { },
{
"url": "/action", "url": "/action",
"state": "claim.card.action", "state": "claim.card.action",
"component": "vn-claim-action", "component": "vn-claim-action",
@ -81,7 +113,8 @@
"claim": "$ctrl.claim" "claim": "$ctrl.claim"
}, },
"acl": ["claimManager"] "acl": ["claimManager"]
}, { },
{
"url": "/photos", "url": "/photos",
"state": "claim.card.photos", "state": "claim.card.photos",
"component": "vn-claim-photos", "component": "vn-claim-photos",
@ -89,7 +122,8 @@
"params": { "params": {
"claim": "$ctrl.claim" "claim": "$ctrl.claim"
} }
}, { },
{
"url" : "/log", "url" : "/log",
"state": "claim.card.log", "state": "claim.card.log",
"component": "vn-claim-log", "component": "vn-claim-log",

View File

@ -1,11 +1,12 @@
<vn-crud-model vn-id="model" <vn-crud-model
vn-id="model"
url="ClaimDms" url="ClaimDms"
filter="::$ctrl.filter" filter="::$ctrl.filter"
data="photos"> data="photos">
</vn-crud-model> </vn-crud-model>
<vn-card class="summary"> <vn-card class="summary">
<h5> <h5>
<a <a
ng-if="::$ctrl.summary.claim.id" ng-if="::$ctrl.summary.claim.id"
vn-tooltip="Go to the claim" vn-tooltip="Go to the claim"
ui-sref="claim.card.summary({id: {{::$ctrl.summary.claim.id}}})" ui-sref="claim.card.summary({id: {{::$ctrl.summary.claim.id}}})"
@ -13,7 +14,7 @@
<vn-icon-button icon="launch"></vn-icon-button> <vn-icon-button icon="launch"></vn-icon-button>
</a> </a>
<span>{{::$ctrl.summary.claim.id}} - {{::$ctrl.summary.claim.client.name}}</span> <span>{{::$ctrl.summary.claim.id}} - {{::$ctrl.summary.claim.client.name}}</span>
<vn-button-menu <vn-button-menu
disabled="!$ctrl.summary.isEditable" disabled="!$ctrl.summary.isEditable"
class="message" class="message"
label="Change state" label="Change state"
@ -26,30 +27,47 @@
<vn-horizontal> <vn-horizontal>
<vn-one> <vn-one>
<vn-label-value <vn-label-value
label="Created" label="Created"
value="{{$ctrl.summary.claim.created | date: 'dd/MM/yyyy'}}"> value="{{$ctrl.summary.claim.created | date: 'dd/MM/yyyy'}}">
</vn-label-value> </vn-label-value>
<vn-label-value <vn-label-value
label="State" label="State"
value="{{$ctrl.summary.claim.claimState.description}}"> value="{{$ctrl.summary.claim.claimState.description}}">
</vn-label-value> </vn-label-value>
<vn-label-value <vn-label-value
label="Salesperson" label="Salesperson"
value="{{$ctrl.summary.claim.client.salesPersonUser.name}}"> value="{{$ctrl.summary.claim.client.salesPersonUser.name}}">
</vn-label-value> </vn-label-value>
<vn-label-value <vn-label-value
label="Attended by" label="Attended by"
value="{{$ctrl.summary.claim.worker.user.nickname}}"> value="{{$ctrl.summary.claim.worker.user.nickname}}">
</vn-label-value> </vn-label-value>
</vn-one> </vn-one>
<vn-two> <vn-auto>
<vn-textarea <h4 ng-show="$ctrl.isSalesPerson && $ctrl.summary.observations.length">
vn-three <a
disabled="true" ui-sref="claim.card.note.index({id:$ctrl.claim.id})"
label="Observation" target="_self">
ng-model="$ctrl.summary.claim.observation"> <span translate vn-tooltip="Go to">Observations</span>
</vn-textarea> </a>
</vn-two> </h4>
<h4
ng-show="!$ctrl.isSalesPerson && $ctrl.summary.observations.length"
translate>
Observations
</h4>
<div
ng-repeat="note in $ctrl.summary.observations"
class="note vn-pa-sm border-solid border-radius vn-mb-md">
<vn-horizontal class="vn-mb-sm" style="color: #666">
<vn-one>{{::note.worker.firstName}} {{::note.worker.lastName}}</vn-one>
<vn-auto>{{::note.created | date:'dd/MM/yyyy HH:mm'}}</vn-auto>
</vn-horizontal>
<vn-horizontal class="text">
{{::note.text}}
</vn-horizontal>
</div>
</vn-auto>
<vn-auto> <vn-auto>
<h4 ng-show="$ctrl.isSalesPerson"> <h4 ng-show="$ctrl.isSalesPerson">
<a <a

View File

@ -50,22 +50,26 @@
"component": "vn-client", "component": "vn-client",
"description": "Clients", "description": "Clients",
"acl": ["employee"] "acl": ["employee"]
}, { },
{
"url": "/index?q", "url": "/index?q",
"state": "client.index", "state": "client.index",
"component": "vn-client-index", "component": "vn-client-index",
"description": "Clients" "description": "Clients"
}, { },
{
"url": "/create", "url": "/create",
"state": "client.create", "state": "client.create",
"component": "vn-client-create", "component": "vn-client-create",
"description": "New client" "description": "New client"
}, { },
{
"url": "/:id?sendSMS&phone&message", "url": "/:id?sendSMS&phone&message",
"state": "client.card", "state": "client.card",
"abstract": true, "abstract": true,
"component": "vn-client-card" "component": "vn-client-card"
}, { },
{
"url": "/summary", "url": "/summary",
"state": "client.card.summary", "state": "client.card.summary",
"component": "vn-client-summary", "component": "vn-client-summary",
@ -73,7 +77,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/basic-data", "url": "/basic-data",
"state": "client.card.basicData", "state": "client.card.basicData",
"component": "vn-client-basic-data", "component": "vn-client-basic-data",
@ -81,7 +86,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/fiscal-data", "url": "/fiscal-data",
"state": "client.card.fiscalData", "state": "client.card.fiscalData",
"component": "vn-client-fiscal-data", "component": "vn-client-fiscal-data",
@ -89,7 +95,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/billing-data", "url": "/billing-data",
"state": "client.card.billingData", "state": "client.card.billingData",
"component": "vn-client-billing-data", "component": "vn-client-billing-data",
@ -97,12 +104,14 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/address", "url": "/address",
"state": "client.card.address", "state": "client.card.address",
"component": "ui-view", "component": "ui-view",
"abstract": true "abstract": true
}, { },
{
"url": "/index?q", "url": "/index?q",
"state": "client.card.address.index", "state": "client.card.address.index",
"component": "vn-client-address-index", "component": "vn-client-address-index",
@ -110,7 +119,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/create", "url": "/create",
"state": "client.card.address.create", "state": "client.card.address.create",
"component": "vn-client-address-create", "component": "vn-client-address-create",
@ -118,12 +128,14 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/:addressId/edit", "url": "/:addressId/edit",
"state": "client.card.address.edit", "state": "client.card.address.edit",
"component": "vn-client-address-edit", "component": "vn-client-address-edit",
"description": "Edit address" "description": "Edit address"
}, { },
{
"url": "/web-access", "url": "/web-access",
"state": "client.card.webAccess", "state": "client.card.webAccess",
"component": "vn-client-web-access", "component": "vn-client-web-access",
@ -131,12 +143,14 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/note", "url": "/note",
"state": "client.card.note", "state": "client.card.note",
"component": "ui-view", "component": "ui-view",
"abstract": true "abstract": true
}, { },
{
"url": "/index", "url": "/index",
"state": "client.card.note.index", "state": "client.card.note.index",
"component": "vn-client-note", "component": "vn-client-note",
@ -144,17 +158,20 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/create", "url": "/create",
"state": "client.card.note.create", "state": "client.card.note.create",
"component": "vn-note-create", "component": "vn-note-create",
"description": "New note" "description": "New note"
}, { },
{
"url": "/credit", "url": "/credit",
"abstract": true, "abstract": true,
"state": "client.card.credit", "state": "client.card.credit",
"component": "ui-view" "component": "ui-view"
}, { },
{
"url": "/index", "url": "/index",
"state": "client.card.credit.index", "state": "client.card.credit.index",
"component": "vn-client-credit-index", "component": "vn-client-credit-index",
@ -162,7 +179,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/create", "url": "/create",
"state": "client.card.credit.create", "state": "client.card.credit.create",
"component": "vn-client-credit-create", "component": "vn-client-credit-create",
@ -171,12 +189,14 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/greuge", "url": "/greuge",
"abstract": true, "abstract": true,
"state": "client.card.greuge", "state": "client.card.greuge",
"component": "ui-view" "component": "ui-view"
}, { },
{
"url": "/index", "url": "/index",
"state": "client.card.greuge.index", "state": "client.card.greuge.index",
"component": "vn-client-greuge-index", "component": "vn-client-greuge-index",
@ -184,7 +204,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/create", "url": "/create",
"state": "client.card.greuge.create", "state": "client.card.greuge.create",
"component": "vn-client-greuge-create", "component": "vn-client-greuge-create",
@ -193,17 +214,20 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/mandate", "url": "/mandate",
"state": "client.card.mandate", "state": "client.card.mandate",
"component": "vn-client-mandate", "component": "vn-client-mandate",
"description": "Mandates" "description": "Mandates"
}, { },
{
"url": "/balance", "url": "/balance",
"abstract": true, "abstract": true,
"state": "client.card.balance", "state": "client.card.balance",
"component": "ui-view" "component": "ui-view"
}, { },
{
"url": "/index", "url": "/index",
"state": "client.card.balance.index", "state": "client.card.balance.index",
"component": "vn-client-balance-index", "component": "vn-client-balance-index",
@ -211,7 +235,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/create?payed&companyFk&bankFk&payedAmount", "url": "/create?payed&companyFk&bankFk&payedAmount",
"state": "client.card.balance.create", "state": "client.card.balance.create",
"component": "vn-client-balance-create", "component": "vn-client-balance-create",
@ -219,12 +244,14 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/recovery", "url": "/recovery",
"abstract": true, "abstract": true,
"state": "client.card.recovery", "state": "client.card.recovery",
"component": "ui-view" "component": "ui-view"
}, { },
{
"url": "/index", "url": "/index",
"state": "client.card.recovery.index", "state": "client.card.recovery.index",
"component": "vn-client-recovery-index", "component": "vn-client-recovery-index",
@ -232,7 +259,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/create", "url": "/create",
"state": "client.card.recovery.create", "state": "client.card.recovery.create",
"component": "vn-client-recovery-create", "component": "vn-client-recovery-create",
@ -240,12 +268,14 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/credit-insurance", "url": "/credit-insurance",
"abstract": true, "abstract": true,
"state": "client.card.creditInsurance", "state": "client.card.creditInsurance",
"component": "ui-view" "component": "ui-view"
}, { },
{
"url": "/index", "url": "/index",
"state": "client.card.creditInsurance.index", "state": "client.card.creditInsurance.index",
"component": "vn-client-credit-insurance-index", "component": "vn-client-credit-insurance-index",
@ -253,7 +283,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/create", "url": "/create",
"state": "client.card.creditInsurance.create", "state": "client.card.creditInsurance.create",
"component": "vn-client-credit-insurance-create", "component": "vn-client-credit-insurance-create",
@ -262,13 +293,15 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/insurance", "url": "/insurance",
"abstract": true, "abstract": true,
"state": "client.card.creditInsurance.insurance", "state": "client.card.creditInsurance.insurance",
"component": "ui-view", "component": "ui-view",
"acl": ["insurance"] "acl": ["insurance"]
}, { },
{
"url": "/:classificationId/index", "url": "/:classificationId/index",
"state": "client.card.creditInsurance.insurance.index", "state": "client.card.creditInsurance.insurance.index",
"component": "vn-client-credit-insurance-insurance-index", "component": "vn-client-credit-insurance-insurance-index",
@ -277,7 +310,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/:classificationId/create", "url": "/:classificationId/create",
"state": "client.card.creditInsurance.insurance.create", "state": "client.card.creditInsurance.insurance.create",
"component": "vn-client-credit-insurance-insurance-create", "component": "vn-client-credit-insurance-insurance-create",
@ -286,7 +320,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/contact", "url": "/contact",
"state": "client.card.contact", "state": "client.card.contact",
"component": "vn-client-contact", "component": "vn-client-contact",
@ -294,12 +329,14 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/sample", "url": "/sample",
"abstract": true, "abstract": true,
"state": "client.card.sample", "state": "client.card.sample",
"component": "ui-view" "component": "ui-view"
}, { },
{
"url": "/index", "url": "/index",
"state": "client.card.sample.index", "state": "client.card.sample.index",
"component": "vn-client-sample-index", "component": "vn-client-sample-index",
@ -307,7 +344,8 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/create", "url": "/create",
"state": "client.card.sample.create", "state": "client.card.sample.create",
"component": "vn-client-sample-create", "component": "vn-client-sample-create",
@ -315,12 +353,14 @@
"params": { "params": {
"client": "$ctrl.client" "client": "$ctrl.client"
} }
}, { },
{
"url": "/web-payment", "url": "/web-payment",
"state": "client.card.webPayment", "state": "client.card.webPayment",
"component": "vn-client-web-payment", "component": "vn-client-web-payment",
"description": "Web Payment" "description": "Web Payment"
}, { },
{
"url" : "/log", "url" : "/log",
"state": "client.card.log", "state": "client.card.log",
"component": "vn-client-log", "component": "vn-client-log",