feesharvester.php 944 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /*
  3. * Fees harvester processing
  4. */
  5. if (ubRouting::get('action') == 'feesharvester') {
  6. if ($ubillingConfig->getAlterParam('FEES_HARVESTER')) {
  7. $harvesterProcess = new StarDust('FEESHARVESTER');
  8. if ($harvesterProcess->notRunning()) {
  9. if (ubRouting::checkGet('full', false)) {
  10. $customMonth = '';
  11. } else {
  12. $customMonth = curmonth();
  13. }
  14. if (ubRouting::checkGet('today', false)) {
  15. $customMonth = curdate();
  16. }
  17. $harvesterProcess->start();
  18. $fundsFlow = new FundsFlow();
  19. $harvestedFees = $fundsFlow->harvestFees($customMonth);
  20. $harvesterProcess->stop();
  21. die('OK: FEES HARVESTED `' . $harvestedFees . '`');
  22. } else {
  23. die('WARNING:FEES_HARVESTER_ALREADY_RUNING');
  24. }
  25. } else {
  26. die('ERROR:FEES_HARVESTER_DISABLED');
  27. }
  28. }