2019-01-03 16:48:52 +01:00
|
|
|
<div class="modal-header">
|
2019-12-17 12:40:36 +01:00
|
|
|
<h3 class="text-center red" translate>{{ 'app.admin.invoices.close_accounting_period' }}</h3>
|
2019-01-03 16:48:52 +01:00
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
2019-01-07 10:50:10 +01:00
|
|
|
<form name="closePeriodForm" novalidate="novalidate" class="row">
|
2019-01-07 15:33:09 +01:00
|
|
|
<div class="form-group col-md-6" ng-class="{'has-error': closePeriodForm.start_at.$dirty && closePeriodForm.start_at.$invalid }">
|
2019-12-17 12:40:36 +01:00
|
|
|
<label translate>{{ 'app.admin.invoices.close_from_date' }}</label>
|
2019-01-03 16:48:52 +01:00
|
|
|
<div class="input-group">
|
|
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
|
|
<input type="text"
|
|
|
|
class="form-control"
|
2019-01-07 15:33:09 +01:00
|
|
|
name="start_at"
|
|
|
|
ng-model="period.start_at"
|
2019-01-03 16:48:52 +01:00
|
|
|
uib-datepicker-popup="{{datePicker.format}}"
|
|
|
|
datepicker-options="datePicker.options"
|
|
|
|
is-open="datePicker.startOpened"
|
2019-01-08 11:19:07 +01:00
|
|
|
min-date="datePicker.minDate"
|
2019-03-11 16:54:08 +01:00
|
|
|
max-date="datePicker.minDate"
|
2019-01-08 11:19:07 +01:00
|
|
|
init-date="period.start_at"
|
2019-01-03 16:48:52 +01:00
|
|
|
placeholder="{{datePicker.format}}"
|
2019-03-11 16:54:08 +01:00
|
|
|
readonly
|
2019-01-03 16:48:52 +01:00
|
|
|
required/>
|
|
|
|
</div>
|
2019-12-17 12:40:36 +01:00
|
|
|
<span class="help-block" ng-show="closePeriodForm.start_at.$dirty && closePeriodForm.start_at.$error.required" translate>{{ 'app.admin.invoices.start_date_is_required' }}</span>
|
2019-01-08 17:32:45 +01:00
|
|
|
<span class="help-block error" ng-show="errors.start_at">{{ errors.start_at[0] }}</span>
|
2019-01-03 16:48:52 +01:00
|
|
|
</div>
|
2019-01-07 15:33:09 +01:00
|
|
|
<div class="form-group col-md-6" ng-class="{'has-error': closePeriodForm.end_at.$dirty && closePeriodForm.end_at.$invalid }">
|
2019-12-17 12:40:36 +01:00
|
|
|
<label translate>{{ 'app.admin.invoices.close_until_date' }}</label>
|
2019-01-03 16:48:52 +01:00
|
|
|
<div class="input-group">
|
|
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
|
|
|
<input type="text"
|
2019-04-03 14:47:39 +02:00
|
|
|
class="form-control as-writable"
|
2019-01-07 15:33:09 +01:00
|
|
|
name="end_at"
|
|
|
|
ng-model="period.end_at"
|
2019-01-03 16:48:52 +01:00
|
|
|
uib-datepicker-popup="{{datePicker.format}}"
|
|
|
|
datepicker-options="datePicker.options"
|
|
|
|
is-open="datePicker.endOpened"
|
2019-01-08 11:19:07 +01:00
|
|
|
min-date="datePicker.minDate"
|
|
|
|
max-date="datePicker.maxDate"
|
|
|
|
init-date="period.end_at"
|
2019-01-03 16:48:52 +01:00
|
|
|
placeholder="{{datePicker.format}}"
|
2019-03-11 16:54:08 +01:00
|
|
|
ng-click="toggleDatePicker($event)"
|
2019-04-03 14:47:39 +02:00
|
|
|
required
|
|
|
|
readonly/>
|
2019-01-03 16:48:52 +01:00
|
|
|
</div>
|
2019-12-17 12:40:36 +01:00
|
|
|
<span class="help-block" ng-show="closePeriodForm.end_at.$dirty && closePeriodForm.end_at.$error.required" translate>{{ 'app.admin.invoices.end_date_is_required' }}</span>
|
2019-01-08 17:32:45 +01:00
|
|
|
<span class="help-block error" ng-show="errors.end_at">{{ errors.end_at[0] }}</span>
|
2019-01-03 16:48:52 +01:00
|
|
|
</div>
|
|
|
|
</form>
|
2019-02-12 17:38:44 +01:00
|
|
|
<div ng-repeat="(key, value) in errors" ng-if="invoiceErrorRE.test(key)" class="row col-md-12">
|
|
|
|
<span class="help-block error">{{ $parent.invoiceErrorRE.exec(key)[1] }} : {{ value[0] }}</span>
|
|
|
|
</div>
|
2019-01-07 10:50:10 +01:00
|
|
|
<div>
|
2019-12-17 12:40:36 +01:00
|
|
|
<h4 translate>{{ 'app.admin.invoices.previous_closings' }}</h4>
|
2019-01-07 17:21:32 +01:00
|
|
|
<table class="table closings-table" ng-show="accountingPeriods.length > 0">
|
2019-01-07 10:50:10 +01:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2019-12-17 12:40:36 +01:00
|
|
|
<th translate>{{ 'app.admin.invoices.start_date' }}</th>
|
|
|
|
<th translate>{{ 'app.admin.invoices.end_date' }}</th>
|
2019-03-11 16:11:49 +01:00
|
|
|
<th></th>
|
2019-01-07 10:50:10 +01:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2019-01-07 16:45:31 +01:00
|
|
|
<tr ng-repeat="period in accountingPeriods">
|
|
|
|
<td>{{period.start_at | amDateFormat:'L'}}</td>
|
|
|
|
<td>{{period.end_at | amDateFormat:'L'}}</td>
|
2019-03-11 16:11:49 +01:00
|
|
|
<td class="actions">
|
2020-10-23 12:09:36 +02:00
|
|
|
<span class="show-more" uib-popover-template="'/admin/invoices/_period.html'"><i class="fa fa-info-circle"></i></span>
|
2019-04-04 12:55:21 +02:00
|
|
|
<span class="download-archive" ng-click="downloadArchive(period)" ng-show="period.archive_ready"><i class="fa fa-archive"></i></span>
|
|
|
|
<span class="no-pointer" ng-hide="period.archive_ready"><i class="fa fa-spinner fa-pulse"></i></span>
|
2019-03-11 16:11:49 +01:00
|
|
|
</td>
|
2019-01-07 10:50:10 +01:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2019-12-17 12:40:36 +01:00
|
|
|
<div ng-show="accountingPeriods.length === 0" translate>{{ 'app.admin.invoices.no_periods'}}</div>
|
2019-01-07 10:50:10 +01:00
|
|
|
</div>
|
2019-01-03 16:48:52 +01:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
2019-12-17 12:40:36 +01:00
|
|
|
<button class="btn btn-warning" ng-click="ok()" ng-disabled="closePeriodForm.$invalid || pendingCreation" translate>{{ 'app.shared.buttons.confirm' }}</button>
|
|
|
|
<button class="btn btn-default" ng-click="cancel()" ng-disabled="pendingCreation" translate>{{ 'app.shared.buttons.cancel' }}</button>
|
2019-01-03 16:48:52 +01:00
|
|
|
</div>
|