lib/pack_material/services/complete_sales_order.rb
# rubocop:disable Metrics/ClassLength
# Complete a sales order and 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_sales_order_id
# @param just_show_xml [bool] set to true to just return XML from the call without updating the db.
disable Metrics/ClassLength
Complete a sales order and send XML representation to accounting system.
use the `just_show_xml` flag to check the XML output without modifying the db.
disable Metrics / ClassLength Complete a sales order and send XML representation to accounting system . use the ` just_show_xml ` flag to check the XML output without modifying the db .
def apply_sales_return_changes(formatted_res)
      @repo.transaction do
        if formatted_res.success
          @return_repo.complete_sales_return(@user_name, @sales_return_id, formatted_res.instance)
          @return_repo.log_status('mr_sales_returns', @sales_return_id, 'SALES RETURN COMPLETED', user_name: @user_name)
        else
          @return_repo.update_sales_return(@sales_return_id, integration_error: true)
          @return_repo.log_status('mr_sales_returns', @sales_return_id, formatted_res.message, user_name: @user_name)
        end
        @block&.call
      end
    end
def apply_sales_return_changes ( formatted_res ) @repo . transaction do if formatted_res . success @return_repo . complete_sales_return ( @user_name , @sales_return_id , formatted_res . instance ) @return_repo . log_status ( 'mr_sales_returns' , @sales_return_id , 'SALES RETURN COMPLETED' , user_name : @user_name ) else @return_repo . update_sales_return ( @sales_return_id , integration_error : true ) @return_repo . log_status ( 'mr_sales_returns' , @sales_return_id , formatted_res . message , user_name : @user_name ) end @block &. call end end
rubocop:disable Metrics/ClassLength
Complete a sales order and send XML representation to accounting system.
rubocop : disable Metrics / ClassLength Complete a sales order and send XML representation to accounting system .
formatted_res
<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 .