1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

display complete info set on accounting archives

This commit is contained in:
Sylvain 2019-03-11 16:11:49 +01:00
parent e35c50e42b
commit b940ae0327
9 changed files with 68 additions and 20 deletions

View File

@ -213,10 +213,6 @@ table.closings-table {
border-bottom: 0;
}
thead th.download-archive {
display: none;
}
tr:after { /* clearing float */
content: ' ';
display: block;
@ -231,19 +227,29 @@ table.closings-table {
}
tbody td, thead th {
width: 24%; /* 24% is less than (100% / 4 cols) = 25% */
width: 32%; /* 32% is less than (100% / 3 cols) = 33.33% */
float: left;
}
tbody td.download-archive {
position: absolute;
right: 10px;
width: 32px;
height: 32px;
cursor: pointer;
tbody .actions {
padding-left: 2em;
& > span {
margin-left: 2em;
cursor: pointer;
}
}
tbody td.download-archive:hover {
tbody .show-more {
color: #00b3ee;
}
tbody .download-archive {
width: 32px;
height: 32px;
}
tbody .download-archive:hover {
i {
display: none;
}
@ -253,3 +259,8 @@ table.closings-table {
}
}
}
.period-info-title {
font-weight: bold;
}

View File

@ -0,0 +1,18 @@
<ul>
<li><span class="period-info-title" translate>{{ 'invoices.closed_at' }}</span> : <span>{{period.closed_at | amDateFormat:'L'}}</span></li>
<li><span class="period-info-title" translate>{{ 'invoices.closed_by' }}</span> : <span>{{period.user_name}}</span></li>
<li><span class="period-info-title" translate>{{ 'invoices.period_total' }}</span> : <span>{{period.period_total | currency}}</span></li>
<li><span class="period-info-title" translate>{{ 'invoices.perpetual_total' }}</span> : <span>{{period.perpetual_total | currency}}</span></li>
<li>
<span class="period-info-title" translate>{{ 'invoices.integrity' }}</span> :
<span>
<div class="input-group">
<span class="input-group-addon">
<i class="fa fa-link chained" ng-show="period.chained_footprint"></i>
<i class="fa fa-chain-broken broken" ng-hide="period.chained_footprint"></i>
</span>
<input type="text" class="form-control" ng-value="period.footprint" readonly="readonly" />
</div>
</span>
</li>
</ul>

View File

@ -56,17 +56,17 @@
<tr>
<th translate>{{ 'invoices.start_date' }}</th>
<th translate>{{ 'invoices.end_date' }}</th>
<th translate>{{ 'invoices.closed_at' }}</th>
<th class="download-archive" />
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="period in accountingPeriods">
<td>{{period.start_at | amDateFormat:'L'}}</td>
<td>{{period.end_at | amDateFormat:'L'}}</td>
<td>{{period.closed_at | amDateFormat:'L'}}</td>
<td>{{period.user_name}}</td>
<td class="download-archive" ng-click="downloadArchive(period)"><i class="fa fa-archive"></i></td>
<td class="actions">
<span class="show-more" uib-popover-template="'<%= asset_path 'admin/invoices/_period.html' %>'"><i class="fa fa-info-circle"></i></span>
<span class="download-archive" ng-click="downloadArchive(period)"><i class="fa fa-archive"></i></span>
</td>
</tr>
</tbody>
</table>

View File

@ -32,6 +32,10 @@ class AccountingPeriod < ActiveRecord::Base
"#{dir}/#{start_at.iso8601}_#{end_at.iso8601}.json"
end
def check_footprint
footprint == compute_footprint
end
private
def to_json_archive(invoices)
@ -71,8 +75,8 @@ class AccountingPeriod < ActiveRecord::Base
end
def compute_footprint
columns = Invoice.columns.map(&:name)
.delete_if { |c| %w[footprint updated_at].include? c }
columns = AccountingPeriod.columns.map(&:name)
.delete_if { |c| %w[footprint updated_at].include? c }
sha256 = Digest::SHA256.new
sha256.hexdigest "#{columns.map { |c| self[c] }.join}#{previous_period ? previous_period.footprint : ''}"

View File

@ -1,6 +1,9 @@
# frozen_string_literal: true
json.array!(@accounting_periods) do |ap|
json.extract! ap, :id, :start_at, :end_at, :closed_at, :closed_by, :created_at
json.extract! ap, :id, :start_at, :end_at, :closed_at, :closed_by, :footprint, :created_at
json.period_total ap.period_total / 100.0
json.perpetual_total ap.perpetual_total / 100.0
json.chained_footprint ap.check_footprint
json.user_name "#{ap.first_name} #{ap.last_name}"
end

View File

@ -416,6 +416,9 @@ en:
end_date: "To"
closed_at: "Closed at"
closed_by: "By"
period_total: "Period total"
perpetual_total: "Perpetual total"
integrity: "Integrity check"
confirmation_required: "Confirmation required"
confirm_close_START_END: "Do you really want to close the accounting period between {{START}} and {{END}}? Any subsequent changes will be impossible. This operation will take some time to complete"
period_START_END_closed_success: "The accounting period from {{START}} to {{END}} has been successfully closed"

View File

@ -416,6 +416,9 @@ es:
end_date: "To" # translation_missing
closed_at: "Closed at" # translation_missing
closed_by: "By" # translation_missing
period_total: "Period total" # translation_missing
perpetual_total: "Perpetual total" # translation_missing
integrity: "Verificación de integridad"
confirmation_required: "Confirmation required" # translation_missing
confirm_close_START_END: "Do you really want to close the accounting period between {{START}} and {{END}}? Any subsequent changes will be impossible. This operation will take some time to complete" # translation_missing
period_START_END_closed_success: "The accounting period from {{START}} to {{END}} has been successfully closed" # translation_missing

View File

@ -416,6 +416,9 @@ fr:
end_date: "Au"
closed_at: "Clôturé le"
closed_by: "Par"
period_total: "Total de la période"
perpetual_total: "Total perpétuel"
integrity: "Contrôle d'intégrité"
confirmation_required: "Confirmation requise"
confirm_close_START_END: "Êtes-vous sur de vouloir clôturer la période comptable du {{START}} au {{END}} ? Toute modification ultérieure sera impossible. Cette opération va prendre un certain temps."
period_START_END_closed_success: "La période comptable du {{START}} au {{END}} a bien été clôturée"

View File

@ -416,6 +416,9 @@ pt:
end_date: "To" # translation_missing
closed_at: "Closed at" # translation_missing
closed_by: "By" # translation_missing
period_total: "Period total" # translation_missing
perpetual_total: "Perpetual total" # translation_missing
integrity: "Verificação de integridade"
confirmation_required: "Confirmation required" # translation_missing
confirm_close_START_END: "Do you really want to close the accounting period between {{START}} and {{END}}? Any subsequent changes will be impossible. This operation will take some time to complete." # translation_missing
period_START_END_closed_success: "The accounting period from {{START}} to {{END}} has been successfully closed" # translation_missing