     $closePurchaseOrderBlock = $purchaseOrderLine.find('.close-purchase-order')
     if $closePurchaseOrderBlock.find('input[type="radio"][value="true"]').is(':checked')
       $formContainer.find('.purchase-order-to-close-id').val(modelId)
-
-  E.onElementDetected 'new_reception', (form) =>
+  
+  E.onElementDetected 'new_reception', (form) => 
     urlParams = new URLSearchParams(window.location.search)
     if urlParams.has('purchase_order_ids')
       open_reconciliation_modal $(form)
-
-  E.onElementDetected 'new_purchase_invoice', (form) =>
+  
+  E.onElementDetected 'new_purchase_invoice', (form) => 
     urlParams = new URLSearchParams(window.location.search)
     if urlParams.has('reception_ids')
       open_reconciliation_modal $(form)

      data['reception'] = action.substr(action.lastIndexOf('/') + 1)
    {url: url, data: data}

  isPurchaseInvoiceForm = ($form) =>
    $form.closest('.simple_form').is('.new_purchase_invoice, .edit_purchase_invoice')

  isReceptionForm = ($form) =>
    $form.closest('.simple_form').is('.new_reception, .edit_reception')

  # Returns a promise that resolves to the content for the modal to be opened
  content_for_reconciliation_modal = ($form) =>
    options = {}

      $(lastLineForm).find('.purchase-item-attribute').val(itemId)

      $selectorInput = $(lastLineForm).find('.item-block-role .parcel-item-variant').first()

      $selectorInput.selector('value', variantId, (-> disable_selector_input($selectorInput);$(lastLineForm).find('.form-field .invoice-quantity').trigger('change')))
      $(lastLineForm).find('.hidden.purchase-item-attribute').val(itemId)
      $(lastLineForm).find('.annotation-logo .annotation-field').trigger('click')
      $(lastLineForm).find('.annotation-section .annotation').val(itemAnnotation)
