refs #4457 @30min requested changes

This commit is contained in:
Pau 2022-11-23 08:55:44 +01:00
parent 4e2741a9cd
commit ade2e777d6
11 changed files with 57 additions and 171 deletions

View File

@ -1,6 +0,0 @@
UPDATE
vn.client
SET
hasInvoiceElectronic = TRUE
WHERE
businessTypeFk = 'officialOrganism';

View File

@ -1,2 +1,2 @@
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
INSERT INTO `salix`.`ACL` (model,property,accessType,permission,principalType,principalId)
VALUES ('NotificationQueue','*','*','ALLOW','ROLE','employee');

View File

@ -1,7 +1,7 @@
ALTER TABLE
`vn`.`client`
ADD
COLUMN `hasInvoiceElectronic` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'Registro de facturas mediante FACe'
COLUMN `hasElectronicInvoice` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'Registro de facturas mediante FACe'
AFTER
`hasInvoiceSimplified`;

View File

@ -1,3 +1,3 @@
UPDATE `vn`.`client`
set hasInvoiceElectronic = TRUE
set hasElectronicInvoice = TRUE
where buisnessTypeFk = 'officialOrganism'

View File

@ -0,0 +1,6 @@
UPDATE
`vn`.`client`
SET
hasElectronicInvoice = TRUE
WHERE
businessTypeFk = 'officialOrganism';

View File

@ -101,7 +101,7 @@ module.exports = Self => {
type: 'boolean'
},
{
arg: 'hasInvoiceElectronic',
arg: 'hasElectronicInvoice',
type: 'boolean'
}
],

View File

@ -143,7 +143,7 @@
"salesPersonFk": {
"type": "number"
},
"hasInvoiceElectronic": {
"hasElectronicInvoice": {
"type": "boolean"
}

View File

@ -1,112 +1,52 @@
<mg-ajax path="Clients/{{patch.params.id}}/updateFiscalData" options="vnPatch"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.client"
id-field="id"
form="form"
save="patch">
<vn-watcher vn-id="watcher" data="$ctrl.client" id-field="id" form="form" save="patch">
</vn-watcher>
<vn-crud-model
auto-load="true"
url="Provinces/location"
data="provincesLocation"
order="name">
<vn-crud-model auto-load="true" url="Provinces/location" data="provincesLocation" order="name">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="Countries"
data="countries"
order="country">
<vn-crud-model auto-load="true" url="Countries" data="countries" order="country">
</vn-crud-model>
<vn-crud-model
auto-load="true"
url="SageTaxTypes"
data="sageTaxTypes"
order="vat">
<vn-crud-model auto-load="true" url="SageTaxTypes" data="sageTaxTypes" order="vat">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-textfield
vn-two
vn-focus
label="Social name"
ng-model="$ctrl.client.socialName"
rule
info="Only letters, numbers and spaces can be used"
required="true">
<vn-textfield vn-two vn-focus label="Social name" ng-model="$ctrl.client.socialName" rule
info="Only letters, numbers and spaces can be used" required="true">
</vn-textfield>
<vn-textfield
vn-one
label="Tax number"
ng-model="$ctrl.client.fi"
rule>
<vn-textfield vn-one label="Tax number" ng-model="$ctrl.client.fi" rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-two
label="Street"
ng-model="$ctrl.client.street"
rule>
<vn-textfield vn-two label="Street" ng-model="$ctrl.client.street" rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
ng-model="$ctrl.client.sageTaxTypeFk"
data="sageTaxTypes"
show-field="vat"
value-field="id"
label="Sage tax type"
vn-acl="salesAssistant"
rule>
<vn-autocomplete vn-one ng-model="$ctrl.client.sageTaxTypeFk" data="sageTaxTypes" show-field="vat"
value-field="id" label="Sage tax type" vn-acl="salesAssistant" rule>
</vn-autocomplete>
<vn-autocomplete vn-one
ng-model="$ctrl.client.sageTransactionTypeFk"
url="SageTransactionTypes"
show-field="transaction"
value-field="id"
label="Sage transaction type"
<vn-autocomplete vn-one ng-model="$ctrl.client.sageTransactionTypeFk" url="SageTransactionTypes"
show-field="transaction" value-field="id" label="Sage transaction type"
search-function="{or: [{id: $search}, {transaction: {like: '%'+ $search +'%'}}]}"
vn-acl="salesAssistant"
order="transaction"
rule>
vn-acl="salesAssistant" order="transaction" rule>
<tpl-item>{{id}}: {{transaction}}</tpl-item>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-datalist vn-one
label="Postcode"
ng-model="$ctrl.client.postcode"
selection="$ctrl.postcode"
url="Postcodes/location"
fields="['code','townFk']"
order="code, townFk"
value-field="code"
show-field="code"
rule>
<vn-datalist vn-one label="Postcode" ng-model="$ctrl.client.postcode" selection="$ctrl.postcode"
url="Postcodes/location" fields="['code','townFk']" order="code, townFk" value-field="code"
show-field="code" rule>
<tpl-item>
{{code}} - {{town.name}} ({{town.province.name}},
{{code}} - {{town.name}} ({{town.province.name}},
{{town.province.country.country}})
</tpl-item>
<append>
<vn-icon-button
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()"
vn-acl="deliveryBoss"
vn-acl-action="remove">
<vn-icon-button icon="add_circle" vn-tooltip="New postcode" ng-click="postcode.open()"
vn-acl="deliveryBoss" vn-acl-action="remove">
</vn-icon-button>
</append>
</vn-datalist>
<vn-datalist vn-id="town" vn-one
label="City"
ng-model="$ctrl.client.city"
selection="$ctrl.town"
url="Towns/location"
fields="['id', 'name', 'provinceFk']"
show-field="name"
value-field="name">
<vn-datalist vn-id="town" vn-one label="City" ng-model="$ctrl.client.city" selection="$ctrl.town"
url="Towns/location" fields="['id', 'name', 'provinceFk']" show-field="name" value-field="name">
<tpl-item>
{{name}}, {{province.name}}
({{province.country.country}})
@ -114,118 +54,64 @@
</vn-datalist>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-id="province" vn-one
label="Province"
ng-model="$ctrl.client.provinceFk"
selection="$ctrl.province"
data="provincesLocation"
fields="['id', 'name', 'countryFk']"
show-field="name"
value-field="id"
rule>
<vn-autocomplete vn-id="province" vn-one label="Province" ng-model="$ctrl.client.provinceFk"
selection="$ctrl.province" data="provincesLocation" fields="['id', 'name', 'countryFk']"
show-field="name" value-field="id" rule>
<tpl-item>{{name}} ({{country.country}})</tpl-item>
</vn-autocomplete>
<vn-autocomplete vn-id="country" vn-one
ng-model="$ctrl.client.countryFk"
data="countries"
show-field="country"
value-field="id"
label="Country"
rule>
<vn-autocomplete vn-id="country" vn-one ng-model="$ctrl.client.countryFk" data="countries"
show-field="country" value-field="id" label="Country" rule>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-check
vn-one
label="Active"
ng-model="$ctrl.client.isActive">
<vn-check vn-one label="Active" ng-model="$ctrl.client.isActive">
</vn-check>
<vn-check
vn-one
label="Frozen"
ng-model="$ctrl.client.isFreezed">
<vn-check vn-one label="Frozen" ng-model="$ctrl.client.isFreezed">
</vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-check
vn-one
label="Has to invoice"
ng-model="$ctrl.client.hasToInvoice">
<vn-check vn-one label="Has to invoice" ng-model="$ctrl.client.hasToInvoice">
</vn-check>
<vn-check
vn-one
label="Vies"
ng-model="$ctrl.client.isVies">
<vn-check vn-one label="Vies" ng-model="$ctrl.client.isVies">
</vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-check
vn-one
label="Notify by email"
ng-model="$ctrl.client.isToBeMailed">
<vn-check vn-one label="Notify by email" ng-model="$ctrl.client.isToBeMailed">
</vn-check>
<vn-check
vn-one
label="Invoice by address"
ng-model="$ctrl.client.hasToInvoiceByAddress">
<vn-check vn-one label="Invoice by address" ng-model="$ctrl.client.hasToInvoiceByAddress">
</vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-check
vn-one
label="Is equalizated"
ng-model="$ctrl.client.isEqualizated"
<vn-check vn-one label="Is equalizated" ng-model="$ctrl.client.isEqualizated"
info="In order to invoice, this field is not consulted, but the consignee's ET. When modifying this field if the invoice by address option is not checked, the change will be automatically propagated to all addresses, otherwise the user will be asked if he wants to propagate it or not."
on-change="$ctrl.onChangeEqualizated(value)">
</vn-check>
<vn-check
vn-one
label="Verified data"
ng-model="$ctrl.client.isTaxDataChecked"
vn-acl="salesAssistant">
<vn-check vn-one label="Verified data" ng-model="$ctrl.client.isTaxDataChecked" vn-acl="salesAssistant">
</vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-check
vn-one
label="Incoterms authorization"
ng-model="$ctrl.client.hasIncoterms"
<vn-check vn-one label="Incoterms authorization" ng-model="$ctrl.client.hasIncoterms"
vn-acl="administrative">
</vn-check>
<vn-check
vn-one
label="Electronic invoice"
ng-model="$ctrl.client.hasInvoiceElectronic"
<vn-check vn-one label="Electronic invoice" ng-model="$ctrl.client.hasElectronicInvoice"
vn-acl="administrative">
</vn-check>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
<vn-submit disabled="!watcher.dataChanged()" label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
<vn-button class="cancel" label="Undo changes" disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form>
<vn-confirm
vn-id="propagate-isEqualizated"
question="You changed the equalization tax"
message="Do you want to spread the change?"
on-accept="$ctrl.onAcceptEt()">
<vn-confirm vn-id="propagate-isEqualizated" question="You changed the equalization tax"
message="Do you want to spread the change?" on-accept="$ctrl.onAcceptEt()">
</vn-confirm>
<vn-confirm
vn-id="confirm-duplicatedClient"
message="Found a client with this data"
<vn-confirm vn-id="confirm-duplicatedClient" message="Found a client with this data"
on-accept="$ctrl.onAcceptDuplication()">
</vn-confirm>
<!-- New postcode dialog -->
<vn-geo-postcode
vn-id="postcode"
on-response="$ctrl.onResponse($response)">
<vn-geo-postcode vn-id="postcode" on-response="$ctrl.onResponse($response)">
</vn-geo-postcode>

View File

@ -36,7 +36,7 @@ class Controller extends ModuleCard {
'email',
'phone',
'mobile',
'hasInvoiceElectronic',
'hasElectronicInvoice',
],
include: {
relation: 'salesPersonUser',

View File

@ -66,7 +66,7 @@ class Controller extends Section {
'email',
'phone',
'mobile',
'hasInvoiceElectronic',
'hasElectronicInvoice',
],
include: {
relation: 'salesPersonUser',
@ -252,7 +252,7 @@ class Controller extends Section {
*/
const client = this.ticket.client;
if (client.hasInvoiceElectronic) {
if (client.hasElectronicInvoice) {
this.$http.post(`NotificationQueues`, {
notificationFk: 'invoiceElectronic',
authorFk: client.id,

View File

@ -40,7 +40,7 @@ class Controller extends Descriptor {
'isActive',
'isFreezed',
'isTaxDataChecked',
'hasInvoiceElectronic',
'hasElectronicInvoice',
],
include: {
relation: 'salesPersonUser',