Miglioramento creazione Clienti da Applicazione

Stile del codice e correzione copyright
This commit is contained in:
Dasc3er 2021-07-15 10:58:36 +02:00
parent e7a2d336a9
commit 85bfaaf466
19 changed files with 102 additions and 45 deletions

View File

@ -69,7 +69,6 @@ echo '
echo '
</div>';
if (!empty($options['show-ritenuta-contributi']) || empty($options['hide_conto'])) {
$width = !empty($options['show-ritenuta-contributi']) && empty($options['hide_conto']) ? 6 : 12;

View File

@ -194,7 +194,6 @@ if (in_array($final_module['name'], ['Fatture di vendita', 'Fatture di acquisto'
{[ "type": "select", "label": "'.tr('Rivalsa').'", "name": "id_rivalsa_inps", "value": "'.$id_rivalsa_inps.'", "values": "query=SELECT * FROM co_rivalse", "help": "'.($options['dir'] == 'entrata' ? setting('Tipo Cassa Previdenziale') : null).'" ]}
</div>';
// Ritenuta d'acconto
echo '
<div class="col-md-4">

View File

@ -1,7 +1,7 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
* 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

View File

@ -1,7 +1,7 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
* 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

View File

@ -1,7 +1,7 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
* 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

View File

@ -1,7 +1,7 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
* 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

View File

@ -1,7 +1,7 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
* 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

View File

@ -60,7 +60,7 @@ class Clienti extends AppResource
}
// Filtro per data (solo nel caso in cui la sincronizzazione non sia totale)
elseif ($last_sync_at) {
if ($last_sync_at) {
$query .= ' AND an_anagrafiche.updated_at > '.prepare($last_sync_at);
}

View File

@ -0,0 +1,62 @@
<?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 API\App\v1;
use API\Interfaces\RetrieveInterface;
use API\Resource;
use Modules\Anagrafiche\Anagrafica;
use Modules\Anagrafiche\Tipo;
class ControlloClienti extends Resource implements RetrieveInterface
{
public function retrieve($data)
{
// Ricerca per Partita IVA
$partita_iva = $data['partita_iva'];
if (!empty($partita_iva)) {
$cliente_partita_iva = Anagrafica::where('piva', $partita_iva)
->first();
}
// Ricerca per Codice fiscale
$codice_fiscale = $data['codice_fiscale'];
if (!empty($codice_fiscale)) {
$cliente_codice_fiscale = Anagrafica::where('codice_fiscale', $codice_fiscale)
->first();
}
$cliente = $cliente_partita_iva ?: $cliente_codice_fiscale;
// Aggiunta tipologia Cliente se non presente nell'anagrafica trovata
if (!empty($cliente) && !$cliente->isTipo('Cliente')) {
$tipo_cliente = Tipo::where('descrizione', '=', 'Cliente')->first();
$tipi = $cliente->tipi->pluck('idtipoanagrafica')->toArray();
$tipi[] = $tipo_cliente->id;
$cliente->tipologie = $tipi;
$cliente->save();
}
return [
'id' => $cliente ? $cliente->id : '',
];
}
}

View File

@ -22,7 +22,6 @@ namespace API\App\v1;
use API\App\AppResource;
use Carbon\Carbon;
use Modules\Articoli\Articolo;
use Modules\Articoli\Movimento;
class MovimentiManuali extends AppResource
{
@ -47,7 +46,7 @@ class MovimentiManuali extends AppResource
$data_movimento = new Carbon($data['created_at']);
$id_movimento = $articolo->movimenta($data['qta'], $data['descrizione'], $data_movimento, true, [
'idsede' => $data['id_sede_azienda']
'idsede' => $data['id_sede_azienda'],
]);
return [

View File

@ -23,8 +23,6 @@ use API\Interfaces\CreateInterface;
use API\Interfaces\RetrieveInterface;
use API\Resource;
use Modules\Emails\Account;
use Modules\Emails\Mail;
use Modules\Emails\Template;
use Notifications\EmailNotification;
class SegnalazioneBug extends Resource implements RetrieveInterface, CreateInterface
@ -58,7 +56,6 @@ class SegnalazioneBug extends Resource implements RetrieveInterface, CreateInter
$mail->subject = 'Segnalazione bug App OSM '.$request['version'];
$infos = [
];
$body = '';

View File

@ -58,7 +58,7 @@ echo "
if ($documento->direzione == 'uscita') {
echo "
<th class='text-center' style='width:11%'>".tr('Codice', [], ['upper' => true])."</th>
<th class='text-center' style='width:11%'>".tr('Codice fornitore', [], ['upper' => true])."</th>";
<th class='text-center' style='width:11%'>".tr('Codice fornitore', [], ['upper' => true]).'</th>';
}
if ($has_image) {

View File

@ -1,7 +1,7 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
* 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

View File

@ -1,7 +1,7 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
* 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

View File

@ -1,7 +1,7 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
* 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

View File

@ -1,7 +1,7 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
* 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

View File

@ -132,5 +132,6 @@ INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `e
(NULL, 'app-v1', 'retrieve', 'movimenti-manuali', 'API\\App\\v1\\MovimentiManuali', '1'),
(NULL, 'app-v1', 'retrieve', 'movimenti-manuali-cleanup', 'API\\App\\v1\\MovimentiManuali', '1'),
(NULL, 'app-v1', 'create', 'movimento-manuale', 'API\\App\\v1\\MovimentiManuali', '1'),
(NULL, 'app-v1', 'retrieve', 'controllo-clienti', 'API\\App\\v1\\ControlloClienti', '1'),
(NULL, 'app-v1', 'retrieve', 'segnalazione-bug', 'API\\App\\v1\\SegnalazioneBug', '1'),
(NULL, 'app-v1', 'create', 'segnalazione-bug', 'API\\App\\v1\\SegnalazioneBug', '1');