   ##############################
   # Open modal on button click
   $(document).on 'click', '#showReconciliationModal', (event) =>
-    open_reconciliation_modal($(event.target))
+    $form = $(event.target).closest('form')
+    open_reconciliation_modal($form)
 
   # Validate modal
   handle_modal_validation = (modal) =>

    closePurchaseOrderBlock.querySelector("input[type='radio'][value=#{value}").checked = true

  # Sets all children checkboxes to 'value' and sync state
  setAllChildrenTo = (commandContainer, value) =>
    commandContainer.querySelectorAll('.item-checkbox').forEach((item) => item.checked = value)
    syncState(commandContainer)

  E.reconciliation =
    reconciliateItems: (modalContent) ->

      # Attacher un ecouteur evenement sur les checkbox des items
      E.delegateListener root, 'click', ".item-checkbox", (e) =>
        commandContainer = e.target.closest('.model')
        syncState(commandContainer, $form)
        return

      # Handle automated selection of multiple checkbox
      E.delegateListener root, 'click', '.model-checkbox', (e) =>
        checked = e.target.checked
        commandContainer = e.target.closest('.model')
        setAllChildrenTo(commandContainer, checked, $form) 
        return

      displayedItemIds = Array.from(document.querySelectorAll('.nested-fields .nested-item-form[data-item-id]'))
      displayedItemIds = displayedItemIds.map((item) => item.dataset.itemId)

      displayedItemIds.forEach (id) => 
        checkbox = content.querySelector(".item input[type='checkbox'][data-id='#{id}']")
        commandContainer = checkbox.closest('.model')
        if checkbox
          checkbox.checked = true
          syncState(commandContainer, $form)
      return

    prom.then (modal) =>
