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

      $(lastLineForm).find('.form-field .invoice-unit-amount').val(itemUnitCost)
      $(lastLineForm).find('.form-field .invoice-discount-percentage').val(itemReductionPercentage)
      $(lastLineForm).find('.form-field .pre-tax-invoice-total').val(itemTotalAmount)
      $selectorInput = $(lastLineForm).find('.form-field .invoice-variant').first()
      $selectorInput.selector('value', variantId, (-> disable_selector_input($selectorInput);$(lastLineForm).find('.form-field .invoice-quantity').trigger('change')))
      $(lastLineForm).find('.form-field .purchase_invoice_items_activity_budget .selector-search').first().selector('value', activityBudgetId)
      $(lastLineForm).find('.form-field .purchase_invoice_items_team .selector-search').first().selector('value', teamId)
      $(lastLineForm).find('.annotation-logo .annotation-field').trigger('click')
      $(lastLineForm).find('.annotation-section .annotation').val(itemAnnotation)


      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
