<commit_before>class PurchaseItemDecorator < Draper::Decorator
  delegate_all

  def reception_number
    return '' if object.parcels_purchase_invoice_items.nil? || object.parcels_purchase_invoice_items.first.nil?

    reception_id = object.parcels_purchase_invoice_items.first.parcel_id

    Reception.find_by(reception_id)&.reference_number
  end

  def merchandise_current_stock
    return 0 if object.variant.nil?

    object.variant.current_stock
  end

  def merchandise_stock_after_order
    return 0 if object.quantity.nil?<commit_msg>PG::DatatypeMismatch: ERROR:  argument of AND must be type boolean, not type integer<commit_after>class PurchaseItemDecorator < Draper::Decorator
  delegate_all

  def reception_number
    return '' if object.parcels_purchase_invoice_items.nil? || object.parcels_purchase_invoice_items.first.nil?

    reception_id = object.parcels_purchase_invoice_items.first.parcel_id

    Reception.find_by(id: reception_id)&.reference_number
  end

  def merchandise_current_stock
    return 0 if object.variant.nil?

    object.variant.current_stock
  end

  def merchandise_stock_after_order
    return 0 if object.quantity.nil?
{'fraction_non_alphanumeric': 0.06373815676141258, 'fraction_numerical': 0.0034453057708871662, 'mean_word_length': 5.052083333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1071075', 'n_tokens_mistral': 395, 'n_tokens_neox': 360, 'n_words': 67}