<commit_before>class Nota.Templates.AerixInvoiceView extends Nota.InvoiceView

  documentName: -> 'Invoice '+@getFullID()

  filesystemName: ->
    customer = @model.get("client").organization
    customer = customer || @model.get("client").contactPerson
    customer = customer.replace ' ', '-'
    project = @model.get("projectName")
    if project?
      project = project.replace ' ', '-'
      "#{@getFullID()}_#{customer}_#{project}.pdf"
    else
      "#{@getFullID()}_#{customer}.pdf"

  getFullID: ->
    date = new Date(@model.get('meta').date)
    date.getUTCFullYear()+'.'+_.str.pad(@model.get('meta').id.toString(), 4, '0')

  # Pretty much everything apart from the table
  _renderInvoiceDetails: ->
    directives = 
      vatPercentage: =>
        @model.get("vatPercentage")*100
      companyFullname: =>
        origin = @model.get('origin') 
        origin.companyName+' '+origin.companyLawform

    @_mapObjToDOM @model.attributes, @$el, directives, false
    
    @_mapObjToDOM @model.get("client"), @$('p#client-block')
    @_mapObjToDOM @model.get("origin"), @$('div.company-info, span#retour-line, footer')
    
    date = new Date(@model.get('meta').date)
    
    @$('#invoice-id').html @getFullID()
    $("html head title").html @documentName()

    monthNames = [ "januari", "feruari", "maart", "april", "mei", "juni",
        "juli", "augustus", "september", "october", "november", "december" ]
    month = monthNames[date.getMonth()]
    year = date.getUTCFullYear()<commit_msg>Regex power fixes dem bugs<commit_after>class Nota.Templates.AerixInvoiceView extends Nota.InvoiceView

  documentName: -> 'Invoice '+@getFullID()

  filesystemName: ->
    customer = @model.get("client").organization
    customer = customer || @model.get("client").contactPerson
    customer = customer.replace /\s/g, '-' # Spaces to dashes using regex
    project = @model.get("projectName")
    if project?
      project = project.replace /\s/g, '-' # Spaces to dashes using regex
      "#{@getFullID()}_#{customer}_#{project}.pdf"
    else
      "#{@getFullID()}_#{customer}.pdf"

  getFullID: ->
    date = new Date(@model.get('meta').date)
    date.getUTCFullYear()+'.'+_.str.pad(@model.get('meta').id.toString(), 4, '0')

  # Pretty much everything apart from the table
  _renderInvoiceDetails: ->
    directives = 
      vatPercentage: =>
        @model.get("vatPercentage")*100
      companyFullname: =>
        origin = @model.get('origin') 
        origin.companyName+' '+origin.companyLawform

    @_mapObjToDOM @model.attributes, @$el, directives, false
    
    @_mapObjToDOM @model.get("client"), @$('p#client-block')
    @_mapObjToDOM @model.get("origin"), @$('div.company-info, span#retour-line, footer')
    
    date = new Date(@model.get('meta').date)
    
    @$('#invoice-id').html @getFullID()
    $("html head title").html @documentName()

    monthNames = [ "januari", "feruari", "maart", "april", "mei", "juni",
        "juli", "augustus", "september", "october", "november", "december" ]
    month = monthNames[date.getMonth()]
    year = date.getUTCFullYear()
{'fraction_non_alphanumeric': 0.18222940226171244, 'fraction_numerical': 0.0032310177705977385, 'mean_word_length': 3.6140089418777945, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1885288', 'n_tokens_mistral': 1052, 'n_tokens_neox': 1030, 'n_words': 187}