     $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)

      else
        E.reconciliation._fillReceptionItem(lastLineForm, checkboxLine, itemId, itemQuantity, itemAnnotation)

      $(lastLineForm).find('input[data-remember="equipment"]').first().selector('value', equipmentId)
      $(lastLineForm).find('input[data-remember="team"]').first().selector('value', teamId)
      $(lastLineForm).find('input[data-remember="project_budget"]').first().selector('value', projectBudgetId)
      $(lastLineForm).find('input[data-remember="activity_budget"]').first().selector('value', activityBudgetId)
      $(lastLineForm).find('.no-reconciliate-item-state').addClass('hidden')
      $(lastLineForm).find('.reconciliate-item-state').removeClass('hidden')
      $line = $(lastLineForm).parent('.nested-fields')

  # Checks the parent checkbox if all children are checked. Uncheck it if not.
  # If all checked, set 'close command to true, else to false'
  # Also hide/display the close command radio
  syncState = (commandContainer, $form) =>
    itemCheckboxes = Array.from(commandContainer.querySelectorAll('.item-checkbox'))
    allItemsCheckboxesChecked = itemCheckboxes.map((cb) => cb.checked).reduce(((acc, e) => acc && e), true)
    commandContainer.querySelector('.model-checkbox').checked = allItemsCheckboxesChecked
