2391 - Editable description
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
30a4bbfe1a
commit
17542472da
|
@ -2,6 +2,9 @@
|
|||
"Account": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"AccountingType": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Bank": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"name": "AccountingType",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "accountingType"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"description": {
|
||||
"type": "String",
|
||||
"required": true
|
||||
},
|
||||
"receiptDescription": {
|
||||
"type": "String",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"acls": [{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}]
|
||||
}
|
|
@ -2,39 +2,49 @@
|
|||
"name": "Bank",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "bank"
|
||||
}
|
||||
"mysql": {
|
||||
"table": "bank"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"bank": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"account": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"cash": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"entityFk": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"isActive": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"currencyFk": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"bank": {
|
||||
"type": "String",
|
||||
"required": true
|
||||
},
|
||||
"account": {
|
||||
"type": "String",
|
||||
"required": true
|
||||
},
|
||||
"accountingTypeFk": {
|
||||
"type": "Number",
|
||||
"required": true,
|
||||
"mysql": {
|
||||
"columnName": "cash"
|
||||
}
|
||||
},
|
||||
"entityFk": {
|
||||
"type": "Number",
|
||||
"required": true
|
||||
},
|
||||
"isActive": {
|
||||
"type": "Boolean",
|
||||
"required": true
|
||||
},
|
||||
"currencyFk": {
|
||||
"type": "Number",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"accountingType": {
|
||||
"type": "belongsTo",
|
||||
"model": "AccountingType",
|
||||
"foreignKey": "accountingTypeFk"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE `vn`.`accountingType`
|
||||
ADD COLUMN `receiptDescription` VARCHAR(50) NULL AFTER `description`;
|
|
@ -116,13 +116,13 @@ INSERT INTO `vn`.`shelving` (`code`, `parkingFk`, `isPrinted`, `priority`, `park
|
|||
('GVC', '1', '0', '1', '0', '106'),
|
||||
('HEJ', '2', '0', '1', '0', '106');
|
||||
|
||||
INSERT INTO `vn`.`accountingType`(`id`, `description`)
|
||||
INSERT INTO `vn`.`accountingType`(`id`, `description`, `receiptDescription`)
|
||||
VALUES
|
||||
(1, 'Digital money'),
|
||||
(2, 'Cash'),
|
||||
(3, 'Card'),
|
||||
(4, 'Stolen Money'),
|
||||
(5, 'Miscellaneous');
|
||||
(1, 'Digital money', ''),
|
||||
(2, 'Cash', 'Cash'),
|
||||
(3, 'Card', 'Pay on receipt'),
|
||||
(4, 'Stolen Money', ''),
|
||||
(5, 'Miscellaneous', '');
|
||||
|
||||
INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`)
|
||||
VALUES
|
||||
|
@ -133,8 +133,8 @@ INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`)
|
|||
|
||||
INSERT INTO `vn`.`bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`, `currencyFk`)
|
||||
VALUES
|
||||
(1, 'Pay on receipt', '0000000000', 4, 0, 1, 1),
|
||||
(2, 'Cash', '1111111111', 1, 0, 1, 1);
|
||||
(1, 'Pay on receipt', '0000000000', 3, 0, 1, 1),
|
||||
(2, 'Cash', '1111111111', 2, 0, 1, 1);
|
||||
|
||||
INSERT INTO `vn`.`deliveryMethod`(`id`, `code`, `description`)
|
||||
VALUES
|
||||
|
|
|
@ -42,11 +42,11 @@ module.exports = Self => {
|
|||
r.workerFk,
|
||||
c.code company,
|
||||
r.created,
|
||||
r.invoiceFk ref,
|
||||
r.invoiceFk description,
|
||||
NULL debit,
|
||||
r.amountPaid credit,
|
||||
r.bankFk,
|
||||
u.nickname userNickname,
|
||||
u.name userName,
|
||||
r.clientFk,
|
||||
FALSE hasPdf,
|
||||
FALSE isInvoice
|
||||
|
|
|
@ -2,6 +2,13 @@
|
|||
New payment
|
||||
</tpl-title>
|
||||
<tpl-body>
|
||||
<vn-crud-model
|
||||
url="Banks"
|
||||
include="{relation: 'accountingType'}"
|
||||
data="banks"
|
||||
order="id"
|
||||
auto-load="true">
|
||||
</vn-crud-model>
|
||||
<vn-horizontal>
|
||||
<vn-date-picker
|
||||
label="Date"
|
||||
|
@ -17,11 +24,15 @@
|
|||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete
|
||||
url="Banks"
|
||||
label="Bank"
|
||||
data="banks"
|
||||
show-field="bank"
|
||||
value-field="id"
|
||||
ng-model="$ctrl.receipt.bankFk">
|
||||
order="id"
|
||||
ng-model="$ctrl.receipt.bankFk"
|
||||
search-function="{or: [{id: $search}, {bank: {like: '%'+ $search +'%'}}]}"
|
||||
selection="$ctrl.bankSelection">
|
||||
<tpl-item>{{id}}: {{bank}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-input-number
|
||||
vn-focus
|
||||
|
@ -31,6 +42,13 @@
|
|||
rule>
|
||||
</vn-input-number>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
label="Reference"
|
||||
ng-model="$ctrl.receipt.description"
|
||||
rule>
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
</tpl-body>
|
||||
<tpl-buttons>
|
||||
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||||
|
|
|
@ -50,6 +50,19 @@ class Controller extends Dialog {
|
|||
return this.receipt.description;
|
||||
}
|
||||
|
||||
get bankSelection() {
|
||||
return this._bankSelection;
|
||||
}
|
||||
|
||||
set bankSelection(value) {
|
||||
this._bankSelection = value;
|
||||
|
||||
if (value) {
|
||||
const accountingType = value.accountingType;
|
||||
this.receipt.description = accountingType && accountingType.receiptDescription;
|
||||
}
|
||||
}
|
||||
|
||||
getAmountPaid() {
|
||||
const filter = {
|
||||
where: {
|
||||
|
|
|
@ -68,25 +68,33 @@
|
|||
<span
|
||||
vn-click-stop="workerDescriptor.show($event, balance.workerFk)"
|
||||
class="link">
|
||||
{{::balance.userNickname}}
|
||||
{{::balance.userName}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td expand>
|
||||
<div ng-show="::balance.ref">
|
||||
<span
|
||||
ng-if="balance.isInvoice"
|
||||
title="{{'BILL' | translate: {ref: balance.ref} }}"
|
||||
vn-click-stop="$ctrl.showInvoiceOutDescriptor($event, balance)"
|
||||
class="link">
|
||||
{{'BILL' | translate: {ref: balance.ref} }}
|
||||
</span>
|
||||
<span
|
||||
ng-if="!balance.isInvoice"
|
||||
title="{{::balance.ref}}">
|
||||
{{::balance.ref}}
|
||||
</span>
|
||||
</div>
|
||||
</vn-td>
|
||||
<vn-td-editable disabled="balance.isInvoice" expand>
|
||||
<text>
|
||||
<div ng-show="::balance.description">
|
||||
<span
|
||||
ng-if="balance.isInvoice"
|
||||
title="{{'BILL' | translate: {ref: balance.description} }}"
|
||||
vn-click-stop="$ctrl.showInvoiceOutDescriptor($event, balance)"
|
||||
class="link">
|
||||
{{'BILL' | translate: {ref: balance.description} }}
|
||||
</span>
|
||||
<span
|
||||
ng-if="!balance.isInvoice"
|
||||
title="{{::balance.description}}">
|
||||
{{balance.description}}
|
||||
</span>
|
||||
</div>
|
||||
</text>
|
||||
<field>
|
||||
<vn-textfield class="dense" vn-focus
|
||||
ng-model="balance.description"
|
||||
on-change="$ctrl.changeDescription(balance)">
|
||||
</vn-textfield>
|
||||
</field>
|
||||
</vn-td-editable>
|
||||
<vn-td number>{{::balance.bankFk}}</vn-td>
|
||||
<vn-td number expand>{{::balance.debit | currency: 'EUR':2}}</vn-td>
|
||||
<vn-td number expand>{{::balance.credit | currency: 'EUR':2}}</vn-td>
|
||||
|
|
|
@ -79,6 +79,13 @@ class Controller extends Section {
|
|||
|
||||
this.$.invoiceOutDescriptor.show(event.target, balance.id);
|
||||
}
|
||||
|
||||
changeDescription(balance) {
|
||||
const params = {description: balance.description};
|
||||
const endpoint = `Receipts/${balance.id}`;
|
||||
this.$http.patch(endpoint, params)
|
||||
.then(() => this.vnApp.showSuccess(this.$t('Data saved!')));
|
||||
}
|
||||
}
|
||||
|
||||
Controller.$inject = ['$element', '$scope'];
|
||||
|
|
Loading…
Reference in New Issue