Merge branch 'dev' of https://git.verdnatura.es/salix into dev
* 'dev' of https://git.verdnatura.es/salix: billing data with acls
This commit is contained in:
commit
ec4adc7552
|
@ -11,23 +11,24 @@
|
|||
<vn-title>Billing information</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete vn-two
|
||||
vn-acl="administrative"
|
||||
field="$ctrl.client.payMethodFk"
|
||||
url="/client/api/PayMethods"
|
||||
select-fields="ibanRequired"
|
||||
initial-data="$ctrl.client.payMethod"
|
||||
label="Forma de pago">
|
||||
</vn-autocomplete>
|
||||
<vn-textfield vn-two label="IBAN" field="$ctrl.client.iban"></vn-textfield>
|
||||
<vn-textfield vn-one label="Vencimiento" field="$ctrl.client.dueDay"></vn-textfield>
|
||||
<vn-textfield vn-two label="IBAN" field="$ctrl.client.iban" vn-acl="administrative"></vn-textfield>
|
||||
<vn-textfield vn-one label="Vencimiento" field="$ctrl.client.dueDay" vn-acl="administrative"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Descuento" field="$ctrl.client.discount"></vn-textfield>
|
||||
<vn-textfield vn-one label="Crédito" field="$ctrl.client.credit"></vn-textfield>
|
||||
<vn-textfield vn-one label="Crédito asegurado" field="$ctrl.client.creditInsurance"></vn-textfield>
|
||||
<vn-textfield vn-one label="Descuento" field="$ctrl.client.discount" vn-acl="administrative"></vn-textfield>
|
||||
<vn-textfield vn-one label="Crédito" field="$ctrl.client.credit" vn-acl="administrative"></vn-textfield>
|
||||
<vn-textfield vn-one label="Crédito asegurado" field="$ctrl.client.creditInsurance" vn-acl="administrative"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Recargo de equivalencia" field="$ctrl.client.equalizationTax"></vn-check>
|
||||
<vn-check vn-one label="Vies" field="$ctrl.client.vies"></vn-check>
|
||||
<vn-check vn-one label="Recargo de equivalencia" field="$ctrl.client.equalizationTax" vn-acl="administrative"></vn-check>
|
||||
<vn-check vn-one label="Vies" field="$ctrl.client.vies" vn-acl="administrative"></vn-check>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
|
@ -35,14 +36,14 @@
|
|||
<vn-vertical pad-large>
|
||||
<vn-title>Documentación</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-check vn-one label="Recibido core VNH" field="$ctrl.client.coreVnh"></vn-check>
|
||||
<vn-check vn-one label="Recibido core VNL" field="$ctrl.client.coreVnl"></vn-check>
|
||||
<vn-check vn-one label="Recibido B2B VNL" field="$ctrl.client.sepaVnl"></vn-check>
|
||||
<vn-check vn-one label="Recibido core VNH" field="$ctrl.client.coreVnh" vn-acl="administrative"></vn-check>
|
||||
<vn-check vn-one label="Recibido core VNL" field="$ctrl.client.coreVnl" vn-acl="administrative"></vn-check>
|
||||
<vn-check vn-one label="Recibido B2B VNL" field="$ctrl.client.sepaVnl" vn-acl="administrative"></vn-check>
|
||||
</vn-horizontal>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit label="Guardar"></vn-submit>
|
||||
<vn-submit label="Guardar" vn-acl="administrative"></vn-submit>
|
||||
</vn-button-bar>
|
||||
</form>
|
||||
<vn-dialog
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import {module} from '../module';
|
||||
|
||||
function vnAcl(aclService, $compile) {
|
||||
function vnAcl(aclService, $timeout) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
priority: -1,
|
||||
link: function($scope, $element, $attrs) {
|
||||
let acls = $attrs.vnAcl.split(',');
|
||||
let action = $attrs.vnAclAction || 'disabled';
|
||||
|
@ -15,8 +16,12 @@ function vnAcl(aclService, $compile) {
|
|||
input = input.querySelector(selector);
|
||||
|
||||
if (input) {
|
||||
input.setAttribute("ng-disabled", "true");
|
||||
$compile(input)($scope);
|
||||
$timeout(() => {
|
||||
input.setAttribute("disabled", "true");
|
||||
});
|
||||
$element[0].querySelectorAll('i, vn-drop-down').forEach(i => {
|
||||
i.parentNode.removeChild(i);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$element.remove();
|
||||
|
@ -25,6 +30,6 @@ function vnAcl(aclService, $compile) {
|
|||
}
|
||||
};
|
||||
}
|
||||
vnAcl.$inject = ['aclService', '$compile'];
|
||||
vnAcl.$inject = ['aclService', '$timeout'];
|
||||
|
||||
module.directive('vnAcl', vnAcl);
|
||||
|
|
Loading…
Reference in New Issue