mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Fix stock ledger user recording [SCI-10492]
This commit is contained in:
parent
6c52f77725
commit
68a5d0de61
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
class MyModuleRepositoryRow < ApplicationRecord
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
attribute :last_modified_by
|
||||
attribute :last_modified_by_id, :integer
|
||||
attribute :comment, :text
|
||||
|
||||
belongs_to :assigned_by,
|
||||
|
@ -28,7 +28,7 @@ class MyModuleRepositoryRow < ApplicationRecord
|
|||
stock_consumption: stock_consumption,
|
||||
repository_stock_unit_item_id:
|
||||
repository_row.repository_stock_value.repository_stock_unit_item_id,
|
||||
last_modified_by: user,
|
||||
last_modified_by_id: user.id,
|
||||
comment: comment
|
||||
)
|
||||
save!
|
||||
|
@ -59,7 +59,7 @@ class MyModuleRepositoryRow < ApplicationRecord
|
|||
yield
|
||||
stock_value.repository_ledger_records.create!(
|
||||
reference: self,
|
||||
user: last_modified_by || assigned_by,
|
||||
user_id: last_modified_by_id || assigned_by_id,
|
||||
amount: delta,
|
||||
balance: stock_value.amount,
|
||||
comment: comment,
|
||||
|
|
Loading…
Reference in a new issue