Browse Source

edit recent history ui

pull/1/head
InKwon James Kim 5 years ago
parent
commit
6c81145e5d
  1. 46
      GME Remit/Extensions/String+Ext.swift
  2. 4
      GME Remit/Modules/AutoDebitModules/AddAccount/User Interface/Wireframe/AddAccountWireframe.swift
  3. 5
      GME Remit/Modules/BiometricAuthModules/BiometricNotification/User Interface/View/BiometricNotificationViewController.swift
  4. 2
      GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/User Interface/View/DomesticRemit.storyboard
  5. 5
      GME Remit/Modules/RemittanceModules/DomesticModules/RecentHistories/User Interface/Presenter/RecentHistoriesPresenter.swift
  6. 55
      GME Remit/Modules/RemittanceModules/DomesticModules/RecentHistories/User Interface/View/RecentHistories.storyboard
  7. 4
      GME Remit/Modules/RemittanceModules/DomesticModules/RecentHistories/User Interface/View/RecentHistoriesViewController.swift
  8. 37
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceipt.storyboard
  9. 16
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift
  10. 2
      GME Remit/Modules/RemittanceModules/TransactionHistoryModules/TransactionHistory/User Interface/View/Cell/TransactionHistoryTableViewCell.swift
  11. 1
      GME Remit/MultiLanguages/ko.lproj/Localizable.strings
  12. 73
      GME RemitTests/FunctionTest.swift

46
GME Remit/Extensions/String+Ext.swift

@ -8,6 +8,28 @@
import Foundation
enum CurrencyType {
case usd
case krw
case `nil`
var front: String {
switch self {
case .usd: return "USD "
case .krw: return "KRW "
case .nil: return ""
}
}
var end: String {
switch self {
case .usd: return " USD"
case .krw: return " KRW"
case .nil: return ""
}
}
}
extension String {
var imageURLInResource: String {
switch self {
@ -74,4 +96,28 @@ extension String {
return self
}
}
func decimalToCurrency(as type: CurrencyType = .nil, isFront: Bool = false) -> String {
let text = self.extract(regex: "[0-9.]")
guard let number = Double(text) else {
return isFront ? "\(type.front)\(self)" : "\(self)\(type.end)"
}
let nsNumber = NSNumber(value: number)
let currencyFormatter = NumberFormatter()
currencyFormatter.locale = Locale(identifier: "en_US")
currencyFormatter.numberStyle = .decimal
let commaSeperatedNumberString = currencyFormatter.string(for: nsNumber)
if isFront {
return "\(type.front)\(commaSeperatedNumberString ?? self)"
} else {
return "\(commaSeperatedNumberString ?? self)\(type.end)"
}
}
func currencyToDecimal() -> String {
return self.extract(regex: "[0-9.]")
}
}

4
GME Remit/Modules/AutoDebitModules/AddAccount/User Interface/Wireframe/AddAccountWireframe.swift

@ -35,7 +35,9 @@ extension AddAccountWireframe: AddAccountWireframeInput {
func openPushMainView(with model: KFTCModel?, source: UIViewController) {
self.model = model
openViewControllerWithNavigation(viewController: getMainView(), source: source)
let nav = UINavigationController(rootViewController: getMainView())
source.present(nav, animated: true, completion: nil)
}
func pushKFTCViewControllerOf(url: String, header: [KftcHeader]?) {

5
GME Remit/Modules/BiometricAuthModules/BiometricNotification/User Interface/View/BiometricNotificationViewController.swift

@ -31,7 +31,7 @@ class BiometricNotificationViewController: UIViewController {
// MARK: IBActions
@IBAction func touchUseBiometricAuth(_ sender: UIButton) {
BiometricAuthenticationWireframe().showBiometricAuthentication() { error in
BiometricAuthenticationWireframe().showBiometricAuthentication { error in
if error != nil {
self.alert(type: .error, message: error!.message)
} else {
@ -50,6 +50,9 @@ class BiometricNotificationViewController: UIViewController {
private func setup() {
// all setup should be done here
useBiometricAuthButton.layer.cornerRadius = 5
useBiometricAuthButton.backgroundColor = .themeRed
usePasswordButton.setTitleColor(.themeRed, for: .normal)
usePasswordButton.layer.cornerRadius = 5
setMultiLanguage()

2
GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/User Interface/View/DomesticRemit.storyboard

@ -114,7 +114,7 @@
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="N/A" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="crF-eg-HNv">
<rect key="frame" x="0.0" y="0.0" width="22" height="30"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="14"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>

5
GME Remit/Modules/RemittanceModules/DomesticModules/RecentHistories/User Interface/Presenter/RecentHistoriesPresenter.swift

@ -23,10 +23,11 @@ extension RecentHistoriesPresenter: RecentHistoriesModuleInterface {
from: String = "",
to: String = ""
) {
viewModel?.progress(isShow: true)
interactor?.fetchHistories(from: from, to: to)
}
func presentDatePicker(completion: ((_ from: String?, _ to: String?) -> ())?) {
func presentDatePicker(completion: ((_ from: String?, _ to: String?) -> Void)?) {
wireframe?.presentDatePicker(completion: completion)
}
}
@ -34,10 +35,12 @@ extension RecentHistoriesPresenter: RecentHistoriesModuleInterface {
// MARK: RecentHistories interactor output interface
extension RecentHistoriesPresenter: RecentHistoriesInteractorOutput {
func setHistories(with model: [RecentRecipientModel]) {
viewModel?.progress(isShow: false)
viewModel?.setHistories(with: model)
}
func setError(with error: Error) {
viewModel?.progress(isShow: false)
viewModel?.setError(with: error)
}
}

55
GME Remit/Modules/RemittanceModules/DomesticModules/RecentHistories/User Interface/View/RecentHistories.storyboard

@ -55,14 +55,31 @@
<constraint firstItem="Gh5-V7-h0V" firstAttribute="centerX" secondItem="Xuy-dc-FlA" secondAttribute="centerX" id="kvf-d8-JT3"/>
</constraints>
</view>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ean-iy-xy9">
<rect key="frame" x="10" y="44" width="355" height="50"/>
<subviews>
<searchBar contentMode="redraw" searchBarStyle="minimal" placeholder="search" translatesAutoresizingMaskIntoConstraints="NO" id="vEO-cI-U7T">
<rect key="frame" x="0.0" y="0.0" width="305" height="50"/>
<textInputTraits key="textInputTraits"/>
</searchBar>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ua4-FA-oLE">
<rect key="frame" x="305" y="0.0" width="50" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="4V1-zf-HHl"/>
<constraint firstAttribute="width" constant="50" id="sWc-xp-mml"/>
</constraints>
<state key="normal" image="ic_calender"/>
</button>
</subviews>
</stackView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Jsr-2H-Myx">
<rect key="frame" x="0.0" y="94" width="375" height="35"/>
<rect key="frame" x="7.5" y="94" width="360" height="35"/>
<subviews>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8LO-G4-CMW">
<rect key="frame" x="10" y="0.0" width="355" height="35"/>
<rect key="frame" x="10" y="0.0" width="340" height="35"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="90P-TB-KnT">
<rect key="frame" x="115" y="-7.5" width="125" height="50"/>
<rect key="frame" x="107.5" y="-7.5" width="125" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fG3-MO-Gxx">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
@ -85,7 +102,7 @@
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xGJ-l2-4gF">
<rect key="frame" x="330" y="10" width="15" height="15"/>
<rect key="frame" x="315" y="10" width="15" height="15"/>
<constraints>
<constraint firstAttribute="width" constant="15" id="KPB-Sg-RlG"/>
<constraint firstAttribute="height" constant="15" id="rhL-pb-B9n"/>
@ -114,10 +131,9 @@
<constraint firstAttribute="bottom" secondItem="8LO-G4-CMW" secondAttribute="bottom" id="kqR-Qn-oHm"/>
</constraints>
</view>
<tableView contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="vSd-Cn-NtH">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="vSd-Cn-NtH">
<rect key="frame" x="0.0" y="129" width="375" height="404.5"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="separatorInset" minX="15" minY="0.0" maxX="15" maxY="0.0"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<view key="tableFooterView" contentMode="scaleToFill" id="Jc0-AE-AKV">
<rect key="frame" x="0.0" y="126" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@ -225,36 +241,19 @@
</tableViewCell>
</prototypes>
</tableView>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ean-iy-xy9">
<rect key="frame" x="0.0" y="44" width="375" height="50"/>
<subviews>
<searchBar contentMode="redraw" searchBarStyle="minimal" placeholder="search" translatesAutoresizingMaskIntoConstraints="NO" id="vEO-cI-U7T">
<rect key="frame" x="0.0" y="0.0" width="325" height="50"/>
<textInputTraits key="textInputTraits"/>
</searchBar>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ua4-FA-oLE">
<rect key="frame" x="325" y="0.0" width="50" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="4V1-zf-HHl"/>
<constraint firstAttribute="width" constant="50" id="sWc-xp-mml"/>
</constraints>
<state key="normal" image="ic_calender"/>
</button>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="vSd-Cn-NtH" firstAttribute="leading" secondItem="9jL-Y3-Li7" secondAttribute="leading" id="4e9-7p-1hF"/>
<constraint firstAttribute="bottom" secondItem="vSd-Cn-NtH" secondAttribute="bottom" id="5uw-xa-P0A"/>
<constraint firstItem="Xuy-dc-FlA" firstAttribute="top" secondItem="9jL-Y3-Li7" secondAttribute="top" id="8BB-ZR-xGS"/>
<constraint firstAttribute="trailing" secondItem="Jsr-2H-Myx" secondAttribute="trailing" id="ADu-o6-B32"/>
<constraint firstAttribute="trailing" secondItem="Jsr-2H-Myx" secondAttribute="trailing" constant="7.5" id="ADu-o6-B32"/>
<constraint firstAttribute="trailing" secondItem="vSd-Cn-NtH" secondAttribute="trailing" id="Aps-rw-KLW"/>
<constraint firstItem="Ean-iy-xy9" firstAttribute="leading" secondItem="9jL-Y3-Li7" secondAttribute="leading" id="CIL-AH-cfT"/>
<constraint firstItem="Ean-iy-xy9" firstAttribute="leading" secondItem="9jL-Y3-Li7" secondAttribute="leading" constant="10" id="CIL-AH-cfT"/>
<constraint firstItem="Ean-iy-xy9" firstAttribute="top" secondItem="Xuy-dc-FlA" secondAttribute="bottom" id="Val-z4-Y6a"/>
<constraint firstAttribute="trailing" secondItem="Xuy-dc-FlA" secondAttribute="trailing" id="Wru-8H-EHe"/>
<constraint firstAttribute="trailing" secondItem="Ean-iy-xy9" secondAttribute="trailing" id="adi-8C-sFa"/>
<constraint firstItem="Jsr-2H-Myx" firstAttribute="leading" secondItem="9jL-Y3-Li7" secondAttribute="leading" id="nS5-gN-E2j"/>
<constraint firstAttribute="trailing" secondItem="Ean-iy-xy9" secondAttribute="trailing" constant="10" id="adi-8C-sFa"/>
<constraint firstItem="Jsr-2H-Myx" firstAttribute="leading" secondItem="9jL-Y3-Li7" secondAttribute="leading" constant="7.5" id="nS5-gN-E2j"/>
<constraint firstItem="Xuy-dc-FlA" firstAttribute="leading" secondItem="9jL-Y3-Li7" secondAttribute="leading" id="qbJ-S8-MQa"/>
<constraint firstItem="vSd-Cn-NtH" firstAttribute="top" secondItem="Jsr-2H-Myx" secondAttribute="bottom" id="t9r-ay-d7l"/>
<constraint firstItem="Jsr-2H-Myx" firstAttribute="top" secondItem="Ean-iy-xy9" secondAttribute="bottom" id="zcG-CI-ZBq"/>

4
GME Remit/Modules/RemittanceModules/DomesticModules/RecentHistories/User Interface/View/RecentHistoriesViewController.swift

@ -46,6 +46,8 @@ class RecentHistoriesViewController: UIViewController {
@IBOutlet private weak var periodViewHeightConstraint: NSLayoutConstraint!
private let impact = UISelectionFeedbackGenerator()
// MARK: VC's Life cycle
override func viewDidLoad() {
super.viewDidLoad()
@ -58,6 +60,8 @@ class RecentHistoriesViewController: UIViewController {
mainView.bottomToOrigin(duration: 0.1)
IQKeyboardManager.shared.enable = false
impact.selectionChanged()
}
override func viewWillDisappear(_ animated: Bool) {

37
GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceipt.storyboard

@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14868" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14824"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -16,6 +14,9 @@
<array key="SanFranciscoDisplay-Heavy.otf">
<string>SanFranciscoDisplay-Heavy</string>
</array>
<array key="SanFranciscoDisplay-Medium.otf">
<string>SanFranciscoDisplay-Medium</string>
</array>
<array key="SanFranciscoDisplay-Regular.otf">
<string>SanFranciscoDisplay-Regular</string>
</array>
@ -171,7 +172,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qz4-OT-jiF">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="Qz4-OT-jiF">
<rect key="frame" x="108.5" y="0.0" width="220.5" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -200,7 +201,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dxd-Uq-v7o">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="dxd-Uq-v7o">
<rect key="frame" x="57.5" y="0.0" width="271.5" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -230,7 +231,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Gge-7S-SaJ">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="Gge-7S-SaJ">
<rect key="frame" x="54" y="0.0" width="275" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -259,7 +260,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SJg-la-JAc">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="SJg-la-JAc">
<rect key="frame" x="69.5" y="0.0" width="259.5" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -291,7 +292,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ertserggfdhfdsdfgdsdfgertserggfdhfdsdfgdsdfgertserggfdhfdsdfgdsdfgertserggfdhfdsdfgdsdfg" textAlignment="right" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="98o-ui-Lmx">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ertserggfdhfdsdfgdsdfgertserggfdhfdsdfgdsdfgertserggfdhfdsdfgdsdfgertserggfdhfdsdfgdsdfg" textAlignment="right" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="98o-ui-Lmx">
<rect key="frame" x="165.5" y="0.0" width="163.5" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -322,7 +323,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="joO-Vx-01A">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="joO-Vx-01A">
<rect key="frame" x="119" y="0.0" width="210" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -351,7 +352,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.34117999999999998" green="0.27843000000000001" blue="0.31764999999999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gWt-Rx-LIV">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="gWt-Rx-LIV">
<rect key="frame" x="48" y="0.0" width="281" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -380,7 +381,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mle-zI-ZDV">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="Mle-zI-ZDV">
<rect key="frame" x="109.5" y="0.0" width="219.5" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -409,7 +410,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Mm-Rr-tjC">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="5Mm-Rr-tjC">
<rect key="frame" x="75" y="0.0" width="254" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -438,7 +439,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="birthday(-20%)" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PP3-Tg-vui">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="birthday(-20%)" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="PP3-Tg-vui">
<rect key="frame" x="151" y="0.0" width="178" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -467,7 +468,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="E9N-rz-5eO">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="E9N-rz-5eO">
<rect key="frame" x="49.5" y="0.0" width="279.5" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -496,7 +497,7 @@ Share with concerned party only</string>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="63I-2O-WVX">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="63I-2O-WVX">
<rect key="frame" x="134" y="0.0" width="195" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<color key="textColor" red="0.2901960784" green="0.2901960784" blue="0.2901960784" alpha="1" colorSpace="calibratedRGB"/>
@ -577,7 +578,7 @@ Share with concerned party only</string>
<constraints>
<constraint firstAttribute="height" constant="50" id="ROj-N3-WAp"/>
</constraints>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="18"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Medium" family="San Francisco Display" pointSize="18"/>
<state key="normal" title="Done">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>

16
GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift

@ -264,7 +264,7 @@ class SendMoneyReceiptViewController: UIViewController {
self.transactionDateLabel.text = reciept?.transactionDate
self.addressLabel.text = self.reciept?.rAddress
self.mobileNoLabel.text = self.reciept?.rContactNo
self.mobileNoLabel.text = self.reciept?.rContactNo ?? "N/A"
self.agentBankLabel.text = self.reciept?.agentBank
let branch = self.reciept?.payoutBankBranch ?? ""
self.branchLabel.text = branch
@ -272,19 +272,19 @@ class SendMoneyReceiptViewController: UIViewController {
let accountNo = self.reciept?.accountNo ?? ""
self.accountNoView.isHidden = accountNo == ""
self.accountNoLabel.text = self.reciept?.accountNo
self.relationLabel.text = self.reciept?.collAmount
self.transferFeeLabel.text = self.reciept?.serviceCharge
self.relationLabel.text = self.reciept?.collAmount?.decimalToCurrency(as: .krw)
self.transferFeeLabel.text = self.reciept?.serviceCharge?.decimalToCurrency(as: .krw)
self.exchangeRateLabel.text = self.reciept?.exRate
let controlNo = self.reciept?.controNo ?? ""
self.gmeControlNumberLabel.text = StringConstants().gmeControlNumberText + ": " + controlNo
let totalAmount = self.reciept?.payoutAmount ?? ""
// let _totalAmt = Utility.getCommaSeperatedString(numberString: totalAmount) ?? ""
self.totalAmountLabel.text = totalAmount
self.totalAmountHeaderLabel.text = StringConstants().totalPayoutAmountText + ": \(totalAmount)"
//Coupon setting couponName(couponValue or discountPercent)
let totalAmount = (receiptType == .overseas) ? (self.reciept?.payoutAmount ?? "") :
(self.reciept?.payoutAmount ?? "").decimalToCurrency(as: .krw)
self.totalAmountLabel.text = totalAmount
self.totalAmountHeaderLabel.text = StringConstants().totalPayoutAmountText + ": \(totalAmount)"
usedCouponLabel.text = reciept?.formattedCouponName
}
}

2
GME Remit/Modules/RemittanceModules/TransactionHistoryModules/TransactionHistory/User Interface/View/Cell/TransactionHistoryTableViewCell.swift

@ -34,7 +34,7 @@ class TransactionHistoryTableViewCell: UITableViewCell {
func setup() {
self.dateLabel.text = model?.sendDate
self.amountLabel.text = (model?.pAmt ?? "") + " " + (model?.pCurrency ?? "")
self.amountLabel.text = (model?.pAmt ?? "").decimalToCurrency() + " " + (model?.pCurrency ?? "")
self.paymentMethodLabel.text = model?.payOutMode
self.nameLabel.text = model?.user
let paystatus = model?.payStatus ?? ""

1
GME Remit/MultiLanguages/ko.lproj/Localizable.strings

@ -655,3 +655,4 @@
"local_text" = "국내";
"international_text" = "해외";
"transfer_charge_text" = "수수료";
"krw_text" = "원";

73
GME RemitTests/FunctionTest.swift

@ -123,12 +123,77 @@ class FunctionTest: XCTestCase {
}
}
}
func testDecimalToCurrency() {
var amount = "10000"
XCTAssert(amount.decimalToCurrency() == "10,000", amount.decimalToCurrency())
amount = "10000.00"
XCTAssert(amount.decimalToCurrency() == "10,000", amount.decimalToCurrency())
amount = "11345.00"
XCTAssert(amount.decimalToCurrency() == "11,345", amount.decimalToCurrency())
amount = "11345.94"
XCTAssert(amount.decimalToCurrency() == "11,345.94", amount.decimalToCurrency())
amount = "0.11"
XCTAssert(amount.decimalToCurrency() == "0.11", amount.decimalToCurrency())
amount = "10000"
XCTAssert(
amount.decimalToCurrency(as: .krw, isFront: true) == "KRW 10,000",
amount.decimalToCurrency(as: .krw, isFront: true)
)
amount = "10000.00"
XCTAssert(
amount.decimalToCurrency(as: .krw, isFront: false) == "10,000 KRW",
amount.decimalToCurrency(as: .krw, isFront: false)
)
amount = "11345.00"
XCTAssert(
amount.decimalToCurrency(as: .usd, isFront: true) == "USD 11,345",
amount.decimalToCurrency(as: .usd, isFront: true)
)
amount = "11345.94"
XCTAssert(
amount.decimalToCurrency(as: .usd, isFront: false) == "11,345.94 USD",
amount.decimalToCurrency(as: .usd, isFront: false)
)
amount = "0.11"
XCTAssert(
amount.decimalToCurrency(as: .usd, isFront: true) == "USD 0.11",
amount.decimalToCurrency(as: .usd, isFront: true)
)
}
func testCurrent(){
let amount = "10000"
func testCurrencyToDecimal() {
var amount = "10,000"
XCTAssert(amount.currencyToDecimal() == "10000", amount.currencyToDecimal())
amount = "10,000.00"
XCTAssert(amount.currencyToDecimal() == "10000.00", amount.currencyToDecimal())
amount = "11,345.94"
XCTAssert(amount.currencyToDecimal() == "11345.94", amount.currencyToDecimal())
amount = "0.11"
XCTAssert(amount.currencyToDecimal() == "0.11", amount.currencyToDecimal())
amount = "KRW 10,000"
XCTAssert(amount.currencyToDecimal() == "10000", amount.currencyToDecimal())
amount = "USD 11,345"
XCTAssert(amount.currencyToDecimal() == "11345", amount.currencyToDecimal())
// getCommaSeperatedStringWithDecimal
print("amount \(Utility.getCommaSeperatedString(numberString: amount))")
amount = "11,345.94 USD"
XCTAssert(amount.currencyToDecimal() == "11345.94", amount.currencyToDecimal())
amount = "USD 0.11"
XCTAssert(amount.currencyToDecimal() == "0.11", amount.currencyToDecimal())
}
}
Loading…
Cancel
Save