Skip to content

Commit

Permalink
Remove swiftlint disable
Browse files Browse the repository at this point in the history
  • Loading branch information
Nef10 committed Sep 9, 2019
1 parent fed1e86 commit 4479f86
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions BeanCountImporter/Model/ManuLifeImporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
// Copyright © 2019 Steffen Kötte. All rights reserved.
//

//swiftlint:disable line_length

import Foundation
import SwiftBeanCountModel

Expand Down Expand Up @@ -236,14 +234,15 @@ class ManuLifeImporter {
private func stringifyPurchase(_ purchase: ([ManuLifeBuy], Date?)) -> String {
let (matches, date) = purchase
let dateString = date != nil ? ManuLifeImporter.printDateFormatter.string(from: date!) : ""
let cashAccount = "\(accountString):\(cashAccountName)"

var decimalPointPosition = 0
if let index = amountString.range(of: ".")?.lowerBound {
decimalPointPosition = amountString.distance(from: amountString.startIndex, to: index)
}

var result = "\(dateString) * \"\" \"\"\n \(cashAccount.padding(toLength: accountPaddingLength - decimalPointPosition + 1, withPad: " ", startingAt: 0)) \(amountString.padding(toLength: 10, withPad: " ", startingAt: 0)) \(commodityString)\n"
let cashAccount = "\(accountString):\(cashAccountName)".padding(toLength: accountPaddingLength - decimalPointPosition + 1, withPad: " ", startingAt: 0)

var result = "\(dateString) * \"\" \"\"\n \(cashAccount) \(amountString.padding(toLength: 10, withPad: " ", startingAt: 0)) \(commodityString)\n"
result += matches.map {
let employeeBasic = "\(accountString):Employee:Basic:\($0.commodity)".padding(toLength: accountPaddingLength, withPad: " ", startingAt: 0)
let employerBasic = "\(accountString):Employer:Basic:\($0.commodity)".padding(toLength: accountPaddingLength, withPad: " ", startingAt: 0)
Expand Down

0 comments on commit 4479f86

Please sign in to comment.