index.php 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. <?php
  2. if (cfr('WAREHOUSE')) {
  3. $altcfg = $ubillingConfig->getAlter();
  4. if ($altcfg['WAREHOUSE_ENABLED']) {
  5. $greed = new Avarice();
  6. $avidity = $greed->runtime('WAREHOUSE');
  7. if (!empty($avidity)) {
  8. $warehouse = new Warehouse();
  9. $avidity_m = $avidity['M']['WARLOCK'];
  10. show_window('', $warehouse->$avidity_m());
  11. //categories
  12. if (wf_CheckGet(array($avidity['S']['C']))) {
  13. if (wf_CheckPost(array($avidity['S']['CC']))) {
  14. $avidity_m = $avidity['M']['CC'];
  15. $warehouse->$avidity_m($_POST[$avidity['S']['CC']]);
  16. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_CATEGORIES);
  17. }
  18. if (wf_CheckGet(array($avidity['S']['CD']))) {
  19. $avidity_m = $avidity['M']['CD'];
  20. $deletionResult = $warehouse->$avidity_m($_GET[$avidity['S']['CD']]);
  21. if ($deletionResult) {
  22. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_CATEGORIES);
  23. } else {
  24. show_error(__('You cant do this'));
  25. }
  26. }
  27. if (wf_CheckPost(array($avidity['S']['CE1'], $avidity['S']['CE2']))) {
  28. $avidity_m = $avidity['M']['CS'];
  29. $warehouse->$avidity_m();
  30. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_CATEGORIES);
  31. }
  32. $avidity_m = $avidity['M']['CF'];
  33. show_window(__('Categories'), $warehouse->$avidity_m());
  34. $avidity_m = $avidity['M']['CL'];
  35. show_window(__('Available categories'), $warehouse->$avidity_m());
  36. $avidity_m = $avidity['M']['FALL'];
  37. $warehouse->$avidity_m();
  38. }
  39. //itemtypes
  40. if (wf_CheckGet(array('itemtypes'))) {
  41. if (wf_CheckPost(array('newitemtypecetegoryid', 'newitemtypename', 'newitemtypeunit'))) {
  42. $avidity_m = $avidity['M']['XC'];
  43. $warehouse->$avidity_m($_POST['newitemtypecetegoryid'], $_POST['newitemtypename'], $_POST['newitemtypeunit'], @$_POST['newitemtypereserve']);
  44. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_ITEMTYPES);
  45. }
  46. if (wf_CheckGet(array($avidity['S']['XD']))) {
  47. $avidity_m = $avidity['M']['XD'];
  48. $deletionResult = $warehouse->$avidity_m($_GET[$avidity['S']['XD']]);
  49. if ($deletionResult) {
  50. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_ITEMTYPES);
  51. } else {
  52. show_error(__('You cant do this'));
  53. }
  54. }
  55. if (wf_CheckPost(array($avidity['S']['XS']))) {
  56. $avidity_m = $avidity['M']['XS'];
  57. $warehouse->$avidity_m();
  58. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_ITEMTYPES);
  59. }
  60. if (ubRouting::checkGet('edititemtype')) {
  61. $editingItemtypeId = ubRouting::get('edititemtype', 'int');
  62. $itemtypeEditingName = $warehouse->itemtypeGetName($editingItemtypeId);
  63. show_window(__('Edit') . ' ' . $itemtypeEditingName, $warehouse->itemtypesEditForm($editingItemtypeId));
  64. show_window('', wf_BackLink($warehouse::URL_ME . '&' . $warehouse::URL_ITEMTYPES));
  65. } else {
  66. $avidity_m = $avidity['M']['XCF'];
  67. show_window(__('Warehouse item types'), $warehouse->$avidity_m());
  68. $avidity_m = $avidity['M']['XL'];
  69. show_window(__('Available item types'), $warehouse->$avidity_m());
  70. $avidity_m = $avidity['M']['FALL'];
  71. $warehouse->$avidity_m();
  72. }
  73. }
  74. //storages
  75. if (wf_CheckGet(array('storages'))) {
  76. if (wf_CheckPost(array('newstorage'))) {
  77. $warehouse->storagesCreate($_POST['newstorage']);
  78. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_STORAGES);
  79. }
  80. if (wf_CheckGet(array('deletestorage'))) {
  81. $deletionResult = $warehouse->storagesDelete($_GET['deletestorage']);
  82. if ($deletionResult) {
  83. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_STORAGES);
  84. } else {
  85. show_error(__('You cant do this'));
  86. }
  87. }
  88. if (wf_CheckPost(array('editstorageid', 'editstoragename'))) {
  89. $warehouse->storagesSave();
  90. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_STORAGES);
  91. }
  92. show_window(__('Warehouse storage'), $warehouse->storagesCreateForm());
  93. show_window(__('Available warehouse storages'), $warehouse->storagesRenderList());
  94. $avidity_m = $avidity['M']['FALL'];
  95. $warehouse->$avidity_m();
  96. }
  97. //contractors
  98. if (wf_CheckGet(array('contractors'))) {
  99. if (wf_CheckPost(array('newcontractor'))) {
  100. $warehouse->contractorCreate($_POST['newcontractor']);
  101. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_CONTRACTORS);
  102. }
  103. if (wf_CheckGet(array('deletecontractor'))) {
  104. $deletionResult = $warehouse->contractorsDelete($_GET['deletecontractor']);
  105. if ($deletionResult) {
  106. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_CONTRACTORS);
  107. } else {
  108. show_error(__('You cant do this'));
  109. }
  110. }
  111. if (wf_CheckPost(array('editcontractorid', 'editcontractorname'))) {
  112. $warehouse->contractorsSave();
  113. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_CONTRACTORS);
  114. }
  115. show_window(__('Contractors'), $warehouse->contractorsCreateForm());
  116. show_window(__('Available contractors'), $warehouse->contractorsRenderList());
  117. $avidity_m = $avidity['M']['FALL'];
  118. $warehouse->$avidity_m();
  119. }
  120. if (wf_CheckGet(array('in'))) {
  121. if (wf_CheckGet(array('ajits'))) {
  122. die($warehouse->itemtypesCategorySelector('newinitemtypeid', $_GET['ajits']));
  123. }
  124. if (wf_CheckGet(array('ajaxinlist'))) {
  125. $avidity_a = $avidity['A']['CINDERELLA'];
  126. $warehouse->$avidity_a();
  127. }
  128. if (wf_CheckPost(array('newindate', 'newinitemtypeid', 'newincontractorid', 'newinstorageid', 'newincount'))) {
  129. $warehouse->incomingCreate($_POST['newindate'], $_POST['newinitemtypeid'], $_POST['newincontractorid'], $_POST['newinstorageid'], $_POST['newincount'], @$_POST['newinprice'], @$_POST['newinbarcode'], $_POST['newinnotes']);
  130. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_IN);
  131. }
  132. show_window(__('Create new incoming operation'), $warehouse->incomingCreateForm());
  133. show_window(__('Available incoming operations'), $warehouse->incomingOperationsList());
  134. $avidity_m = $avidity['M']['FALL'];
  135. $warehouse->$avidity_m();
  136. }
  137. //outcoming
  138. if (wf_CheckGet(array('out'))) {
  139. if (wf_CheckGet(array('ajods'))) {
  140. $avidity_a = $avidity['A']['CHAINSAW'];
  141. die($warehouse->$avidity_a($_GET['ajods']));
  142. }
  143. if (wf_CheckGet(array('ajaxoutlist'))) {
  144. $avidity_a = $avidity['A']['ALICE'];
  145. $warehouse->$avidity_a();
  146. }
  147. if (wf_CheckPost(array('newoutdate', 'newoutdesttype', 'newoutdestparam', 'newoutitemtypeid', 'newoutstorageid', 'newoutcount'))) {
  148. $outCreateResult = $warehouse->outcomingCreate($_POST['newoutdate'], $_POST['newoutdesttype'], $_POST['newoutdestparam'], $_POST['newoutstorageid'], $_POST['newoutitemtypeid'], $_POST['newoutcount'], @$_POST['newoutprice'], @$_POST['newoutnotes'], @$_POST['newoutfromreserve'], @$_POST['newoutnetw']);
  149. if (!empty($outCreateResult)) {
  150. show_window(__('Something went wrong'), $outCreateResult);
  151. } else {
  152. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_OUT);
  153. }
  154. }
  155. if (!wf_CheckGet(array('storageid'))) {
  156. show_window(__('Warehouse storages'), $warehouse->outcomingStoragesList());
  157. if (!ubRouting::checkGet('withnotes')) {
  158. $notesControl = ' ' . wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_OUT . '&withnotes=true', wf_img_sized('skins/icon_note.gif', __('Show notes'), '12', '12'));
  159. } else {
  160. $notesControl = ' ' . wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_OUT, wf_img_sized('skins/icon_note.gif', __('Hide notes'), '12', '12'));
  161. }
  162. show_window(__('Available outcoming operations') . $notesControl, $warehouse->outcomingOperationsList());
  163. $avidity_m = $avidity['M']['FALL'];
  164. $warehouse->$avidity_m();
  165. } else {
  166. if (wf_CheckGet(array('storageid', 'ajaxremains'))) {
  167. $avidity_a = $avidity['A']['FRIDAY'];
  168. $warehouse->$avidity_a($_GET['storageid']);
  169. }
  170. if (!wf_CheckGet(array('outitemid'))) {
  171. $storageId = $_GET['storageid'];
  172. $remainsPrintControls = ' ' . wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_VIEWERS . '&printremainsstorage=' . $storageId, wf_img('skins/icon_print.png', __('Print')));
  173. show_window(__('The remains in the warehouse storage') . ': ' . $warehouse->storageGetName($storageId) . $remainsPrintControls, $warehouse->outcomingItemsList($storageId));
  174. $avidity_m = $avidity['M']['FALL'];
  175. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_OUT);
  176. } else {
  177. show_window(__('New outcoming operation') . ' ' . $warehouse->itemtypeGetName($_GET['outitemid']), $warehouse->outcomingCreateForm($_GET['storageid'], $_GET['outitemid'], @$_GET['reserveid']));
  178. $avidity_m = $avidity['M']['FALL'];
  179. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_OUT);
  180. }
  181. }
  182. }
  183. //reservation
  184. if (wf_CheckGet(array('reserve'))) {
  185. if (wf_CheckGet(array('itemtypeid', 'storageid'))) {
  186. if (wf_CheckPost(array('newreserveitemtypeid', 'newreservestorageid', 'newreserveemployeeid', 'newreservecount'))) {
  187. $creationResult = $warehouse->reserveCreate($_POST['newreservestorageid'], $_POST['newreserveitemtypeid'], $_POST['newreservecount'], $_POST['newreserveemployeeid']);
  188. //succefull
  189. if (!$creationResult) {
  190. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_RESERVE);
  191. } else {
  192. show_window('', $creationResult);
  193. }
  194. }
  195. $reservationTitle = __('Reservation') . ' ' . $warehouse->itemtypeGetName($_GET['itemtypeid']) . ' ' . __('from') . ' ' . $warehouse->storageGetName($_GET['storageid']);
  196. show_window($reservationTitle, $warehouse->reserveCreateForm($_GET['storageid'], $_GET['itemtypeid']));
  197. $avidity_m = $avidity['M']['FALL'];
  198. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&' . 'totalremains=true');
  199. } else {
  200. if (wf_CheckGet(array('deletereserve'))) {
  201. $warehouse->reserveDelete($_GET['deletereserve']);
  202. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_RESERVE);
  203. }
  204. if (wf_CheckPost(array('editreserveid'))) {
  205. $warehouse->reserveSave();
  206. rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_RESERVE);
  207. }
  208. if (wf_CheckGet(array('reshistajlist'))) {
  209. $warehouse->reserveHistoryAjaxReply();
  210. }
  211. if (wf_CheckPost(array('reshistfilterfrom'))) {
  212. $warehouse->reserveHistoryPrintFiltered();
  213. }
  214. if (wf_CheckGet(array('reserveajlist'))) {
  215. $resEmpFilter = ubRouting::checkGet('empidfilter') ? ubRouting::get('empidfilter') : '';
  216. $warehouse->reserveListAjaxReply($resEmpFilter);
  217. }
  218. if (wf_CheckPost(array('newmassemployeeid', 'newmassstorageid', 'newmasscreation'))) {
  219. $massReserveResult = $warehouse->reserveMassCreate();
  220. //rendering mass reserve results
  221. show_window('', $massReserveResult);
  222. }
  223. $reserveControls = '';
  224. if (ubRouting::checkGet('empidfilter')) {
  225. $inventoryUrl = $warehouse::URL_ME . '&' . $warehouse::URL_RESERVE . '&empinventory=' . ubRouting::get('empidfilter');
  226. $reserveControls .= wf_Link($inventoryUrl, wf_img('skins/icon_user.gif', __('Employee inventory')), false) . ' ';
  227. } else {
  228. $reserveControls = wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_RESERVE . '&printable=true', web_icon_print(), false, '', 'target="_BLANK"') . ' ';
  229. }
  230. $reserveControls .= wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_RESERVE . '&reshistory=true', wf_img('skins/time_machine.png', __('History')), false) . ' ';
  231. if (ubRouting::checkGet('empidfilter')) {
  232. if (cfr('WAREHOUSEOUTRESERVE') or cfr('WAREHOUSEOUT')) {
  233. $massOutUrl = $warehouse::URL_ME . '&' . $warehouse::URL_RESERVE . '&massoutemployee=' . ubRouting::get('empidfilter');
  234. $reserveControls .= wf_Link($massOutUrl, wf_img('skins/drain_icon.png', __('Mass outcome')), false) . ' ';
  235. }
  236. }
  237. $reserveControls .= wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_RESERVE . '&mass=true', web_icon_create(__('Mass reservation')), false) . ' ';
  238. if (!ubRouting::checkGet('mass') and !ubRouting::checkGet('massoutemployee')) {
  239. if (wf_CheckGet(array('reshistory'))) {
  240. show_window(__('Reserve') . ': ' . __('History'), $warehouse->reserveRenderHistory());
  241. } else {
  242. if (ubRouting::checkGet('empinventory')) {
  243. $warehouse->reportEmployeeInventrory(ubRouting::get('empinventory'));
  244. } else {
  245. show_window(__('Reserved') . ' ' . $reserveControls, $warehouse->reserveRenderList());
  246. }
  247. }
  248. } else {
  249. if (!ubRouting::checkGet('massoutemployee')) {
  250. show_window(__('Mass reservation'), $warehouse->reserveMassForm());
  251. } else {
  252. //batch outcome creation
  253. if (ubRouting::checkPost($warehouse::PROUTE_DOMASSRESOUT)) {
  254. $massResOutResult = $warehouse->runMassReserveOutcome();
  255. if (empty($massResOutResult)) {
  256. ubRouting::nav($warehouse::URL_ME . '&' . $warehouse::URL_OUT);
  257. } else {
  258. show_window(__('Error'), $massResOutResult);
  259. }
  260. } else {
  261. //rendering some mass reserve outcome UI
  262. $massOutEmployeeId = ubRouting::get('massoutemployee');
  263. $massoutEmployeeName = $warehouse->getEmployeeName($massOutEmployeeId);
  264. $massOutWinLabel = __('Mass outcome') . ' ' . __('from reserved on') . ' ' . $massoutEmployeeName . ' ';
  265. $massEmpChForm = $warehouse->renderMassOutEmployyeReplaceForm($massOutEmployeeId);
  266. $massOutWinLabel .= wf_modalAuto(wf_img('skins/icon_replace_employee.png', __('Change employee')), __('Change employee'), $massEmpChForm);
  267. show_window($massOutWinLabel, $warehouse->renderMassOutForm($massOutEmployeeId));
  268. }
  269. }
  270. }
  271. $avidity_m = $avidity['M']['FALL'];
  272. $warehouse->$avidity_m($warehouse::URL_ME);
  273. }
  274. }
  275. //viewers
  276. if (ubRouting::checkGet('viewers')) {
  277. if (ubRouting::checkGet('showinid')) {
  278. //editing subroutine
  279. if (ubRouting::checkPost('editincomeid')) {
  280. if (cfr('WAREHOUSEINEDT')) {
  281. $incEditResult = $warehouse->incomingSaveChanges();
  282. if (empty($incEditResult)) {
  283. ubRouting::nav($warehouse::URL_ME . '&' . $warehouse::URL_VIEWERS . '&showinid=' . ubRouting::post('editincomeid'));
  284. } else {
  285. show_error($incEditResult);
  286. }
  287. } else {
  288. show_error(__('Access denied'));
  289. }
  290. }
  291. //deletion subroutine
  292. if (ubRouting::checkGet($warehouse::ROUTE_DELIN)) {
  293. if (cfr('WAREHOUSEINEDT')) {
  294. $incDelResult = $warehouse->incomingDelete(ubRouting::get($warehouse::ROUTE_DELIN));
  295. if (empty($incDelResult)) {
  296. ubRouting::nav($warehouse::URL_ME . '&' . $warehouse::URL_VIEWERS . '&showinid=' . ubRouting::get($warehouse::ROUTE_DELIN));
  297. } else {
  298. show_error($incDelResult);
  299. }
  300. } else {
  301. show_error(__('Access denied'));
  302. }
  303. }
  304. //rendering income op itself
  305. show_window(__('Incoming operation') . ': ' . ubRouting::get('showinid'), $warehouse->incomingView(ubRouting::get('showinid')));
  306. $avidity_m = $avidity['M']['FALL'];
  307. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_IN);
  308. }
  309. if (ubRouting::checkGet('showoutid')) {
  310. if (ubRouting::checkGet($warehouse::ROUTE_DELOUT)) {
  311. $warehouse->outcomingDelete(ubRouting::get($warehouse::ROUTE_DELOUT));
  312. ubRouting::nav($warehouse::URL_ME . '&' . $warehouse::URL_VIEWERS . '&showoutid=' . ubRouting::get($warehouse::ROUTE_DELOUT));
  313. }
  314. show_window(__('Outcoming operation') . ': ' . ubRouting::get('showoutid'), $warehouse->outcomingView(ubRouting::get('showoutid')));
  315. $avidity_m = $avidity['M']['FALL'];
  316. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_OUT);
  317. }
  318. if (wf_CheckGet(array('showremains'))) {
  319. show_window(__('The remains in the warehouse storage'), $warehouse->reportAllStoragesRemainsView($_GET['showremains']));
  320. $avidity_m = $avidity['M']['FALL'];
  321. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&totalremains=true');
  322. }
  323. if (wf_CheckGet(array('qrcode', 'renderid'))) {
  324. $warehouse->qrCodeDraw($_GET['qrcode'], $_GET['renderid']);
  325. }
  326. if (wf_CheckGet(array('printremainsstorage'))) {
  327. $warehouse->reportStorageRemainsPrintable($_GET['printremainsstorage']);
  328. }
  329. if (wf_CheckGet(array('itemhistory'))) {
  330. $warehouse->renderItemHistory($_GET['itemhistory']);
  331. }
  332. }
  333. //reports
  334. if (wf_CheckGet(array('reports'))) {
  335. if (wf_CheckGet(array('ajaxtremains'))) {
  336. $avidity_a = $avidity['A']['SEENOEVIL'];
  337. $warehouse->$avidity_a();
  338. }
  339. if (wf_CheckGet(array('calendarops'))) {
  340. if (cfr('WAREHOUSEREPORTS')) {
  341. show_window(__('Operations in the context of time'), $warehouse->reportCalendarOps());
  342. } else {
  343. show_error(__('Access denied'));
  344. }
  345. $avidity_m = $avidity['M']['FALL'];
  346. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&' . 'totalremains=true');
  347. }
  348. if (wf_CheckGet(array('totalremains'))) {
  349. show_window(__('The remains in all storages'), $warehouse->reportAllStoragesRemains());
  350. $avidity_m = $avidity['M']['FALL'];
  351. $warehouse->$avidity_m();
  352. }
  353. if (wf_CheckGet(array('dateremains'))) {
  354. if (cfr('WAREHOUSEREPORTS')) {
  355. show_window(__('Date remains'), $warehouse->reportDateRemains());
  356. } else {
  357. show_error(__('Access denied'));
  358. }
  359. $avidity_m = $avidity['M']['FALL'];
  360. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&' . 'totalremains=true');
  361. }
  362. if (wf_CheckGet(array('storagesremains'))) {
  363. if (cfr('WAREHOUSEREPORTS')) {
  364. show_window(__('The remains in the warehouse storage'), $warehouse->reportStoragesRemains());
  365. $avidity_m = $avidity['M']['FALL'];
  366. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&' . 'totalremains=true');
  367. } else {
  368. show_error(__('Access denied'));
  369. }
  370. }
  371. if (ubRouting::checkGet('itemtypeoutcomes')) {
  372. if (cfr('WAREHOUSEREPORTS')) {
  373. show_window(__('Sales'), $warehouse->renderItemtypeOutcomesHistory());
  374. $avidity_m = $avidity['M']['FALL'];
  375. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&' . 'totalremains=true');
  376. } else {
  377. show_error(__('Access denied'));
  378. }
  379. }
  380. if (ubRouting::checkGet('purchases')) {
  381. if (cfr('WAREHOUSEREPORTS')) {
  382. show_window(__('Purchases'), $warehouse->renderPurchasesReport());
  383. $avidity_m = $avidity['M']['FALL'];
  384. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&' . 'totalremains=true');
  385. } else {
  386. show_error(__('Access denied'));
  387. }
  388. }
  389. if (ubRouting::checkGet('contractorincomes')) {
  390. if (cfr('WAREHOUSEREPORTS')) {
  391. show_window(__('Income') . ' ' . __('from') . ' ' . __('Contractor'), $warehouse->renderContractorIncomesReport());
  392. $avidity_m = $avidity['M']['FALL'];
  393. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&' . 'totalremains=true');
  394. } else {
  395. show_error(__('Access denied'));
  396. }
  397. }
  398. if (ubRouting::checkGet('returns')) {
  399. if (cfr('WAREHOUSEREPORTS')) {
  400. if (ubRouting::checkGet('ajreturnslist')) {
  401. $warehouse->ajReturnsList();
  402. }
  403. show_window(__('Returns'), $warehouse->renderReturnsReport());
  404. $avidity_m = $avidity['M']['FALL'];
  405. $warehouse->$avidity_m($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&' . 'totalremains=true');
  406. } else {
  407. show_error(__('Access denied'));
  408. }
  409. }
  410. if (ubRouting::checkGet('netwupgrade')) {
  411. if (cfr('WAREHOUSEREPORTS')) {
  412. show_window(__('Item types spent on network upgrade'), $warehouse->renderNetwUpgradeReport());
  413. $avidity_m = $avidity['M']['FALL'];
  414. $warehouse->$avidity_m($warehouse::URL_ME);
  415. } else {
  416. show_error(__('Access denied'));
  417. }
  418. }
  419. }
  420. $avidity = $avidity['M']['FRONT'];
  421. $warehouse->$avidity();
  422. } else {
  423. show_error(__('No license key available'));
  424. }
  425. } else {
  426. show_error(__('This module is disabled'));
  427. }
  428. } else {
  429. show_error(__('Permission denied'));
  430. }