Skip to content

Commit

Permalink
feat: aggiunta risorsa api per pagamenti
Browse files Browse the repository at this point in the history
  • Loading branch information
Bacca1997 committed Nov 7, 2024
1 parent 4e40f49 commit a60182a
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
50 changes: 50 additions & 0 deletions modules/pagamenti/src/API/v1/Pagamenti.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.r.l.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

namespace Modules\Pagamenti\API\v1;

use API\Interfaces\RetrieveInterface;
use API\Resource;
use Modules\Pagamenti\Pagamento;

class Pagamenti extends Resource implements RetrieveInterface
{
public function retrieve($request)
{
// Periodo per selezionare interventi
$user = \Auth::user();

$table = 'co_pagamenti';

$select = [
'co_pagamenti.*'
];

$where = [];

$group = 'co_pagamenti.id';

return [
'table' => $table,
'select' => $select,
'where' => $where,
'group' => $group,
];
}
}
5 changes: 4 additions & 1 deletion update/2_6.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,7 @@ UPDATE `zz_views_lang` SET `title` = 'emailto_Email' WHERE `zz_views_lang`.`id_r
ALTER TABLE `mg_articoli` ADD `modello` VARCHAR(255) NULL AFTER `id_marchio`;

-- Fix filtro segmento Non completate in Attività
UPDATE `zz_segments` SET `clause` = 'in_interventi.idstatointervento NOT IN(SELECT in_statiintervento.id FROM in_statiintervento WHERE is_completato=1)' WHERE `zz_segments`.`name` = 'Non completate' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi');
UPDATE `zz_segments` SET `clause` = 'in_interventi.idstatointervento NOT IN(SELECT in_statiintervento.id FROM in_statiintervento WHERE is_completato=1)' WHERE `zz_segments`.`name` = 'Non completate' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi');

INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `enabled`) VALUES
(NULL, 'v1', 'retrieve', 'pagamenti', 'Modules\\Pagamenti\\API\\v1\\Pagamenti', 1);

0 comments on commit a60182a

Please sign in to comment.