3092-module_transactions #740

Merged
joan merged 41 commits from 3092-module_transactions into dev 2021-10-18 07:42:24 +00:00
29 changed files with 166 additions and 124 deletions
Showing only changes of commit cb3d0678ce - Show all commits

View File

@ -96,24 +96,6 @@ vn-table {
max-width: 400px;
min-width: 0;
}
&[vn-fetched-tags] {
min-width: 155px;
& > vn-one {
overflow: hidden;
text-overflow: ellipsis;
font-size: 1rem;
}
& > vn-one:nth-child(2) h3 {
color: $color-font-secondary;
text-transform: uppercase;
line-height: initial;
font-size: 0.75rem
}
}
&[vn-fetched-tags][wide] {
width: 430px;
}
vn-icon.bright, i.bright {
color: #f7931e;
}

View File

@ -65,10 +65,12 @@
</vn-td>
<vn-td expand>{{::sale.shipped | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td vn-fetched-tags wide>
<vn-one title="{{::sale.concept}}">{{::sale.concept}}</vn-one>
<vn-one ng-if="::sale.subName">
<h3 title="{{::sale.subName}}">{{::sale.subName}}</h3>
</vn-one>
<div>
<vn-one title="{{::sale.concept}}">{{::sale.concept}}</vn-one>
<vn-one ng-if="::sale.subName">
<h3 title="{{::sale.subName}}">{{::sale.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::sale"

View File

@ -56,6 +56,7 @@ module.exports = Self => {
'id',
'typeFk',
'name',
'subName',
'size',
'minPrice',
'tag5',

View File

@ -172,7 +172,12 @@
</span>
</td>
<td vn-fetched-tags colspan="8">
<vn-one title="{{::buy.item.name}}">{{::buy.item.name}}</vn-one>
<div>
<vn-one title="{{::buy.item.concept}}">{{::buy.item.name}}</vn-one>
<vn-one ng-if="::buy.item.subName">
<h3 title="{{::buy.item.subName}}">{{::buy.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::buy.item"

View File

@ -100,10 +100,12 @@
</vn-td>
<vn-td number>{{::buy.size}}</vn-td>
<vn-td vn-fetched-tags>
<vn-one title="{{::buy.name}}">{{::buy.name}}</vn-one>
<vn-one ng-if="::buy.subName">
<h3 title="{{::buy.subName}}">{{::buy.subName}}</h3>
</vn-one>
<div>
<vn-one title="{{::buy.name}}">{{::buy.name}}</vn-one>
<vn-one ng-if="::buy.subName">
<h3 title="{{::buy.subName}}">{{::buy.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::buy"

View File

@ -156,7 +156,12 @@
</span>
</td>
<td vn-fetched-tags colspan="6">
<vn-one title="{{::line.item.name}}">{{::line.item.name}}</vn-one>
<div>
<vn-one title="{{::line.item.concept}}">{{::line.item.name}}</vn-one>
<vn-one ng-if="::line.item.subName">
<h3 title="{{::line.item.subName}}">{{::line.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::line.item"

View File

@ -10,7 +10,7 @@
Show invoice PDF
</a>
<vn-item
ng-click="invoiceConfirmation.show()"
ng-click="invoiceConfirmation.show({email: $ctrl.invoiceOut.client.email})"
name="sendInvoice"
translate>
Send invoice PDF
@ -106,9 +106,18 @@
</vn-confirm>
<!-- Send invoice confirmation popup -->
<vn-confirm
<vn-dialog class="edit"
vn-id="invoiceConfirmation"
on-accept="$ctrl.sendInvoice()"
question="Are you sure you want to send it?"
on-accept="$ctrl.sendInvoice($data)"
message="Send invoice PDF">
</vn-confirm>
<tpl-body>
<span translate>Are you sure you want to send it?</span>
<vn-textfield vn-one
ng-model="invoiceConfirmation.data.email">
</vn-textfield>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Confirm</button>
</tpl-buttons>
</vn-dialog>

View File

@ -60,10 +60,10 @@ class Controller extends Descriptor {
.then(res => this.entity = res.data);
}
sendInvoice() {
sendInvoice($data) {
return this.vnEmail.send('invoice', {
recipientId: this.invoiceOut.client.id,
recipient: this.invoiceOut.client.email,
recipient: $data.email,
invoiceId: this.id
});
}

View File

@ -1,5 +1,30 @@
@import "variables";
[vn-fetched-tags] {
min-width: 155px;
& [wide] {
width: 430px;
}
& div {
display: flex;
flex-wrap: wrap;
align-items: center;
& vn-one {
min-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
font-size: 1rem;
}
& vn-one h3 {
color: $color-font-secondary;
text-transform: uppercase;
line-height: initial;
font-size: 0.75rem;
margin-bottom: 0px;
}
}
}
vn-fetched-tags {
& > vn-horizontal {
align-items: center;

View File

@ -65,10 +65,12 @@
</vn-autocomplete>
</vn-td>
<vn-td vn-fetched-tags>
<vn-one title="{{price.name}}">{{price.name}}</vn-one>
<vn-one ng-if="price.subName">
<h3 title="{{price.subName}}">{{price.subName}}</h3>
</vn-one>
<div>
<vn-one title="{{price.name}}">{{price.name}}</vn-one>
<vn-one ng-if="price.subName">
<h3 title="{{price.subName}}">{{price.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="price"

View File

@ -51,10 +51,12 @@
<vn-td shrink>{{::item.grouping | dashIfEmpty}}</vn-td>
<vn-td shrink>{{::item.packing | dashIfEmpty}}</vn-td>
<vn-td vn-fetched-tags>
<vn-one title="{{::item.name}}">{{::item.name}}</vn-one>
<vn-one ng-if="::item.subName">
<h3 title="{{::item.subName}}">{{::item.subName}}</h3>
</vn-one>
<div>
<vn-one title="{{::item.name}}">{{::item.name}}</vn-one>
<vn-one ng-if="::item.subName">
<h3 title="{{::item.subName}}">{{::item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="item"

View File

@ -11,13 +11,13 @@ describe('Item', () => {
beforeEach(inject(($componentController, $rootScope) => {
$scope = $rootScope.$new();
$scope.model = crudModel;
$scope.model.data = [{priority: 1}, {priority: 2}, {priority: 1}];
const $element = angular.element('<vn-item-tags></vn-item-tags>');
controller = $componentController('vnItemTags', {$element, $scope});
}));
describe('getHighestPriority', () => {
it('should return the highest priority value + 1 from the array', () => {
$scope.model.data = [{priority: 1}, {priority: 2}, {priority: 1}];
let result = controller.getHighestPriority();
expect(result).toEqual(3);

View File

@ -115,9 +115,8 @@ module.exports = Self => {
}
});
const collegues = worker.collegues() || [];
collegues.forEach(collegue => {
for (let collegue of collegues)
teamMembersId.push(collegue.collegueFk);
});
if (teamMembersId.length == 0)
teamMembersId.push(userId);

View File

@ -43,10 +43,12 @@
</span>
</vn-td>
<vn-td vn-fetched-tags>
<vn-one title="{{::row.item.name}}">{{::row.item.name}}</vn-one>
<vn-one ng-if="::row.item.subName">
<h3 title="{{::row.item.subName}}">{{::row.item.subName}}</h3>
</vn-one>
<div>
<vn-one title="{{::row.item.name}}">{{::row.item.name}}</vn-one>
<vn-one ng-if="::row.item.subName">
<h3 title="{{::row.item.subName}}">{{::row.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::row.item"

View File

@ -98,11 +98,13 @@
{{::row.itemFk | zeroFill:6}}
</span>
</vn-td>
<vn-td expand vn-fetched-tags>
<vn-one title="{{::row.item.name}}">{{::row.item.name}}</vn-one>
<vn-one ng-if="::row.item.subName">
<h3 title="{{::row.item.subName}}">{{::row.item.subName}}</h3>
</vn-one>
<vn-td vn-fetched-tags>
<div>
<vn-one title="{{::row.item.name}}">{{::row.item.name}}</vn-one>
<vn-one ng-if="::row.item.subName">
<h3 title="{{::row.item.subName}}">{{::row.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::row.item"

View File

@ -39,11 +39,13 @@
{{::row.itemFk}}
</span>
</vn-td>
<vn-td wide vn-fetched-tags>
<vn-one title="{{::row.item.name}}">{{::row.item.name}}</vn-one>
<vn-one ng-if="::row.item.subName">
<h3 title="{{::row.item.subName}}">{{::row.item.subName}}</h3>
</vn-one>
<vn-td vn-fetched-tags>
<div>
<vn-one title="{{::row.item.name}}">{{::row.item.name}}</vn-one>
<vn-one ng-if="::row.item.subName">
<h3 title="{{::row.item.subName}}">{{::row.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::row.item"

View File

@ -51,11 +51,13 @@
{{::buy.itemName}}
</span>
</vn-td>
<vn-td vn-fetched-tags wide>
<vn-one></vn-one>
<vn-one ng-if="::buy.subName">
<h3 title="{{::buy.subName}}">{{::buy.subName}}</h3>
</vn-one>
<vn-td vn-fetched-tags>
<div>
<vn-one></vn-one>
<vn-one ng-if="::buy.subName">
<h3 title="{{::buy.subName}}">{{::buy.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::buy"

View File

@ -145,9 +145,8 @@ module.exports = Self => {
}, myOptions);
const collegues = worker.collegues() || [];
collegues.forEach(collegue => {
for (let collegue of collegues)
teamMembersId.push(collegue.collegueFk);
});
if (teamMembersId.length == 0)
teamMembersId.push(userId);

View File

@ -35,6 +35,7 @@ module.exports = Self => {
fields: [
'id',
'name',
'subName',
'itemPackingTypeFk',
'tag5',
'value5',

View File

@ -18,11 +18,13 @@
<vn-tbody>
<vn-tr ng-repeat="sale in $ctrl.ticket.sale.items track by sale.id">
<vn-td number>{{("000000"+sale.itemFk).slice(-6)}}</vn-td>
<vn-td vn-fetched-tags wide>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
<vn-td vn-fetched-tags>
<div>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::sale.item"

View File

@ -31,10 +31,12 @@
</span>
</td>
<td rowspan="{{::sale.components.length + 1}}" vn-fetched-tags>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
<div>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::sale.item"

View File

@ -1,5 +1,6 @@
<vn-crud-model
vn-id="model"
params="::$ctrl.filterParams"
url="Tickets/filter"
limit="20"
order="shippedDate DESC, shippedHour ASC, zoneLanding ASC, id">

View File

@ -5,9 +5,9 @@ export default class Ticket extends ModuleMain {
constructor() {
super();
this.filterParams = {
this.filterParams = this.fetchParams({
scopeDays: 1
};
});
}
fetchParams($params) {

View File

@ -35,10 +35,12 @@
</span>
</vn-td>
<vn-td vn-fetched-tags>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
<div>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::sale.item"

View File

@ -39,11 +39,13 @@
{{sale.itemFk | zeroFill:6}}
</span>
</vn-td>
<vn-td vn-fetched-tags wide>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
<vn-td vn-fetched-tags>
<div>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::sale.item"

View File

@ -157,12 +157,16 @@
</vn-input-number>
</field>
</vn-td-editable>
<vn-td-editable vn-fetched-tags expand disabled="!sale.id || !$ctrl.isEditable">
<vn-td-editable vn-fetched-tags disabled="!sale.id || !$ctrl.isEditable">
<text>
<vn-one title="{{sale.concept}}">{{sale.concept}}</vn-one>
<vn-one ng-if="::sale.subName">
<h3 title="{{::sale.subName}}">{{::sale.subName}}</h3>
</vn-one>
<div>
<vn-one title="{{sale.concept}}">{{sale.concept}}</vn-one>
<vn-one
ng-if="::sale.item.subName"
title="{{::sale.item.subName}}">
<h3>{{::sale.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::sale.item"

View File

@ -23,23 +23,6 @@ vn-ticket-sale {
margin: 3px;
}
}
vn-td-editable[vn-fetched-tags] {
& text {
max-width: 430px;
min-width: 150px;
& vn-one {
overflow: hidden;
text-overflow: ellipsis;
}
& vn-one:nth-child(2) h3 {
color: $color-font-secondary;
text-transform: uppercase;
line-height: initial;
font-size: 0.75rem
}
}
}
vn-dialog.edit {
@extend .edit-popover;

View File

@ -124,9 +124,9 @@
<vn-th number shrink>Available</vn-th>
<vn-th number shrink>Quantity</vn-th>
<vn-th>Description</vn-th>
<vn-th number>Price</vn-th>
<vn-th number>Discount</vn-th>
<vn-th number>Amount</vn-th>
<vn-th shrink number>Price</vn-th>
<vn-th shrink number>Discount</vn-th>
<vn-th shrink number>Amount</vn-th>
<vn-th shrink>Packing</vn-th>
</vn-tr>
</vn-thead>
@ -191,20 +191,22 @@
</vn-chip>
</vn-td>
<vn-td number shrink>{{::sale.quantity}}</vn-td>
<vn-td vn-fetched-tags wide>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
<vn-td vn-fetched-tags>
<div>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::sale.item"
tabindex="-1">
</vn-fetched-tags>
</vn-td>
<vn-td number>{{::sale.price | currency: 'EUR':2}}</vn-td>
<vn-td number>{{::sale.discount}} %</vn-td>
<vn-td number>{{::sale.quantity * sale.price * ((100 - sale.discount) / 100) | currency: 'EUR':2}}</vn-td>
<vn-td shrink number>{{::sale.price | currency: 'EUR':2}}</vn-td>
<vn-td shrink number>{{::sale.discount}} %</vn-td>
<vn-td shrink number>{{::sale.quantity * sale.price * ((100 - sale.discount) / 100) | currency: 'EUR':2}}</vn-td>
<vn-td shrink>
{{::sale.item.itemPackingTypeFk | dashIfEmpty}}
</vn-td>

View File

@ -43,10 +43,12 @@
</span>
</vn-td>
<vn-td vn-fetched-tags>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
<div>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
<vn-one ng-if="::sale.item.subName">
<h3 title="{{::sale.item.subName}}">{{::sale.item.subName}}</h3>
</vn-one>
</div>
<vn-fetched-tags
max-length="6"
item="::sale.item"