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:
parent
e35c50e42b
commit
b940ae0327
@ -213,10 +213,6 @@ table.closings-table {
|
|||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
thead th.download-archive {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
tr:after { /* clearing float */
|
tr:after { /* clearing float */
|
||||||
content: ' ';
|
content: ' ';
|
||||||
display: block;
|
display: block;
|
||||||
@ -231,19 +227,29 @@ table.closings-table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tbody td, thead th {
|
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;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
tbody td.download-archive {
|
tbody .actions {
|
||||||
position: absolute;
|
padding-left: 2em;
|
||||||
right: 10px;
|
|
||||||
width: 32px;
|
& > span {
|
||||||
height: 32px;
|
margin-left: 2em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tbody td.download-archive:hover {
|
tbody .show-more {
|
||||||
|
color: #00b3ee;
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody .download-archive {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody .download-archive:hover {
|
||||||
i {
|
i {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -253,3 +259,8 @@ table.closings-table {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.period-info-title {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
18
app/assets/templates/admin/invoices/_period.html.erb
Normal file
18
app/assets/templates/admin/invoices/_period.html.erb
Normal 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>
|
@ -56,17 +56,17 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th translate>{{ 'invoices.start_date' }}</th>
|
<th translate>{{ 'invoices.start_date' }}</th>
|
||||||
<th translate>{{ 'invoices.end_date' }}</th>
|
<th translate>{{ 'invoices.end_date' }}</th>
|
||||||
<th translate>{{ 'invoices.closed_at' }}</th>
|
<th></th>
|
||||||
<th class="download-archive" />
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="period in accountingPeriods">
|
<tr ng-repeat="period in accountingPeriods">
|
||||||
<td>{{period.start_at | amDateFormat:'L'}}</td>
|
<td>{{period.start_at | amDateFormat:'L'}}</td>
|
||||||
<td>{{period.end_at | amDateFormat:'L'}}</td>
|
<td>{{period.end_at | amDateFormat:'L'}}</td>
|
||||||
<td>{{period.closed_at | amDateFormat:'L'}}</td>
|
<td class="actions">
|
||||||
<td>{{period.user_name}}</td>
|
<span class="show-more" uib-popover-template="'<%= asset_path 'admin/invoices/_period.html' %>'"><i class="fa fa-info-circle"></i></span>
|
||||||
<td class="download-archive" ng-click="downloadArchive(period)"><i class="fa fa-archive"></i></td>
|
<span class="download-archive" ng-click="downloadArchive(period)"><i class="fa fa-archive"></i></span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -32,6 +32,10 @@ class AccountingPeriod < ActiveRecord::Base
|
|||||||
"#{dir}/#{start_at.iso8601}_#{end_at.iso8601}.json"
|
"#{dir}/#{start_at.iso8601}_#{end_at.iso8601}.json"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_footprint
|
||||||
|
footprint == compute_footprint
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def to_json_archive(invoices)
|
def to_json_archive(invoices)
|
||||||
@ -71,8 +75,8 @@ class AccountingPeriod < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def compute_footprint
|
def compute_footprint
|
||||||
columns = Invoice.columns.map(&:name)
|
columns = AccountingPeriod.columns.map(&:name)
|
||||||
.delete_if { |c| %w[footprint updated_at].include? c }
|
.delete_if { |c| %w[footprint updated_at].include? c }
|
||||||
|
|
||||||
sha256 = Digest::SHA256.new
|
sha256 = Digest::SHA256.new
|
||||||
sha256.hexdigest "#{columns.map { |c| self[c] }.join}#{previous_period ? previous_period.footprint : ''}"
|
sha256.hexdigest "#{columns.map { |c| self[c] }.join}#{previous_period ? previous_period.footprint : ''}"
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
json.array!(@accounting_periods) do |ap|
|
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}"
|
json.user_name "#{ap.first_name} #{ap.last_name}"
|
||||||
end
|
end
|
||||||
|
@ -416,6 +416,9 @@ en:
|
|||||||
end_date: "To"
|
end_date: "To"
|
||||||
closed_at: "Closed at"
|
closed_at: "Closed at"
|
||||||
closed_by: "By"
|
closed_by: "By"
|
||||||
|
period_total: "Period total"
|
||||||
|
perpetual_total: "Perpetual total"
|
||||||
|
integrity: "Integrity check"
|
||||||
confirmation_required: "Confirmation required"
|
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"
|
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"
|
period_START_END_closed_success: "The accounting period from {{START}} to {{END}} has been successfully closed"
|
||||||
|
@ -416,6 +416,9 @@ es:
|
|||||||
end_date: "To" # translation_missing
|
end_date: "To" # translation_missing
|
||||||
closed_at: "Closed at" # translation_missing
|
closed_at: "Closed at" # translation_missing
|
||||||
closed_by: "By" # 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
|
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
|
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
|
period_START_END_closed_success: "The accounting period from {{START}} to {{END}} has been successfully closed" # translation_missing
|
||||||
|
@ -416,6 +416,9 @@ fr:
|
|||||||
end_date: "Au"
|
end_date: "Au"
|
||||||
closed_at: "Clôturé le"
|
closed_at: "Clôturé le"
|
||||||
closed_by: "Par"
|
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"
|
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."
|
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"
|
period_START_END_closed_success: "La période comptable du {{START}} au {{END}} a bien été clôturée"
|
||||||
|
@ -416,6 +416,9 @@ pt:
|
|||||||
end_date: "To" # translation_missing
|
end_date: "To" # translation_missing
|
||||||
closed_at: "Closed at" # translation_missing
|
closed_at: "Closed at" # translation_missing
|
||||||
closed_by: "By" # 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
|
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
|
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
|
period_START_END_closed_success: "The accounting period from {{START}} to {{END}} has been successfully closed" # translation_missing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user