mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
Merge branch 'dev' into 'projects-improvements'
# Conflicts: # Gemfile.lock
This commit is contained in:
commit
bc320693cf
@ -1,6 +1,8 @@
|
||||
# Changelog Fab-manager
|
||||
|
||||
- Fix a bug: unable to refresh machine/space/training calender after pay an reservation
|
||||
- Fix a bug: Accouning Line in duplicate
|
||||
- [TODO DEPLOY] `rails fablab:setup:build_accounting_lines`
|
||||
|
||||
## v6.0.7 2023 June 20
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
<li><a ui-sref="app.logged.dashboard.events" translate>{{ 'app.public.common.my_events' }}</a></li>
|
||||
<li><a ui-sref="app.logged.dashboard.invoices" ng-show="$root.modules.invoicing" translate>{{ 'app.public.common.my_invoices' }}</a></li>
|
||||
<li><a ui-sref="app.logged.dashboard.payment_schedules" ng-show="$root.modules.invoicing" translate>{{ 'app.public.common.my_payment_schedules' }}</a></li>
|
||||
<li><a ui-sref="app.logged.dashboard.orders" translate>{{ 'app.public.common.my_orders' }}</a></li>
|
||||
<li ng-if="$root.modules.store"><a ui-sref="app.logged.dashboard.orders" translate>{{ 'app.public.common.my_orders' }}</a></li>
|
||||
<li ng-show="$root.modules.wallet"><a ui-sref="app.logged.dashboard.wallet" translate>{{ 'app.public.common.my_wallet' }}</a></li>
|
||||
<li class="divider" ng-if="isAuthorized(['admin', 'manager'])"></li>
|
||||
<li><a class="text-black pointer" ng-click="help($event)" ng-if="isAuthorized(['admin', 'manager'])"><i class="fa fa-question-circle"></i> <span translate>{{ 'app.public.common.help' }}</span> </a></li>
|
||||
|
@ -22,11 +22,19 @@ class Accounting::AccountingService
|
||||
lines = []
|
||||
processed = []
|
||||
invoices.find_each do |i|
|
||||
Rails.logger.debug { "processing invoice #{i.id}..." } unless Rails.env.test?
|
||||
lines.concat(generate_lines(i))
|
||||
processed.push(i.id)
|
||||
Rails.logger.debug { "[AccountLine] processing invoice #{i.id}..." } unless Rails.env.test?
|
||||
if i.main_item.nil?
|
||||
Rails.logger.error { "[AccountLine] invoice #{i.id} main_item is nil" } unless Rails.env.test?
|
||||
else
|
||||
lines.concat(generate_lines(i))
|
||||
processed.push(i.id)
|
||||
end
|
||||
end
|
||||
ActiveRecord::Base.transaction do
|
||||
ids = invoices.map(&:id)
|
||||
AccountingLine.where(invoice_id: ids).delete_all
|
||||
AccountingLine.create!(lines)
|
||||
end
|
||||
AccountingLine.create!(lines)
|
||||
processed
|
||||
end
|
||||
|
||||
|
@ -27,8 +27,6 @@ class AccountingWorker
|
||||
end
|
||||
|
||||
def invoices(invoices_ids)
|
||||
# clean
|
||||
AccountingLine.where(invoice_id: invoices_ids).delete_all
|
||||
# build
|
||||
service = Accounting::AccountingService.new
|
||||
invoices = Invoice.where(id: invoices_ids)
|
||||
@ -37,8 +35,6 @@ class AccountingWorker
|
||||
end
|
||||
|
||||
def all
|
||||
# clean
|
||||
AccountingLine.delete_all
|
||||
# build
|
||||
service = Accounting::AccountingService.new
|
||||
ids = service.build_from_invoices(Invoice.all)
|
||||
|
Loading…
x
Reference in New Issue
Block a user