index.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?php
  2. if (cfr('DREAMKAS')) {
  3. if ($ubillingConfig->getAlterParam('DREAMKAS_ENABLED')) {
  4. $greed = new Avarice();
  5. $insatiability = $greed->runtime('DREAMKAS');
  6. if (!empty($insatiability)) {
  7. $DreamKasNotify = new DreamKasNotifications();
  8. if (wf_CheckGet(array('getnotys'))) {
  9. $DreamKasNotify->getDreamkasNotifications();
  10. }
  11. $DreamKas = new DreamKas();
  12. $voracity = $insatiability['LT']['LAL'];
  13. $rapacity = $insatiability['M']['KICKTHEFLOOR'];
  14. show_window(__($insatiability['LT']['LIL']), $DreamKas->$rapacity());
  15. zb_BillingStats(true);
  16. if (wf_CheckGet(array('dreamkasforcecacheupdate'))) {
  17. $DreamKas->refreshCacheForced();
  18. $messageWindow = $DreamKas->getUbMsgHelperInstance()->getStyledMessage(__('Cache data updated succesfuly'),
  19. 'success', 'style="margin: auto 0; padding: 10px 3px; width: 100%;"');
  20. die(wf_modalAutoForm('', $messageWindow, $_GET['modalWindowId'], '', true));
  21. }
  22. if (wf_CheckGet(array('cashiersslistajax'))) {
  23. $DreamKas->renderCashiersListJSON();
  24. }
  25. if (wf_CheckGet(array('cashmachineslistajax'))) {
  26. $DreamKas->renderCashMachinesListJSON();
  27. }
  28. if (wf_CheckGet(array('goodslistajax'))) {
  29. $DreamKas->renderSellPositionsListJSON();
  30. }
  31. if (wf_CheckGet(array('foperationslistajax'))) {
  32. $dateFrom = (ubRouting::checkGet('fopsdatefrom', false) ? ubRouting::get('fopsdatefrom') : date('Y-m-d', strtotime(curdate() . "-1 day")));
  33. $dateTo = (ubRouting::checkGet('fopsdateto', false) ? ubRouting::get('fopsdateto') : curdate());
  34. $DreamKas->renderFiscalOperationsListJSON($dateFrom, $dateTo);
  35. }
  36. $rapacity = $insatiability['M']['GETBABLO'];
  37. $voracity_a = $insatiability['PG']['RLX'];
  38. $voracity_b = $insatiability['PG']['RDF'];
  39. $voracity_c = $insatiability['PG']['RDT'];
  40. $voracity_d = $insatiability['PG']['DAVID'];
  41. $voracity_e = $insatiability['PG']['RMC'];
  42. if (wf_CheckGet(array($voracity_a))) {
  43. $voracity_b = (wf_CheckGet(array($voracity_b))) ? $_GET[$voracity_b] : '';
  44. $voracity_c = (wf_CheckGet(array($voracity_c))) ? $_GET[$voracity_c] : '';
  45. $voracity_d = (wf_CheckGet(array($voracity_d))) ? $_GET[$voracity_d] : '';
  46. $voracity_e = (wf_CheckGet(array($voracity_e))) ? $_GET[$voracity_e] : '';
  47. $DreamKas->$rapacity($voracity_b, $voracity_c, $voracity_d, $voracity_e);
  48. }
  49. if (wf_CheckGet(array('webhookslistajax'))) {
  50. $DreamKas->renderWebhooksListJSON();
  51. }
  52. if (wf_CheckGet(array('getcashiers'))) {
  53. show_window(__('Cashiers'), $DreamKas->renderCashiersJQDT());
  54. }
  55. if (wf_CheckGet(array('getcashmachines'))) {
  56. show_window(__('Cash machines'), $DreamKas->renderCashMachinesJQDT());
  57. }
  58. if (wf_CheckGet(array('getgoods'))) {
  59. show_window(__('Selling positions'), $DreamKas->renderSellPositionsJQDT());
  60. }
  61. if (wf_CheckGet(array('getoperations'))) {
  62. show_window(__('Operations'), $DreamKas->web_FiscalOperationsFilter() . $DreamKas->renderFiscalOperationsJQDT());
  63. }
  64. if (wf_CheckGet(array('getreceipts'))) {
  65. show_window(__('Checks'), $DreamKas->web_ReceiptsFilter() . $DreamKas->renderReceiptsJQDT());
  66. }
  67. if (wf_CheckGet(array('getwebhookss'))) {
  68. $DreamKas->web_WebhooksForm();
  69. }
  70. if (wf_CheckPost(array('whcreate'))) {
  71. if (wf_CheckPost(array('whfullurl'))) {
  72. $DreamKas->createeditdeleteWebhook($_POST['whfullurl'], wf_CheckPost(array('whisactive')), $_POST['whnotifyopts']);
  73. die();
  74. }
  75. die(wf_modalAutoForm(__('Add webhook'), $DreamKas->renderWebhookAddForm($_POST['modalWindowId']), $_POST['modalWindowId'], $_POST['modalWindowBodyId'], true));
  76. }
  77. if (wf_CheckPost(array('whedit'))) {
  78. if (wf_CheckPost(array('whfullurl'))) {
  79. $DreamKas->createeditdeleteWebhook($_POST['whfullurl'], wf_CheckPost(array('whisactive')), $_POST['whnotifyopts'], $_POST['whid']);
  80. die();
  81. }
  82. die(wf_modalAutoForm(__('Edit webhook'), $DreamKas->renderWebhookEditForm($_POST['whid'], $_POST['modalWindowId']), $_POST['modalWindowId'], $_POST['modalWindowBodyId'], true));
  83. }
  84. if (wf_CheckPost(array('delWebhook'))) {
  85. $DreamKas->createeditdeleteWebhook('', '', '', $_POST['whid'], true);
  86. die();
  87. }
  88. if (wf_CheckGet(array('showdetailedrcpt'))) {
  89. $windowContent = wf_tag('pre', false, 'floatpanelswide', 'style="width: 90%; padding: 10px 15px;"');
  90. $windowContent .= print_r($DreamKas->getReceiptDetails($_GET['showdetailedrcpt']), true);
  91. $windowContent .= wf_tag('pre', true);
  92. die(wf_modalAutoForm(__($voracity), $windowContent, $_GET['modalWindowId'], '', true));
  93. }
  94. if (wf_CheckGet(array('showdetailedCM'))) {
  95. $windowContent = wf_tag('pre', false, 'floatpanelswide', 'style="width: 90%; padding: 10px 15px;"');
  96. $windowContent .= print_r($DreamKas->getCashMachines($_GET['showdetailedCM']), true);
  97. $windowContent .= wf_tag('pre', true);
  98. die(wf_modalAutoForm(__($voracity), $windowContent, $_GET['modalWindowId'], '', true));
  99. }
  100. if (wf_CheckGet(array('showdetailedGoods'))) {
  101. $windowContent = wf_tag('pre', false, 'floatpanelswide', 'style="width: 90%; padding: 10px 15px;"');
  102. $windowContent .= print_r($DreamKas->getSellingPositions($_GET['showdetailedGoods']), true);
  103. $windowContent .= wf_tag('pre', true);
  104. die(wf_modalAutoForm(__($voracity), $windowContent, $_GET['modalWindowId'], '', true));
  105. }
  106. $rapacity = $insatiability['M']['PORORO'];
  107. if (wf_CheckGet(array($insatiability['PG']['SLX']))) {
  108. $result = $DreamKas->$rapacity($_GET[$insatiability['PG']['SLX']],
  109. $_GET[$insatiability['PG']['GRID']],
  110. $_GET[$insatiability['PG']['GRAME']],
  111. $_GET[$insatiability['PG']['GRYPE']],
  112. $_GET[$insatiability['PG']['GRICE']],
  113. $_GET[$insatiability['PG']['GRAX']],
  114. $_GET[$insatiability['PG']['HACHIKUJI']]
  115. );
  116. if (empty($result)) {
  117. $msg = $DreamKas->getUbMsgHelperInstance()->getStyledMessage(__('Done'), 'success', 'style="margin: auto 0; padding: 10px 3px; width: 100%;"');
  118. $result = wf_modalAutoForm(__('Success'), $msg, $_GET['modalWindowId'], '', true);
  119. } else {
  120. $errormes = $DreamKas->getUbMsgHelperInstance()->getStyledMessage($result, 'error', 'style="margin: auto 0; padding: 10px 3px; width: 100%;"');
  121. $result = wf_modalAutoForm(__('Error'), $errormes, $_GET['modalWindowId'], '', true);
  122. }
  123. die($result);
  124. }
  125. if (wf_CheckGet(array('delselpossrvmapping'))) {
  126. $service = $_GET['servicetype'];
  127. if (empty($service)) {
  128. $errormes = $DreamKas->getUbMsgHelperInstance()->getStyledMessage(__('This selling posistion is not mapped to any service yet'),
  129. 'warning', 'style="margin: auto 0; padding: 10px 3px; width: 100%;"');
  130. die(wf_modalAutoForm(__('Warning'), $errormes, $_GET['modalWindowId'], '', true));
  131. } else {
  132. $DreamKas->delSellingPositionSrvType($service);
  133. die();
  134. }
  135. }
  136. if (wf_CheckGet(array($insatiability['PG']['HANEKAWA']))) {
  137. $windowContent = wf_tag('pre', false, 'floatpanelswide', 'style="width: 90%; padding: 10px 15px;"');
  138. $windowContent .= print_r(json_decode($DreamKas->getFiscalOperationLocalBody($_GET[$insatiability['PG']['HANEKAWA']]), true), true);
  139. $windowContent .= wf_tag('pre', true);
  140. die(wf_modalAutoForm(__($voracity), $windowContent, $_GET['modalWindowId'], '', true));
  141. }
  142. $rapacity_a = $insatiability['M']['SMACKUP'];
  143. $rapacity_b = $insatiability['M']['PACKUP'];
  144. $rapacity_c = $insatiability['M']['PICKUP'];
  145. $rapacity_d = $insatiability['M']['PUSHCASHLO'];
  146. $rapacity_e = $insatiability['M']['BAKA'];
  147. if (wf_CheckGet(array($insatiability['PG']['OSHINO']))) {
  148. $DreamKas->$rapacity_a($_GET[$insatiability['PG']['OSHINO']]);
  149. $voracity_e = $DreamKas->$rapacity_b($_GET[$insatiability['PG']['OSHINO']]);
  150. $voracity_n = $DreamKas->$rapacity_e($_GET[$insatiability['PG']['OSHINO']]);
  151. $DreamKas->$rapacity_d($voracity_e, $voracity_n, $_GET[$insatiability['PG']['OSHINO']]);
  152. $voracity_f = $DreamKas->$rapacity_c();
  153. if (!empty($voracity_f)) {
  154. $errormes = $DreamKas->getUbMsgHelperInstance()->getStyledMessage($voracity_f, 'error');
  155. die(wf_modalAutoForm(__($insatiability['LT']['LOL']), $errormes, $_GET['modalWindowId'], '', true, 'true', '700'));
  156. } else {
  157. $message = $DreamKas->getUbMsgHelperInstance()->getStyledMessage(__($insatiability['LT']['LUL']), 'info');
  158. die(wf_modalAutoForm(__($insatiability['LT']['LEL']), $message, $_GET['modalWindowId'], '', true, 'true', '400'));
  159. }
  160. }
  161. } else {
  162. show_error(__('No license key available'));
  163. }
  164. } else {
  165. show_warning(__('This module is disabled'));
  166. }
  167. } else {
  168. show_error(__('Access denied'));
  169. }
  170. ?>