CatalogController.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Support\Carbon;
  5. use Illuminate\Support\Facades\DB;
  6. use Illuminate\Support\Facades\Validator;
  7. class CatalogController extends Controller
  8. {
  9. private $responseController;
  10. private $encController;
  11. private $resourcesController;
  12. public function __construct() {
  13. $this->responseController = new ResponseController();
  14. $this->encController = new EncryptionController();
  15. $this->resourcesController = new ResourcesController();
  16. }
  17. public function getTaxRegimeActive($line) {
  18. try {
  19. $getTaxRegime = DB::table('S002V01TREFI')
  20. ->where('REFI_ESTA', '=', 'Activo')
  21. ->where('REFI_NULI', '=', $line)
  22. ->get([
  23. 'REFI_CRFI',
  24. 'REFI_NULI',
  25. 'REFI_DRFI',
  26. 'REFI_APFI',
  27. 'REFI_APMO',
  28. ]);
  29. } catch (\Throwable $th) {
  30. return $this->responseController->makeResponse(true, "ERR_CATALOG_TAXREGIME_GET000: Ocurrió un error al obtener el contenido.", $th->getMessage(), 500);
  31. }
  32. $arrTaxRegime = json_decode(json_encode($getTaxRegime), true);
  33. return $this->responseController->makeResponse(false, "ÉXITO: Consulta Exitosa.", $arrTaxRegime);
  34. }
  35. }