Odyssey
hcuTransfer.prg
1 <?php
2 /*
3  * File: hcuTransfer
4  *
5  * Purpose: To allow the member to transfer money from one account to another. If
6  * the member chooses, they can set up recurring transfers, an immediate transfer,
7  * and/or a transfer on a future date.
8  *
9  *
10  * Form Validation:
11  *
12  * From Account - Required, FROM LIST PROVIDED
13  * may not match TO Account
14  * TO Account - Required, FROM List Provided
15  * Amount - Required, Less than the available balance of the From Account
16  * Comment - Optional, must be trimmed to specific length
17  */
18 require_once(dirname(__FILE__) . '/../library/permissions.i');
19 
20 // ** SET SCRIPT LEVEL VARIABLES
21 $serviceShowInfo = true;
22 $serviceLoadMenu = true;
23 $serviceShowMenu = true;
24 $serviceLiveCheck = true;
25 
26 // ** INCLUDE MAIN GLOBAL SCRIPT -- Handles security / global variable values
27 require_once(dirname(__FILE__) . '/../library/hcuService.i');
28 
29 // ** INCLUDE to access scheduled transfer functions
30 require_once(dirname(__FILE__) . '/../library/hcuTransferScheduled.i');
31 
32 // ** INCLUDE to access ach functions
33 require_once(dirname(__FILE__) . '/../library/hcuACH.i');
34 
35 $string= array("filter" => FILTER_SANITIZE_STRING);
36 
37 // Format used to export date time to JavaScript. Example: 2019-05-15T10:06:08.000-06:00
38 $DATETIME_FORMAT = 'Y-m-d\TH:i:s.000P';
39 
40 // ** INSERT BUSINESS LOGIC FOR THIS FORM
41 $dms_ok = array("security_email"=>$string, "btnSubmit"=>$string,
42  "security_egenl"=>$string, "security_valid"=>$string);
43 
44 HCU_ImportVars($HB_ENV, 'HCUPOST', $dms_ok);
45 
46 // Use the timezone coming from the client to determine today
47 $today = new DateTimeImmutable('now', new DateTimeZone(trim($HB_ENV["tz"])));
48 
49 /*
50  * ** CHECK USER FEATURE PERMISSIONS **
51  * NOTE: DOES NOT RETURN ON FAILURE
52  * ** CUSTOM FOR TRANSFER -- THEY MUST HAVE CREATE ABILITY TO USE THIS SCREEN **
53  */
54 PermCheckFeatureScreen($dbh, $HB_ENV, $MC, FEATURE_TRANSFERS, 'create');
55 
56 // get some allowed amounts for client-side validation
57 // for internal funds transfer, external and member to member.
58 $perTransactionLimits = array(
59  FEATURE_TRANSFERS,
60  FEATURE_EXTERNAL_TRANSFERS,
61  FEATURE_M2M_TRANSFERS
62 );
63 $perTransactionAmounts = array();
64 
65 foreach ($perTransactionLimits as $key => $value) {
66  $permissionInputs = array("feature" => $value);
67  $limits = Perm_GetValidationLimits( $dbh, $HB_ENV, $permissionInputs );
68 
69  if ($limits === false) {
70  $perTransactionAmounts[$value] = 0;
71  } else {
72  $perTransactionAmounts[$value] = floatval( $limits["amount_per_transaction"] );
73  }
74 }
75 
76 // ** SET VARIABLES FOR WEBSITE FLAGS
77 /*
78  * SET LOGIC FOR SCHEDULED TRANSFER
79  * DEPENDENT ON CU SETTINGS AND USER PERMS
80  */
81 
82 $allowScheduled = (($HB_ENV['flagset2'] & $GLOBALS['CU2_PROCRECUR']) && PermCheckFeatureScreen($dbh, $HB_ENV, $MC, FEATURE_SCHEDULED_TRANSFERS, '', false));
83 $disallowTransfersToDiffAccount = ($HB_ENV["flagset3"] & GetFlagsetValue("CU3_DISALLOW_MULT_ACCOUNTS_TRANSFER")) !== 0; // Careful how I phrase this because this doesn't prevent cross accounts.
84 
85 $transferFrequencyList = TxIntervalList($HB_ENV["MC"]);
86 $transferContinueList = TxContinueList($HB_ENV["MC"]);
87 
88 // ** get member to member/external account permissions
89 $permissionInputs = array( "feature" => FEATURE_M2M_TRANSFERS );
90 $permissionM2M = Perm_AccessRights( $dbh, $HB_ENV, $permissionInputs );
91 
92 // get system status: live/batch
93 $isLive = $HB_ENV['live'] == 0 ? false : true;
94 
95 /*
96  * FETCH ACCOUNT LIST
97  */
98 
99 $Transfer_List_ary = TX_list($dbh, $HB_ENV);
100 
101 
102 setFmsgTxCookie($HB_ENV, $Transfer_List_ary);
103 
104 // ** Create an empty row
105 $acctFromListAry[] = Array("acctText" => '', "acctValue" => '', "acctAvail" => '', 'acctClass' => '', 'acctGroup' => '', 'acctOrder'=>'');
106 $acctToListAry[] = Array("acctText" => '', "acctValue" => '', "acctAvail" => '', 'acctClass' => '', 'acctGroup' => '', 'acctOrder'=>'');
107 $acctFromListAry = Array();
108 $acctToListAry = Array();
109 
110 /**
111  * Set default values for the terms/notice url and description
112  * the implementation is poor as it always prints the information to the html buffer
113  * instead of relying on some logic in php on when to write.
114  * Setting the values will remove the "noise" from the console.log until better implementation is done
115  * mws 11/2/17 - remove this comment at that time
116  */
117 
118 $fromAccountCount = 0;
119 $toAccountCount = 0;
120 $acctOrder = 0;
121 if (count($Transfer_List_ary['acctlist']) > 0) {
122  foreach ($Transfer_List_ary['acctlist'] as $acct_key => $acct_values) {
123 
124  /* BUILD FROM ACCOUNT */
125  $acctInfo = Array();
126  if ($acct_values['from'] == 'Y' && !$acct_values['out_of_sync']) {
127  $acctInfo = Array();
128  $historyAcct = explode('|', $acct_key);
129  switch ($historyAcct[0]) {
130  case "X":
131  // not doing anything
132  break;
133  default:
134  $acctInfo = Array(
135  Array("desc" => $MC->msg('Available', HCU_DISPLAY_AS_RAW), "value" => $acct_values['available']),
136  Array("desc" => $MC->msg('Balance', HCU_DISPLAY_AS_RAW), "value" => $acct_values['balance'])
137  );
138  break;
139  }
140 
141  // ** Decode the values so kendo can properly display any encoded characters. This seems to work for at least single quote
142  $acctFromListAry[] = Array(
143  "acctText" => htmlspecialchars_decode(mobile_displayhtml($acct_values['description']), ENT_QUOTES),
144  "acctValue" => mobile_displayhtml($acct_key),
145  "acctAvail" => $acct_values['available'],
146  "acctInfo" => $acctInfo,
147  'acctClass' => $acct_values['acctclass'],
148  'acctGroup' => $acct_values['item-group'],
149  'acctOrder' => $acctOrder,
150  "permissionAcct" => $acct_values["member"] // For cross and joint accounts, I need the account that it is under for determining if the transfer is allowed.
151  );
152  }
153 
154  /* BUILD TO ACCOUNT */
155 
156  if ($acct_values['to'] == 'Y' && !$acct_values['out_of_sync']) {
157  $acctInfo = Array();
158  $historyAcct = explode('|', $acct_key);
159 
160  // if member to member account and not live system or no access, do not add
161  if ($acct_values['acctclass'] == "M" && !($isLive && $permissionM2M['access'])) {
162  continue;
163  }
164 
165  /**
166  * When 'trust' is transfer, this is a Cross-Account, there is no information to specify, the values would be empty
167  */
168  if ($acct_values['trust'] != 'transfer' && $acct_values['view_balances'] == 'Y') {
169  switch ($historyAcct[0]) {
170  case "D":
171  $acctInfo = Array(
172  Array("desc" => $MC->msg('Balance', HCU_DISPLAY_AS_RAW), "value" => $acct_values['balance'])
173  );
174  break;
175  case "L":
176  $acctInfo = Array(
177  Array("desc" => $MC->msg('Payoff', HCU_DISPLAY_AS_RAW), "value" => $acct_values['payoff']),
178  Array("desc" => $MC->msg('Balance', HCU_DISPLAY_AS_RAW), "value" => $acct_values['balance']),
179  Array("desc" => $MC->msg('Payment', HCU_DISPLAY_AS_RAW), "value" => $acct_values['paymentdue'])
180  );
181  break;
182  case "C":
183  $acctInfo = Array(
184  Array("desc" => $MC->msg('Payoff', HCU_DISPLAY_AS_RAW), "value" => $acct_values['payoff']),
185  Array("desc" => $MC->msg('Balance', HCU_DISPLAY_AS_RAW), "value" => $acct_values['balance']),
186  Array("desc" => $MC->msg('Payment', HCU_DISPLAY_AS_RAW), "value" => $acct_values['paymentdue'])
187  );
188  break;
189  }
190  }
191  $acctToListAry[] = Array(
192  "acctText" => htmlspecialchars_decode($acct_values['description'], ENT_QUOTES),
193  "acctValue" => mobile_displayhtml($acct_key),
194  "acctInfo" => $acctInfo,
195  'acctClass' => $acct_values['acctclass'],
196  'acctGroup' => $acct_values['item-group'],
197  'acctOrder' => $acctOrder,
198  "permissionAcct" => $acct_values["member"] // For cross and joint accounts, I need the account that it is under for determining if the transfer is allowed.
199  );
200  }
201  $acctOrder++;
202  }
203 
204  // do not allow ad-hoc if system is not live or no permissions
205  if ($isLive && $permissionM2M['access']) {
206  $acctToListAry[] = array(
207  "acctText" => $MC->msg("Transfer to another member", HCU_DISPLAY_AS_RAW),
208  "acctValue" => "M|" . $HB_ENV['Uid'] . "|0",
209  "acctInfo" => array(),
210  "acctClass" => "M",
211  "acctGroup" => "6 - " . $MC->msg("Other Member Accounts", HCU_DISPLAY_AS_RAW),
212  "acctOrder" => $acctOrder
213  );
214  }
215 }
216 
217 // list the account types for remote account (for ach) - used in dropdown list
218 $accountTypes = array(
219  array( "type" => 10, "display" => $MC->msg("ACH Checking", HCU_DISPLAY_AS_HTML) ),
220  array( "type" => 20, "display" => $MC->msg("ACH Savings", HCU_DISPLAY_AS_HTML) ));
221 
222 
223 
224 /*
225  * PERFORM SANITY CHECKS TO ENSURE GOOD DATA
226  */
227 
228 // ** INSERT BUSINESS LOGIC FOR THIS FORM
229 // ** Verify the feature is enabled for the Credit Union.
230 // * this is done by check the role 'transfernotify'
231 $sql = "SELECT email
232  FROM cuadmnotify
233  WHERE cu = '{$HB_ENV['Cu']}' AND role = 'transfernotify'";
234 $em_rs = db_query($sql, $dbh);
235 list($notifyemail) = db_fetch_array($em_rs, 0);
236 db_free_result($em_rs);
237 
238 /*
239  * Put the retrieval of the Available Trans Types higher in the code, this way
240  * I can check the CU has Cross-accounts enabled.
241  * They Fmsg_tx will never get set to a successful 32 , if Cross Accoutns
242  * are not enabled
243  */
244 $cuTransTypesAllowed = Get_HaveTrans($dbh, $HB_ENV);
245 
246 if (($HB_ENV['Fset'] & $CU_MAILTXNS) && trim($notifyemail) == "") {
247  // * Feature NOT set
248  // * Include the Error page and exit
249  $serviceErrorMsg = $MC->msg('Option not set', HCU_DISPLAY_AS_HTML);
250  $serviceErrorCode = '915';
251 
252  require_once(dirname(__FILE__) . '/../includes/hcuErrorPage.i');
253  // ** DO NOT CONTINUE
254  exit;
255 } elseif ($HB_ENV['live'] && (($HB_ENV['Fset3'] & GetFlagsetValue('CU3_API_XAC')) && ($HB_ENV['Fmsg_tx'] & GetMsgTxValue('MSGTX_TMP_XAX_LD')) == 0)) {
256  // ** Current Cross Account Data Not Retrieved
257  $serviceErrorCode = '911';
258 
259  require_once(dirname(__FILE__) . '/../includes/hcuErrorPage.i');
260  // ** DO NOT CONTINUE
261  exit;
262 } elseif (count($acctFromListAry) < 1 || count($acctToListAry) <= 1) {
263  // ** NO VALID ACOUNTS FOR TRANSFER
264  $serviceErrorMsg = $MC->msg("No valid accounts transfer", HCU_DISPLAY_AS_HTML);
265  $serviceErrorCode = '915';
266 
267  require_once(dirname(__FILE__) . '/../includes/hcuErrorPage.i');
268  // ** DO NOT CONTINUE
269  exit;
270 }
271 /*
272  * RETRIEVE the Transfer Notice
273  *
274  */
275 $noticesAry = Get_NoticeInfo($dbh, $HB_ENV, $MC, "D", "transferNotice", true);
276 $hasNoticeTRN = false;
277 $hasNoticePopupTRN = false;
278 $noticeURLTRN = "";
279 $noticeLinkDisplayTRN = "";
280 
281 if ( $noticesAry["status"]["code"] == "000" && HCU_array_key_exists('0', $noticesAry['notice'])) {
282  if ($noticesAry["notice"][0]["notice_id"] ) {
283 
284  $hasNoticeTRN = true;
285  $noticeOption = $noticesAry['notice'][0];
286 
287  $noticeOptions = Array (
288  'docsid' => $noticeOption['notice_id'],
289  'docstype' => $noticeOption['notice_type'],
290  'device' => 'D',
291  'noticeOnly' => '0',
292  'expireTime' => mktime() + 86400
293  );
294 
295  $encryptedDocDetails= HCU_PayloadEncode($HB_ENV['Cu'], $noticeOptions);
296 
297  $noticeOptions['noticeOnly'] = 1;
298 
299  $encryptedDocDetailsNoticeOnly= HCU_PayloadEncode($HB_ENV['Cu'], $noticeOptions);
300 
301  // build the url encoded string
302  // * For the Popup
303  if ($noticeOption['notice_popup'] > 0) {
304  $hasNoticePopupTRN = true;
305  $noticeURLTRN = $HB_ENV['homebankingpath'] . '/hcuViewNotice.prg?cu=' . $HB_ENV['cu'] . '&x=' . urlencode($encryptedDocDetails);
306  }
307  // * For the regular Button
308  $noticeURLNoticeOnly = $HB_ENV['homebankingpath'] . '/hcuViewNotice.prg?cu=' . $HB_ENV['cu'] . '&x=' . urlencode($encryptedDocDetailsNoticeOnly);
309  }
310 }
311 
312 // ** Retrieve the Terms of Use for SCHEDULED TRANSACTIONS
313 // ** the user needs to accept these in order to make a
314 // ** scheduled transaction from this screen.
315 $noticesAry = Get_NoticeInfo($dbh, $HB_ENV, $MC, "D", "rptTransferTerms", true);
316 
317 $hasTermsRPT = false;
318 $hasTermsPopupRPT = false;
319 $termsURLRPT = "";
320 $termsLinkDisplayRPT = "";
321 
322 if ( $noticesAry["status"]["code"] == "000" && HCU_array_key_exists('0', $noticesAry['notice'])) {
323  if ($noticesAry["notice"][0]["notice_id"] ) {
324  $hasTermsRPT = true;
325  $noticeOption = $noticesAry['notice'][0];
326 
327  $noticeOptions = Array (
328  'docsid' => $noticeOption['notice_id'],
329  'docstype' => $noticeOption['notice_type'],
330  'device' => 'D',
331  'noticeOnly' => '0',
332  'expireTime' => mktime() + 86400
333  );
334 
335  $encryptedDocDetails= HCU_PayloadEncode($HB_ENV['Cu'], $noticeOptions);
336 
337  $noticeOptions['noticeOnly'] = 1;
338 
339  $encryptedDocDetailsNoticeOnly= HCU_PayloadEncode($HB_ENV['Cu'], $noticeOptions);
340 
341  // build the url encoded string
342  // * For the popup terms
343  $termsURLRPT = $HB_ENV['homebankingpath'] . '/hcuViewNotice.prg?cu=' . $HB_ENV['cu'] . '&x=' . urlencode($encryptedDocDetails);
344 
345  // * For the regular Button
346  $termsURLNoticeOnly = $HB_ENV['homebankingpath'] . '/hcuViewNotice.prg?cu=' . $HB_ENV['cu'] . '&x=' . urlencode($encryptedDocDetailsNoticeOnly);
347 
348  // see if there is a popup notice
349  $hasTermsPopupRPT = $noticeOption["notice_popup"] ? true : false;
350 
351  $termsButtonText = $noticeOption["notice_linkdisplay"];
352  }
353 }
354 
355 // ** Retrieve the Terms of Use for MEMBER TO MEMBER
356 // ** the user needs to accept these in order to make a
357 // ** transfer using a member to member account.
358 $noticesAry = Get_NoticeInfo($dbh, $HB_ENV, $MC, "D", "m2mAccountTerms", true);
359 
360 $hasTermsM2M = false;
361 $hasTermsPopupM2M = false;
362 $termsURLM2M = "";
363 $termsLinkDisplayM2M = "";
364 
365 if ( $noticesAry["status"]["code"] == "000" && HCU_array_key_exists('0', $noticesAry['notice'])) {
366  if ($noticesAry["notice"][0]["notice_id"] ) {
367  $hasTermsM2M = true;
368  $noticeOption = $noticesAry['notice'][0];
369 
370  $noticeOptions = Array (
371  'docsid' => $noticeOption['notice_id'],
372  'docstype' => $noticeOption['notice_type'],
373  'device' => 'D',
374  'noticeOnly' => '0',
375  'expireTime' => mktime() + 86400
376  );
377 
378  $encryptedDocDetails= HCU_PayloadEncode($HB_ENV['Cu'], $noticeOptions);
379 
380  $noticeOptions['noticeOnly'] = 1;
381 
382  $encryptedDocDetailsNoticeOnly= HCU_PayloadEncode($HB_ENV['Cu'], $noticeOptions);
383 
384  // build the url encoded string
385  // * For the popup terms
386  $termsURLM2M = $HB_ENV['homebankingpath'] . '/hcuViewNotice.prg?cu=' . $HB_ENV['cu'] . '&x=' . urlencode($encryptedDocDetails);
387 
388  // * For the regular Button
389  $termsURLNoticeOnly = $HB_ENV['homebankingpath'] . '/hcuViewNotice.prg?cu=' . $HB_ENV['cu'] . '&x=' . urlencode($encryptedDocDetailsNoticeOnly);
390 
391  // see if there is a popup notice
392  $hasTermsPopupM2M = $noticeOption["notice_popup"] ? true : false;
393 
394  $termsButtonText = $noticeOption["notice_linkdisplay"];
395  }
396 }
397 
398 // External transfers have a cutoff time, the user
399 // must be notified that the transaction will process
400 // the next business day if the current time is after
401 // the cutoff.
402 $achCutoffMessageString = ACH_GetCutoffTimeMessage($HB_ENV);
403 
404 // ** INCLUDE PRE CONTENT SCRIPT
405 require_once(dirname(__FILE__) . '/../includes/hcuPreContent.i');
406 
407 /*
408  * ** START CONTENT
409  */
410 ?>
411 <script type="text/javascript">
412 
413  var sourceFreqListAry = <?php echo HCU_JsonEncode($transferFrequencyList); ?>;
414  var sourceContListAry = <?php echo HCU_JsonEncode($transferContinueList); ?>;
415  var sourceAcctListAry = <?php print HCU_JsonEncode($acctFromListAry); ?>;
416  var targetAcctListAry = <?php print HCU_JsonEncode($acctToListAry); ?>;
417  var acctTypes = <?php print HCU_JsonEncode($accountTypes); ?>;
418 
419  var sourceConfirmResp = [];
420  var winObject;
421 
422  // check for notices
423  var noticeTRN = <?php echo HCU_JsonEncode($hasNoticeTRN && $hasNoticePopupTRN); ?>;
424  var termsRPT = <?php echo HCU_JsonEncode($hasTermsRPT && $hasTermsPopupRPT); ?>;
425  var termsM2M = <?php echo HCU_JsonEncode($hasTermsM2M && $hasTermsPopupM2M); ?>;
426  var allowScheduled = <?php echo HCU_JsonEncode($allowScheduled); ?>;
427  var allowMember2Member = <?php echo HCU_JsonEncode($isLive && $permissionM2M['access']); ?>;
428  var perTransactionAmounts = <?php echo HCU_JsonEncode($perTransactionAmounts); ?>;
429 
430  var wndMessage;
431  var confirmWindow = null;
432  var responseWindow = null;
433  var dsTransfer = null;
434  var dsTransferTo = null;
435  var windowStack = [];
436  var printAction = false;
437 
438  function selectSourceAcct(e) {
439  var dropdown = this;
440  var dropdownData = dropdown.dataItem(e.item.index() + 1);
441 
442  if (dropdownData.acctAvail !== undefined) {
443  $('#txAmount').data("kendoNumericTextBox").max(dropdownData.acctAvail);
444  } else {
445  $('#txAmount').data("kendoNumericTextBox").max(0);
446  }
447  $('#txAmount').data("kendoNumericTextBox").value("");
448 
449  // External accounts must display a cutoff time message
450  // add the acctClass value to the acctInfo object so the template
451  // may display the message based on the acctClass = X.
452  dropdownData.acctInfo.acctClass = dropdownData.acctClass;
453 
454  SetAcctInfo("txFromSuffixInfo", dropdownData.acctInfo);
455 
456  $("[name='txFromMember']").val(dropdownData.permissionAcct); <?php // This is for the non-cross account permission (#1568). ?>
457  }
458 
459  function selectTargetAcct(e) {
460  var dropdown = e.sender;
461  var dropdownData = e.dataItem;
462  var acctValueParts = dropdownData.acctValue.split("|");
463 
464  // scheduled transfers not allowed with destination of type OTHER
465  // scheduled transfers not allowed for ad-hoc m2m accounts
466  // these fields must be hidden
467  if ((acctValueParts[0] == "O") || (acctValueParts[0] === "M" && acctValueParts[2] == "0")) {
468  // disable repeating and date picker
469  if (allowScheduled) {
470  var today = new Date('<?php echo $today->format($DATETIME_FORMAT); ?>');
471 
472  $("#txDateStart").data("kendoDatePicker").min(today);
473  $("#txDateStart").data("kendoDatePicker").value(today);
474  $("#txDateEnd").data("kendoDatePicker").value(null);
475  $("#txContinue").data("kendoDropDownList").value("continuous");
476  $("#txFrequency").data("kendoDropDownList").value("OneTime");
477 
478  $("#transferDivContinue").hide();
479  $("#continueUntilSpan").hide();
480  $("#txScheduledFields").hide();
481  }
482  }
483 
484  // check if doing ad-hoc m2m
485  if (acctValueParts[0] === "M" && acctValueParts[2] == "0") {
486  // show and set field attributes for ad hoc M2M
487  $("#txMemAccount").attr("required", "required");
488  $("#txMemName").attr("required", "required");
489  $("#txMemType").attr("required", "required");
490  $(".local-hide-member-inp").show();
491 
492  } else if (acctValueParts[0] == "O") {
493  // never scheduled
494  // hide ad hoc M2M entry
495  $("#txMemAccount").removeAttr("required");
496  $("#txMemName").removeAttr("required");
497  $("#txMemType").removeAttr("required");
498  $(".local-hide-member-inp").hide();
499  } else {
500  $("#txMemAccount").removeAttr("required");
501  $("#txMemName").removeAttr("required");
502  $("#txMemType").removeAttr("required");
503  $(".local-hide-member-inp").hide();
504 
505  if (allowScheduled) {
506  // enable frequency and start date
507  $("#txFrequency").data("kendoDropDownList").enable(true);
508  $("#txDateStart").data("kendoDatePicker").enable(true);
509  $("#txScheduledFields").show();
510  }
511  }
512 
513  if ( acctValueParts.length > 2 && acctValueParts[2].substr( 0, 1 ) === "P" && acctValueParts[0].substr( 0, 1 ) === 'O') {
514  // hide transfer, show payment
515  $("#reqComment").show();
516  $("#xferComment").hide();
517  $("#confPaymentComment").show();
518  $("#confTransferComment").hide();
519  $("#ccPayNote").show();
520  }
521  else
522  {
523  $("#reqComment").hide();
524  $("#xferComment").show();
525  $("#confPaymentComment").hide();
526  $("#confTransferComment").show();
527  $("#ccPayNote").hide();
528  }
529 
530  // External accounts must display a cutoff time message
531  // add the acctClass value to the acctInfo object so the template
532  // may display the message based on the acctClass = X.
533  dropdownData.acctInfo.acctClass = dropdownData.acctClass;
534 
535  SetAcctInfo("txToSuffixInfo", dropdownData.acctInfo);
536 
537  $("[name='txToMember']").val(dropdownData.permissionAcct); <?php // This is for the non-cross account permission (#1568). ?>
538  }
539 
540  // use this function to check if member to member terms are necessary
541  // otherwise we would need to double the code for selectTargetAcct.
542  function checkTermsTargetAcct(e) {
543  var dropdown = e.sender;
544  var dropdownData = e.dataItem;
545  var dropdownValue = dropdown.value();
546  var acctValueParts = dropdownData.acctValue.split("|");
547 
548  switch (acctValueParts[0]) {
549  case "M":
550  if (termsM2M) {
551  ShowNotice("<?php echo $termsURLM2M; ?>", "<?php echo $termsLinkDisplayM2M; ?>",
552  function() {
553  // set termsRPT t false so terms dont show every time
554  termsM2M = false;
555 
556  // accept terms, continue as normal
557  selectTargetAcct(e);
558  },
559  function() {
560  // decline terms, prevent change
561  e.preventDefault();
562 
563  // select OneTime
564  e.sender.value(dropdownValue);
565  }
566  );
567 
568  // break; must go here, this will fall through
569  // so the default action is hit when there are no terms setup
570  break;
571  }
572  default:
573  selectTargetAcct(e);
574  break;
575  }
576  }
577 
578  function setDataAttributes(showContinue) {
579  if (showContinue) {
580  $("label[for='txDateStart']").text("<?php echo $MC->msg('Transfer Start On', HCU_DISPLAY_AS_JS); ?>");
581  $("#txDateStart").attr("data-required-msg",
582  "<?php echo $MC->msg('Transfer Start On', HCU_DISPLAY_AS_HTML) ?>: " +
583  "<?php echo $MC->msg('is a Required Field', HCU_DISPLAY_AS_HTML); ?>");
584  $("#txDateStart").attr("data-homecuCustomMatch-msg",
585  "<?php echo $MC->msg('Transfer Start On', HCU_DISPLAY_AS_HTML) ?>: " +
586  "<?php echo $MC->msg('is not a valid date', HCU_DISPLAY_AS_HTML); ?>");
587  $("#txDateStart").attr("data-homecuCustomDateGTValue-msg",
588  "<?php echo $MC->msg('Transfer Start On', HCU_DISPLAY_AS_HTML) ?>: " +
589  "<?php echo $MC->msg('must be future date', HCU_DISPLAY_AS_HTML); ?>");
590  } else {
591  $("label[for='txDateStart']").text("<?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_JS); ?>");
592  $("#txDateStart").attr("data-required-msg",
593  "<?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_HTML) ?>: " +
594  "<?php echo $MC->msg('is a Required Field', HCU_DISPLAY_AS_HTML); ?>");
595  $("#txDateStart").attr("data-homecuCustomMatch-msg",
596  "<?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_HTML) ?>: " +
597  "<?php echo $MC->msg('is not a valid date', HCU_DISPLAY_AS_HTML); ?>");
598  $("#txDateStart").attr("data-homecuCustomDateGTValue-msg",
599  "<?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_HTML) ?>: " +
600  "<?php echo $MC->msg('must be future date', HCU_DISPLAY_AS_HTML); ?>");
601  }
602  }
603 
604  function SetAcctInfo(pInfoName, pValues) {
605  var info = $("#" + pInfoName);
606  var infoTemplate = kendo.template($("#acctInfo").html());
607  var infoHtml = infoTemplate(pValues);
608 
609  info.empty();
610  info.append(infoHtml);
611  }
612  function getAcctSeg(pField, pSeg) {
613  var fieldName = (pField === 'from' ? 'txFromSuffix' : 'txToSuffix');
614  var retVal = '';
615 
616  // * lookup current data line
617  var listField = $('#' + fieldName).data('kendoDropDownList');
618  var dataItem = listField.dataItem(listField.select());
619 
620  if (dataItem.acctValue !== undefined) {
621  var segments = dataItem.acctValue.split('|');
622  switch (pSeg){
623  case 'type':
624  retVal = segments[0];
625  break;
626  case 'acct':
627  retVal = segments[1];
628  break;
629  case 'sfx':
630  retVal = segments[2];
631  break;
632  case "permissionAcct":
633  retVal = dataItem["permissionAcct"]; <?php // Could not exist in the case of adhoc M2M or any new features. Using the dot syntax will give an error. ?>
634  break;
635  }
636  }
637  return retVal;
638  }
639 
640  function InitDataSources() {
641 
642  var definition = {
643  cache: false,
644  transport: {
645  read: {
646  url: 'hcuTransfer.data?cu=<?php echo $HB_ENV['cu']; ?>',
647  type: "POST",
648  dataType: "json",
649  cache: false,
650  beforeSend: function() {
651  ShowWaitWindow('<?php echo $MC->msg("Please Wait", HCU_DISPLAY_AS_JS); ?>...');
652  }
653  },
654  success: function(result) {
655  },
656  error: function(result) {
657  // notify the data source that the request failed
658  },
659  parameterMap: function(data, operation) {
660  if (operation === 'read') {
661 
662  return $('#formTransfer').serialize();
663  }
664  }
665  },
666  schema: {
667  errors: function(response) {
668 
669  // ** SETUP ERRORS
670  // * Check for the Results Array being sent from data server
671  try {
672  if (response['Results']) {
673  // ** Should be a single array of pieces
674  if (response['Results'][0]) {
675  // ** Look for the errors being returned from the server
676  if (response['Results'][0]['homecuErrors']) {
677  if (response['Results'][0]['homecuErrors'].length > 0) {
678  return {error: response['Results'][0]['homecuErrors']};
679  }
680  }
681  } else {
682  throw "<?php echo $MC->msg('Error parsing server', HCU_DISPLAY_AS_JS) ?>";
683  }
684  } else {
685  throw "<?php echo $MC->msg('Error parsing server', HCU_DISPLAY_AS_JS) ?>";
686  }
687  } catch (err) {
688  return {error: err};
689  }
690  },
691 
692  parse: function(response) {
693 
694  return response;
695 
696  },
697  data: "Results",
698  dataxyz: function(response) {
699 
700  var dataResponse = [];
701  var dataInfo = { homecuErrors: 'test', homecuInfo: 'Info Others', homecuData: 'Sample Data'};
702  dataResponse.push(dataInfo);
703  return dataResponse;
704 
705  },
706  type: "json"
707  },
708  error: function(e) {
709  // Ability to parse the returned errors.
710 
711  // **
712  if (e.errors) {
713  if (e.errors.error.length > 0) {
714  $.homecuValidator.displayMessage(e.errors.error, $.homecuValidator.settings.statusError);
715  }
716  } else {
717  // ** UNKNOWN ERROR
718  $.homecuValidator.displayMessage('<?php echo $MC->msg('Transfer Error', HCU_DISPLAY_AS_JS); ?>', $.homecuValidator.settings.statusError);
719  }
720  },
721  requestEnd: function (e) {
722  CloseWaitWindow();
723  }
724 
725  };
726 
727  dsTransfer = new kendo.data.DataSource(definition);
728 
729  var transferToDefinition = $.extend(true, {}, definition);
730  transferToDefinition.transport.read.url = 'hcuTransfer.data?cu=<?php echo $HB_ENV['cu']; ?>&action=GetTransferToOptions';
731 
732  <?php // group by the "category" field ?>
733  transferToDefinition.group = {field: "acctGroup"};
734  transferToDefinition.sort = {field: "acctOrder", dir: "asc"};
735 
736  transferToDefinition.schema.data = function (response) {
737  var returnVal = response == null || response.Results == null || response.Results[0] == null ? [] : response.Results[0].homecuData;
738 
739  <?php // popup message iff returnVal is an empty array. ?>
740  if (returnVal.length == 0) {
741  var emptyToDialog = $("#emptyToDialog").data("kendoDialog");
742  if (emptyToDialog == null) {
743  emptyToDialog = $("<div id='emptyToDialog'></div>").appendTo("body").kendoDialog({
744  content: $("#emptyToTemplate").html(),
745  modal: true,
746  visible: false,
747  title: "<?php echo $MC->msg('Feature Unavailable', HCU_DISPLAY_AS_HTML); ?>",
748  actions: [
749  {text: "<?php echo $MC->msg('Okay', HCU_DISPLAY_AS_JS); ?>", primary: true}
750  ],
751  open: function() {
752  windowStack.push(this);
753  },
754  close: function() {
755  windowStack.pop();
756  }
757  }).data("kendoDialog");
758  }
759 
760  emptyToDialog.open();
761  }
762  return returnVal;
763  };
764 
765  dsTransferTo = new kendo.data.DataSource(transferToDefinition);
766  }
767 
768  function InitDataViews() {
769  confirmWindow = $("<div id='confirmTransfer'></div>").appendTo("body").kendoDialog({
770  content: $("#confirmTransferTemplate").html(),
771  width: "85%",
772  maxWidth: "768px",
773  minWidth: "300px",
774  title: '<?php echo $MC->msg('CONFIRM TRANSACTION', HCU_DISPLAY_AS_JS); ?>',
775  modal: true,
776  visible: false,
777  resizable: false,
778  actions: [
779  { text: '<?php echo $MC->msg("Cancel", HCU_DISPLAY_AS_JS); ?>',
780  action: function(e) { }
781  },
782  { text: '<?php echo $MC->msg("Confirm", HCU_DISPLAY_AS_JS); ?>', primary: true,
783  action: function(e) {
784  // * Pass the data to the transfer script
785  dsTransfer.fetch(function() {
786  var data = dsTransfer.data();
787 
788  // * Data
789  var javascriptTemplate = kendo.template($("#confirmationTemplate").html());
790  var javascriptData = {};
791 
792  if ( data[0] ) {
793  // only show if data was returned
794  if (data[0].homecuData) {
795  javascriptData = {"homecuData":data[0].homecuData};
796  } else {
797  javascriptData = {"homecuData":""};
798  }
799 
800  responseWindow.html(javascriptTemplate(javascriptData));
801  winObject = responseWindow.kendoDialog({
802  width: "85%",
803  maxWidth: "768px",
804  minWidth: "300px",
805  title: '<?php echo $MC->msg('Transfer Confirmation', HCU_DISPLAY_AS_JS); ?>',
806  modal: true,
807  visible: false,
808  resizable: false,
809  actions: [
810  { text: '<?php echo $MC->msg("Close", HCU_DISPLAY_AS_JS); ?>', primary: true,
811  action: function(e) { }
812  }
813  ],
814  show: function(e) {
815  windowStack.push(this);
816  },
817  close: function(e) {
818  ShowWaitWindow();
819 
820  windowStack.pop();
821  document.location="<?php echo "{$HB_ENV['loginpath']}/hcuTransfer.prg?{$HB_ENV['cuquery']}"; ?>";
822  }
823  }).data("kendoDialog").open();
824  }
825  });
826  }
827  }
828  ],
829  show: function(e) {
830  windowStack.push(this);
831  },
832  close: function(e) {
833  windowStack.pop();
834  }
835  });
836  responseWindow = $('<div id="responseWindow"/>');
837 
838  // if the user has not accepted terms of use for scheduled
839  // transactions, don't show the scheduled fields
840  if (allowScheduled) {
841  $("#txScheduledFields").show();
842  } else {
843  $("#txScheduledFields").hide();
844  }
845 
846  $('#txFromSuffix').kendoDropDownList({
847  dataTextField: "acctText",
848  dataValueField: "acctValue",
849  optionLabel: '<?php echo $MC->msg('From Account', HCU_DISPLAY_AS_JS); ?>',
850  OLDtdataSource: sourceAcctListAry,
851  dataSource: {
852  data: sourceAcctListAry,
853  // group by the "category" field
854  group: { field: "acctGroup" },
855  sort: { field: "acctOrder", dir: "asc" }
856  },
857  fixedGroupTemplate: "#: LocalShowGroupDescription(data) #",
858  groupTemplate: "#: LocalShowGroupDescription(data) #",
859  select: selectSourceAcct,
860  change: function (e) { <?php // This happens after the selection is made. The select function is before. Therefore, the from value is populated. ?>
861  <?php // DO NOT read dataSource if user changes from account to "From Account." ?>
862  if (this.value() == "") {
863  $("#txToSuffix").data("kendoDropDownList").value("");
864  $("#txToSuffix").data("kendoDropDownList").enable(false);
865 
866  $(".local-hide-member-inp").hide();
867  $("#reqComment").hide();
868  $("#transferDivContinue").hide();
869  $("#continueUntilSpan").hide();
870  $("#txFromSuffixInfo").hide();
871  $("#txToSuffixInfo").hide();
872  } else {
873  $("#txFromSuffixInfo").show();
874  $("#txToSuffix").data("kendoDropDownList").dataSource.read();
875  }
876  },
877  template: kendo.template($('#acctFromTemplate').html())
878  });
879 
880  $('#txToSuffix').kendoDropDownList({
881  dataTextField: "acctText",
882  dataValueField: "acctValue",
883  optionLabel: '<?php echo $MC->msg('To Account', HCU_DISPLAY_AS_JS); ?>',
884  dataSource: dsTransferTo,
885  fixedGroupTemplate: "#: LocalShowGroupDescription(data) #",
886  groupTemplate: "#: LocalShowGroupDescription(data) #",
887  select: function(e) {
888  <?php // Case if user selects "To Account" after a value is selected.
889  // Then reset to as if user just went to the transfer screen.
890  // SPB: Issue #2752. ?>
891  if (e.item.text() == "To Account") {
892  $(".local-hide-member-inp").hide();
893  $("#reqComment").hide();
894  $("#transferDivContinue").hide();
895  $("#continueUntilSpan").hide();
896  $("#txToSuffixInfo").hide();
897  } else {
898  $("#txToSuffixInfo").show();
899  checkTermsTargetAcct(e);
900  }
901  },
902  template: kendo.template($('#acctToTemplate').html()),
903  autoBind: false,
904  enable: false, <?php // Makes it clearer that the from has to selected first. ?>
905  dataBound: function(e) {
906  this.enable(this.dataSource.data().length > 0);
907 
908  <?php // Case if to option was available in from.
909  // Then from changed so that option was no longer available.
910  // In this case, reset to as if "To Account" was selected.
911  // SPB: Issue #2752. ?>
912  if (this.value() == "") {
913  $(".local-hide-member-inp").hide();
914  $("#reqComment").hide();
915  $("#transferDivContinue").hide();
916  $("#continueUntilSpan").hide();
917  $("#txToSuffixInfo").hide();
918  }
919  }
920  });
921 
922  // only show date fields if allowed
923  if (allowScheduled) {
924  $('#txFrequency').kendoDropDownList({
925  dataTextField: "text",
926  dataValueField: "value",
927  dataSource: sourceFreqListAry,
928  //select: selectRepeatFreq
929  select: checkTermsScheduled
930  });
931  $('#txContinue').kendoDropDownList({
932  dataTextField: "text",
933  dataValueField: "value",
934  dataSource: sourceContListAry,
935  select: selectRepeatContinue
936  });
937  $('#txDateEnd').kendoDatePicker({
938  format: 'MM/dd/yyyy',
939  min: new Date('<?php echo $today->add(new DateInterval('P2D'))->format($DATETIME_FORMAT); ?>'),
940  });
941  $('#txDateStart').kendoDatePicker({
942  format: 'MM/dd/yyyy',
943  value: new Date('<?php echo $today->format($DATETIME_FORMAT); ?>'),
944  min: new Date('<?php echo $today->format($DATETIME_FORMAT); ?>'),
945  change: checkTermsScheduled
946  });
947  }
948 
949  if (allowMember2Member) {
950  $("#txMemType").kendoDropDownList({
951  dataSource: acctTypes,
952  dataTextField: "display",
953  dataValueField: "type"
954  });
955 
956  $("#txMemAccount").kendoMaskedTextBox({
957  mask: "000000000000",
958  clearPromtChar: true,
959  change: function() {
960  var value = this.value();
961  var valueStrip = value.replace(/_/g, '');
962  var valueMask = "";
963 
964  for (var i = 0; i < (12 - valueStrip.length); i++) {
965  valueMask += "_";
966  }
967 
968  $("#txMemAccount").val(valueStrip + valueMask);
969  }
970  });
971  }
972 
973  $("#txAmount").kendoNumericTextBox({
974  format: "c",
975  decimals: 2,
976  step: 0,
977  spinners: false,
978  min: .01,
979  placeholder: '<?php echo $MC->msg('Amount', HCU_DISPLAY_AS_JS); ?>'
980  });
981 
982  $.homecuValidator.setup({formValidate:'formTransfer', validateOnClick: 'btnTransfer', formErrorTitle: '<?php echo $MC->msg("Error Occurred", HCU_DISPLAY_AS_JS); ?>'});
983 
984  $('#btnTransfer').click(function() {
985  // ** Add custom per field validation
986  // ** Add custom errors to the Error display
987  // ** Add new messages to array
988 
989  var otherErrors = Array();
990  // ** Validate Source Account
991  // ** Do NOT allow repeating CW/LA
992  fromAcctType = getAcctSeg ('from', 'type');
993  toAcctType = getAcctSeg ('to', 'type');
994  toAcctSfx = getAcctSeg ('to', 'sfx');
995  if (fromAcctType === 'L' && toAcctType === 'L') {
996  otherErrors[otherErrors.length] = '<?php echo $MC->msg('Loan Add-on cannot payment', HCU_DISPLAY_AS_JS); ?>';
997  } else if (fromAcctType === 'X' || toAcctType === 'X') {
998  // external account rules - one account must be internal
999  if ( (fromAcctType !== 'D' && fromAcctType !== 'L' && toAcctType === 'X') ||
1000  (toAcctType !== 'D' && toAcctType !== 'L' && fromAcctType === 'X') ) {
1001  otherErrors[otherErrors.length] = '<?php echo $MC->msg('Transfer Error external', HCU_DISPLAY_AS_JS); ?>';
1002  }
1003  }
1004 
1005  // validate the amount of the transaction
1006  var txAmount = $("#txAmount").data("kendoNumericTextBox").value();
1007  var txLimit = 0;
1008  // must check per transaction limit amount for TRN, TRNEXT and TRNM2M
1009  if (fromAcctType == "X" || toAcctType == "X") {
1010  txLimit = perTransactionAmounts.TRNEXT;
1011  } else if (fromAcctType == "M" || toAcctType == "M") {
1012  txLimit = perTransactionAmounts.TRNM2M;
1013  } else {
1014  txLimit = perTransactionAmounts.TRN;
1015  }
1016 
1017  if ( txAmount > txLimit ) {
1018  otherErrors[otherErrors.length] = '<?php echo $MC->msg('Transfer Amount over allowed', HCU_DISPLAY_AS_JS); ?>';
1019  }
1020 
1021  <?php if (!HCU_array_key_exists( 'LC', $cuTransTypesAllowed)): ?>
1022  if (fromAcctType === 'L' && toAcctSfx === 'CW') {
1023  otherErrors[otherErrors.length] = '<?php echo $MC->msg('Loan Add-on cannot check withdrawal', HCU_DISPLAY_AS_JS); ?>';
1024  }
1025  <?php endif; ?>
1026 
1027  if (allowScheduled) {
1028  var transFreq = $('#txFrequency').data('kendoDropDownList');
1029  if (transFreq.select() > 0) {
1030  if (fromAcctType === 'L' || toAcctSfx === 'CW' || toAcctType == 'O') {
1031  otherErrors[otherErrors.length] = "<?php echo $MC->msg('Repeating transfer not available', HCU_DISPLAY_AS_JS); ?>";
1032  }
1033  }
1034  // * Test Semi-Monthly
1035  if ($('#txFrequency').data('kendoDropDownList').value() === 'SemiMonthly') {
1036  var repeatDay = $('#txDateStart').data('kendoDatePicker').value().getDate();
1037  if (repeatDay.toString() !== '15') {
1038  // ** Check Last Day
1039  var lastDayOfMonth = new Date($('#txDateStart').data('kendoDatePicker').value().getFullYear(), $('#txDateStart').data('kendoDatePicker').value().getMonth() + 1, 0);
1040  var lastDay = lastDayOfMonth.getDate();
1041  if (repeatDay !== lastDay) {
1042  otherErrors[otherErrors.length] = '<?php echo $MC->msg('Repeating Transfer - SemiMonthly Invalid', HCU_DISPLAY_AS_JS); ?>';
1043  }
1044  }
1045  }
1046  }
1047 
1048  <?php // Check to see if transfer uses multiple accounts. This excludes M2M accounts and external account transfers.
1049  if ($disallowTransfersToDiffAccount) { ?>
1050  var fromAcct = getAcctSeg ('from', 'permissionAcct');
1051  var toAcct = getAcctSeg ('to', 'permissionAcct');
1052  var typesRelevant = ["D", "L"];
1053 
1054  if (typesRelevant.indexOf(fromAcctType) != -1 && typesRelevant.indexOf(toAcctType) != -1 && fromAcct != toAcct) {
1055  otherErrors.push('<?php echo $MC->msg('Transfers between accounts are prohibited', HCU_DISPLAY_AS_JS); ?>');
1056  }
1057  <?php } ?>
1058 
1059 
1060  if (otherErrors.length > 0) {
1061  $.homecuValidator.homecuResetMessage = $.homecuValidator.homecuValidate;
1062  $.homecuValidator.displayMessage(otherErrors, $.homecuValidator.settings.statusError);
1063  $.homecuValidator.homecuResetMessage = true;
1064  $.homecuValidator.homecuValidate = false;
1065 
1066  }
1067 
1068  if ($.homecuValidator.homecuValidate) {
1069 
1070  var txFromSuffixList = $("#txFromSuffix").data("kendoDropDownList");
1071  $('#confFrom').text(txFromSuffixList.text());
1072  var txToSuffixList = $("#txToSuffix").data("kendoDropDownList");
1073  $('#confTo').text(txToSuffixList.text());
1074 
1075  $('#confAmount').text("$" + txAmount.toFixed( 2 ) );
1076 
1077  var dropdownlist = $("#txToSuffix").data("kendoDropDownList");
1078  var dataItem = dropdownlist.dataItem();
1079  var acctValueParts = dataItem.acctValue.split("|");
1080 
1081  // if 3rd part starts with a "P" then this is a credit card payment request
1082  if ( acctValueParts.length > 2 && acctValueParts[2].substr( 0, 1 ) === "P" && acctValueParts[0].substr( 0, 1 ) === 'O' ) {
1083  // if comments, show them
1084  // NOTE: only immediate, non recurring for credit card payment requests
1085 
1086  $('#confInfo').html('<?php echo $MC->msg("Confirm payment request", HCU_DISPLAY_AS_HTML); ?>');
1087 
1088  // same code as mammoth
1089  // if Transfer Comment Limit is not set in monitor, do not show comments in confirmation
1090  // if Transfer Comment Limit is set in monitor, only show comments in confirmation if a value exists
1091  if ($('#paymentComment').length > 0) {
1092  if ($('#paymentComment').val() === '') {
1093  $('#confComment').text('');
1094  $("#confPaymentComment").hide();
1095  } else{
1096  $("#confPaymentComment").show();
1097  $('#confComment').text($("#paymentComment").val());
1098  }
1099  } else {
1100  $('#confComment').text('');
1101  $("#confPaymentComment").hide();
1102  }
1103  $("#confTransferComment").hide();
1104  } else {
1105 
1106  // same code as mammoth
1107  // if Transfer Comment Limit is not set in monitor, do not show comments in confirmation
1108  // if Transfer Comment Limit is set in monitor, only show comments in confirmation if a value exists
1109  if ($('#txMemo').length > 0) {
1110  if ($('#txMemo').val() === '') {
1111  $('#confComment').text('');
1112  $("#confTransferComment").hide();
1113  } else{
1114  $("#confTransferComment").show();
1115  $('#confComment').text($('#txMemo').val());
1116  }
1117  } else {
1118  $('#confComment').text('');
1119  $("#confTransferComment").hide();
1120  }
1121  $("#confPaymentComment").hide();
1122 
1123  if (allowScheduled) {
1124 
1125  var dropdownFrequency = $("#txFrequency").data("kendoDropDownList");
1126  var valueFrequency = $("#txFrequency").data("kendoDropDownList").value();
1127  var valueContinue = $("#txContinue").data("kendoDropDownList").value();
1128  var valueStart = $("#txDateStart").data("kendoDatePicker").value();
1129  var valueEnd = $("#txDateEnd").data("kendoDatePicker").value();
1130 
1131  var messageConfirm = "";
1132  var messageRepeat = "";
1133 
1134  if (valueFrequency == "OneTime") {
1135  messageConfirm = "<?php echo $MC->msg("Confirm transfer", HCU_DISPLAY_AS_HTML); ?>";
1136  $("#confInfo").html(messageConfirm);
1137  $("#confirmRepeatTransfer").empty();
1138  $("#confirmRepeatTransfer").hide();
1139  } else {
1140  messageRepeat += "<?php echo $MC->msg("Transfer will repeat", HCU_DISPLAY_AS_HTML); ?> ";
1141  messageRepeat += dropdownFrequency.text() + " ";
1142  messageRepeat += "<?php echo $MC->msg("starting on", HCU_DISPLAY_AS_HTML); ?> ";
1143  messageRepeat += kendo.toString(valueStart, "MM/dd/yyyy") + ". ";
1144 
1145  if (valueContinue == "continuous") {
1146  messageRepeat += "<?php echo $MC->msg("Transfer does not stop", HCU_DISPLAY_AS_HTML); ?>";
1147  } else {
1148  messageRepeat += "<?php echo $MC->msg("stops after", HCU_DISPLAY_AS_HTML); ?> ";
1149  messageRepeat += kendo.toString(valueEnd, "MM/dd/yyyy") + ". ";
1150  }
1151 
1152  $("#confirmRepeatTransfer").html(messageRepeat);
1153  $("#confirmRepeatTransfer").show();
1154  }
1155  } else {
1156  $('#confInfo').html('<?php echo $MC->msg("Confirm transfer immediate", HCU_DISPLAY_AS_HTML); ?>');
1157  }
1158  }
1159  confirmWindow.data("kendoDialog").open();
1160 
1161  }
1162 
1163  });
1164  }
1165 
1166  function InitScreen() {
1167  InitDataSources();
1168  InitDataViews();
1169  }
1170 
1171  function LocalShowGroupDescription(pString) {
1172  var retVal = '';
1173  try {
1174  // ** This will take the string and trim the first 4 characters
1175  retVal = pString.substring(3);
1176  } catch (err) {
1177  // ** An error occurred -- Show Nothing
1178  retVal = '';
1179  }
1180  return retVal;
1181  }
1182 
1183  <?php if ($allowScheduled): ?>
1184  // use this function to check if scheduled terms are necessary
1185  // otherwise we would need to double the code for selectRepeatFreq.
1186  function checkTermsScheduled(e) {
1187  if (termsRPT) {
1188  ShowNotice("<?php echo $termsURLRPT; ?>", "<?php echo $termsLinkDisplayRPT; ?>",
1189  function() {
1190  // set termsRPT t false so terms dont show every time
1191  termsRPT = false;
1192 
1193  // accept terms, continue as normal
1194  if (e.sender.element[0].id == "txFrequency") {
1195  selectRepeatFreq(e);
1196  }
1197 
1198  },
1199  function() {
1200  // decline terms, prevent change
1201  e.preventDefault();
1202 
1203  // set frequency to One Time
1204  $("#txFrequency").data("kendoDropDownList").value("OneTime");
1205 
1206  // set start date to todays date
1207  $("#txDateStart").data("kendoDatePicker").value(
1208  new Date('<?php echo $today->format($DATETIME_FORMAT); ?>')
1209  );
1210  }
1211  );
1212  } else {
1213  if (e.sender.element[0].id == "txFrequency") {
1214  selectRepeatFreq(e);
1215  }
1216  }
1217  }
1218 
1219  function selectRepeatFreq(e) {
1220  var dropdown = e.sender;
1221  var dropdownData = e.dataItem;
1222  var dropdownValue = dropdownData.value;
1223  var dropdownContinue = $("#txContinue").data("kendoDropDownList");
1224  var dropdownContinueValue = dropdownContinue.value();
1225 
1226  var showContinue =
1227  dropdownValue != "OneTime";
1228  var showEnd =
1229  showContinue &&
1230  dropdownContinueValue != "continuous";
1231 
1232  var labelStart = $("label[for='txDateStart']");
1233  var labelStartText = dropdownValue == 'OneTime' ?
1234  "<?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_JS); ?>" :
1235  "<?php echo $MC->msg('Transfer Start On', HCU_DISPLAY_AS_JS); ?>";
1236 
1237  if (showContinue) {
1238  $("#transferDivContinue").show();
1239  $("#txDateStart").data("kendoDatePicker").min(
1240  new Date('<?php echo $today->add(new DateInterval('P1D'))->format($DATETIME_FORMAT); ?>')
1241  );
1242  } else {
1243  $("#transferDivContinue").hide();
1244  $("#txDateStart").data("kendoDatePicker").min(
1245  new Date('<?php echo $today->format($DATETIME_FORMAT); ?>')
1246  );
1247  }
1248 
1249  if (showEnd) {
1250  $("#continueUntilSpan").show();
1251  $('#txDateEnd').attr('required', true);
1252  } else {
1253  $("#continueUntilSpan").hide();
1254  $('#txDateEnd').removeAttr('required');
1255  $("#txDateEnd").data("kendoDatePicker").value("");
1256  }
1257 
1258  // set value if it is less than the minimum
1259  var startVal = $("#txDateStart").data("kendoDatePicker").value();
1260  var startMin = $("#txDateStart").data("kendoDatePicker").min();
1261  if (startVal < startMin) {
1262  $("#txDateStart").data("kendoDatePicker").value(startMin);
1263  }
1264 
1265  setDataAttributes(showContinue);
1266 
1267  labelStart.text(labelStartText);
1268  }
1269 
1270  function selectRepeatContinue(e) {
1271  var dropdown = this;
1272  var dropdownData = dropdown.dataItem(e.item.index());
1273  var dropdownValue = dropdownData.value;
1274 
1275  var showEnd = dropdownValue != "continuous";
1276 
1277  if (showEnd) {
1278  $("#continueUntilSpan").show();
1279  $('#txDateEnd').attr('required', true);
1280  } else {
1281  $("#continueUntilSpan").hide();
1282  $('#txDateEnd').removeAttr('required');
1283  $("#txDateEnd").data("kendoDatePicker").value("");
1284  }
1285  }
1286 
1287  function setDataAttributes(showContinue) {
1288  if (showContinue) {
1289  $("label[for='txDateStart']").text("<?php echo $MC->msg('Transfer Start On', HCU_DISPLAY_AS_JS); ?>");
1290  $("#txDateStart").attr("data-required-msg",
1291  "<?php echo $MC->msg('Transfer Start On', HCU_DISPLAY_AS_HTML) ?>: " +
1292  "<?php echo $MC->msg('is a Required Field', HCU_DISPLAY_AS_HTML); ?>");
1293  $("#txDateStart").attr("data-homecuCustomMatch-msg",
1294  "<?php echo $MC->msg('Transfer Start On', HCU_DISPLAY_AS_HTML) ?>: " +
1295  "<?php echo $MC->msg('is not a valid date', HCU_DISPLAY_AS_HTML); ?>");
1296  $("#txDateStart").attr("data-homecuCustomDateGTValue-msg",
1297  "<?php echo $MC->msg('Transfer Start On', HCU_DISPLAY_AS_HTML) ?>: " +
1298  "<?php echo $MC->msg('must be future date', HCU_DISPLAY_AS_HTML); ?>");
1299  } else {
1300  $("label[for='txDateStart']").text("<?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_JS); ?>");
1301  $("#txDateStart").attr("data-required-msg",
1302  "<?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_HTML) ?>: " +
1303  "<?php echo $MC->msg('is a Required Field', HCU_DISPLAY_AS_HTML); ?>");
1304  $("#txDateStart").attr("data-homecuCustomMatch-msg",
1305  "<?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_HTML) ?>: " +
1306  "<?php echo $MC->msg('is not a valid date', HCU_DISPLAY_AS_HTML); ?>");
1307  $("#txDateStart").attr("data-homecuCustomDateGTValue-msg",
1308  "<?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_HTML) ?>: " +
1309  "<?php echo $MC->msg('must be future date', HCU_DISPLAY_AS_HTML); ?>");
1310  }
1311  }
1312 
1313  <?php endif; ?>
1314 
1315  $(document).ready(function() {
1316  InitScreen();
1317 
1318  if (noticeTRN) {
1319  ShowNotice('<?php echo $noticeURLTRN; ?>', "<?php echo $noticeLinkDisplayTRN ?>");
1320  }
1321  });
1322 
1323  $(document).on("click", ".k-overlay", function () {
1324  if(windowStack.length > 0) {
1325  var open = windowStack[windowStack.length-1];
1326  open.close();
1327  }
1328  });
1329 </script>
1330 <style>
1331 #hcuTransferBlock {
1332  max-width: 700px;
1333  margin-left: 0px;
1334  margin-top: 15px;
1335 }
1336 .local-hide-member-inp {
1337  display: none;
1338 }
1339 
1340 .local-transfer-msg {
1341  padding: 1em;
1342 }
1343 
1344 .local-transfer-button {
1345  padding-top: 20px;
1346 }
1347 
1348 .response-label {
1349  font-weight: bold;
1350 }
1351 .response-field {
1352 
1353 }
1354 .transfer-confirm {
1355  list-style: none;
1356 }
1357 
1358 
1359 .k-dropdown .k-input,.k-selectbox .k-input {
1360  white-space: normal;
1361 }
1362 
1363 .k-window.transferResponse .k-icon {
1364  background-image: url('https://d1kryjpwpzirc7.cloudfront.net/homecu/images/printer.png');
1365 }
1366 .k-window.transferResponse .k-i-custom,
1367 .k-window.transferResponse .k-state-hover .k-i-custom {
1368  background-position: 0px 0px;
1369 }
1370 
1371 #confirmTransferRows .row:nth-child(odd) {
1372  background-color: #ddd;
1373 }
1374 
1375  .container-fluid-margin {
1376  margin: 15px;
1377  }
1378 
1379  .k-block > .k-header {
1380  white-space: normal;
1381  height: 100%;
1382  }
1383 
1384  .hcu-info-margin, .hcu-error-margin {
1385  margin: 15px 0;
1386  }
1387 
1388  .hcu-info-padding, .hcu-error-padding {
1389  padding: 15px;
1390  }
1391 
1392  .hcu-all-100 {
1393  width: 100%;
1394  }
1395  /* top-bottom margin */
1396  .hcu-container-margin {
1397  margin: 15px 0;
1398  }
1399 
1400  .local-adjust-container-bottom {
1401  margin-bottom: -15px;
1402  }
1403 
1404  .local-inside-well {
1405  margin-bottom: 0px;
1406  margin-top: 15px;
1407  }
1408 </style>
1409 
1410 <div class="container-fluid">
1411  <div class='well well-sm col-xs-12' id="hcuTransferBlock">
1412 
1413  <h3><?php echo $MC->msg("Transfer Funds", HCU_DISPLAY_AS_HTML); ?></h3>
1414 
1415  <form id='formTransfer' name='formTransfer'>
1416  <input type='hidden' name='txFromMember'> <?php // Needed for preventing transfers between accounts (#1568). ?>
1417  <input type='hidden' name='txToMember'>
1418  <fieldset>
1419  <div class="col-xs-12 hcu-container-margin">
1420  <label for="txFromSuffix" class="hcu-all-100">
1421  <?php echo $MC->msg('From', HCU_DISPLAY_AS_HTML); ?>:
1422  </label>
1423 
1424  <input id='txFromSuffix' name='txFromSuffix' class='distinctAcct hcu-all-100'
1425  required data-required-msg="<?php echo $MC->msg('Select From', HCU_DISPLAY_AS_HTML);?>"/>
1426 
1427  <span class="k-invalid-msg" title=""
1428  data-for="txFromSuffix">
1429 
1430  <span class="k-icon k-warning " ></span>
1431  </span>
1432 
1433  <div class="col-xs-12" id="txFromSuffixInfo"></div>
1434  </div>
1435 
1436  <div class="col-xs-12">
1437  <label for="txToSuffix" class="hcu-all-100">
1438  <?php echo $MC->msg('To', HCU_DISPLAY_AS_HTML); ?>:
1439  </label>
1440 
1441  <input id='txToSuffix' name='txToSuffix' class='distinctAcct hcu-all-100'
1442  required data-required-msg="<?php echo $MC->msg('Select To', HCU_DISPLAY_AS_HTML);?>"
1443  homecu-distinct="distinctAcct"
1444  data-homecuCustomDistinct-msg='<?php echo $MC->msg('Selected the Same Accounts', HCU_DISPLAY_AS_HTML); ?>'/>
1445  <span class="k-invalid-msg" title=""
1446  data-for="txToSuffix">
1447  <span class="k-icon k-warning"></span>
1448  </span>
1449 
1450  <div class="col-xs-12" id="txToSuffixInfo"></div>
1451  </div>
1452  </fieldset>
1453 
1454  <?php if ($isLive && $permissionM2M['access']) { ?>
1455  <fieldset class="local-hide-member-inp">
1456  <div class="col-sm-12">
1457  <div class="well well-sm local-inside-well">
1458  <div class="row local-adjust-container-bottom">
1459  <div class="col-sm-12 hcu-secondary">
1460  <small class="hcu-secondary-text"><?php echo $MC->msg("Transfer Funds sec", HCU_DISPLAY_AS_HTML); ?></small>
1461  </div>
1462  <div class="col-xs-12 col-md-4 hcu-container-margin">
1463  <label for="txMemName">
1464  <?php echo $MC->msg("Last Name", HCU_DISPLAY_AS_HTML); ?>
1465  </label>
1466  <input type="" name="txMemName" class="k-textbox hcu-all-100"
1467  id="txMemName"
1468  data-required-msg="<?php echo $MC->msg("EXT Name On Account required", HCU_DISPLAY_AS_HTML); ?>">
1469  </div>
1470  <div class="col-xs-12 col-md-4 hcu-container-margin">
1471  <label for="txMemAccount">
1472  <?php echo $MC->msg("ACH Account", HCU_DISPLAY_AS_HTML) ?>
1473  </label>
1474  <input type="" name="txMemAccount" class="hcu-all-100"
1475  id="txMemAccount"
1476  maxlength="20"
1477  data-required-msg="<?php echo $MC->msg('ACH Need remote account', HCU_DISPLAY_AS_HTML); ?>">
1478  </div>
1479  <div class="col-xs-12 col-md-4 hcu-container-margin">
1480  <label for="txMemType">
1481  <?php echo $MC->msg('Account Type', HCU_DISPLAY_AS_HTML); ?>
1482  </label>
1483  <input type="" name="txMemType" class="hcu-all-100"
1484  id="txMemType"
1485  maxlength="20"
1486  data-required-msg="<?php echo $MC->msg('ACH Need remote account type', HCU_DISPLAY_AS_HTML) ?>">
1487  </div>
1488  </div>
1489  </div>
1490  </div>
1491  </fieldset>
1492  <?php } ?>
1493 
1494  <fieldset>
1495  <div class="col-xs-12 col-md-4 hcu-container-margin">
1496  <label for="txAmount" class="hcu-all-100">
1497  <?php echo $MC->msg('Amount', HCU_DISPLAY_AS_HTML); ?>
1498  </label>
1499 
1500  <input type="number" id="txAmount" name="txAmount" max="0" class="hcu-all-100"
1501  placeholder="<?php echo $MC->msg('Amount', HCU_DISPLAY_AS_HTML); ?>"
1502  required data-bind="value: txAmount"
1503  data-required-msg="<?php echo $MC->msg('Enter Amount', HCU_DISPLAY_AS_HTML);?>"
1504  data-max-msg="<?php echo $MC->msg('Requested transfer exceeds available funds', HCU_DISPLAY_AS_HTML); ?>"/>
1505 
1506  <span class="k-invalid-msg"
1507  data-for="txAmount"></span>
1508  </div>
1509 
1510  <?php if (intval($HB_ENV['trmemomaxlen']) > 0): ?>
1511  <div id="xferComment" class="col-xs-12 col-md-8 hcu-container-margin">
1512  <label for="txMemo" class="hcu-all-100">
1513  <?php echo $MC->msg('Transfer Comment', HCU_DISPLAY_AS_HTML); ?>
1514  </label>
1515 
1516  <input type="text" id="txMemo" name="txMemo" class="k-textbox hcu-all-100"
1517  placeholder="<?php echo $MC->msg('Transfer Comment', HCU_DISPLAY_AS_HTML); ?>"
1518  maxlength="<?php echo $HB_ENV['trmemomaxlen']; ?>"
1519  data-bind="value: txMemo"
1520  homecu-maxlen="<?php echo $HB_ENV['trmemomaxlen']; ?>"
1521  data-homecuCustomMaxLen-msg="
1522  <?php echo $MC->msg('Transfer Comment', HCU_DISPLAY_AS_HTML); ?>:
1523  <?php echo $MC->msg('exceeds max length', HCU_DISPLAY_AS_HTML); ?>"/>
1524  </div>
1525  <?php endif; ?>
1526  </fieldset>
1527 
1528  <fieldset id='reqComment' style="display: none;">
1529  <div class="col-xs-12 hcu-container-margin">
1530  <label for="paymentComment" class="hcu-all-100">
1531  <?php echo $MC->msg('Comments', HCU_DISPLAY_AS_HTML); ?>
1532  </label>
1533 
1534  <textarea rows='5' cols='50' id="paymentComment" name="paymentComment" class="k-textarea hcu-all-100"
1535  data-bind="value: txMemo"></textarea>
1536  </div>
1537  <div id='reqCCNote' class="col-xs-12">
1538  <?php echo $MC->msg("NOTE", HCU_DISPLAY_AS_HTML); ?> <?php echo $MC->msg("CCPayNote", HCU_DISPLAY_AS_HTML); ?>
1539  </div>
1540  </fieldset>
1541 
1542  <?php if ($allowScheduled): ?>
1543  <div id='txScheduledFields'>
1544  <!-- DO NOT ALLOW THE SETTING FOR REPEATING A TRANSFER -->
1545  <!-- They must have repeating setup to use the FUTURE transfer feature -->
1546  <fieldset>
1547  <div class="col-xs-12 col-md-6 hcu-container-margin">
1548  <label for="txFrequency" class="hcu-all-100">
1549  <?php echo $MC->msg('Repeat', HCU_DISPLAY_AS_HTML); ?>
1550  </label>
1551 
1552  <input id='txFrequency' name='txFrequency' class="hcu-all-100"
1553  data-bind='value: txFrequency' required/>
1554 
1555  <span class="k-invalid-msg" data-for="txFrequency"></span>
1556  </div>
1557 
1558  <div id="transferDivDate" class="col-xs-12 col-md-6 hcu-container-margin"><!-- DISPLAY NONE -->
1559  <label for="txDateStart" class="hcu-all-100">
1560  <?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_HTML); ?>
1561  </label>
1562 
1563  <input type="text" id="txDateStart" name="txDateStart" class="hcu-all-100"
1564  placeholder="eg. MM/DD/YYYY"
1565  homecu-match="date"
1566  homecu-dategtvalue="<?php echo $today->format('m/d/Y'); ?>"
1567  data-required-msg="
1568  <?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_HTML) ?>:
1569  <?php echo $MC->msg('is a Required Field', HCU_DISPLAY_AS_HTML); ?>"
1570  data-homecuCustomMatch-msg="
1571  <?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_HTML) ?>:
1572  <?php echo $MC->msg('is not a valid date', HCU_DISPLAY_AS_HTML); ?>"
1573  data-homecuCustomDateGTValue-msg="
1574  <?php echo $MC->msg('Transfer On', HCU_DISPLAY_AS_HTML) ?>:
1575  <?php echo $MC->msg('must be future date', HCU_DISPLAY_AS_HTML); ?>"
1576  data-bind="
1577  value: txDateStart"
1578  required/>
1579 
1580  <span class="k-invalid-msg" data-for="txDateStart"></span>
1581  </div>
1582  </fieldset>
1583  <fieldset>
1584  <div id="transferDivContinue" class="col-xs-12 col-md-6 hcu-container-margin" style="display: none;"><!-- DISPLAY NONE -->
1585  <input id="txContinue" name="txContinue" class="hcu-all-100"/>
1586  </div>
1587 
1588  <div id="continueUntilSpan" class="col-xs-12 col-md-6 hcu-container-margin" style="display: none;"><!-- DISPLAY NONE -->
1589  <input type="text" id="txDateEnd" name="txDateEnd" class="hcu-all-100"
1590  placeholder="eg. MM/DD/YYYY"
1591  data-bind="value: txDateEnd"
1592  homecu-match="date"
1593  homecu-dategtvalue="txDateStart"
1594  homecu-dategttype="field"
1595  data-required-msg="<?php echo $MC->msg('Continue Until must be entered', HCU_DISPLAY_AS_HTML); ?>"
1596  data-homecuCustomMatch-msg="<?php echo $MC->msg('Transfer Continue Until', HCU_DISPLAY_AS_HTML) . ' ' . $MC->msg('is not a valid date', HCU_DISPLAY_AS_HTML); ?>"
1597  data-homecuCustomDateGTValue-msg="<?php echo $MC->msg('Stop date after transfer', HCU_DISPLAY_AS_HTML); ?>"
1598  />
1599 
1600  <span class="k-invalid-msg" data-for="txDateEnd"></span>
1601  </div>
1602  </fieldset>
1603  </div>
1604  <?php endif; ?>
1605 
1606  <fieldset>
1607  <div class="col-xs-12 col-sm-6 hcu-container-margin">
1608  <button id="btnTransfer" name='btnTransfer' type="button" class="k-button k-primary hcu-all-100">
1609  <span class="fa fa-arrow-right"></span>
1610  <?php print $MC->msg('Continue Transfer', HCU_DISPLAY_AS_HTML); ?>
1611  </button>
1612  </div>
1613  </fieldset>
1614  </form>
1615  </div>
1616 </div> <?php // Container ending tag. ?>
1617 <script id='acctFromTemplate' type='text/x-kendo-tmpl'>
1618  <div class="row">
1619  # if ( data.acctClass == 'X' ) { #
1620  <div class="col-xs-12"><strong>#: data.acctText #</strong></div>
1621  # } else if (data.acctValue == '') { #
1622  <div class="col-xs-12">#: data.acctText #</div>
1623  # } else { #
1624  <div class="col-xs-12"><strong>#: data.acctText #</strong></div>
1625  <div class="col-xs-12">
1626  <div class="col-xs-6 text-left">
1627  <span><?php print trim($MC->msg('Available', HCU_DISPLAY_AS_JS)); ?>:</span>
1628  </div>
1629  <div class="col-xs-6 text-right">
1630  <span>$#: data.acctAvail #</span>
1631  </div>
1632  </div>
1633  # } #
1634  </div>
1635 </script>
1636 <script id='acctToTemplate' type='text/x-kendo-tmpl'>
1637  <div class="row">
1638  <div class="col-xs-12"><strong>#: data.acctText #</strong></div>
1639  # if (data.acctValue != '') { #
1640  <div class="col-xs-12">
1641  # var acctInfo = data.acctInfo; #
1642  # for (i=0; i<acctInfo.length; i++ ) { #
1643  <div class="col-xs-6 text-left">
1644  <span>
1645  #: acctInfo[i].desc #: <!-- display data -->
1646  </span>
1647  </div>
1648  <div class="col-xs-6 text-right">
1649  <span>
1650  # if (acctInfo[i]['value'] != "N/A") { #
1651  $#: acctInfo[i].value # <!-- display data -->
1652  # } else { #
1653  #: acctInfo[i].value # <!-- display data -->
1654  # } #
1655  </span>
1656  </div>
1657  # } #
1658  </div>
1659  # } #
1660  </div>
1661 </script>
1662 
1663 <script type="text/x-kendo-tmpl" id="acctInfo">
1664  # if (data.acctClass == 'X') { #
1665  <div class="col-xs-12 hcu-secondary">
1666  <span class="hcu-secondary-alt-text"><?php echo $achCutoffMessageString; ?></span>
1667  </div>
1668  # } #
1669  # for (var i = 0; i < data.length; i++) { #
1670  # if (i % 2 == 0) { #
1671  <div class="col-xs-6 text-left">#: data[i].desc #</div>
1672  <div class="col-xs-6 text-right">
1673  # if (data[i].value != "N/A") { #
1674  $#: data[i].value # <!-- display data -->
1675  # } else { #
1676  #: data[i].value # <!-- display data -->
1677  # } #
1678  </div>
1679  # } else { #
1680  <div class="col-xs-6 text-left" style="background-color: \#ddd;">#: data[i].desc #</div>
1681  <div class="col-xs-6 text-right" style="background-color: \#ddd;">
1682  # if (data[i].value != "N/A") { #
1683  $#: data[i].value # <!-- display data -->
1684  # } else { #
1685  #: data[i].value # <!-- display data -->
1686  # } #
1687  </div>
1688  # } #
1689  # } #
1690 </script>
1691 
1692 <script id="confirmTransferTemplate" type="text/x-kendo-tmpl">
1693  <div style="background-color:white;">
1694 
1695  <div id="confirmTransferRows">
1696  <fieldset class="row hcu-container-padding">
1697  <div class="col-sm-4 nopadding">
1698  <strong><?php echo $MC->msg('Transfer Title From Account', HCU_DISPLAY_AS_HTML); ?>:</strong>
1699  </div>
1700 
1701  <div class="col-sm-6 nopadding">
1702  <p id='confFrom'></p>
1703  </div>
1704  </fieldset>
1705 
1706  <fieldset class="row hcu-container-padding">
1707  <div class="col-sm-4 nopadding">
1708  <strong><?php echo $MC->msg('Transfer Title To Account', HCU_DISPLAY_AS_HTML); ?>:</strong>
1709  </div>
1710 
1711  <div class="col-sm-6 nopadding">
1712  <p id='confTo'></p>
1713  </div>
1714  </fieldset>
1715 
1716  <fieldset class="row hcu-container-padding">
1717  <div class="col-sm-4 nopadding">
1718  <strong><?php echo $MC->msg('Amount', HCU_DISPLAY_AS_HTML); ?>:</strong>
1719  </div>
1720 
1721  <div class="col-sm-6 nopadding">
1722  <p id='confAmount' ></p>
1723  </div>
1724  </fieldset>
1725 
1726  <fieldset class="row hcu-container-padding">
1727  <div id='confPaymentComment' class="col-sm-4 nopadding">
1728  <strong><?php echo $MC->msg('Comments', HCU_DISPLAY_AS_HTML); ?>:</strong>
1729  </div>
1730 
1731  <div id='confTransferComment' class="col-sm-4 nopadding">
1732  <strong><?php echo $MC->msg('Transfer Comment', HCU_DISPLAY_AS_HTML); ?>:</strong>
1733  </div>
1734 
1735  <div class="col-sm-6 nopadding">
1736  <p id='confComment'></p>
1737  </div>
1738  </fieldset>
1739 
1740  <fieldset id="ccPayNote" class="row hcu-container-padding">
1741  <div class="col-sm-4 nopadding">
1742  <strong><?php echo $MC->msg("NOTE", HCU_DISPLAY_AS_HTML); ?></strong>
1743  </div>
1744 
1745  <div class="col-sm-6 nopadding">
1746  <p><?php echo $MC->msg("CCPayNote", HCU_DISPLAY_AS_HTML); ?></p>
1747  </div>
1748  </fieldset>
1749 
1750  <fieldset id='confirmRepeatTransfer' class=" hcu-container-padding">
1751 
1752  </fieldset>
1753  </div>
1754  </div>
1755 </script>
1756 
1757 <script id="emptyToTemplate" type="text/k-kendo-template">
1758  <?php echo $MC->msg('No valid accounts transfer', HCU_DISPLAY_AS_JS); ?>
1759 </script>
1760 
1761 <script id="confirmationTemplate" type="text/x-kendo-tmpl">
1762  <div id="responseDiv">
1763  <div class="local-transfer-msg">
1764  <?php echo $MC->msg('Transfer posted', HCU_DISPLAY_AS_JS); ?>
1765  </div>
1766 
1767  # if (homecuData) { #
1768  # if (homecuData['transfer']) { #
1769  # for (i=0; i < homecuData['transfer'].length; i++ ) { #
1770  <div class="row">
1771  <div class="col-xs-6 text-right">
1772  <span class="response-label">#= homecuData['transfer'][i]['label'] #:</span>
1773  </div>
1774  <div class="col-xs-6">
1775  <span class="response-field">#= homecuData['transfer'][i]['caption'] #</span>
1776  </div>
1777  </div>
1778  # } #
1779  # } #
1780  <div>&emsp;</div>
1781  # if (homecuData['repeat']) { #
1782  # if (typeof homecuData['repeat'] === 'object') { #
1783  <br/>
1784  <div class='k-block k-error-colored'>
1785  # for (i=0; i < homecuData['repeat'].length; i++ ) { #
1786  #= homecuData['repeat'][i] #<br/>
1787  # } #
1788  </div>
1789  # } else { #
1790  <div class='local-transfer-msg k-block k-success-colored'>
1791  #= homecuData['repeat'] #
1792  </div>
1793  # } #
1794  # } #
1795  # if (homecuData['posted']) { #
1796  <div class="local-transfer-msg">
1797  #= homecuData['posted'] #
1798  </div>
1799  # } #
1800  # } #
1801  <div>&emsp;</div>
1802  </div>
1803 </script>
1804 <?php
1805  /*
1806  * ** END CONTENT
1807  */
1808 
1809 
1810  // ** INCLUDE POST CONTENT SCRIPT
1811  require_once(dirname(__FILE__) . '/../includes/hcuPostContent.i');