CatalogController.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_CORF',
  24. 'REFI_VERS',
  25. 'REFI_DESC',
  26. 'REFI_FISI',
  27. 'REFI_MORA',
  28. 'REFI_FEIV',
  29. 'REFI_FEFV',
  30. ]);
  31. } catch (\Throwable $th) {
  32. return $this->responseController->makeResponse(true, "ERR_CATALOG_TAXREGIME_GET000: Ocurrió un error al obtener el contenido.", $th->getMessage(), 500);
  33. }
  34. $arrTaxRegime = json_decode(json_encode($getTaxRegime), true);
  35. return $this->responseController->makeResponse(false, "ÉXITO: Consulta Exitosa.", $arrTaxRegime);
  36. }
  37. }