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 credit_xml(depreciation_value) 
      Nokogiri::XML::Builder.new do |xml|
        xml.bsa_journal do
          xml.transaction_date @time
          xml.reference 'JVL'
          xml.description "Correction of PMAT Stock - BSA #{@bsa.stock_adjustment_number}"
          xml.items do
            xml.item do
              xml.account '77300'
              xml.object 'OTH'
              xml.description "Correction of PMAT Stock - BSA #{@bsa.stock_adjustment_number}"
              xml.base_debit nil
              xml.base_credit depreciation_value
            end
            xml.item do
              xml.account '77000'
              xml.object 'OTH'
              xml.description "Correction of PMAT Stock - BSA #{@bsa.stock_adjustment_number}"
              xml.base_debit depreciation_value
              xml.base_credit nil
            end
          end
        end
      end
    end
def credit_xml ( depreciation_value ) Nokogiri :: XML :: Builder . new do | xml | xml . bsa_journal do xml . transaction_date @time xml . reference 'JVL' xml . description "Correction of PMAT Stock - BSA #{@bsa.stock_adjustment_number}" xml . items do xml . item do xml . account '77300' xml . object 'OTH' xml . description "Correction of PMAT Stock - BSA #{@bsa.stock_adjustment_number}" xml . base_debit nil xml . base_credit depreciation_value end xml . item do xml . account '77000' xml . object 'OTH' xml . description "Correction of PMAT Stock - BSA #{@bsa.stock_adjustment_number}" xml . base_debit depreciation_value xml . base_credit nil end end end end end
rubocop:disable Metrics/ClassLength
Send XML representation to accounting system.
rubocop : disable Metrics / ClassLength Send XML representation to accounting system .
# rubocop:disable Metrics/AbcSize
depreciation_value
<not_specific>
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 .