PageRenderTime 52ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/webccr/src/com/emis/caesar/senao/notiy/TUserInterfaceNotify.java

https://bitbucket.org/sanliou/synccr
Java | 1349 lines | 988 code | 72 blank | 289 comment | 113 complexity | c640a292d1103512bd12da4e1637181a MD5 | raw file
  1. package com.emis.caesar.senao.notiy;
  2. import com.emis.caesar.senao.data.TEntryEdit;
  3. import com.emis.caesar.senao.data.TEntryEdits;
  4. import com.emis.caesar.senao.data.TLoginData;
  5. import com.emis.caesar.senao.event.TButtonEventContext;
  6. import com.emis.caesar.senao.event.TEventContext;
  7. import com.emis.caesar.senao.event.button.*;
  8. import com.emis.caesar.senao.unit.*;
  9. import com.emis.caesar.senao.unit.sale.TInvoice;
  10. import com.emis.caesar.senao.unit.sale.TMember;
  11. import com.emis.caesar.senao.unit.sale.TPayment;
  12. import com.emis.caesar.senao.unit.sale.TSaleItem;
  13. import com.emis.caesar.senao.util.CcrUtil;
  14. import com.emis.caesarui.webccr.core.PromotionInfoList;
  15. import com.emis.caesarui.webccr.ui.table.TSalePayTable;
  16. import com.emis.caesarui.webccr.ui.table.TSalesTable;
  17. import com.emis.caesarui.webccr.ui.window.*;
  18. import com.emis.caesarui.webccr.webccr;
  19. import com.emis.user.emisAuthFactory;
  20. import com.emis.util.emisUtil;
  21. import com.vaadin.event.FieldEvents;
  22. import com.vaadin.server.Page;
  23. import com.vaadin.server.VaadinService;
  24. import com.vaadin.server.VaadinSession;
  25. import com.vaadin.server.WrappedSession;
  26. import com.vaadin.ui.*;
  27. import de.steinwedel.messagebox.ButtonOption;
  28. import de.steinwedel.messagebox.MessageBox;
  29. import java.util.ArrayList;
  30. public class TUserInterfaceNotify {
  31. TCcr FoCcr = null;
  32. public TUserInterfaceNotify(TCcr oCcr_) {
  33. overWriteCcr(oCcr_);
  34. }
  35. //
  36. public void overWriteCcr(TCcr oCcr_) {
  37. FoCcr = oCcr_;
  38. }
  39. // 多個條件顯示本來得P_NO
  40. public void swEntryEdits(TEntryEdits oEdits_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
  41. swEntryEdits(oEdits_, oEvent_, sOkMethod_, sCancelMethod_, "");
  42. }
  43. /**
  44. * 建立一個可動態大小的視窗, 依_oEdits筆數, 建立一個STRING GRID.2欄, 一欄取得TEntryEdit的caption , 一欄輸入
  45. * 按下確定後. 執行oEvent_ .runEventMethod( _sOkMethod), 按下取消, 則呼叫oEvent_的oEvent_ .runEventMethod(_sCancelMethod_)
  46. *
  47. * @param oEdits_
  48. * @param oEvent_
  49. * @param sOkMethod_
  50. * @param sCancelMethod_
  51. */
  52. public void swEntryEdits(TEntryEdits oEdits_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String sCondition) {
  53. WinInputText _oInput = new WinInputText(oEdits_, oEvent_, sOkMethod_, sCancelMethod_, sCondition);
  54. _oInput.setModal(true);
  55. _oInput.setResizable(false);
  56. _oInput.setWidth("650px");
  57. _oInput.setClosable(false);
  58. _oInput.addStyleName("v-scrollable");
  59. int _iEditCnt = oEdits_.getEditCount();
  60. if (_iEditCnt > 0 && _iEditCnt > 12) {
  61. _oInput.setHeight((14 * 70) + "px");
  62. } else if (_iEditCnt > 0) {
  63. _oInput.setHeight(((_iEditCnt + 2) * 70) + "px");
  64. } else {
  65. _oInput.setHeight("70px");
  66. }
  67. UI.getCurrent().addWindow(_oInput);
  68. _oInput.addFocusListener(new FieldEvents.FocusListener() {
  69. @Override
  70. public void focus(FieldEvents.FocusEvent event) {
  71. _oInput.TextList.get(0).focus();
  72. }
  73. });
  74. _oInput.addCloseListener(new Window.CloseListener(){
  75. @Override
  76. public void windowClose(Window.CloseEvent e) {
  77. if (( UI.getCurrent() instanceof webccr)) {
  78. // ((webccr) UI.getCurrent()).getlog().info(webccr.class,
  79. // "Before window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
  80. CcrUtil.setMessage("Before window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
  81. ((webccr) UI.getCurrent()).getInputLabel().focus();
  82. // ((webccr) UI.getCurrent()).getlog().info(webccr.class,
  83. // "After window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
  84. CcrUtil.setMessage("After window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
  85. }
  86. }
  87. });
  88. }
  89. //add by Ares 20200207 判斷要適用優惠券、可否折上折,才可帶出優惠券滿額單
  90. public void swEntryEdits_COUPON(TEntryEdits oEdits_, TEventContext oEvent_, String sOkMethod_) {
  91. WinInputText_COUPON _oInput = new WinInputText_COUPON(oEdits_, oEvent_, sOkMethod_);
  92. _oInput.setModal(true);
  93. _oInput.setResizable(false);
  94. _oInput.setWidth("650px");
  95. _oInput.setClosable(false);
  96. _oInput.addStyleName("v-scrollable");
  97. int _iEditCnt = oEdits_.getEditCount();
  98. if (_iEditCnt > 0 && _iEditCnt > 12) {
  99. _oInput.setHeight((14 * 70) + "px");
  100. } else if (_iEditCnt > 0) {
  101. _oInput.setHeight(((_iEditCnt + 2) * 70) + "px");
  102. } else {
  103. _oInput.setHeight("70px");
  104. }
  105. UI.getCurrent().addWindow(_oInput);
  106. _oInput.addFocusListener(new FieldEvents.FocusListener() {
  107. @Override
  108. public void focus(FieldEvents.FocusEvent event) {
  109. _oInput.TextList.get(0).focus();
  110. }
  111. });
  112. _oInput.addCloseListener(new Window.CloseListener(){
  113. @Override
  114. public void windowClose(Window.CloseEvent e) {
  115. if (( UI.getCurrent() instanceof webccr)) {
  116. // ((webccr) UI.getCurrent()).getlog().info(webccr.class,
  117. // "Before window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
  118. CcrUtil.setMessage("Before window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
  119. ((webccr) UI.getCurrent()).getInputLabel().focus();
  120. // ((webccr) UI.getCurrent()).getlog().info(webccr.class,
  121. // "After window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
  122. CcrUtil.setMessage("After window close ReadOnly:"+((webccr) UI.getCurrent()).getInputLabel().isReadOnly());
  123. }
  124. }
  125. });
  126. }
  127. /**
  128. * 彈出顯示YES/NO, 訊息為sMsg_的子視窗, YES/NO按鍵的預設位置由bDefaultYes控制
  129. * 按下YES後. 執行oEvent_ .runEventMethod( sYesMethod_),
  130. * 按下NOP 則呼叫oEvent_的oEvent_ .runEventMethod(_sNoMethod_)
  131. *
  132. * @param bDefaultYes
  133. * @param sMsg_
  134. * @param oEvent_
  135. * @param sYesMethod_
  136. * @param sNoMethod_
  137. */
  138. public void askYesOrNo(boolean bDefaultYes, String sMsg_, TEventContext oEvent_, String sYesMethod_, String sNoMethod_) {
  139. MessageBox _oMsgBox = MessageBox.createInfo();
  140. _oMsgBox.withCaption("訊息")
  141. .withMessage(sMsg_);
  142. if (bDefaultYes) {
  143. _oMsgBox.withYesButton(() -> {
  144. oEvent_.runEventMethod(sYesMethod_);
  145. }, ButtonOption.focus())
  146. .withNoButton(() -> {
  147. oEvent_.runEventMethod(sNoMethod_);
  148. })
  149. .open();
  150. } else {
  151. _oMsgBox.withYesButton(() -> {
  152. oEvent_.runEventMethod(sYesMethod_);
  153. })
  154. .withNoButton(() -> {
  155. oEvent_.runEventMethod(sNoMethod_);
  156. }, ButtonOption.focus())
  157. .open();
  158. }
  159. }
  160. /**
  161. * 切換按鍵頁面. 第iBtnPanel_塊功能面版, 切換至指定iBtnPage_頁面
  162. *
  163. * @param sBtnPanel_
  164. * @param iBtnPage_
  165. */
  166. public void moveToBtnPage(String sBtnPanel_, int iBtnPage_) {
  167. webccr _oUI = (webccr) UI.getCurrent();
  168. if (iBtnPage_ == 0 || iBtnPage_ < 0) return; // 為0則表示不換頁
  169. if ("T".equals(sBtnPanel_)) {
  170. _oUI.changeTopButton(iBtnPage_ - 1);
  171. } else if ("B".equals(sBtnPanel_)) {
  172. _oUI.changeButton(iBtnPage_ - 1);
  173. }
  174. }
  175. /**
  176. * 開啟WEBCCR主畫面
  177. */
  178. public void openWebCcr() {
  179. String EMIS_USER_BIND_NAME = "com.emis.user.emisCaesarUser.class";
  180. WrappedSession session = VaadinService.getCurrentRequest().getWrappedSession();
  181. session.setAttribute(EMIS_USER_BIND_NAME, FoCcr);
  182. VaadinSession.getCurrent().setAttribute(EMIS_USER_BIND_NAME, FoCcr);
  183. //
  184. String path = "/webccr";
  185. if (!emisUtil.isEmpty(FoCcr.getsHTTP())) {
  186. path += "?name=" + FoCcr.getsHTTP();
  187. }
  188. emisUtil.setLocation(path);
  189. }
  190. // 關閉WEBCCR(關閉CHROME的網頁)
  191. public void closeWebCcr() {
  192. try {
  193. // 正常登出時, 將CASH_ID.IDNO_TOKEN清空
  194. FoCcr.wrDataToDb.updCASH_IDcolumnIDNO_TOKEN(FoCcr.getCcrID(), true);
  195. // ((webccr) UI.getCurrent()).getlog().info(login.class, "登出機號="+ FoCcr.getCcrID());
  196. CcrUtil.setMessage("登出機號="+ FoCcr.getCcrID());
  197. //
  198. String path = "/login";
  199. if (!emisUtil.isEmpty(FoCcr.getsHTTP())) {
  200. path += "?name=" + FoCcr.getsHTTP();
  201. }
  202. //
  203. WrappedSession session = VaadinService.getCurrentRequest().getWrappedSession();
  204. JavaScript.getCurrent().execute("window.onbeforeunload = function (e) { };");
  205. //
  206. emisAuthFactory.logout(emisUtil.getServletContext(), session);
  207. emisUtil.setLocation(path);
  208. UI.getCurrent().getSession().close();
  209. } catch (Exception e) {
  210. // ((webccr) UI.getCurrent()).getlog().error(webccr.class, e);
  211. CcrUtil.setMessage(emisUtil.getStackTrace(e));
  212. }
  213. }
  214. /**
  215. * 商品查詢畫面, 若雙點擊grid上商品, 則回傳指定商品之P_NO, 其餘傳空白
  216. * TCcrConst.BTN_QUERY_PRODUCT
  217. * @param oEdit_
  218. * @param oEvent_
  219. * @param sOkMethod_
  220. * @param sCancelMethod_
  221. * @param sPLUMethod_
  222. */
  223. public void swQueryProductFrom(TEntryEdit oEdit_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String sPLUMethod_) {
  224. WinProductQry _oWinProdQry = new WinProductQry(oEdit_, oEvent_, sOkMethod_, sCancelMethod_, sPLUMethod_);
  225. _oWinProdQry.setModal(true);
  226. _oWinProdQry.setResizable(false);
  227. _oWinProdQry.setClosable(false);
  228. _oWinProdQry.setWidth("95%");
  229. _oWinProdQry.setHeight("95%");
  230. UI.getCurrent().addWindow(_oWinProdQry);
  231. }
  232. /**
  233. * 門市群組庫存查詢 (同商品查詢畫面,Table不同)
  234. * TCcrConst.BTN_QUERY_S_STOCK
  235. */
  236. public void swQueryStockFrom(TEntryEdit oEdit_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String sPLUMethod_) {
  237. WinProductQry _oWinProdQry = new WinProductQry(oEdit_, oEvent_, sOkMethod_, sCancelMethod_, sPLUMethod_, TCcrConst.BTN_QUERY_S_STOCK);
  238. _oWinProdQry.setModal(true);
  239. _oWinProdQry.setResizable(false);
  240. _oWinProdQry.setClosable(false);
  241. _oWinProdQry.setWidth("95%");
  242. _oWinProdQry.setHeight("95%");
  243. UI.getCurrent().addWindow(_oWinProdQry);
  244. }
  245. //開啟促銷單號頁面
  246. public void swPromotionFrom(String title,PromotionInfoList pmList, ArrayList<TSaleItem> SaleItemPool,
  247. TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
  248. WinPromotion _oWinPromotion = new WinPromotion(pmList, SaleItemPool, oEvent_, sOkMethod_, sCancelMethod_);
  249. _oWinPromotion.setCaption(title);
  250. _oWinPromotion.setModal(true);
  251. _oWinPromotion.setResizable(false);
  252. _oWinPromotion.setClosable(false);
  253. _oWinPromotion.setWidth("100%");
  254. _oWinPromotion.setHeight("100%");
  255. UI.getCurrent().addWindow(_oWinPromotion);
  256. _oWinPromotion.addFocusListener(new FieldEvents.FocusListener() {
  257. @Override
  258. public void focus(FieldEvents.FocusEvent event) {
  259. _oWinPromotion.gettPno().focus();
  260. }
  261. });
  262. }
  263. //add by Ares 20200207 判斷要適用優惠券、可否折上折,才可帶出優惠券滿額單
  264. //開啟滿額單號頁面 by 折扣折讓
  265. public void swPromotionFrom1ByFI(PromotionInfoList pmList, TEntryEdit oEdit_, TEventContext oEvent_,
  266. String sOkMethod_, String sCancelMethod_, String sIS_COUPON_, String sCaption_) {
  267. //WinPromotion4FI_23 _oWinPromotion4FI_23 = new WinPromotion4FI_23(pmList, oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
  268. WinPromotion4FI_23 _oWinPromotion4FI_23 = new WinPromotion4FI_23(pmList, oEdit_, oEvent_, sOkMethod_, sCancelMethod_, sIS_COUPON_, sCaption_);
  269. _oWinPromotion4FI_23.setModal(true);
  270. _oWinPromotion4FI_23.setResizable(false);
  271. _oWinPromotion4FI_23.setClosable(false);
  272. _oWinPromotion4FI_23.setWidth("60%");
  273. _oWinPromotion4FI_23.setHeight("50%");
  274. UI.getCurrent().addWindow(_oWinPromotion4FI_23);
  275. }
  276. //add by Ares 20200207 判斷要適用優惠券、可否折上折,才可帶出優惠券滿額單
  277. //開啟滿額單號頁面 by 加購贈
  278. public void swPromotionFrom2ByFI(PromotionInfoList pmList, TEventContext oEvent_,
  279. String sOkMethod_, String sCancelMethod_, String sIS_COUPON_, String sCaption_) {
  280. //WinPromotion4FI _oWinPromotion4FI = new WinPromotion4FI(pmList, oEvent_, sOkMethod_, sCancelMethod_);
  281. WinPromotion4FI _oWinPromotion4FI = new WinPromotion4FI(pmList, oEvent_, sOkMethod_, sCancelMethod_, sIS_COUPON_, sCaption_);
  282. _oWinPromotion4FI.setModal(true);
  283. _oWinPromotion4FI.setResizable(false);
  284. _oWinPromotion4FI.setClosable(false);
  285. _oWinPromotion4FI.setWidth("90%");
  286. _oWinPromotion4FI.setHeight("90%");
  287. UI.getCurrent().addWindow(_oWinPromotion4FI);
  288. }
  289. //顯示清(讀)帳畫面, 畫面資料輸入完畢, 按下確認後, 將資料寫入oCcrLog_
  290. public boolean swSettleAccountsForm(TCcrLog oCcrLog_) {
  291. MessageBox.createWarning()
  292. .withCaption("訊息")
  293. .withMessage("功能開發中")
  294. .withWidth("400px")
  295. .withHeight("150").open();
  296. return true;
  297. }
  298. public void swErrMsg(String sMsg_) {
  299. //swErrMsg(sMsg_, "400px");
  300. swErrMsg(sMsg_, "450"); //add by Ares 20200416 禮物卡串接銀科
  301. }
  302. /**
  303. * 顯示錯誤訊息視窗
  304. *
  305. * @param sMsg_
  306. */
  307. public void swErrMsg(String sMsg_, String size) {
  308. MessageBox.createError()
  309. .withCaption("錯誤")
  310. .withMessage(sMsg_)
  311. .withWidth(size)
  312. // .withHeight("150")
  313. .withCloseButton(ButtonOption.focus())
  314. .open();
  315. }
  316. /**
  317. * 顯示錯誤訊息視窗
  318. *
  319. * @param sMsg_
  320. */
  321. public void swErrMsgNoSetSize(String sMsg_) {
  322. MessageBox.createError()
  323. .withCaption("錯誤")
  324. .withMessage(sMsg_)
  325. .withCloseButton(ButtonOption.focus())
  326. .open();
  327. }
  328. /**
  329. * 顯示錯誤訊息視窗
  330. * 關閉後,執行Event內的Method
  331. */
  332. public void swErrMsgWithBtnEvent(String sMsg_,TEventContext oEventContext_,String sMethod_) {
  333. MessageBox.createError()
  334. .withCaption("錯誤")
  335. .withMessage(sMsg_)
  336. .withWidth("400px")
  337. // .withHeight("150")
  338. .withCloseButton(()->{
  339. oEventContext_.runEventMethod(sMethod_);
  340. },ButtonOption.focus())
  341. .open();
  342. }
  343. /**
  344. * 檢查TextField必填,顯示錯誤訊息視窗 by Notification
  345. */
  346. public boolean emisEmptyValid(TextField oField, String sCaption, String sFieldName) {
  347. boolean _bValid = true;
  348. if (emisUtil.isEmpty(sCaption)) {
  349. sCaption = "必填";
  350. }
  351. if (emisUtil.isEmpty(oField.getValue())) {
  352. Notification notif = new Notification(sCaption, "「" + sFieldName + "」欄位不可為空白!", Notification.Type.WARNING_MESSAGE);
  353. notif.setDelayMsec(500);
  354. notif.show(oField.getUI().getPage());
  355. oField.focus();
  356. _bValid = false;
  357. }
  358. return _bValid;
  359. }
  360. /**
  361. * 檢查DateField必填,顯示錯誤訊息視窗 by Notification
  362. */
  363. public static boolean emisEmptyValid(DateField oField, String sCaption, String sFieldName) {
  364. boolean _bValid = true;
  365. String _sMsg = "「" + sFieldName + "」欄位不可為空白!";
  366. if (emisUtil.isEmpty(sCaption)) {
  367. sCaption = "必填";
  368. }
  369. if (oField.getValue() == null) {
  370. _bValid = false;
  371. sCaption = "錯誤";
  372. _sMsg = "「" + sFieldName + "」欄位格式錯誤或不可為空白!";
  373. }
  374. if (!_bValid) {
  375. Notification notif = new Notification(sCaption, _sMsg, Notification.Type.WARNING_MESSAGE);
  376. notif.setDelayMsec(500);
  377. notif.show(oField.getUI().getPage());
  378. oField.focus();
  379. }
  380. return _bValid;
  381. }
  382. /**
  383. * 檢查NativeSelect必選,顯示錯誤訊息視窗 by Notification
  384. */
  385. public static boolean emisEmptyValid(NativeSelect oSelect, String sCaption, String sFieldName) {
  386. boolean _bValid = true;
  387. String _sMsg = "「" + sFieldName + "」下拉式選單未選擇項目!";
  388. if (emisUtil.isEmpty(sCaption)) {
  389. sCaption = "必選";
  390. }
  391. if (oSelect.getValue() == null || emisUtil.isEmpty((String)oSelect.getValue())) {
  392. _bValid = false;
  393. }
  394. if (!_bValid) {
  395. Notification notif = new Notification(sCaption, _sMsg, Notification.Type.WARNING_MESSAGE);
  396. notif.setDelayMsec(500);
  397. notif.show(oSelect.getUI().getPage());
  398. oSelect.focus();
  399. }
  400. return _bValid;
  401. }
  402. /**
  403. * 顯示錯誤訊息視窗 by Notification
  404. */
  405. public void emisErrValid(TextField oField, String sCaption,String sMsg_) {
  406. Notification notif = new Notification(sCaption, sMsg_, Notification.Type.WARNING_MESSAGE);
  407. notif.setDelayMsec(500);
  408. notif.show(oField.getUI().getPage());
  409. oField.focus();
  410. }
  411. public void emisErrValid(DateField oField, String sCaption,String sMsg_) {
  412. Notification notif = new Notification(sCaption, sMsg_, Notification.Type.WARNING_MESSAGE);
  413. notif.setDelayMsec(500);
  414. notif.show(oField.getUI().getPage());
  415. oField.focus();
  416. }
  417. public void emisErrValid(PasswordField oField, String sCaption,String sMsg_) {
  418. Notification notif = new Notification(sCaption, sMsg_, Notification.Type.WARNING_MESSAGE);
  419. notif.setDelayMsec(500);
  420. notif.show(oField.getUI().getPage());
  421. oField.focus();
  422. }
  423. public void emisErrValid(CheckBox oField, String sCaption,String sMsg_) {
  424. Notification notif = new Notification(sCaption, sMsg_, Notification.Type.WARNING_MESSAGE);
  425. notif.setDelayMsec(500);
  426. notif.show(oField.getUI().getPage());
  427. oField.focus();
  428. }
  429. public void emisErrValid(String sCaption, String sMsg_) {
  430. Notification notif = new Notification(sCaption, sMsg_, Notification.Type.WARNING_MESSAGE);
  431. notif.setDelayMsec(500);
  432. }
  433. /**
  434. * 判斷編號欄位之起始編號迄是否大於終止編號 by Notification
  435. * if (!emisSeqValid(INPUTE_DATE_S, INPUTE_DATE_E, "有效日期", "", 1)) return;
  436. *
  437. * @param oField1 起始欄位物件
  438. * @param oField2 結束欄位物件
  439. * @param sMsg 欄位名稱訊息
  440. * @param sUMsg 自訂訊息
  441. * @param iShowType 訊息顯示方式 0:Notification;other:MessageBox
  442. * @return
  443. */
  444. public boolean emisSeqValid(Object oField1, Object oField2, String sMsg, String sUMsg, int iShowType) {
  445. String sField1 = "";
  446. String sField2 = "";
  447. Page page = null;
  448. TextField FocusTextField = null;
  449. DateField FocusDateField = null;
  450. boolean _bValid = true;
  451. String _sShow = "";
  452. if (oField1 instanceof TextField && oField2 instanceof TextField) {
  453. TextField oText1 = (TextField) oField1;
  454. TextField oText2 = (TextField) oField2;
  455. if (!emisUtil.isEmpty(oText1.getValue()) || !emisUtil.isEmpty(oText2.getValue())) {
  456. sField1 = oText1.getValue();
  457. sField2 = oText2.getValue();
  458. page = oText1.getUI().getPage();
  459. FocusTextField = oText2;
  460. }
  461. } else if (oField1 instanceof DateField && oField2 instanceof DateField) {
  462. DateField oDate1 = (DateField) oField1;
  463. DateField oDate2 = (DateField) oField2;
  464. if (oDate1.getValue() != null || oDate2.getValue() != null) {
  465. if (oDate1.getValue() != null) {
  466. sField1 = emisUtil.formatDateTime("%Y%M%D", oDate1.getValue());
  467. } else {
  468. sField1 = "0";
  469. }
  470. if (oDate2.getValue() != null) {
  471. sField2 = emisUtil.formatDateTime("%Y%M%D", oDate2.getValue());
  472. } else {
  473. sField2 = "0";
  474. }
  475. page = oDate1.getUI().getPage();
  476. FocusDateField = oDate2;
  477. }
  478. }
  479. if (!emisUtil.isEmpty(sField1) && !emisUtil.isEmpty(sField2)) {
  480. try {
  481. int _iField1Val = Integer.parseInt(sField1);
  482. int _iField2Val = Integer.parseInt(sField2);
  483. if (_iField1Val > _iField2Val) _bValid = false;
  484. if (!emisUtil.isEmpty(sMsg)) {
  485. _sShow = "「" + sMsg + "」起始不可大於終止!";
  486. } else {
  487. _sShow = sUMsg;
  488. }
  489. if (!_bValid) {
  490. // 顯示訊息方式
  491. if (iShowType == 0) {
  492. Notification notif = new Notification("警告", _sShow, Notification.Type.WARNING_MESSAGE);
  493. notif.setDelayMsec(500);
  494. notif.show(page);
  495. } else {
  496. swWarningMsg(_sShow);
  497. }
  498. if (FocusTextField != null) {
  499. FocusTextField.focus();
  500. } else if(FocusDateField != null) {
  501. FocusDateField.focus();
  502. }
  503. }
  504. } catch (Exception e) {
  505. // ((webccr) UI.getCurrent()).getlog().error(webccr.class, e);
  506. CcrUtil.setMessage(emisUtil.getStackTrace(e));
  507. }
  508. }
  509. return _bValid;
  510. }
  511. /**
  512. * 顯示警告視窗
  513. *
  514. * @param sMsg_
  515. */
  516. public void swWarningMsg(String sMsg_) {
  517. MessageBox.createWarning()
  518. .withCaption("警告")
  519. .withMessage(sMsg_)
  520. .withWidth("400px")
  521. // .withHeight("150")
  522. .withCloseButton(ButtonOption.focus())
  523. .open();
  524. }
  525. /**
  526. * 顯示一般訊息
  527. *
  528. * @param sMsg_
  529. */
  530. public void swMessage(String sMsg_) {
  531. MessageBox.createInfo()
  532. .withCaption("訊息")
  533. .withMessage(sMsg_)
  534. .withWidth("400px")
  535. // .withHeight("150")
  536. .withOkButton(ButtonOption.focus()).open();
  537. }
  538. /**
  539. * 顯示一般訊息
  540. * @param sMsg_
  541. * @param oEventContext_
  542. * @param sMethod_
  543. */
  544. public void swMessageWithBtnEvent(String sMsg_,TEventContext oEventContext_,String sMethod_) {
  545. MessageBox.createInfo().withCaption("訊息")
  546. .withMessage(sMsg_).withWidth("400px").withHeight("150")
  547. .withOkButton(()->{
  548. oEventContext_.runEventMethod(sMethod_);
  549. },ButtonOption.focus())
  550. .open();
  551. }
  552. /**
  553. * 取得登入畫面的輸入值
  554. *
  555. * @param oData_
  556. * @return
  557. */
  558. public boolean receiveLoginData(TLoginData oData_) {
  559. if (!"".equals(oData_.UIxS_NO) && !"".equals(oData_.UIxPASSWORD)
  560. && !"".equals(oData_.UIxSALE_DATE)) {
  561. return true;
  562. }
  563. return false;
  564. }
  565. //將sMsg_輸出至輸入框
  566. public void wrMessageToMainDisplay(String sMsg_) {
  567. if ((UI.getCurrent() instanceof webccr)){
  568. ((webccr) UI.getCurrent()).setShowMsg(sMsg_);
  569. ((webccr) UI.getCurrent()).setInput("");
  570. FoCcr.setMainDisplayReset(true);
  571. }
  572. }
  573. /**
  574. * 取得主畫面, 輸入框已輸入字串值
  575. *
  576. * @return
  577. */
  578. public String receivceMainDisplayEntryData() {
  579. return ((webccr) UI.getCurrent()).getInput();
  580. }
  581. /**
  582. * 更新主畫面交易內容, 不含grid. N(not)I(Include)G(Grid)
  583. */
  584. public void updateMainFormNIG() {
  585. try {
  586. webccr _oWebccr = (webccr) UI.getCurrent();
  587. // _oWebccr.setInput("");
  588. if (FoCcr.getCurrentSale() != null) {
  589. _oWebccr.getFlSlNo().setValue(FoCcr.getCurrentSale().getSn() + "");//交易序號
  590. _oWebccr.getFlUID().setValue(FoCcr.getCurrentSale().getUID());//統一編號
  591. _oWebccr.getFlCsNo().setValue(FoCcr.getCurrentSale().getFsCS_NO()); // 經銷商
  592. // _oWebccr.getFlOwner().setValue(FoCcr.getCurrentSale().getOwner()); //買受人
  593. _oWebccr.getFlTotalAmt().setValue(((long) FoCcr.getCurrentSale().getRealSaleTotal()) + "");//銷售金額
  594. _oWebccr.getFlTotalOrderAmt().setValue(((long) FoCcr.getCurrentSale().getOrderTotal()) + "");//客訂金額
  595. _oWebccr.getFlTotalPayAmt().setValue(((long) FoCcr.getCurrentSale().getRealSaleTotal()) + "");//應付金額
  596. _oWebccr.getFlChangeAmt().setValue(((long) FoCcr.getCurrentSale().getUnpaidAmout()) + ""); //未付款(+)/找零(-)
  597. TInvoice _oInvoce = FoCcr.getCurrentSale().getInvoice();
  598. if (_oInvoce != null) {
  599. if (!emisUtil.isEmpty(_oInvoce.getDonate())) {
  600. _oWebccr.getFlCarryDonate().setValue(_oInvoce.getDonate());
  601. } else if (!emisUtil.isEmpty(_oInvoce.getCarrierCode())) {
  602. _oWebccr.getFlCarryDonate().setValue(_oInvoce.getCarrierCode());
  603. }
  604. }
  605. } else {
  606. _oWebccr.getFlSlNo().setValue("");//交易序號
  607. _oWebccr.getFlUID().setValue("");//統一編號
  608. _oWebccr.getFlCsNo().setValue(""); // 經銷商
  609. // _oWebccr.getFlOwner().setValue(""); //買受人
  610. _oWebccr.getFlTotalAmt().setValue("0");//銷售金額
  611. _oWebccr.getFlTotalOrderAmt().setValue("0");//客訂金額
  612. _oWebccr.getFlTotalPayAmt().setValue("0");//應付金額
  613. _oWebccr.getFlChangeAmt().setValue("0"); //未付款(+)/找零(-)
  614. _oWebccr.getFlCarryDonate().setValue("");
  615. }
  616. if (FoCcr.getUser() != null) {
  617. _oWebccr.getFlSaler().setValue(FoCcr.getUser().getFLDxUSERNAME()); //售貨員
  618. } else {
  619. _oWebccr.getFlSaler().setValue(""); //售貨員
  620. }
  621. _oWebccr.getFlSysDate().setValue(FoCcr.getSaleDate() + "/" + emisUtil.todayTime(":"));//交易日期
  622. _oWebccr.getFlStoreNo().setValue(FoCcr.getStore().getFLDxS_NO());//門市
  623. _oWebccr.getFlIdNo().setValue(FoCcr.getCcrID());//機號
  624. _oWebccr.getFlInvNo().setValue(FoCcr.getCurrentInvoiceNo());//發票編號
  625. //TODO
  626. _oWebccr.getFlInvCount().setValue("");//發票剩餘張數
  627. _oWebccr.getFlCcrState().setValue(getCcrStateStr(FoCcr.getCurrnetState()));
  628. //會員信息
  629. if (FoCcr.getCurrentSale() != null && FoCcr.getCurrentSale().getFoMerber()!=null) {
  630. TMember member= FoCcr.getCurrentSale().getFoMerber();
  631. _oWebccr.getFlMEM_NAME().setValue(member.getFLDxNAME());
  632. _oWebccr.getFlMEM_POINT().setValue(member.getFLDxPOINT());
  633. if ("Y".equals(member.getFLDxDOUBLE_AUTH())) {
  634. _oWebccr.getFlMEM_DOUBLE_AUTH().setValue(member.getFLDxDOUBLE_AUTH()
  635. + "(" + member.getFLDxPOINT_MAX_EXCHANGE_RATE() + "%)");
  636. } else {
  637. _oWebccr.getFlMEM_DOUBLE_AUTH().setValue(member.getFLDxDOUBLE_AUTH());
  638. }
  639. _oWebccr.getFlMEM_JOINSTORE ().setValue(member.getFLDxJOINSTORE());
  640. _oWebccr.getFlMEM_EMAIL().setValue(member.getFLDxEMAIL());
  641. _oWebccr.getFlMEM_ADDRESS().setValue(member.getFLDxADDRESS());
  642. _oWebccr.getFlMEM_SEX().setValue(member.getFLDxSEX());
  643. _oWebccr.getFlMEM_BIRTHDAY().setValue(member.getFLDxBIRTHDAY());
  644. _oWebccr.getFlMEN_NUMBER().setValue(member.getFLDxMOBILE());
  645. }else{
  646. _oWebccr.getFlMEM_NAME().setValue("");
  647. _oWebccr.getFlMEM_POINT().setValue("");
  648. _oWebccr.getFlMEM_DOUBLE_AUTH().setValue("");
  649. _oWebccr.getFlMEM_JOINSTORE ().setValue("");
  650. _oWebccr.getFlMEM_EMAIL().setValue("");
  651. _oWebccr.getFlMEM_ADDRESS().setValue("");
  652. _oWebccr.getFlMEM_SEX().setValue("");
  653. _oWebccr.getFlMEM_BIRTHDAY().setValue("");
  654. _oWebccr.getFlMEN_NUMBER().setValue("");
  655. }
  656. } catch (Exception e) {
  657. CcrUtil.setMessage(emisUtil.getStackTrace(e));
  658. }
  659. }
  660. /**
  661. * 更新主畫面上所有內容值
  662. */
  663. public void updateMainForm() {
  664. try {
  665. webccr _oWebccr = (webccr) UI.getCurrent();
  666. if (FoCcr.getCurrentSale() != null) {
  667. ((TSalesTable) _oWebccr.getFTSaleTable()).refreshTbl(FoCcr);
  668. ((TSalePayTable) _oWebccr.getFTSalePayTable()).refreshTbl(FoCcr);
  669. } else {
  670. ((TSalesTable) _oWebccr.getFTSaleTable()).removeAllItems();
  671. ((TSalePayTable) _oWebccr.getFTSalePayTable()).removeAllItems();
  672. }
  673. updateMainFormNIG();
  674. } catch (Exception e) {
  675. // ((webccr) UI.getCurrent()).getlog().error(webccr.class, e);
  676. CcrUtil.setMessage(emisUtil.getStackTrace(e));
  677. }
  678. }
  679. /**
  680. * 插入oSaleItem_至主畫上交易明細grid
  681. *
  682. * @param oSaleItem_
  683. * @return
  684. */
  685. public boolean insertSaleItemToMainForm(TSaleItem oSaleItem_) {
  686. try {
  687. webccr _oWebccr = (webccr) UI.getCurrent();
  688. TSalesTable _oTbl = ((TSalesTable) _oWebccr.getFTSaleTable());
  689. _oTbl.addItem(oSaleItem_);
  690. //Todo select 把子標移到新增加當下SaleItem
  691. // _oTbl.select(oSaleItem_);
  692. updateMainForm();
  693. return true;
  694. } catch (Exception e) {
  695. // ((webccr) UI.getCurrent()).getlog().error(webccr.class, e);
  696. CcrUtil.setMessage(emisUtil.getStackTrace(e));
  697. }
  698. return false;
  699. }
  700. /**
  701. * 主畫面上將oSaleItem_標記刪除(雙刪線)
  702. *
  703. * @param oSaleItem_
  704. * @return
  705. */
  706. public boolean delSaleItemToMainForm(TSaleItem oSaleItem_) {
  707. updateMainForm();
  708. return false;
  709. }
  710. //插入oPayment_至主畫面上付款明細
  711. public boolean insertPaymentToMainForm(TPayment oPayment_) {
  712. try {
  713. webccr _oWebccr = (webccr) UI.getCurrent();
  714. TSalePayTable _oTbl = ((TSalePayTable) _oWebccr.getFTSalePayTable());
  715. _oTbl.addItem(oPayment_);
  716. //Todo select 把子標移到新增加當下SaleItem
  717. // _oTbl.select(oSaleItem_);
  718. updateMainForm();
  719. return true;
  720. } catch (Exception e) {
  721. // ((webccr) UI.getCurrent()).getlog().error(webccr.class, e);
  722. CcrUtil.setMessage(emisUtil.getStackTrace(e));
  723. }
  724. return false;
  725. }
  726. //主畫面上將oPayment_標記刪除
  727. public boolean delPaymentToMainForm(TPayment oPayment_) {
  728. updateMainForm();
  729. return false;
  730. }
  731. //交易查詢
  732. public void swQuerySale(String sSaleDate_, TEventContext oEvent_, String sCancelMethod_) {
  733. SaleQry _oSaleQry = new SaleQry(sSaleDate_, oEvent_, sCancelMethod_);
  734. _oSaleQry.setModal(true);
  735. _oSaleQry.setResizable(false);
  736. _oSaleQry.setClosable(false);
  737. _oSaleQry.setWidth("95%");
  738. _oSaleQry.setHeight("100%");
  739. UI.getCurrent().addWindow(_oSaleQry);
  740. }
  741. /**
  742. * 顯示清(讀)帳畫面, 畫面資料輸入完畢, 按下確認後, 將資料寫入oCcrLog_
  743. *
  744. * @param oEvent_
  745. * @param sOkMethod_
  746. * @param sCancelMethod_
  747. * @return
  748. */
  749. public boolean swSettleAccountsForm(TCcrLog oCcrLog_, TEventContext oEvent_, boolean isLogin, String sOkMethod_, String sCancelMethod_) {
  750. WinSettleAccount _oWinStlAcc = new WinSettleAccount(oCcrLog_, oEvent_, isLogin, sOkMethod_, sCancelMethod_);
  751. _oWinStlAcc.setModal(true);
  752. _oWinStlAcc.setResizable(false);
  753. _oWinStlAcc.setClosable(false);
  754. _oWinStlAcc.setHeight("100%");
  755. //_oWinStlAcc.setWidth("380px"); //add by Ares 20200701 振興券匯款、餘額的紀錄與計算,同現金方式
  756. _oWinStlAcc.setWidth("600px");
  757. UI.getCurrent().addWindow(_oWinStlAcc);
  758. return true;
  759. }
  760. // 門號申辦 / 固網申辦
  761. public void swPhoneNumber(TEntryEdit oEdit_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
  762. WinPhoneNumber _oPhoneNumber = new WinPhoneNumber(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
  763. _oPhoneNumber.setModal(true);
  764. _oPhoneNumber.setResizable(false);
  765. _oPhoneNumber.setClosable(false);
  766. _oPhoneNumber.setWidth("900px");
  767. //_oPhoneNumber.setHeight("85%");
  768. _oPhoneNumber.setHeight("90%"); //add by Ares 20190722 特殊商品才需輸入卡片金額
  769. _oPhoneNumber.addStyleName("v-scrollable");
  770. UI.getCurrent().addWindow(_oPhoneNumber);
  771. }
  772. // 領機
  773. public void swReceivePhone(TEntryEdit oEdit_ ,TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
  774. WinReceivePhone _oReceivePhone = new WinReceivePhone(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
  775. _oReceivePhone.setModal(true);
  776. _oReceivePhone.setResizable(false);
  777. _oReceivePhone.setClosable(false);
  778. _oReceivePhone.setWidth("500px");
  779. _oReceivePhone.setHeight("310px");
  780. UI.getCurrent().addWindow(_oReceivePhone);
  781. }
  782. // 弹窗-是否購買鈦金服務
  783. public void swTservice1(TEntryEdit oEdit_, TBtnTService oEvent_, String sOkMethod_, String sCancelMethod_) {
  784. WinTService1 _oTService1 = new WinTService1(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
  785. _oTService1.setModal(true);
  786. _oTService1.setResizable(false);
  787. _oTService1.setClosable(false);
  788. _oTService1.setWidth("600px");
  789. _oTService1.setHeight("450px");
  790. _oTService1.addStyleName("v-scrollable");
  791. UI.getCurrent().addWindow(_oTService1);
  792. }
  793. // 弹窗-鈦金服務 T_SERVICE 輸入客戶姓名、手機號碼(必填)
  794. public void swTservice2(TEntryEdits oEdits_, TBtnTService oEvent_, String sOkMethod_, String sCancelMethod_) {
  795. WinTService2 _oTService1 = new WinTService2(oEdits_, oEvent_, sOkMethod_, sCancelMethod_);
  796. _oTService1.setModal(true);
  797. _oTService1.setResizable(false);
  798. _oTService1.setClosable(false);
  799. _oTService1.setWidth("600px");
  800. _oTService1.setHeight("240px");
  801. _oTService1.addStyleName("v-scrollable");
  802. UI.getCurrent().addWindow(_oTService1);
  803. }
  804. // 彈窗--是否購買鈦金服務(新)
  805. public void swTserviceNew1(TEntryEdit oEdit_, TBtnTServiceNew oEvent_, String sOkMethod_, String sCancelMethod_) {
  806. WinTServiceNew1 _oTServiceNew1 = new WinTServiceNew1(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
  807. _oTServiceNew1.setModal(true);
  808. _oTServiceNew1.setResizable(false);
  809. _oTServiceNew1.setClosable(false);
  810. _oTServiceNew1.setWidth("600px");
  811. _oTServiceNew1.setHeight("450px");
  812. _oTServiceNew1.addStyleName("v-scrollable");
  813. UI.getCurrent().addWindow(_oTServiceNew1);
  814. }
  815. // 弹窗-鈦金服務 T_SERVICE_NEW 輸入客戶姓名、手機號碼(必填)、身分證後四碼(AS)
  816. public void swTserviceNew2(TEntryEdits oEdits_, TBtnTServiceNew oEvent_, String sOkMethod_, String sCancelMethod_) {
  817. WinTServiceNew2 _oTServiceNew2 = new WinTServiceNew2(oEdits_, oEvent_, sOkMethod_, sCancelMethod_);
  818. _oTServiceNew2.setModal(true);
  819. _oTServiceNew2.setResizable(false);
  820. _oTServiceNew2.setClosable(false);
  821. _oTServiceNew2.setWidth("600px");
  822. _oTServiceNew2.setHeight("250px");
  823. _oTServiceNew2.addStyleName("v-scrollable");
  824. UI.getCurrent().addWindow(_oTServiceNew2);
  825. }
  826. // 弹窗--經銷&企業戶 CS_NO
  827. public void swCsNo(TEntryEdit oEdit_, TBtnCS_NO oEvent_, String sOkMethod_, String sCancelMethod_) {
  828. WinCsNo _oTService1 = new WinCsNo(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
  829. _oTService1.setModal(true);
  830. _oTService1.setResizable(false);
  831. _oTService1.setClosable(false);
  832. _oTService1.setWidth("520px");
  833. _oTService1.setHeight("600px");
  834. _oTService1.addStyleName("v-scrollable");
  835. UI.getCurrent().addWindow(_oTService1);
  836. }
  837. // 弹窗--代收
  838. public void swCollection(TBtnCollection oEvent_, String sOkMethod_, String sCancelMethod_) {
  839. WinCollection _oTService1 = new WinCollection(oEvent_, sOkMethod_, sCancelMethod_);
  840. _oTService1.setModal(true);
  841. _oTService1.setResizable(false);
  842. _oTService1.setClosable(false);
  843. _oTService1.setWidth("520px");
  844. _oTService1.setHeight("410px");
  845. _oTService1.addStyleName("v-scrollable");
  846. UI.getCurrent().addWindow(_oTService1);
  847. }
  848. // 弹窗-會員點數兌換-折抵金額
  849. public void swMemPointAmt(TEntryEdit oEdit_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
  850. WinMemPointAmt _oTService1 = new WinMemPointAmt(oEdit_, oEvent_, sOkMethod_, sCancelMethod_);
  851. _oTService1.setModal(true);
  852. _oTService1.setResizable(false);
  853. _oTService1.setClosable(false);
  854. _oTService1.setWidth("600px");
  855. _oTService1.setHeight("220px");
  856. _oTService1.addStyleName("v-scrollable");
  857. UI.getCurrent().addWindow(_oTService1);
  858. }
  859. // 個案開帳
  860. public void swCaseSale(TEventContext oEvent_, String sCancelMethod_) {
  861. WinCaseSale _oCaseSale = new WinCaseSale(oEvent_, sCancelMethod_);
  862. _oCaseSale.setModal(true);
  863. _oCaseSale.setResizable(false);
  864. _oCaseSale.setClosable(false);
  865. _oCaseSale.setWidth("60%");
  866. _oCaseSale.setHeight("100%");
  867. UI.getCurrent().addWindow(_oCaseSale);
  868. }
  869. //彈窗--小白單手動列印
  870. public void swSMHandPrint(TEventContext oEvent_, String sOkMethod_){
  871. WinSM _oSM = new WinSM(oEvent_, sOkMethod_);
  872. _oSM.setModal(true);
  873. _oSM.setResizable(false);
  874. _oSM.setClosable(false);
  875. _oSM.setWidth("500px");
  876. //add by Ares 20181024 小白單批次列印
  877. //_oSM.setHeight("350px");
  878. _oSM.setHeight("450px");
  879. _oSM.addStyleName("v-scrollable");
  880. UI.getCurrent().addWindow(_oSM);
  881. }
  882. //彈窗--全退&作廢
  883. public void swFullVoid(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_){
  884. WinFullVoid _oFullVoid = new WinFullVoid(oEvent_, sOkMethod_, sCancelMethod_);
  885. _oFullVoid.setModal(true);
  886. _oFullVoid.setResizable(false);
  887. _oFullVoid.setClosable(false);
  888. _oFullVoid.setWidth("90%");
  889. _oFullVoid.setHeight("90%");
  890. _oFullVoid.addStyleName("v-scrollable");
  891. UI.getCurrent().addWindow(_oFullVoid);
  892. }
  893. /**
  894. * 作廢或折讓選項
  895. * 1. INV_TYPE = 6 直接作廢 不用輸入發票編號與隨機碼
  896. * 2. (INV_TYPE = 8 || INV_TYPE = 4) & 跨期 -> 折讓
  897. * 3. INV_TYPE = 8 & (載具||愛心碼) & 無跨期 > 作廢 不用輸入發票編號與隨機碼
  898. * 4 (INV_TYPE = 8 || INV_TYPE = 4) & 無跨期 > 其他
  899. */
  900. //中華家電宅配 by daff 20200107
  901. public void swVoidDisc(TEventContext oEvent_, String sOkMethod_) {
  902. webccr webccr = (webccr) UI.getCurrent();
  903. String OriginDate = webccr.getFoCCR().getCurrentSale().getOriginDate();
  904. String CreateDate = webccr.getFoCCR().getCurrentSale().getCreateDate();
  905. boolean bFALG = CcrUtil.isDISCOUNT(OriginDate, CreateDate);
  906. // ((webccr) UI.getCurrent()).getlog().info(webccr.class, "VOID bFALG=" + bFALG);
  907. CcrUtil.setMessage("VOID bFALG=" + bFALG);
  908. boolean bEnable = webccr.getFoCCR().getCurrentSale().getInvType().equals(TCcrConst.INV_TYPE_NONE) ? true : false;
  909. // ((webccr) UI.getCurrent()).getlog().info(webccr.class, "VOID bEnable=" + bEnable);
  910. CcrUtil.setMessage("VOID bEnable=" + bEnable);
  911. String SL_INVTYPE = webccr.getFoCCR().getCurrentSale().getInvType(); //發票別
  912. //中華家電宅配 by daff 20200107 開窗(全退 作廢/折讓/取消) 前檢核 - 20200915 fix
  913. WinVoid_Disc _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
  914. boolean open_ = _Void_Disc.chkMBMS_disc(oEvent_, sOkMethod_);
  915. if (open_) {
  916. if (bEnable) {
  917. //作廢
  918. webccr.getFoCCR().getCurrentSale().setIncomeKind(TCcrConst.SIK_CANCEL); // 收入類別
  919. //WinVoid_Disc _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
  920. _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
  921. _Void_Disc.doOK(oEvent_, sOkMethod_);
  922. } else if (!bEnable && !bFALG) {
  923. // 折讓
  924. webccr.getFoCCR().getCurrentSale().setIncomeKind(TCcrConst.SIK_DISCOUNT); // 收入類別
  925. webccr.getFoCCR().getCurrentSale().setInvType(TCcrConst.INV_TYPE_DISCOUNT); // 發票別
  926. //WinVoid_Disc _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
  927. _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
  928. _Void_Disc.doOK(oEvent_, sOkMethod_);
  929. } else if (SL_INVTYPE.equals(TCcrConst.INV_TYPE_ELEC) &&
  930. (!emisUtil.isEmpty(webccr.getFoCCR().getCurrentSale().getInvoice().getCarrierType()) ||
  931. !emisUtil.isEmpty(webccr.getFoCCR().getCurrentSale().getInvoice().getDonate())) &&
  932. bFALG) {
  933. webccr.getFoCCR().getCurrentSale().setIncomeKind(TCcrConst.SIK_CANCEL); // 收入類別
  934. //WinVoid_Disc _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
  935. _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
  936. _Void_Disc.doOK(oEvent_, sOkMethod_);
  937. } else {
  938. //WinVoid_Disc _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
  939. _Void_Disc = new WinVoid_Disc(oEvent_, sOkMethod_);
  940. //boolean open_ = _Void_Disc.chkMBMS_disc(oEvent_, sOkMethod_);//中華家電宅配 by daff 20200107 開窗(全退 作廢/折讓/取消) 前檢核
  941. _Void_Disc.setModal(true);
  942. _Void_Disc.setResizable(false);
  943. _Void_Disc.setClosable(false);
  944. _Void_Disc.setWidth("280px");
  945. _Void_Disc.setHeight("240px");
  946. _Void_Disc.addStyleName("v-scrollable");
  947. //UI.getCurrent().addWindow(_Void_Disc);
  948. //if(open_) {//中華家電宅配 by daff 20200107
  949. UI.getCurrent().addWindow(_Void_Disc);
  950. //}
  951. }
  952. }
  953. }
  954. // 弹窗-二手機回收作業
  955. public void swSenaoSec(TSenaoSec FoSenaoSec, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
  956. WinSenaoSec _oTService1 = new WinSenaoSec(FoSenaoSec, oEvent_, sOkMethod_, sCancelMethod_);
  957. _oTService1.setModal(true);
  958. _oTService1.setResizable(false);
  959. _oTService1.setClosable(false);
  960. _oTService1.setWidth("900px");
  961. _oTService1.setHeight("600px");
  962. _oTService1.addStyleName("v-scrollable");
  963. UI.getCurrent().addWindow(_oTService1);
  964. }
  965. // 銷退/重銷 申請 (鈦金、IMEI)
  966. public void swReturn(TEntryEdits oEdits_, TButtonEventContext oEvent_, ArrayList listReturn_, String sOkMethod_, String sCancelMethod_) {
  967. WinSalesReturn _oSalesReturn = new WinSalesReturn(oEdits_, oEvent_, listReturn_, sOkMethod_, sCancelMethod_);
  968. _oSalesReturn.setModal(true);
  969. _oSalesReturn.setResizable(false);
  970. _oSalesReturn.setClosable(false);
  971. _oSalesReturn.setWidth("30%");
  972. _oSalesReturn.setHeight("65%");
  973. _oSalesReturn.addStyleName("v-scrollable");
  974. UI.getCurrent().addWindow(_oSalesReturn);
  975. }
  976. // 門號解約 / 固網解約
  977. public void swCancelContract(TEntryEdits oEdits_, TButtonEventContext oEvent_, int iType_, String sOkMethod_, String sCancelMethod_) {
  978. WinCancelContract _oCancelContract = new WinCancelContract(oEdits_, oEvent_, iType_, sOkMethod_, sCancelMethod_);
  979. _oCancelContract.setModal(true);
  980. _oCancelContract.setResizable(false);
  981. _oCancelContract.setClosable(false);
  982. _oCancelContract.setWidth("60%");
  983. _oCancelContract.setHeight("90%");
  984. _oCancelContract.addStyleName("v-scrollable");
  985. UI.getCurrent().addWindow(_oCancelContract);
  986. }
  987. // 交易備忘-聯單號碼&手機號碼&個資 (門號解約/固網解約)
  988. public void swSaleMemo(TEntryEdits oEdits_, TButtonEventContext oEvent_, String sOkMethod_) {
  989. WinSaleMemo _oSaleMemo = new WinSaleMemo(oEdits_, oEvent_, sOkMethod_);
  990. _oSaleMemo.setModal(true);
  991. _oSaleMemo.setResizable(false);
  992. _oSaleMemo.setClosable(false);
  993. _oSaleMemo.setWidth("30%");
  994. _oSaleMemo.setHeight("30%");
  995. _oSaleMemo.addStyleName("v-scrollable");
  996. UI.getCurrent().addWindow(_oSaleMemo);
  997. }
  998. // 包膜(料號 4802開頭)作業 / 有客訂商品且非電視宅配 顧客資料
  999. //add by Ares 20181107 電視宅配修改
  1000. //public void swCustomer(TEventContext oEvent_, String sCaption_, String sOkMethod_, String sIMEI_) {
  1001. public void swCustomer(TEventContext oEvent_, String sCaption_, String sOkMethod_, String sCancelMethod_, String sIMEI_) {
  1002. //WinCustomer _oCustomer = new WinCustomer(oEvent_, sCaption_, sOkMethod_, sIMEI_);
  1003. WinCustomer _oCustomer = new WinCustomer(oEvent_, sCaption_, sOkMethod_, sCancelMethod_, sIMEI_);
  1004. _oCustomer.setModal(true);
  1005. _oCustomer.setResizable(false);
  1006. _oCustomer.setClosable(false);
  1007. _oCustomer.setWidth("47%");
  1008. _oCustomer.setHeight("70%");
  1009. UI.getCurrent().addWindow(_oCustomer);
  1010. }
  1011. // 宅配派工
  1012. //add by Ares 20181107 電視宅配修改
  1013. //public void swDelivery(TEventContext oEvent_, String sOkMethod_, boolean bIsOrder) {
  1014. public void swDelivery(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, boolean bIsOrder) {
  1015. //WinDelivery _oDelivery = new WinDelivery(oEvent_, sOkMethod_);
  1016. WinDelivery _oDelivery = new WinDelivery(oEvent_, sOkMethod_, sCancelMethod_);
  1017. _oDelivery.setModal(true);
  1018. _oDelivery.setResizable(false);
  1019. _oDelivery.setClosable(false);
  1020. _oDelivery.setWidth("38%");
  1021. _oDelivery.setHeight("100%");
  1022. _oDelivery.setOrder(bIsOrder);
  1023. UI.getCurrent().addWindow(_oDelivery);
  1024. }
  1025. // 特殊商品快取功能
  1026. public void swSpecialProduct(TEntryEdits oEdits_, TButtonEventContext oEvent_, ArrayList listProduct_, String sOkMethod_, String sCancelMethod_) {
  1027. WinSpecialProduct _oSpecialProduct = new WinSpecialProduct(oEdits_, oEvent_, listProduct_, sOkMethod_, sCancelMethod_);
  1028. _oSpecialProduct.setModal(true);
  1029. _oSpecialProduct.setResizable(false);
  1030. _oSpecialProduct.setClosable(false);
  1031. _oSpecialProduct.setWidth("30%");
  1032. _oSpecialProduct.setHeight("70%");
  1033. _oSpecialProduct.addStyleName("v-scrollable");
  1034. UI.getCurrent().addWindow(_oSpecialProduct);
  1035. }
  1036. // 愛心碼
  1037. public void swEinvDonate(TEntryEdits oEdits_, TButtonEventContext oEvent_, ArrayList listDonate_, String sOkMethod_, String sCancelMethod_) {
  1038. WinEinvDonate _oEinvDonate = new WinEinvDonate(oEdits_, oEvent_, listDonate_, sOkMethod_, sCancelMethod_);
  1039. _oEinvDonate.setModal(true);
  1040. _oEinvDonate.setResizable(false);
  1041. _oEinvDonate.setClosable(false);
  1042. _oEinvDonate.setWidth("30%");
  1043. _oEinvDonate.setHeight("70%");
  1044. _oEinvDonate.addStyleName("v-scrollable");
  1045. UI.getCurrent().addWindow(_oEinvDonate);
  1046. }
  1047. // 預購取件 企客(ENT)特殊處理
  1048. public void swPreOrderCsNo(TEntryEdits oEdits_, TButtonEventContext oEvent_, ArrayList listSale_, String sPayMethod_, String sCancelMethod_) {
  1049. WinPreOrderCsNo _oPreOrderCsNo = new WinPreOrderCsNo(oEdits_, oEvent_, listSale_, sPayMethod_, sCancelMethod_);
  1050. _oPreOrderCsNo.setModal(true);
  1051. _oPreOrderCsNo.setResizable(false);
  1052. _oPreOrderCsNo.setClosable(false);
  1053. _oPreOrderCsNo.setWidth("50%");
  1054. _oPreOrderCsNo.setHeight("70%");
  1055. UI.getCurrent().addWindow(_oPreOrderCsNo);
  1056. }
  1057. // 門市繳費畫面
  1058. public void swStorePayment(TBtnStorePayment oEvent_, String sOkMethod_, String sCancelMethod_) {
  1059. WinStorePayment _oStorePayment = new WinStorePayment(oEvent_, sOkMethod_, sCancelMethod_);
  1060. _oStorePayment.setModal(true);
  1061. _oStorePayment.setResizable(false);
  1062. _oStorePayment.setClosable(false);
  1063. _oStorePayment.setWidth("600px");
  1064. _oStorePayment.setHeight("500px");
  1065. UI.getCurrent().addWindow(_oStorePayment);
  1066. }
  1067. // 舊機回收(一般)
  1068. public void swSenaoSecNew(TSenaoSecNew SenaoSecNew, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
  1069. WinSenaoSecNew _oSenaoSecNew = new WinSenaoSecNew(SenaoSecNew, oEvent_, sOkMethod_, sCancelMethod_);
  1070. _oSenaoSecNew.setModal(true);
  1071. _oSenaoSecNew.setResizable(false);
  1072. _oSenaoSecNew.setClosable(false);
  1073. _oSenaoSecNew.setWidth("400px");
  1074. _oSenaoSecNew.setHeight("200px");
  1075. UI.getCurrent().addWindow(_oSenaoSecNew);
  1076. }
  1077. //dongle機交易明細查詢
  1078. public void swDongleUuCard() {
  1079. WinUuCardDongle _oDongleUuCard = new WinUuCardDongle();
  1080. _oDongleUuCard.setModal(true);
  1081. _oDongleUuCard.setResizable(false);
  1082. _oDongleUuCard.setClosable(false);
  1083. _oDongleUuCard.setWidth("400px");
  1084. _oDongleUuCard.setHeight("240px");
  1085. // _oDongleUuCard.addStyleName("v-scrollable");
  1086. UI.getCurrent().addWindow(_oDongleUuCard);
  1087. }
  1088. // LINE PAY 識別碼
  1089. public void swLinePayIdentifier(int iEntryAmt, TBtnLinePay oEvent_) {
  1090. WinLinePay _oLinePay = new WinLinePay(iEntryAmt, oEvent_);
  1091. _oLinePay.setModal(true);
  1092. _oLinePay.setResizable(false);
  1093. _oLinePay.setClosable(false);
  1094. _oLinePay.setWidth("400px");
  1095. _oLinePay.setHeight("180px");
  1096. UI.getCurrent().addWindow(_oLinePay);
  1097. }
  1098. // 會員福利金QRCODE
  1099. public void swBenefitQRCode(TBtnBenefit oEvent_) {
  1100. WinBenefit _oBenefit = new WinBenefit(oEvent_);
  1101. _oBenefit.setModal(true);
  1102. _oBenefit.setResizable(false);
  1103. _oBenefit.setClosable(false);
  1104. _oBenefit.setWidth("400px");
  1105. _oBenefit.setHeight("180px");
  1106. UI.getCurrent().addWindow(_oBenefit);
  1107. }
  1108. //add by Ares 20181009 HAMIPOINT QRCODE
  1109. public void swHamiPointQRCode(TBtnHamiPoint oEvent_) {
  1110. WinHamiPoint _oHamiPoint = new WinHamiPoint(oEvent_);
  1111. _oHamiPoint.setModal(true);
  1112. _oHamiPoint.setResizable(false);
  1113. _oHamiPoint.setClosable(false);
  1114. _oHamiPoint.setWidth("400px");
  1115. _oHamiPoint.setHeight("180px");
  1116. UI.getCurrent().addWindow(_oHamiPoint);
  1117. }
  1118. //add by Ares 20191120 舊會員程式MARK
  1119. /*
  1120. // 輸入會員視窗
  1121. public void swMemQry(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
  1122. WinMemQry _oWinMemQry = new WinMemQry(oEvent_, sOkMethod_, sCancelMethod_);
  1123. _oWinMemQry.setModal(true);
  1124. _oWinMemQry.setResizable(false);
  1125. _oWinMemQry.setClosable(false);
  1126. _oWinMemQry.setWidth("40%");
  1127. _oWinMemQry.setHeight("30%");
  1128. UI.getCurrent().addWindow(_oWinMemQry);
  1129. }
  1130. */
  1131. //add by Ares 20190502 會員分級
  1132. // 新輸入會員視窗
  1133. //public void swQueryMemberInfo(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
  1134. public void swQueryMemberInfo(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String Query_Mode_) { //add by Ares 20190829 會員分級問題修正
  1135. WinQueryMemberInfo _oWinQueryMemberInfo = new WinQueryMemberInfo(oEvent_, sOkMethod_, sCancelMethod_, Query_Mode_);
  1136. _oWinQueryMemberInfo.setModal(true);
  1137. _oWinQueryMemberInfo.setResizable(false);
  1138. _oWinQueryMemberInfo.setClosable(false);
  1139. _oWinQueryMemberInfo.setWidth("50%");
  1140. //_oWinQueryMemberInfo.setHeight("30%");
  1141. UI.getCurrent().addWindow(_oWinQueryMemberInfo);
  1142. }
  1143. //add by Ares 20191118 一致性員購
  1144. // 輸入員工代碼視窗
  1145. public void swQueryEmpPurchaseInfo(TEntryEdit oEdit_, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String sPartnerEmployeeId_) {
  1146. WinEmpPurchaseInfo _oTService1 = new WinEmpPurchaseInfo(oEdit_, oEvent_, sOkMethod_, sCancelMethod_, sPartnerEmployeeId_);
  1147. _oTService1.setModal(true);
  1148. _oTService1.setResizable(false);
  1149. _oTService1.setClosable(false);
  1150. _oTService1.setWidth("600px");
  1151. _oTService1.setHeight("220px");
  1152. _oTService1.addStyleName("v-scrollable");
  1153. UI.getCurrent().addWindow(_oTService1);
  1154. }
  1155. /*
  1156. public void swQueryEmpPurchaseInfo(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String Query_Mode_) { //add by Ares 20190829 會員分級問題修正
  1157. WinEmpPurchaseInfo _oWinEmpPurchaseInfo = new WinEmpPurchaseInfo(oEvent_, sOkMethod_, sCancelMethod_, Query_Mode_);
  1158. _oWinEmpPurchaseInfo.setModal(true);
  1159. _oWinEmpPurchaseInfo.setResizable(false);
  1160. _oWinEmpPurchaseInfo.setClosable(false);
  1161. _oWinEmpPurchaseInfo.setWidth("40%");
  1162. _oWinEmpPurchaseInfo.setHeight("30%");
  1163. UI.getCurrent().addWindow(_oWinEmpPurchaseInfo);
  1164. } */
  1165. //ADD BY DAFF 新鈦金月繳版修正 20190322
  1166. public void swInsuInsp(TBtnINSU oEvent_, String sOkMethod_, String sCancelMethod_ , String sIMEI ,String sSOURFROM ,String sPAYMENT ,String sS_NO, String sITEMNO ,String sSALEDATE , String sAGNTNO){
  1167. WinInsuInspNo _oInsuInspo = new WinInsuInspNo(oEvent_, sOkMethod_,sIMEI,sSOURFROM,sPAYMENT,sS_NO,sITEMNO,sSALEDATE,sAGNTNO);
  1168. _oInsuInspo.setModal(true);
  1169. _oInsuInspo.setResizable(false);
  1170. _oInsuInspo.setClosable(false);
  1171. _oInsuInspo.setWidth("400px");
  1172. _oInsuInspo.setHeight("450px");
  1173. _oInsuInspo.addStyleName("v-scrollable");
  1174. if(_oInsuInspo.getInsuflag_sow().equals("Y")) {
  1175. UI.getCurrent().addWindow(_oInsuInspo);
  1176. }
  1177. }
  1178. public void swInsuInfo(TBtnINSU oEvent_, String sOkMethod_, String sCancelMethod_) {
  1179. WinInsuInfo _oInsuInfo = new WinInsuInfo(oEvent_, sOkMethod_, sCancelMethod_);
  1180. _oInsuInfo.setModal(true);
  1181. _oInsuInfo.setResizable(false);
  1182. _oInsuInfo.setClosable(false);
  1183. _oInsuInfo.setWidth("1100px");
  1184. _oInsuInfo.setHeight("500px");
  1185. _oInsuInfo.addStyleName("v-scrollable");
  1186. UI.getCurrent().addWindow(_oInsuInfo);
  1187. }
  1188. //add by Ares 20180613 新鈦金優惠券
  1189. public void swINSU_SM(TINSU_SM INSU_SM, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_) {
  1190. WinINSU_SM _oINSU_SM = new WinINSU_SM(INSU_SM, oEvent_, sOkMethod_, sCancelMethod_);
  1191. _oINSU_SM.setModal(true);
  1192. _oINSU_SM.setResizable(false);
  1193. _oINSU_SM.setClosable(false);
  1194. _oINSU_SM.setWidth("400px");
  1195. _oINSU_SM.setHeight("300px");
  1196. UI.getCurrent().addWindow(_oINSU_SM);
  1197. }
  1198. //add by Ares 20180810 中華年繳版保費輸入
  1199. //AIG改下拉方式帶入保險料號 20190911
  1200. public void swINSU_PAID(TINSU_PAID INSU_PAID, TEventContext oEvent_, String sOkMethod_, String sCancelMethod_, String sSHOW_SELECT) {
  1201. WinINSU_PAID _oINSU_PAID = new WinINSU_PAID(INSU_PAID, oEvent_, sOkMethod_, sCancelMethod_ ,sSHOW_SELECT);
  1202. _oINSU_PAID.setModal(true);
  1203. _oINSU_PAID.setResizable(false);
  1204. _oINSU_PAID.setClosable(false);
  1205. _oINSU_PAID.setWidth("600px");
  1206. _oINSU_PAID.setHeight("400px");
  1207. UI.getCurrent().addWindow(_oINSU_PAID);
  1208. }
  1209. //神腦保險年繳代收保費 增加付款方式UI ADD BY DAFF 20190110 START
  1210. //ADD BY DAFF 新鈦金卷號版修正 20190408 START
  1211. //ADD BY DAFF 20190509 加總金額 只判斷年繳 其餘0 sSUM_AMT
  1212. public void swInsuPayMethod(TEventContext oEvent_, String sOkMethod_, String sCancelMethod_,String Coupon, String sALLOW_PAYFLAG , String sCOUNP_NO ,int sSUM_AMT ) {
  1213. WinInsuPayMethod _oWinInsuPayMethod = new WinInsuPayMethod(oEvent_, sOkMethod_, sCancelMethod_, Coupon, sALLOW_PAYFLAG ,sCOUNP_NO ,sSUM_AMT );
  1214. _oWinInsuPayMethod.setModal(true);
  1215. _oWinInsuPayMethod.setResizable(false);
  1216. _oWinInsuPayMethod.setClosable(false);
  1217. _oWinInsuPayMethod.setWidth("40%");
  1218. _oWinInsuPayMethod.setHeight("30%");
  1219. UI.getCurrent().addWindow(_oWinInsuPayMethod);
  1220. }
  1221. //ADD BY DAFF 新鈦金卷號版修正 20190408 END
  1222. //神腦保險年繳代收保費 增加付款方式UI ADD BY DAFF 20190110 END
  1223. //ADD BY DAFF 新鈦金卷號版修正 20190408 START
  1224. public void CouponActivity(TBtnSubtotal oEvent_, String sOkMethod_){
  1225. WinCoupon _oSM = new WinCoupon(oEvent_, sOkMethod_);
  1226. _oSM.setModal(true);
  1227. _oSM.setResizable(false);
  1228. _oSM.setClosable(false);
  1229. _oSM.setWidth("500px");
  1230. _oSM.setHeight("450px");
  1231. _oSM.addStyleName("v-scrollable");
  1232. if(_oSM.getOpenCouponWin().equals("Y")) {
  1233. UI.getCurrent().addWindow(_oSM);
  1234. }
  1235. //call 卷號如有異常彈出訊息
  1236. if(!emisUtil.isEmpty((_oSM.getMESSAGE()))){
  1237. FoCcr.UInotify.swMessage(_oSM.getMESSAGE());
  1238. }
  1239. }
  1240. //ADD BY DAFF 新鈦金卷號版修正 20190408 END
  1241. //add by Ares 20190725 客訂>=庫存時,跳出選擇「要銷售庫存,還是要銷售客訂」
  1242. public void swWinStock_Order(TEventContext oEvent_, String DoStock_, String DoOrder_, String DoCancel_) {
  1243. WinStock_Order _oWinStock_Order = new WinStock_Order(oEvent_, DoStock_, DoOrder_, DoCancel_);
  1244. _oWinStock_Order.setModal(true);
  1245. _oWinStock_Order.setResizable(false);
  1246. _oWinStock_Order.setClosable(false);
  1247. _oWinStock_Order.setWidth("40%");
  1248. _oWinStock_Order.setHeight("27%");
  1249. UI.getCurrent().addWindow(_oWinStock_Order);
  1250. }
  1251. /**
  1252. * 取得CCR狀態字串
  1253. *
  1254. * @param state_
  1255. * @return
  1256. */
  1257. public String getCcrStateStr(int state_) {
  1258. String _sStateName = "";
  1259. if (state_ == TCcrConst.CPS_WAIT_SALE) {
  1260. _sStateName = TCcrConst.CPS_NAME_WAIT_SALE; //等待交易起始
  1261. } else if (state_ == TCcrConst.CPS_SALE) {
  1262. _sStateName = TCcrConst.CPS_NAME_SALE;//交易進行中
  1263. } else if (state_ == TCcrConst.CPS_WAIT_PAY) {
  1264. _sStateName = TCcrConst.CPS_NAME_WAIT_PAY;//等待付款
  1265. } else if (state_ == TCcrConst.CPS_PAY) {
  1266. _sStateName = TCcrConst.CPS_NAME_PAY;//付款中
  1267. } else if (state_ == TCcrConst.CPS_LOCK_PAY) {
  1268. _sStateName = TCcrConst.CPS_NAME_LOCK_PAY; //限定付款
  1269. }
  1270. return _sStateName;
  1271. }
  1272. public void getFocus() {
  1273. if ((UI.getCurrent() instanceof webccr)){
  1274. ((webccr) UI.getCurrent()).getInputLabel().focus();
  1275. }
  1276. }
  1277. }