|
|
@ -10,294 +10,299 @@ import UIKit |
|
|
|
import Kingfisher |
|
|
|
|
|
|
|
enum MailBoxType { |
|
|
|
case cancel |
|
|
|
case edit |
|
|
|
case cancel |
|
|
|
case edit |
|
|
|
} |
|
|
|
|
|
|
|
enum ReceiptType { |
|
|
|
case overseas |
|
|
|
case overseas |
|
|
|
} |
|
|
|
|
|
|
|
class SendMoneyReceiptViewController: UIViewController { |
|
|
|
|
|
|
|
// MARK: IBOutlets |
|
|
|
|
|
|
|
struct StringConstants { |
|
|
|
let transferSuccessText = "transfer_success_text".localized() |
|
|
|
let transactionDateText = "transaction_date_text".localized() |
|
|
|
let recieverText = "receiver_text".localized() |
|
|
|
let addressText = "email_address_text".localized() |
|
|
|
let mobileNoText = "mobile_number_text".localized() |
|
|
|
let payoutAgentText = "payout_agent_text".localized() |
|
|
|
let totalSentAmountText = "total_sent_amount_text".localized() |
|
|
|
let branchText = "branch_text".localized() |
|
|
|
let accountNumberText = "account_number_text".localized() |
|
|
|
let totalPayoutAmountText = "total_payout_amount_text".localized() |
|
|
|
let serviceFeeText = "service_fee_text".localized() |
|
|
|
let exRateText = "ex_rate_text".localized() |
|
|
|
let payoutAmountText = "total_amount_text".localized() |
|
|
|
let gmeControlNumberText = "gme_control_no_text".localized() |
|
|
|
let doneText = "done_text".localized() |
|
|
|
} |
|
|
|
|
|
|
|
@IBOutlet weak var fullnameLabel: UILabel! |
|
|
|
@IBOutlet weak var transactionDateLabel: UILabel! |
|
|
|
|
|
|
|
@IBOutlet weak var exchangeRateLabel: UILabel! |
|
|
|
@IBOutlet weak var relationLabel: UILabel! |
|
|
|
@IBOutlet weak var addressLabel: UILabel! |
|
|
|
@IBOutlet weak var mobileNoLabel: UILabel! |
|
|
|
@IBOutlet weak var recieverNameLabelLabel: UILabel! |
|
|
|
@IBOutlet weak var agentBankLabel: UILabel! |
|
|
|
@IBOutlet weak var branchLabel: UILabel! |
|
|
|
@IBOutlet weak var accountNoLabel: UILabel! |
|
|
|
@IBOutlet weak var transferFeeLabel: UILabel! |
|
|
|
@IBOutlet weak var totalAmountLabel: UILabel! |
|
|
|
@IBOutlet weak var gmeControlNumberLabel: UILabel! |
|
|
|
@IBOutlet weak var totalAmountHeaderLabel: UILabel! |
|
|
|
@IBOutlet weak var doneButton: UIButton! |
|
|
|
@IBOutlet weak var requestToChangeButton: UIButton! |
|
|
|
@IBOutlet weak var requestToCancelButton: UIButton! |
|
|
|
@IBOutlet weak var transactionReportButtonStackView: UIStackView! |
|
|
|
|
|
|
|
@IBOutlet weak var accountNoView: UIView! |
|
|
|
@IBOutlet weak var branchView: UIView! |
|
|
|
|
|
|
|
// title labels |
|
|
|
@IBOutlet weak var transferSuccessfullTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var moneygramImageView: UIImageView! |
|
|
|
@IBOutlet weak var moneygramLogoLabel: UILabel! |
|
|
|
@IBOutlet weak var warningLabel: UILabel! |
|
|
|
@IBOutlet weak var moneygramStackView: UIStackView! |
|
|
|
|
|
|
|
// Body labels |
|
|
|
@IBOutlet weak var tansactionDateTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var recieverTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var addressTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var mobileTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var payoutAgentTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var sentAmountTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var branchTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var accountNumberTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var serviceTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var exRateTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var totalPayoutAmountTitleLabel: UILabel! |
|
|
|
|
|
|
|
|
|
|
|
@IBOutlet private weak var transactionDateContainerView: UIView! |
|
|
|
@IBOutlet private weak var receiverNameContainerView: UIView! |
|
|
|
@IBOutlet private weak var addressContainerView: UIView! |
|
|
|
@IBOutlet private weak var mobileContainerView: UIView! |
|
|
|
@IBOutlet private weak var bankContainerView: UIView! |
|
|
|
@IBOutlet private weak var totalSentAmountContainerView: UIView! |
|
|
|
@IBOutlet private weak var serviceFeeContainerView: UIView! |
|
|
|
@IBOutlet private weak var exchangeRateContainerView: UIView! |
|
|
|
@IBOutlet private weak var totalPayoutAmountContainerView: UIView! |
|
|
|
|
|
|
|
// MARK: Properties |
|
|
|
|
|
|
|
var presenter: SendMoneyReceiptModuleInterface? |
|
|
|
weak var hudDelegate: HUDStatusDelegate? |
|
|
|
var shouldShowCancelAmmendButton = false |
|
|
|
var isFromTransactionHistory = false |
|
|
|
var controlNo: String? |
|
|
|
var transactionId: String? |
|
|
|
var type: MailBoxType? |
|
|
|
|
|
|
|
var receiptType: ReceiptType = .overseas |
|
|
|
|
|
|
|
var reciept: SendMoneyReciept? { |
|
|
|
didSet { |
|
|
|
self.showRecipt() |
|
|
|
// MARK: IBOutlets |
|
|
|
|
|
|
|
struct StringConstants { |
|
|
|
let transferSuccessText = "transfer_success_text".localized() |
|
|
|
let transactionDateText = "transaction_date_text".localized() |
|
|
|
let recieverText = "receiver_text".localized() |
|
|
|
let addressText = "email_address_text".localized() |
|
|
|
let mobileNoText = "mobile_number_text".localized() |
|
|
|
let payoutAgentText = "payout_agent_text".localized() |
|
|
|
let totalSentAmountText = "total_sent_amount_text".localized() |
|
|
|
let branchText = "branch_text".localized() |
|
|
|
let accountNumberText = "account_number_text".localized() |
|
|
|
let totalPayoutAmountText = "total_payout_amount_text".localized() |
|
|
|
let serviceFeeText = "service_fee_text".localized() |
|
|
|
let exRateText = "ex_rate_text".localized() |
|
|
|
let payoutAmountText = "total_amount_text".localized() |
|
|
|
let gmeControlNumberText = "gme_control_no_text".localized() |
|
|
|
let doneText = "done_text".localized() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// MARK: VC's Life cycle |
|
|
|
|
|
|
|
override func viewDidLoad() { |
|
|
|
super.viewDidLoad() |
|
|
|
self.setup() |
|
|
|
self.presenter?.viewIsReady(type: receiptType) |
|
|
|
} |
|
|
|
|
|
|
|
override func viewWillAppear(_ animated: Bool) { |
|
|
|
super.viewWillAppear(animated) |
|
|
|
self.navigationItem.title = "Receipt" |
|
|
|
self.setupBackButton() |
|
|
|
|
|
|
|
switch receiptType { |
|
|
|
case .overseas: |
|
|
|
transactionDateContainerView.isHidden = false |
|
|
|
receiverNameContainerView.isHidden = false |
|
|
|
mobileContainerView.isHidden = false |
|
|
|
bankContainerView.isHidden = false |
|
|
|
totalSentAmountContainerView.isHidden = false |
|
|
|
accountNoView.isHidden = false |
|
|
|
serviceFeeContainerView.isHidden = false |
|
|
|
|
|
|
|
addressContainerView.isHidden = false |
|
|
|
branchView.isHidden = false |
|
|
|
exchangeRateContainerView.isHidden = false |
|
|
|
totalPayoutAmountContainerView.isHidden = false |
|
|
|
|
|
|
|
@IBOutlet weak var fullnameLabel: UILabel! |
|
|
|
@IBOutlet weak var transactionDateLabel: UILabel! |
|
|
|
|
|
|
|
@IBOutlet weak var exchangeRateLabel: UILabel! |
|
|
|
@IBOutlet weak var relationLabel: UILabel! |
|
|
|
@IBOutlet weak var addressLabel: UILabel! |
|
|
|
@IBOutlet weak var mobileNoLabel: UILabel! |
|
|
|
@IBOutlet weak var recieverNameLabelLabel: UILabel! |
|
|
|
@IBOutlet weak var agentBankLabel: UILabel! |
|
|
|
@IBOutlet weak var branchLabel: UILabel! |
|
|
|
@IBOutlet weak var accountNoLabel: UILabel! |
|
|
|
@IBOutlet weak var transferFeeLabel: UILabel! |
|
|
|
@IBOutlet weak var totalAmountLabel: UILabel! |
|
|
|
@IBOutlet weak var gmeControlNumberLabel: UILabel! |
|
|
|
@IBOutlet weak var totalAmountHeaderLabel: UILabel! |
|
|
|
@IBOutlet weak var doneButton: UIButton! |
|
|
|
@IBOutlet weak var requestToChangeButton: UIButton! |
|
|
|
@IBOutlet weak var requestToCancelButton: UIButton! |
|
|
|
@IBOutlet weak var transactionReportButtonStackView: UIStackView! |
|
|
|
|
|
|
|
@IBOutlet weak var accountNoView: UIView! |
|
|
|
@IBOutlet weak var branchView: UIView! |
|
|
|
|
|
|
|
// title labels |
|
|
|
@IBOutlet weak var transferSuccessfullTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var moneygramImageView: UIImageView! |
|
|
|
@IBOutlet weak var moneygramLogoLabel: UILabel! |
|
|
|
@IBOutlet weak var warningLabel: UILabel! |
|
|
|
@IBOutlet weak var moneygramStackView: UIStackView! |
|
|
|
|
|
|
|
// Body labels |
|
|
|
@IBOutlet weak var tansactionDateTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var recieverTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var addressTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var mobileTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var payoutAgentTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var sentAmountTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var branchTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var accountNumberTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var serviceTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var exRateTitleLabel: UILabel! |
|
|
|
@IBOutlet weak var totalPayoutAmountTitleLabel: UILabel! |
|
|
|
|
|
|
|
@IBOutlet private weak var transactionDateContainerView: UIView! |
|
|
|
@IBOutlet private weak var receiverNameContainerView: UIView! |
|
|
|
@IBOutlet private weak var addressContainerView: UIView! |
|
|
|
@IBOutlet private weak var mobileContainerView: UIView! |
|
|
|
@IBOutlet private weak var bankContainerView: UIView! |
|
|
|
@IBOutlet private weak var totalSentAmountContainerView: UIView! |
|
|
|
@IBOutlet private weak var serviceFeeContainerView: UIView! |
|
|
|
@IBOutlet private weak var exchangeRateContainerView: UIView! |
|
|
|
@IBOutlet private weak var totalPayoutAmountContainerView: UIView! |
|
|
|
|
|
|
|
// MARK: Properties |
|
|
|
|
|
|
|
var presenter: SendMoneyReceiptModuleInterface? |
|
|
|
weak var hudDelegate: HUDStatusDelegate? |
|
|
|
var shouldShowCancelAmmendButton = false |
|
|
|
var isFromTransactionHistory = false |
|
|
|
var controlNo: String? |
|
|
|
var transactionId: String? |
|
|
|
var type: MailBoxType? |
|
|
|
var isfromNotice = false |
|
|
|
|
|
|
|
var receiptType: ReceiptType = .overseas |
|
|
|
|
|
|
|
var reciept: SendMoneyReciept? { |
|
|
|
didSet { |
|
|
|
self.showRecipt() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
override func viewWillDisappear(_ animated: Bool) { |
|
|
|
super.viewWillAppear(animated) |
|
|
|
self.navigationItem.title = "" |
|
|
|
} |
|
|
|
// MARK: VC's Life cycle |
|
|
|
|
|
|
|
override func viewDidAppear(_ animated: Bool) { |
|
|
|
super.viewDidAppear(animated) |
|
|
|
override func viewDidLoad() { |
|
|
|
super.viewDidLoad() |
|
|
|
self.setup() |
|
|
|
self.presenter?.viewIsReady(type: receiptType) |
|
|
|
} |
|
|
|
|
|
|
|
if !isFromTransactionHistory { |
|
|
|
StoreReviewHelper.shared.checkAndAskForReview() |
|
|
|
override func viewWillAppear(_ animated: Bool) { |
|
|
|
super.viewWillAppear(animated) |
|
|
|
self.navigationItem.title = "Receipt" |
|
|
|
self.setupBackButton() |
|
|
|
|
|
|
|
switch receiptType { |
|
|
|
case .overseas: |
|
|
|
transactionDateContainerView.isHidden = false |
|
|
|
receiverNameContainerView.isHidden = false |
|
|
|
mobileContainerView.isHidden = false |
|
|
|
bankContainerView.isHidden = false |
|
|
|
totalSentAmountContainerView.isHidden = false |
|
|
|
accountNoView.isHidden = false |
|
|
|
serviceFeeContainerView.isHidden = false |
|
|
|
|
|
|
|
addressContainerView.isHidden = false |
|
|
|
branchView.isHidden = false |
|
|
|
exchangeRateContainerView.isHidden = false |
|
|
|
totalPayoutAmountContainerView.isHidden = false |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// MARK: IBActions |
|
|
|
@IBAction func done(_ sender: UIButton) { |
|
|
|
if (isFromTransactionHistory) { |
|
|
|
self.navigationController?.popViewController(animated: true) |
|
|
|
} else { |
|
|
|
self.navigationController?.popToRootViewController(animated: true) |
|
|
|
|
|
|
|
override func viewWillDisappear(_ animated: Bool) { |
|
|
|
super.viewWillAppear(animated) |
|
|
|
self.navigationItem.title = "" |
|
|
|
} |
|
|
|
} |
|
|
|
// MARK: Other Functions |
|
|
|
|
|
|
|
@IBAction func requestToCancel(_ sender: UIButton) { |
|
|
|
self.sendMail(type: .cancel) |
|
|
|
} |
|
|
|
|
|
|
|
@IBAction func requestToChange(_ sender: UIButton) { |
|
|
|
self.sendMail(type: .edit) |
|
|
|
} |
|
|
|
|
|
|
|
func sendMail(type: MailBoxType) { |
|
|
|
self.presenter?.openMail( |
|
|
|
controlNO: self.controlNo ?? "", |
|
|
|
transactionId: self.transactionId ?? "", |
|
|
|
type: type |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
private func setup() { |
|
|
|
// all setup should be done here |
|
|
|
setupBackButton() |
|
|
|
configureLanguage() |
|
|
|
} |
|
|
|
|
|
|
|
func configureLanguage() { |
|
|
|
self.transferSuccessfullTitleLabel.text = StringConstants().transferSuccessText |
|
|
|
self.tansactionDateTitleLabel.text = StringConstants().transactionDateText |
|
|
|
self.recieverTitleLabel.text = StringConstants().recieverText |
|
|
|
self.addressTitleLabel.text = StringConstants().addressText |
|
|
|
self.mobileTitleLabel.text = StringConstants().mobileNoText |
|
|
|
self.payoutAgentTitleLabel.text = StringConstants().payoutAgentText |
|
|
|
self.totalPayoutAmountTitleLabel.text = StringConstants().totalSentAmountText |
|
|
|
self.branchTitleLabel.text = StringConstants().branchText |
|
|
|
self.accountNumberTitleLabel.text = StringConstants().accountNumberText |
|
|
|
self.serviceTitleLabel.text = StringConstants().serviceFeeText |
|
|
|
self.exRateTitleLabel.text = StringConstants().exRateText |
|
|
|
self.totalPayoutAmountTitleLabel.text = StringConstants().payoutAmountText |
|
|
|
self.sentAmountTitleLabel.text = StringConstants().totalSentAmountText |
|
|
|
self.doneButton.setTitle(StringConstants().doneText, for: UIControl.State.normal) |
|
|
|
self.requestToCancelButton.setTitle("request_to_cancel_text".localized(), for: UIControl.State.normal) |
|
|
|
self.requestToChangeButton.setTitle("request_to_change_text".localized(), for: UIControl.State.normal) |
|
|
|
} |
|
|
|
|
|
|
|
func setupBackButton() { |
|
|
|
if shouldShowCancelAmmendButton { |
|
|
|
self.navigationController?.navigationItem.hidesBackButton = false |
|
|
|
let button = UIBarButtonItem.init( |
|
|
|
image: #imageLiteral(resourceName: "backIconBlack"), style: UIBarButtonItem.Style.plain, |
|
|
|
target: self, |
|
|
|
action: #selector(self.back) |
|
|
|
) |
|
|
|
self.navigationItem.backBarButtonItem = button |
|
|
|
self.doneButton.isHidden = true |
|
|
|
self.transactionReportButtonStackView.isHidden = false |
|
|
|
} else { |
|
|
|
self.doneButton.isHidden = false |
|
|
|
self.doneButton.backgroundColor = .themeRed |
|
|
|
self.doneButton.layer.cornerRadius = 5 |
|
|
|
|
|
|
|
self.transactionReportButtonStackView.isHidden = true |
|
|
|
self.navigationController?.navigationItem.hidesBackButton = true |
|
|
|
let button = UIBarButtonItem.init( |
|
|
|
title: nil, |
|
|
|
style: UIBarButtonItem.Style.plain, |
|
|
|
target: nil, |
|
|
|
action: nil |
|
|
|
) |
|
|
|
self.navigationItem.leftBarButtonItem = button |
|
|
|
|
|
|
|
override func viewDidAppear(_ animated: Bool) { |
|
|
|
super.viewDidAppear(animated) |
|
|
|
|
|
|
|
if !isFromTransactionHistory { |
|
|
|
StoreReviewHelper.shared.checkAndAskForReview() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@objc private func back() { |
|
|
|
self.presenter?.dismiss() |
|
|
|
} |
|
|
|
// MARK: IBActions |
|
|
|
@IBAction func done(_ sender: UIButton) { |
|
|
|
if (isFromTransactionHistory) { |
|
|
|
self.navigationController?.popViewController(animated: true) |
|
|
|
} else { |
|
|
|
self.navigationController?.popToRootViewController(animated: true) |
|
|
|
} |
|
|
|
} |
|
|
|
// MARK: Other Functions |
|
|
|
|
|
|
|
private func showRecipt() { |
|
|
|
let firstName = self.reciept?.rFirstName ?? "" |
|
|
|
let lastName = self.reciept?.rLastName ?? "" |
|
|
|
let middleName = self.reciept?.rMiddleName ?? "" |
|
|
|
@IBAction func requestToCancel(_ sender: UIButton) { |
|
|
|
self.sendMail(type: .cancel) |
|
|
|
} |
|
|
|
|
|
|
|
let fullName = firstName + " " + middleName + " " + lastName |
|
|
|
@IBAction func requestToChange(_ sender: UIButton) { |
|
|
|
self.sendMail(type: .edit) |
|
|
|
} |
|
|
|
|
|
|
|
self.recieverNameLabelLabel.text = fullName.uppercased() |
|
|
|
self.fullnameLabel.text = "To: \(fullName.uppercased())" |
|
|
|
func sendMail(type: MailBoxType) { |
|
|
|
self.presenter?.openMail( |
|
|
|
controlNO: self.controlNo ?? "", |
|
|
|
transactionId: self.transactionId ?? "", |
|
|
|
type: type |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
self.transactionDateLabel.text = reciept?.transactionDate |
|
|
|
private func setup() { |
|
|
|
// all setup should be done here |
|
|
|
setupBackButton() |
|
|
|
configureLanguage() |
|
|
|
noticeReceipt() |
|
|
|
} |
|
|
|
|
|
|
|
self.addressLabel.text = self.reciept?.rAddress |
|
|
|
self.mobileNoLabel.text = self.reciept?.rContactNo ?? "N/A" |
|
|
|
self.agentBankLabel.text = self.reciept?.agentBank |
|
|
|
let branch = self.reciept?.payoutBankBranch ?? "" |
|
|
|
self.branchLabel.text = branch |
|
|
|
self.branchView.isHidden = branch == "" |
|
|
|
let accountNo = self.reciept?.accountNo ?? "" |
|
|
|
self.accountNoView.isHidden = accountNo == "" |
|
|
|
self.accountNoLabel.text = self.reciept?.accountNo |
|
|
|
self.relationLabel.text = self.reciept?.collAmount?.decimalToCurrency(as: .krw) |
|
|
|
self.transferFeeLabel.text = self.reciept?.serviceCharge?.decimalToCurrency(as: .krw) |
|
|
|
self.exchangeRateLabel.text = self.reciept?.exRate |
|
|
|
func noticeReceipt() { |
|
|
|
|
|
|
|
let controlNo = self.reciept?.controNo ?? "" |
|
|
|
self.gmeControlNumberLabel.text = StringConstants().gmeControlNumberText + ": " + controlNo |
|
|
|
} |
|
|
|
|
|
|
|
let totalAmount = (receiptType == .overseas) ? (self.reciept?.payoutAmount ?? "") : |
|
|
|
(self.reciept?.payoutAmount ?? "").decimalToCurrency(as: .krw) |
|
|
|
func configureLanguage() { |
|
|
|
self.transferSuccessfullTitleLabel.text = StringConstants().transferSuccessText |
|
|
|
self.tansactionDateTitleLabel.text = StringConstants().transactionDateText |
|
|
|
self.recieverTitleLabel.text = StringConstants().recieverText |
|
|
|
self.addressTitleLabel.text = StringConstants().addressText |
|
|
|
self.mobileTitleLabel.text = StringConstants().mobileNoText |
|
|
|
self.payoutAgentTitleLabel.text = StringConstants().payoutAgentText |
|
|
|
self.totalPayoutAmountTitleLabel.text = StringConstants().totalSentAmountText |
|
|
|
self.branchTitleLabel.text = StringConstants().branchText |
|
|
|
self.accountNumberTitleLabel.text = StringConstants().accountNumberText |
|
|
|
self.serviceTitleLabel.text = StringConstants().serviceFeeText |
|
|
|
self.exRateTitleLabel.text = StringConstants().exRateText |
|
|
|
self.totalPayoutAmountTitleLabel.text = StringConstants().payoutAmountText |
|
|
|
self.sentAmountTitleLabel.text = StringConstants().totalSentAmountText |
|
|
|
self.doneButton.setTitle(StringConstants().doneText, for: UIControl.State.normal) |
|
|
|
self.requestToCancelButton.setTitle("request_to_cancel_text".localized(), for: UIControl.State.normal) |
|
|
|
self.requestToChangeButton.setTitle("request_to_change_text".localized(), for: UIControl.State.normal) |
|
|
|
} |
|
|
|
|
|
|
|
self.totalAmountLabel.text = totalAmount |
|
|
|
self.totalAmountHeaderLabel.text = StringConstants().totalPayoutAmountText + ": \(totalAmount)" |
|
|
|
func setupBackButton() { |
|
|
|
if shouldShowCancelAmmendButton { |
|
|
|
self.navigationController?.navigationItem.hidesBackButton = false |
|
|
|
let button = UIBarButtonItem.init( |
|
|
|
image: #imageLiteral(resourceName: "backIconBlack"), style: UIBarButtonItem.Style.plain, |
|
|
|
target: self, |
|
|
|
action: #selector(self.back) |
|
|
|
) |
|
|
|
self.navigationItem.backBarButtonItem = button |
|
|
|
self.doneButton.isHidden = true |
|
|
|
self.transactionReportButtonStackView.isHidden = false |
|
|
|
} else { |
|
|
|
self.doneButton.isHidden = false |
|
|
|
self.doneButton.backgroundColor = .themeRed |
|
|
|
self.doneButton.layer.cornerRadius = 5 |
|
|
|
|
|
|
|
self.transactionReportButtonStackView.isHidden = true |
|
|
|
self.navigationController?.navigationItem.hidesBackButton = true |
|
|
|
let button = UIBarButtonItem.init( |
|
|
|
title: nil, |
|
|
|
style: UIBarButtonItem.Style.plain, |
|
|
|
target: nil, |
|
|
|
action: nil |
|
|
|
) |
|
|
|
self.navigationItem.leftBarButtonItem = button |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@objc private func back() { |
|
|
|
self.presenter?.dismiss() |
|
|
|
} |
|
|
|
|
|
|
|
if reciept?.showPartnerLogo == "Y" { |
|
|
|
private func showRecipt() { |
|
|
|
let firstName = self.reciept?.rFirstName ?? "" |
|
|
|
let lastName = self.reciept?.rLastName ?? "" |
|
|
|
let middleName = self.reciept?.rMiddleName ?? "" |
|
|
|
|
|
|
|
moneygramLogoLabel.text = reciept?.logoText |
|
|
|
} else { |
|
|
|
moneygramStackView.isHidden = true |
|
|
|
let fullName = firstName + " " + middleName + " " + lastName |
|
|
|
|
|
|
|
self.recieverNameLabelLabel.text = fullName.uppercased() |
|
|
|
self.fullnameLabel.text = "To: \(fullName.uppercased())" |
|
|
|
|
|
|
|
self.transactionDateLabel.text = reciept?.transactionDate |
|
|
|
|
|
|
|
self.addressLabel.text = self.reciept?.rAddress |
|
|
|
self.mobileNoLabel.text = self.reciept?.rContactNo ?? "N/A" |
|
|
|
self.agentBankLabel.text = self.reciept?.agentBank |
|
|
|
let branch = self.reciept?.payoutBankBranch ?? "" |
|
|
|
self.branchLabel.text = branch |
|
|
|
self.branchView.isHidden = branch == "" |
|
|
|
let accountNo = self.reciept?.accountNo ?? "" |
|
|
|
self.accountNoView.isHidden = accountNo == "" |
|
|
|
self.accountNoLabel.text = self.reciept?.accountNo |
|
|
|
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 = (receiptType == .overseas) ? (self.reciept?.payoutAmount ?? "") : |
|
|
|
(self.reciept?.payoutAmount ?? "").decimalToCurrency(as: .krw) |
|
|
|
|
|
|
|
self.totalAmountLabel.text = totalAmount |
|
|
|
self.totalAmountHeaderLabel.text = StringConstants().totalPayoutAmountText + ": \(totalAmount)" |
|
|
|
|
|
|
|
|
|
|
|
if reciept?.showPartnerLogo == "Y" { |
|
|
|
|
|
|
|
moneygramLogoLabel.text = reciept?.logoText |
|
|
|
} else { |
|
|
|
moneygramStackView.isHidden = true |
|
|
|
} |
|
|
|
warningLabel.text = reciept?.note |
|
|
|
} |
|
|
|
warningLabel.text = reciept?.note |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// MARK: SendMoneyReceiptViewInterface |
|
|
|
extension SendMoneyReceiptViewController: SendMoneyReceiptViewInterface { |
|
|
|
func showLoading() { |
|
|
|
self.hudDelegate?.showLoading() |
|
|
|
} |
|
|
|
func showLoading() { |
|
|
|
self.hudDelegate?.showLoading() |
|
|
|
} |
|
|
|
|
|
|
|
func hideLoading() { |
|
|
|
self.hudDelegate?.hideLoading() |
|
|
|
} |
|
|
|
func hideLoading() { |
|
|
|
self.hudDelegate?.hideLoading() |
|
|
|
} |
|
|
|
|
|
|
|
func show(error: String) { |
|
|
|
self.alert(type: .error, message: error) |
|
|
|
} |
|
|
|
func show(error: String) { |
|
|
|
self.alert(type: .error, message: error) |
|
|
|
} |
|
|
|
|
|
|
|
func show(model: SendMoneyReciept) { |
|
|
|
self.reciept = model |
|
|
|
} |
|
|
|
func show(model: SendMoneyReciept) { |
|
|
|
self.reciept = model |
|
|
|
} |
|
|
|
} |