lib/pack_material/services/integrate_bulk_stock_adjustment.rb
# rubocop:disable Metrics/ClassLength
# Send XML representation to accounting system.
# - use the `just_show_xml` flag to check the XML output without modifying the db.
#
# @param user_name [string] the user who initiated this task.
# @param [Integer] mr_bulk_stock_adjustment_id
# @param just_show_xml [bool] set to true to just return XML from the call without updating the db.
disable Metrics/ClassLength
Send XML representation to accounting system.
use the `just_show_xml` flag to check the XML output without modifying the db.
disable Metrics / ClassLength Send XML representation to accounting system . use the ` just_show_xml ` flag to check the XML output without modifying the db .
def build_xml
      total_depreciation_value = @bsa_repo.depreciation_value(@id)
      depreciation_value = UtilityFunctions.delimited_number(total_depreciation_value, delimiter: '', no_decimals: 2)
      request_xml = if total_depreciation_value.positive?
                      debit_xml(depreciation_value)
                    else
                      credit_xml(depreciation_value)
                    end
      request_xml.to_xml
    end
def build_xml total_depreciation_value = @bsa_repo . depreciation_value ( @id ) depreciation_value = UtilityFunctions . delimited_number ( total_depreciation_value , delimiter : '' , no_decimals : 2 ) request_xml = if total_depreciation_value . positive? debit_xml ( depreciation_value ) else credit_xml ( depreciation_value ) end request_xml . to_xml end
rubocop:disable Metrics/ClassLength
Send XML representation to accounting system.
rubocop : disable Metrics / ClassLength Send XML representation to accounting system .
# IF depreciation > 0 debit 77300 (#usage/consumption), credit 77000 (#inventory) # IF depreciation < 0 credit 77300, debit 77000
user_name
<not_specific>
the user who initiated this task.
the user who initiated this task .
<not_specific>
None
just_show_xml
<not_specific>
set to true to just return XML from the call without updating the db.
set to true to just return XML from the call without updating the db .