refactor
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
facaee6f95
commit
61b0aa079a
|
@ -1,4 +1,16 @@
|
||||||
<h3 ng-if="$ctrl.packageInvoicing" translate style="text-align: center;">{{'Calculating packages to invoice...'}}</h3>
|
<vn-card class="vn-w-lg">
|
||||||
|
<h5 ng-if="$ctrl.packageInvoicing" translate text-center class="vn-pa-md">{{'Calculating packages to invoice...'}}</h5>
|
||||||
|
<vn-vertical ng-if="$ctrl.lastClientId" text-center class="vn-pa-md">
|
||||||
|
<h5 translate>Invoicing</h5>
|
||||||
|
<div>
|
||||||
|
{{'Id Client' | translate}}: {{$ctrl.currentClientId}}
|
||||||
|
{{'of' | translate}} {{::$ctrl.lastClientId}}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{($ctrl.percentage / 100) | percentage: 0}}
|
||||||
|
</div>
|
||||||
|
</vn-vertical>
|
||||||
|
</vn-card>
|
||||||
<vn-card class="vn-w-lg">
|
<vn-card class="vn-w-lg">
|
||||||
<vn-table ng-if="data.length">
|
<vn-table ng-if="data.length">
|
||||||
<vn-thead>
|
<vn-thead>
|
||||||
|
@ -64,18 +76,6 @@
|
||||||
order="code">
|
order="code">
|
||||||
</vn-crud-model>
|
</vn-crud-model>
|
||||||
<form class="vn-pa-md">
|
<form class="vn-pa-md">
|
||||||
<vn-vertical text-center
|
|
||||||
class="progress vn-my-sm"
|
|
||||||
ng-if="$ctrl.lastClientId">
|
|
||||||
<h5 class="vn-mb-md vn-mt-lg" translate>Invoicing</h5>
|
|
||||||
<div>
|
|
||||||
{{'Id Client' | translate}}: {{$ctrl.currentClientId}}
|
|
||||||
{{'of' | translate}} {{::$ctrl.lastClientId}}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
{{($ctrl.percentage / 100) | percentage: 0}}
|
|
||||||
</div>
|
|
||||||
</vn-vertical>
|
|
||||||
<vn-vertical>
|
<vn-vertical>
|
||||||
<vn-date-picker
|
<vn-date-picker
|
||||||
vn-one
|
vn-one
|
||||||
|
@ -87,39 +87,6 @@
|
||||||
label="Max date"
|
label="Max date"
|
||||||
ng-model="$ctrl.invoice.maxShipped">
|
ng-model="$ctrl.invoice.maxShipped">
|
||||||
</vn-date-picker>
|
</vn-date-picker>
|
||||||
<vn-radio
|
|
||||||
label="All clients"
|
|
||||||
val="allClients"
|
|
||||||
ng-model="$ctrl.clientsNumber"
|
|
||||||
ng-click="$ctrl.$onInit()">
|
|
||||||
</vn-radio>
|
|
||||||
<vn-radio
|
|
||||||
label="Clients range"
|
|
||||||
val="clientsRange"
|
|
||||||
ng-model="$ctrl.clientsNumber">
|
|
||||||
</vn-radio>
|
|
||||||
</vn-vertical>
|
|
||||||
<vn-vertical ng-show="$ctrl.clientsNumber == 'clientsRange'">
|
|
||||||
<vn-autocomplete
|
|
||||||
url="Clients"
|
|
||||||
label="From client"
|
|
||||||
search-function="{or: [{id: $search}, {name: {like: '%'+$search+'%'}}]}"
|
|
||||||
order="id"
|
|
||||||
show-field="name"
|
|
||||||
value-field="id"
|
|
||||||
ng-model="$ctrl.invoice.fromClientId">
|
|
||||||
<tpl-item>{{::id}} - {{::name}}</tpl-item>
|
|
||||||
</vn-autocomplete>
|
|
||||||
<vn-autocomplete
|
|
||||||
url="Clients"
|
|
||||||
label="To client"
|
|
||||||
search-function="{or: [{id: $search}, {name: {like: '%'+$search+'%'}}]}"
|
|
||||||
order="id"
|
|
||||||
show-field="name"
|
|
||||||
value-field="id"
|
|
||||||
ng-model="$ctrl.invoice.toClientId">
|
|
||||||
<tpl-item>{{::id}} - {{::name}}</tpl-item>
|
|
||||||
</vn-autocomplete>
|
|
||||||
</vn-vertical>
|
</vn-vertical>
|
||||||
<vn-vertical>
|
<vn-vertical>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
|
@ -139,7 +106,6 @@
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
</vn-vertical>
|
</vn-vertical>
|
||||||
<vn-submit vn-id="invoiceButton" ng-click="$ctrl.makeInvoice()" label="Invoice" class="vn-mt-sm" ></vn-submit>
|
<vn-submit vn-id="invoiceButton" ng-click="$ctrl.makeInvoice()" label="Invoice" class="vn-mt-sm" ></vn-submit>
|
||||||
<vn-button ng-click="$ctrl.clean()" label="Clean" class="vn-mt-sm" disabled="!data.length"></vn-button>
|
|
||||||
</form>
|
</form>
|
||||||
</vn-side-menu>
|
</vn-side-menu>
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@ class Controller extends Section {
|
||||||
maxShipped: new Date(),
|
maxShipped: new Date(),
|
||||||
companyFk: this.vnConfig.companyFk
|
companyFk: this.vnConfig.companyFk
|
||||||
};
|
};
|
||||||
this.clientsNumber = 'allClients';
|
|
||||||
this.currentClient = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$onInit() {
|
$onInit() {
|
||||||
|
@ -45,7 +43,6 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
restartValues() {
|
restartValues() {
|
||||||
this.lastClientId = null;
|
|
||||||
this.$.invoiceButton.disabled = false;
|
this.$.invoiceButton.disabled = false;
|
||||||
this.packageInvoicing = false;
|
this.packageInvoicing = false;
|
||||||
}
|
}
|
||||||
|
@ -100,9 +97,6 @@ class Controller extends Section {
|
||||||
if (!this.invoice.invoiceDate || !this.invoice.maxShipped)
|
if (!this.invoice.invoiceDate || !this.invoice.maxShipped)
|
||||||
throw new Error('Invoice date and the max date should be filled');
|
throw new Error('Invoice date and the max date should be filled');
|
||||||
|
|
||||||
if (!this.invoice.fromClientId || !this.invoice.toClientId)
|
|
||||||
throw new Error('Choose a valid clients range');
|
|
||||||
|
|
||||||
if (!this.invoice.companyFk)
|
if (!this.invoice.companyFk)
|
||||||
throw new Error('Choose a valid company');
|
throw new Error('Choose a valid company');
|
||||||
|
|
||||||
|
@ -123,6 +117,7 @@ class Controller extends Section {
|
||||||
this.clients = [];
|
this.clients = [];
|
||||||
for (const clientAndAddress of clientsAndAddresses)
|
for (const clientAndAddress of clientsAndAddresses)
|
||||||
this.clients.push(clientAndAddress.clientId);
|
this.clients.push(clientAndAddress.clientId);
|
||||||
|
this.currentClient = 0;
|
||||||
this.lastClientId = clientsAndAddresses[clientsAndAddresses.length - 1].clientId;
|
this.lastClientId = clientsAndAddresses[clientsAndAddresses.length - 1].clientId;
|
||||||
|
|
||||||
return this.invoiceOut(invoice, clientsAndAddresses);
|
return this.invoiceOut(invoice, clientsAndAddresses);
|
||||||
|
@ -135,10 +130,6 @@ class Controller extends Section {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clean() {
|
|
||||||
this.$.data = this.$.data.filter(client => client.status == 'error');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Controller.$inject = ['$element', '$scope', '$transclude'];
|
Controller.$inject = ['$element', '$scope', '$transclude'];
|
||||||
|
|
|
@ -8,7 +8,3 @@ vn-td {
|
||||||
color: $color-success;
|
color: $color-success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h5{
|
|
||||||
color: $color-primary;
|
|
||||||
}
|
|
||||||
|
|
|
@ -68,24 +68,13 @@
|
||||||
</vn-card>
|
</vn-card>
|
||||||
</vn-data-viewer>
|
</vn-data-viewer>
|
||||||
<div fixed-bottom-right>
|
<div fixed-bottom-right>
|
||||||
<vn-vertical style="align-items: center;">
|
<vn-button class="round sm vn-mb-sm"
|
||||||
<vn-button class="round sm vn-mb-sm"
|
icon="add"
|
||||||
icon="add"
|
ng-click="manualInvoicing.show()"
|
||||||
ng-click="invoicingOptions.show($event)"
|
vn-tooltip="Make invoice..."
|
||||||
vn-tooltip="Make invoice..."
|
vn-acl="invoicing"
|
||||||
tooltip-position="left"
|
vn-acl-action="remove">
|
||||||
vn-acl="invoicing"
|
</vn-button>
|
||||||
vn-acl-action="remove">
|
|
||||||
</vn-button>
|
|
||||||
|
|
||||||
<vn-menu vn-id="invoicingOptions">
|
|
||||||
<vn-item translate
|
|
||||||
name="manualInvoice"
|
|
||||||
ng-click="manualInvoicing.show()">
|
|
||||||
Manual invoicing
|
|
||||||
</vn-item>
|
|
||||||
</vn-menu>
|
|
||||||
</vn-vertical>
|
|
||||||
</div>
|
</div>
|
||||||
<vn-popup vn-id="summary">
|
<vn-popup vn-id="summary">
|
||||||
<vn-invoice-out-summary
|
<vn-invoice-out-summary
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
data="taxAreas"
|
data="taxAreas"
|
||||||
order="code">
|
order="code">
|
||||||
</vn-crud-model>
|
</vn-crud-model>
|
||||||
<div
|
<div
|
||||||
class="progress vn-my-md"
|
class="progress vn-my-md"
|
||||||
ng-if="$ctrl.isInvoicing">
|
ng-if="$ctrl.isInvoicing">
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-icon vn-none icon="warning"></vn-icon>
|
<vn-icon vn-none icon="warning"></vn-icon>
|
||||||
<span vn-none translate>Invoicing in progress...</span>
|
<span vn-none translate>Invoicing in progress...</span>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</div>
|
</div>
|
||||||
|
@ -80,4 +80,4 @@
|
||||||
<tpl-buttons>
|
<tpl-buttons>
|
||||||
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||||||
<button response="accept" translate vn-focus>Make invoice</button>
|
<button response="accept" translate vn-focus>Make invoice</button>
|
||||||
</tpl-buttons>
|
</tpl-buttons>
|
||||||
|
|
|
@ -14,4 +14,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue