mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-26 16:27:47 +01:00
Merge
This commit is contained in:
commit
16d830b9dc
@ -108,8 +108,8 @@ Input.prototype.init = function () {
|
||||
if (this.element.hasClass('autosize'))
|
||||
initCompleted = initTextareaInput(htmlElement);
|
||||
|
||||
if (htmlElement.hasAttribute('maxlength'))
|
||||
initCompleted = initCharsCounter(htmlElement);
|
||||
if (htmlElement.hasAttribute('charcounter'))
|
||||
initCompleted = initCharCounter(htmlElement);
|
||||
|
||||
}
|
||||
|
||||
|
@ -26,20 +26,41 @@ function initTextareaInput(input) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function initCharsCounter(input) {
|
||||
function initCharCounter(input) {
|
||||
let $input = $(input);
|
||||
|
||||
$input.maxlength({
|
||||
warningClass: "label label-info",
|
||||
limitReachedClass: "label label-warning",
|
||||
preText: 'usati ',
|
||||
separator: ' di ',
|
||||
postText: ' caratteri.',
|
||||
showMaxLength: false,
|
||||
placement: 'bottom-right-inside',
|
||||
utf8: true,
|
||||
appendToParent: true
|
||||
});
|
||||
if (input.hasAttribute('maxlength')){
|
||||
|
||||
$input.maxlength({
|
||||
warningClass: "help-block",
|
||||
limitReachedClass: "help-block text-danger",
|
||||
preText: '',
|
||||
separator: ' / ',
|
||||
postText: '',
|
||||
showMaxLength: true,
|
||||
placement: 'bottom-right-inside',
|
||||
utf8: true,
|
||||
appendToParent: true,
|
||||
alwaysShow: false,
|
||||
threshold: 150
|
||||
});
|
||||
|
||||
}else{
|
||||
|
||||
$input.attr('maxlength','65535');
|
||||
|
||||
$input.maxlength({
|
||||
warningClass: "help-block",
|
||||
limitReachedClass: "help-block text-danger",
|
||||
showMaxLength: false,
|
||||
placement: 'bottom-right-inside',
|
||||
utf8: true,
|
||||
appendToParent: true,
|
||||
alwaysShow: true
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -52,8 +52,8 @@ if (preg_match('/[`]*([a-z0-9_]*)[`]*[\.]*([`]*deleted_at[`]* IS NULL)/i', $quer
|
||||
$conditions_to_remove[] = ' AND '.$condition;
|
||||
$conditions_to_remove[] = $condition.' AND ';
|
||||
|
||||
$query = str_replace( $conditions_to_remove, '', $query);
|
||||
$query = str_replace( $condition, '', $query);
|
||||
$query = str_replace($conditions_to_remove, '', $query);
|
||||
$query = str_replace($condition, '', $query);
|
||||
}
|
||||
|
||||
$has_access = !empty($query) ? $dbo->fetchNum($query) !== 0 : true;
|
||||
@ -197,7 +197,7 @@ if (empty($record) || !$has_access) {
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
<li><a href="#" id="'.(!empty($record['deleted_at']) ? 'restore' : 'save').'-close">
|
||||
<i class="fa fa-'.(!empty($record['deleted_at']) ? 'undo' : 'check').'"></i>
|
||||
<i class="fa fa-'.(!empty($record['deleted_at']) ? 'undo' : 'check-square-o').'"></i>
|
||||
'.(!empty($record['deleted_at']) ? tr('Ripristina e chiudi') : tr('Salva e chiudi')).'
|
||||
</a></li>
|
||||
</ul>
|
||||
|
@ -672,7 +672,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "textarea", "label": "<?php echo tr('Note'); ?>", "name": "note", "value": "$note$", "maxlength": 255 ]}
|
||||
{[ "type": "textarea", "label": "<?php echo tr('Note'); ?>", "name": "note", "value": "$note$", "maxlength": 255, "charcounter": 1 ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -30,6 +30,7 @@ switch (post('op')) {
|
||||
flash()->info(tr('Articolo ripristinato correttamente!'));
|
||||
|
||||
// Aggiunta articolo
|
||||
// no break
|
||||
case 'add':
|
||||
//Se non specifico il codice articolo lo imposto uguale all'id della riga
|
||||
if (empty(post('codice'))) {
|
||||
|
@ -63,7 +63,7 @@ include_once __DIR__.'/../../core.php';
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "textarea", "label": "<?php echo tr('Descrizione'); ?>", "name": "descrizione", "required": 1, "value": "$descrizione$" ]}
|
||||
{[ "type": "textarea", "label": "<?php echo tr('Descrizione'); ?>", "name": "descrizione", "required": 1, "value": "$descrizione$", "charcounter": 1 ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -19,51 +19,60 @@
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
// Individuazione dati selezionabili
|
||||
// Stati interventi
|
||||
$stati_intervento = $dbo->fetchArray('SELECT idstatointervento AS id, descrizione, colore FROM in_statiintervento WHERE deleted_at IS NULL ORDER BY descrizione ASC');
|
||||
|
||||
// Tipi intervento
|
||||
$tipi_intervento = $dbo->fetchArray('SELECT idtipointervento AS id, descrizione FROM in_tipiintervento ORDER BY descrizione ASC');
|
||||
|
||||
// Tecnici disponibili
|
||||
$tecnici_disponibili = $dbo->fetchArray("SELECT an_anagrafiche.idanagrafica AS id, ragione_sociale, colore FROM an_anagrafiche
|
||||
INNER JOIN
|
||||
an_tipianagrafiche_anagrafiche ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica
|
||||
INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica
|
||||
LEFT OUTER JOIN in_interventi_tecnici ON in_interventi_tecnici.idtecnico = an_anagrafiche.idanagrafica
|
||||
INNER JOIN in_interventi ON in_interventi_tecnici.idintervento=in_interventi.id
|
||||
WHERE an_anagrafiche.deleted_at IS NULL AND an_tipianagrafiche.descrizione='Tecnico' ".Modules::getAdditionalsQuery('Interventi').'
|
||||
GROUP BY an_anagrafiche.idanagrafica
|
||||
ORDER BY ragione_sociale ASC');
|
||||
|
||||
// Zone
|
||||
$zone = $dbo->fetchArray('(SELECT 0 AS ordine, \'0\' AS id, \'Nessuna zona\' AS descrizione) UNION (SELECT 1 AS ordine, id, descrizione FROM an_zone) ORDER BY ordine, descrizione ASC');
|
||||
|
||||
// Prima selezione globale per tutti i filtri
|
||||
if (!isset($_SESSION['dashboard']['idtecnici'])) {
|
||||
$rs = $dbo->fetchArray("SELECT an_anagrafiche.idanagrafica AS id FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE deleted_at IS NULL AND descrizione='Tecnico'");
|
||||
|
||||
$_SESSION['dashboard']['idtecnici'] = ["'-1'"];
|
||||
|
||||
for ($i = 0; $i < count($rs); ++$i) {
|
||||
$_SESSION['dashboard']['idtecnici'][] = "'".$rs[$i]['id']."'";
|
||||
foreach ($tecnici_disponibili as $tecnico) {
|
||||
$_SESSION['dashboard']['idtecnici'][] = "'".$tecnico['id']."'";
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($_SESSION['dashboard']['idstatiintervento'])) {
|
||||
$rs = $dbo->fetchArray('SELECT idstatointervento AS id, descrizione FROM in_statiintervento WHERE deleted_at IS NULL');
|
||||
|
||||
$_SESSION['dashboard']['idstatiintervento'] = ["'-1'"];
|
||||
|
||||
for ($i = 0; $i < count($rs); ++$i) {
|
||||
$_SESSION['dashboard']['idstatiintervento'][] = "'".$rs[$i]['id']."'";
|
||||
foreach ($stati_intervento as $stato) {
|
||||
$_SESSION['dashboard']['idstatiintervento'][] = "'".$stato['id']."'";
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($_SESSION['dashboard']['idtipiintervento'])) {
|
||||
$rs = $dbo->fetchArray('SELECT idtipointervento AS id, descrizione FROM in_tipiintervento');
|
||||
|
||||
$_SESSION['dashboard']['idtipiintervento'] = ["'-1'"];
|
||||
|
||||
for ($i = 0; $i < count($rs); ++$i) {
|
||||
$_SESSION['dashboard']['idtipiintervento'][] = "'".$rs[$i]['id']."'";
|
||||
foreach ($tipi_intervento as $tipo) {
|
||||
$_SESSION['dashboard']['idtipiintervento'][] = "'".$tipo['id']."'";
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($_SESSION['dashboard']['idzone'])) {
|
||||
$rs = $dbo->fetchArray('SELECT id, descrizione FROM an_zone');
|
||||
|
||||
$_SESSION['dashboard']['idzone'] = ["'-1'"];
|
||||
|
||||
// "Nessuna zona" di default
|
||||
$_SESSION['dashboard']['idzone'][] = "'0'";
|
||||
|
||||
for ($i = 0; $i < count($rs); ++$i) {
|
||||
$_SESSION['dashboard']['idzone'][] = "'".$rs[$i]['id']."'";
|
||||
foreach ($zone as $zona) {
|
||||
$_SESSION['dashboard']['idzone'][] = "'".$zona['id']."'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo '
|
||||
<!-- Filtri -->
|
||||
<div class="row">
|
||||
@ -77,7 +86,6 @@ echo '
|
||||
|
||||
// Stati intervento
|
||||
$stati_sessione = session_get('dashboard.idstatiintervento', []);
|
||||
$stati_intervento = $dbo->fetchArray('SELECT idstatointervento AS id, descrizione, colore FROM in_statiintervento WHERE deleted_at IS NULL ORDER BY descrizione ASC');
|
||||
foreach ($stati_intervento as $stato) {
|
||||
$attr = '';
|
||||
if (in_array("'".$stato['id']."'", $stati_sessione)) {
|
||||
@ -115,7 +123,6 @@ echo '
|
||||
|
||||
// Tipi intervento
|
||||
$tipi_sessione = session_get('dashboard.idtipiintervento', []);
|
||||
$tipi_intervento = $dbo->fetchArray('SELECT idtipointervento AS id, descrizione FROM in_tipiintervento ORDER BY descrizione ASC');
|
||||
foreach ($tipi_intervento as $tipo) {
|
||||
$attr = '';
|
||||
if (in_array("'".$tipo['id']."'", $tipi_sessione)) {
|
||||
@ -152,15 +159,6 @@ echo '
|
||||
<ul class="dropdown-menu" role="menu">';
|
||||
|
||||
$tecnici_sessione = session_get('dashboard.idtecnici', []);
|
||||
$tecnici_disponibili = $dbo->fetchArray("SELECT an_anagrafiche.idanagrafica AS id, ragione_sociale, colore FROM an_anagrafiche
|
||||
INNER JOIN
|
||||
an_tipianagrafiche_anagrafiche ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica
|
||||
INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica
|
||||
LEFT OUTER JOIN in_interventi_tecnici ON in_interventi_tecnici.idtecnico = an_anagrafiche.idanagrafica
|
||||
INNER JOIN in_interventi ON in_interventi_tecnici.idintervento=in_interventi.id
|
||||
WHERE an_anagrafiche.deleted_at IS NULL AND an_tipianagrafiche.descrizione='Tecnico' ".Modules::getAdditionalsQuery('Interventi').'
|
||||
GROUP BY an_anagrafiche.idanagrafica
|
||||
ORDER BY ragione_sociale ASC');
|
||||
foreach ($tecnici_disponibili as $tecnico) {
|
||||
$attr = '';
|
||||
if (in_array("'".$tecnico['id']."'", $tecnici_sessione)) {
|
||||
@ -198,7 +196,6 @@ echo '
|
||||
|
||||
// Zone
|
||||
$zone_sessione = session_get('dashboard.idzone', []);
|
||||
$zone = $dbo->fetchArray('(SELECT 0 AS ordine, \'0\' AS id, \'Nessuna zona\' AS descrizione) UNION (SELECT 1 AS ordine, id, descrizione FROM an_zone) ORDER BY ordine, descrizione ASC');
|
||||
foreach ($zone as $zona) {
|
||||
$attr = '';
|
||||
if (in_array("'".$zona['id']."'", $zone_sessione)) {
|
||||
|
@ -337,7 +337,7 @@ switch (post('op')) {
|
||||
|
||||
// Aggiornamento seriali dalla riga dell'ordine
|
||||
if ($copia->isArticolo()) {
|
||||
if($documento->tipo->dir == 'uscita'){
|
||||
if ($documento->tipo->dir == 'uscita') {
|
||||
$originale = ArticoloOriginale::find($riga->idarticolo);
|
||||
$id_iva = $originale->idiva_vendita ? $originale->idiva_vendita : setting('Iva predefinita');
|
||||
$copia->setPrezzoUnitario($originale->prezzo_vendita, $id_iva);
|
||||
|
@ -20,17 +20,17 @@
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$stati = $dbo->fetchArray('SELECT descrizione FROM `dt_statiddt` WHERE `is_fatturabile` = 1');
|
||||
foreach($stati as $stato){
|
||||
foreach ($stati as $stato) {
|
||||
$stati_importabili[] = $stato['descrizione'];
|
||||
}
|
||||
|
||||
$causali = $dbo->fetchArray('SELECT descrizione FROM `dt_causalet` WHERE `is_importabile` = 1');
|
||||
foreach($causali as $causale){
|
||||
foreach ($causali as $causale) {
|
||||
$causali_importabili[] = $causale['descrizione'];
|
||||
}
|
||||
|
||||
echo '
|
||||
<div class="tip" data-toggle="tooltip" title="'.tr("Il ddt è fatturabile solo se si trova negli stati _STATE_LIST_ e la relativa causale è una delle seguenti: _CAUSALE_LIST_", [
|
||||
<div class="tip" data-toggle="tooltip" title="'.tr('Il ddt è fatturabile solo se si trova negli stati _STATE_LIST_ e la relativa causale è una delle seguenti: _CAUSALE_LIST_', [
|
||||
'_STATE_LIST_' => implode(', ', $stati_importabili),
|
||||
'_CAUSALE_LIST_' => implode(', ', $causali_importabili),
|
||||
]).'">
|
||||
|
@ -128,11 +128,10 @@ class DDT extends Document
|
||||
{
|
||||
$database = database();
|
||||
$stati = $database->fetchArray('SELECT descrizione FROM `dt_statiddt` WHERE `is_fatturabile` = 1');
|
||||
foreach($stati as $stato){
|
||||
foreach ($stati as $stato) {
|
||||
$stati_importabili[] = $stato['descrizione'];
|
||||
}
|
||||
|
||||
|
||||
$causale = $database->fetchOne('SELECT * FROM `dt_causalet` WHERE `id` = '.prepare($this->idcausalet));
|
||||
|
||||
return $causale['is_importabile'] && in_array($this->stato->descrizione, $stati_importabili);
|
||||
@ -228,18 +227,18 @@ class DDT extends Document
|
||||
$parziale = $qta != $qta_evasa;
|
||||
|
||||
$fattura = Fattura::find($trigger->iddocumento);
|
||||
if(!empty($fattura)){
|
||||
if (!empty($fattura)) {
|
||||
$righe_fatturate = $fattura->getRighe()->where('idddt', '=', $this->id);
|
||||
$qta_fatturate = $righe_fatturate->sum('qta');
|
||||
$parziale_fatturato = $qta != $qta_fatturate;
|
||||
}
|
||||
|
||||
|
||||
// Impostazione del nuovo stato
|
||||
if ($qta_evasa == 0) {
|
||||
$descrizione = 'Bozza';
|
||||
} elseif(empty($qta_fatturate)){
|
||||
} elseif (empty($qta_fatturate)) {
|
||||
$descrizione = $parziale ? 'Parzialmente evaso' : 'Evaso';
|
||||
} else{
|
||||
} else {
|
||||
$descrizione = $parziale_fatturato ? 'Parzialmente fatturato' : 'Fatturato';
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ echo '
|
||||
<?php
|
||||
|
||||
// Variabili utilizzabili
|
||||
$variables = include Modules::filepath($record['id_module'], 'variables.php');
|
||||
$variables = $module->getPlaceholders($id_record);
|
||||
|
||||
echo '
|
||||
<!-- Istruzioni per il contenuto -->
|
||||
|
@ -189,6 +189,34 @@ trait RelationTrait
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifica la quantità del componente.
|
||||
* Se la fattura è una Nota di credito/debito, risale al secondo livello di origine del componente e corregge di conseguenza le quantità evase.
|
||||
*
|
||||
* @param float $value
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function setQtaAttribute($value)
|
||||
{
|
||||
list($qta, $diff) = $this->parseQta($value);
|
||||
parent::setQtaAttribute($value);
|
||||
|
||||
if ($this->fattura->isNota() && $this->hasOriginalComponent()) {
|
||||
$source = $this->getOriginalComponent();
|
||||
|
||||
// Aggiornamento della quantità evasa di origine
|
||||
if ($source->hasOriginalComponent()) {
|
||||
$target = $source->getOriginalComponent();
|
||||
|
||||
$target->qta_evasa -= $diff;
|
||||
$target->save();
|
||||
}
|
||||
}
|
||||
|
||||
return $diff;
|
||||
}
|
||||
|
||||
/**
|
||||
* Effettua i conti per la Rivalsa INPS.
|
||||
*/
|
||||
|
@ -20,7 +20,7 @@
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$stati = $dbo->fetchArray('SELECT descrizione FROM `or_statiordine` WHERE `is_fatturabile` = 1');
|
||||
foreach($stati as $stato){
|
||||
foreach ($stati as $stato) {
|
||||
$stati_importabili[] = $stato['descrizione'];
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,8 @@ echo '
|
||||
<div class="tip" data-toggle="tooltip" title="'.tr('Per creare una nuova revisione lo stato del preventivo deve essere tra: _STATE_LIST_', [
|
||||
'_STATE_LIST_' => $stati_abilitati,
|
||||
]).'">
|
||||
<button type="button" class="btn btn-warning '.($record['is_revisionabile'] ? '' : 'disabled').'" onclick="if(confirm(\'Vuoi creare un nuova revisione?\')){$(\'#crea-revisione\').submit();}">
|
||||
<i class="fa fa-edit"></i> '.tr('Crea nuova revisione...').'
|
||||
<button type="button" class="btn btn-warning '.($record['is_revisionabile'] ? '' : 'disabled').'" onclick="if(confirm(\''.tr('Creare un nuova revisione?').'\')){$(\'#crea-revisione\').submit();}">
|
||||
<i class="fa fa-plus-square"></i> '.tr('Crea nuova revisione...').'
|
||||
</button>
|
||||
</div>';
|
||||
|
||||
|
@ -54,7 +54,7 @@ include_once __DIR__.'/../../core.php';
|
||||
|
||||
<?php
|
||||
// Variabili utilizzabili
|
||||
$variables = include Modules::filepath($record['id_module'], 'variables.php');
|
||||
$variables = $module->getPlaceholders($id_record);
|
||||
|
||||
echo '
|
||||
<!-- Istruzioni per il contenuto -->
|
||||
|
@ -105,10 +105,17 @@ if (Services::isEnabled()) {
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.tr('Anno').'</th>
|
||||
<th>'.tr('Documenti transitati').'</th>
|
||||
<th>'.tr('Spazio fatture').'</th>
|
||||
<th>'.tr('Spazio ricevute').'</th>
|
||||
<th>'.tr('Spazio totale occupato').'</th>
|
||||
<th>'.tr('Documenti archiviati').'
|
||||
<span class="tip" title="'.tr('Fatture attive e relative ricevute, fatture passive').'.">
|
||||
<i class="fa fa-question-circle-o"></i>
|
||||
</span>
|
||||
</th>
|
||||
|
||||
<th>'.tr('Totale spazio occupato').'
|
||||
<span class="tip" title="'.tr('Fatture attive con eventuali allegati e ricevute, fatture passive con eventuali allegati').'.">
|
||||
<i class="fa fa-question-circle-o"></i>
|
||||
</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -116,8 +123,6 @@ if (Services::isEnabled()) {
|
||||
<tr class="info">
|
||||
<td>'.tr('Totale').'</td>
|
||||
<td id="fe_numero"></td>
|
||||
<td id="fe_spazio_fatture"></td>
|
||||
<td id="fe_spazio_ricevute"></td>
|
||||
<td id="fe_spazio"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -137,8 +142,6 @@ if (Services::isEnabled()) {
|
||||
},
|
||||
success: function (response) {
|
||||
$("#fe_numero").html(response.invoice_number);
|
||||
$("#fe_spazio_fatture").html(response.invoices_size);
|
||||
$("#fe_spazio_ricevute").html(response.notifies_size);
|
||||
$("#fe_spazio").html(response.size);
|
||||
|
||||
if (response.history.length) {
|
||||
@ -148,8 +151,6 @@ if (Services::isEnabled()) {
|
||||
$("#elenco-fe").append(`<tr>
|
||||
<td>` + data["year"] + `</td>
|
||||
<td>` + data["number"] + `</td>
|
||||
<td>` + data["invoices_size"] + `</td>
|
||||
<td>` + data["notifies_size"] + `</td>
|
||||
<td>` + data["size"] + `</td>
|
||||
</tr>`);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
"bootstrap": "^3.3.7",
|
||||
"bootstrap-colorpicker": "2.5.1",
|
||||
"bootstrap-daterangepicker": "^2.1.25",
|
||||
"bootstrap-maxlength": "1.10.0",
|
||||
"bootstrap-maxlength": "^1.10.0",
|
||||
"chart.js": "^2.7.0",
|
||||
"ckeditor4-dev": "^4.14.1",
|
||||
"components-jqueryui": "^1.12.1",
|
||||
|
@ -26,7 +26,7 @@ use Util\XML;
|
||||
|
||||
/* Per le PA EC02 e EC01 sono dei stati successivi a NE il quale a sua volta è successivo a RC. EC01 e EC02 sono definiti all'interno della ricevuta di NE che di fatto indica il rifiuto o l'accettazione. */
|
||||
$stato_fe = $database->fetchOne('SELECT * FROM fe_stati_documento WHERE codice = '.prepare($fattura->codice_stato_fe));
|
||||
$abilita_genera = (empty($fattura->codice_stato_fe) && $fattura->stato->descrizione != 'Bozza') || intval($stato_fe['is_generabile']);
|
||||
$abilita_genera = $fattura->stato->descrizione != 'Bozza' && (empty($fattura->codice_stato_fe) || intval($stato_fe['is_generabile']));
|
||||
$ricevuta_principale = $fattura->getRicevutaPrincipale();
|
||||
|
||||
if (!empty($fattura_pa)) {
|
||||
|
@ -21,12 +21,12 @@ use Plugins\PianificazioneInterventi\Promemoria;
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
$elenco_promemoria = Promemoria::doesntHave('intervento')->orderByraw("data_richiesta ASC")->get();
|
||||
$elenco_promemoria = Promemoria::doesntHave('intervento')->orderByraw('data_richiesta ASC')->get();
|
||||
|
||||
$array_promemoria = [];
|
||||
foreach($elenco_promemoria as $promemoria){
|
||||
foreach ($elenco_promemoria as $promemoria) {
|
||||
$data_pro = new Carbon($promemoria->data_richiesta);
|
||||
$array_promemoria[$data_pro->format("Y-m")][] = $promemoria;
|
||||
$array_promemoria[$data_pro->format('Y-m')][] = $promemoria;
|
||||
}
|
||||
|
||||
if ($elenco_promemoria->isEmpty()) {
|
||||
@ -53,12 +53,12 @@ foreach ($raggruppamenti as $mese => $raggruppamento) {
|
||||
$class = 'fa-plus-circle';
|
||||
}
|
||||
|
||||
$nome_mese = new Carbon($mese."-01");
|
||||
$nome_mese = new Carbon($mese.'-01');
|
||||
|
||||
echo "
|
||||
<h4>
|
||||
<a class='clickable' onclick=\"if( $('#promemoria_pianificare_".$counter."').css('display') == 'none' ){ $(this).children('i').removeClass('fa-plus-circle'); $(this).children('i').addClass('fa-minus-circle'); }else{ $(this).children('i').addClass('fa-plus-circle'); $(this).children('i').removeClass('fa-minus-circle'); } $('#promemoria_pianificare_".$counter."').slideToggle();\">
|
||||
<i class='fa ".$class."'></i> ".ucfirst($nome_mese->formatLocalized("%B %Y")).'
|
||||
<i class='fa ".$class."'></i> ".ucfirst($nome_mese->formatLocalized('%B %Y')).'
|
||||
</a>
|
||||
</h4>';
|
||||
|
||||
|
@ -19,11 +19,8 @@
|
||||
|
||||
namespace API\App\v1;
|
||||
|
||||
use API\App\AppResource;
|
||||
use API\Interfaces\RetrieveInterface;
|
||||
use API\Resource;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
|
||||
class Revisione extends Resource implements RetrieveInterface
|
||||
{
|
||||
|
@ -115,21 +115,8 @@ abstract class Component extends Model
|
||||
*/
|
||||
public function setQtaAttribute($value)
|
||||
{
|
||||
$previous = $this->qta;
|
||||
$diff = $value - $previous;
|
||||
|
||||
// Controlli su eventuale massimo per la quantità
|
||||
if ($this->hasOriginalComponent()) {
|
||||
$original = $this->getOriginalComponent();
|
||||
|
||||
// Controllo per evitare di superare la quantità totale del componente di origine
|
||||
if ($original->qta_rimanente < $diff) {
|
||||
$diff = $original->qta_rimanente;
|
||||
$value = $previous + $diff;
|
||||
}
|
||||
}
|
||||
|
||||
$this->attributes['qta'] = $value;
|
||||
list($qta, $diff) = $this->parseQta($value);
|
||||
$this->attributes['qta'] = $qta;
|
||||
|
||||
// Aggiornamento della quantità evasa di origine
|
||||
if ($this->hasOriginalComponent()) {
|
||||
@ -363,6 +350,32 @@ abstract class Component extends Model
|
||||
return $new;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifica e calcola quantità e differenziale delle quantità.
|
||||
*
|
||||
* @param $value
|
||||
*
|
||||
* @return array [nuova quantità, differenza rispetto alla quantità precedente]
|
||||
*/
|
||||
protected function parseQta($value)
|
||||
{
|
||||
$previous = $this->qta;
|
||||
$diff = $value - $previous;
|
||||
|
||||
// Controlli su eventuale massimo per la quantità
|
||||
if ($this->hasOriginalComponent()) {
|
||||
$original = $this->getOriginalComponent();
|
||||
|
||||
// Controllo per evitare di superare la quantità totale del componente di origine
|
||||
if ($original->qta_rimanente < $diff) {
|
||||
$diff = $original->qta_rimanente;
|
||||
$value = $previous + $diff;
|
||||
}
|
||||
}
|
||||
|
||||
return [$value, $diff];
|
||||
}
|
||||
|
||||
/**
|
||||
* Azione personalizzata per la copia dell'oggetto (inizializzazione della copia).
|
||||
*
|
||||
|
@ -63,7 +63,7 @@ INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `e
|
||||
(NULL, 'app-v1', 'retrieve', 'revisione', 'API\\App\\v1\\Revisione', '1')
|
||||
|
||||
-- Fix query listini
|
||||
UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM mg_prezzi_articoli\n INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica = mg_prezzi_articoli.id_anagrafica\n INNER JOIN mg_articoli ON mg_articoli.id = mg_prezzi_articoli.id_articolo\n LEFT JOIN mg_categorie AS categoria ON mg_articoli.id_categoria=categoria.id\n LEFT JOIN mg_categorie AS sottocategoria ON mg_articoli.id_sottocategoria=sottocategoria.id\nWHERE 1=1 AND mg_articoli.deleted_at IS NULL AND an_anagrafiche.deleted_at IS NULL\nHAVING 2=2\nORDER BY an_anagrafiche.ragione_sociale' WHERE `zz_modules`.`name` = 'Listini';
|
||||
UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM mg_prezzi_articoli INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica = mg_prezzi_articoli.id_anagrafica INNER JOIN mg_articoli ON mg_articoli.id = mg_prezzi_articoli.id_articolo LEFT JOIN mg_categorie AS categoria ON mg_articoli.id_categoria=categoria.id LEFT JOIN mg_categorie AS sottocategoria ON mg_articoli.id_sottocategoria=sottocategoria.id WHERE 1=1 AND mg_articoli.deleted_at IS NULL AND an_anagrafiche.deleted_at IS NULL HAVING 2=2 ORDER BY an_anagrafiche.ragione_sociale' WHERE `zz_modules`.`name` = 'Listini';
|
||||
|
||||
-- Cambiato title al plugin prezzi specifici
|
||||
UPDATE `zz_plugins` SET `title` = 'Prezzi di listino' WHERE `zz_plugins`.`name` = 'Prezzi specifici articolo';
|
||||
@ -86,4 +86,12 @@ INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`,
|
||||
((SELECT `id` FROM `zz_modules` WHERE name='Movimenti'), 'Um', 'mg_articoli.um', 5, 1, 0, 0, '', '', 0, 0, 0);
|
||||
INSERT INTO `zz_group_view` (`id_gruppo`, `id_vista`) (
|
||||
SELECT `zz_groups`.`id`, `zz_views`.`id` FROM `zz_groups`, `zz_views` INNER JOIN `zz_modules` ON `zz_views`.`id_module` = `zz_modules`.`id` WHERE `zz_modules`.`name` = 'Movimenti' AND `zz_views`.`name` = 'Um'
|
||||
);
|
||||
);
|
||||
-- Fix campo iva per Sconti di versioni precedenti
|
||||
UPDATE `co_righe_documenti` SET `iva` = ABS(`iva`) * IF(`sconto` > 0, -1, 1) WHERE `is_sconto` = 1;
|
||||
UPDATE `co_righe_preventivi` SET `iva` = ABS(`iva`) * IF(`sconto` > 0, -1, 1) WHERE `is_sconto` = 1;
|
||||
UPDATE `co_righe_contratti` SET `iva` = ABS(`iva`) * IF(`sconto` > 0, -1, 1) WHERE `is_sconto` = 1;
|
||||
UPDATE `dt_righe_ddt` SET `iva` = ABS(`iva`) * IF(`sconto` > 0, -1, 1) WHERE `is_sconto` = 1;
|
||||
UPDATE `or_righe_ordini` SET `iva` = ABS(`iva`) * IF(`sconto` > 0, -1, 1) WHERE `is_sconto` = 1;
|
||||
UPDATE `co_righe_promemoria` SET `iva` = ABS(`iva`) * IF(`sconto` > 0, -1, 1) WHERE `is_sconto` = 1;
|
||||
UPDATE `in_righe_interventi` SET `iva` = ABS(`iva`) * IF(`sconto` > 0, -1, 1) WHERE `is_sconto` = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user