     
     itemsTable.setDelegate(self)
     itemsTable.setDataSource(self)
+    
+    resetDates()
   }
   
   // MARK: - private
+  
+  private func resetDates() {
+    issueDateField.dateValue = NSDate()
+    
+    let calendar = NSCalendar.currentCalendar()
+    let dayComponent = NSDateComponents()
+    dayComponent.day = 5
+    
+    guard let paymentDate = calendar.dateByAddingComponents(dayComponent, toDate: NSDate(), options: []) else { return }
+    
+    paymentDeadlineField.dateValue = paymentDate
+  }
   
   private func addEmptyItem() {
     items.append(InvoiceItem())

  }
  
  @IBAction func save(sender: NSButton) {
    closeWindow()
  }
  
  @IBAction func cancel(sender: NSButton) {

    return (from, to)
  }
  
  private func saveInvoice() -> Bool {
    let invoice = Invoice()
    invoice.number = numberField.stringValue
    invoice.issueDate = issueDateField.dateValue
    
    
    return true
  }
  
  // MARK: - IBAction
  
  @IBAction func cellValueChanged(sender: NSTextField) {
