mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Aggiunta data ricezione in fase di import fatture di acquisto
Migliorie minori
This commit is contained in:
@@ -87,7 +87,7 @@ if (Auth::check()) {
|
|||||||
result = JSON.parse(data);
|
result = JSON.parse(data);
|
||||||
|
|
||||||
$("#hook-loader-" + hook.id).remove();
|
$("#hook-loader-" + hook.id).remove();
|
||||||
message = \'<li class="hook-element"><a href="\' + (result.link ? result.link : "#") + \'"><i class="\' + result.icon + \'"></i> \' + result.message + \'</a></li>\';
|
message = \'<li class="hook-element"><a href="\' + (result.link ? result.link : "#") + \'"><i class="\' + result.icon + \'"></i><span class="small" > \' + result.message + \'</span></a></li>\';
|
||||||
|
|
||||||
// Inserimento della notifica
|
// Inserimento della notifica
|
||||||
if(result.notify) {
|
if(result.notify) {
|
||||||
|
@@ -367,43 +367,48 @@ if ($vista == 'mese') {
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function load_interventi_da_pianificare(mese){
|
||||||
|
|
||||||
|
if (mese == undefined){
|
||||||
|
// Seleziono il mese corrente per gli interventi da pianificare
|
||||||
|
var date = new Date();
|
||||||
|
var mese;
|
||||||
|
date.setDate(date.getDate());
|
||||||
|
|
||||||
$('#select-intreventi-pianificare').change(function(){
|
//Note: January is 0, February is 1, and so on.
|
||||||
var mese = $(this).val();
|
mese = ('0' + (date.getMonth()+1)).slice(-2) + date.getFullYear();
|
||||||
$.get( '<?php echo $rootdir; ?>/modules/dashboard/actions.php', { op: 'load_intreventi', mese: mese }, function(data){
|
|
||||||
$('#interventi-pianificare').html(data);
|
$('#select-intreventi-pianificare option[value='+mese+']').attr('selected','selected').trigger('change');
|
||||||
$('#external-events .fc-event').each(function() {
|
}
|
||||||
|
|
||||||
|
$('#interventi-pianificare').html('<center><br><br><i class=\'fa fa-refresh fa-spin fa-2x fa-fw\'></i></center>');
|
||||||
|
$.get( '<?php echo $rootdir; ?>/modules/dashboard/actions.php', { op: 'load_intreventi', mese: mese }, function(data){
|
||||||
|
|
||||||
|
})
|
||||||
|
.done(function( data ) {
|
||||||
|
$('#interventi-pianificare').html(data);
|
||||||
|
$('#external-events .fc-event').each(function() {
|
||||||
$(this).draggable({
|
$(this).draggable({
|
||||||
zIndex: 999,
|
zIndex: 999,
|
||||||
revert: true,
|
revert: true,
|
||||||
revertDuration: 0
|
revertDuration: 0
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
$('#select-intreventi-pianificare').change(function(){
|
||||||
|
var mese = $(this).val();
|
||||||
|
load_interventi_da_pianificare(mese);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Seleziono il mese corrente per gli interventi da pianificare
|
|
||||||
var date = new Date();
|
|
||||||
var mese;
|
load_interventi_da_pianificare();
|
||||||
date.setDate(date.getDate());
|
|
||||||
|
|
||||||
//Note: January is 0, February is 1, and so on.
|
|
||||||
mese = ('0' + (date.getMonth()+1)).slice(-2) + date.getFullYear();
|
|
||||||
|
|
||||||
$('#select-intreventi-pianificare option[value='+mese+']').attr('selected','selected').trigger('change');
|
|
||||||
|
|
||||||
$.get( '<?php echo $rootdir; ?>/modules/dashboard/actions.php', { op: 'load_intreventi', mese: mese }, function(data){
|
|
||||||
$('#interventi-pianificare').html(data);
|
|
||||||
$('#external-events .fc-event').each(function() {
|
|
||||||
$(this).draggable({
|
|
||||||
zIndex: 999,
|
|
||||||
revert: true,
|
|
||||||
revertDuration: 0
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// Comandi seleziona tutti
|
// Comandi seleziona tutti
|
||||||
$('#selectallstati').click(function(event) {
|
$('#selectallstati').click(function(event) {
|
||||||
|
@@ -52,6 +52,7 @@ switch (filter('op')) {
|
|||||||
'id_pagamento' => post('pagamento'),
|
'id_pagamento' => post('pagamento'),
|
||||||
'id_segment' => post('id_segment'),
|
'id_segment' => post('id_segment'),
|
||||||
'id_tipo' => post('id_tipo'),
|
'id_tipo' => post('id_tipo'),
|
||||||
|
'data_ricezione' => post('data_ricezione'),
|
||||||
'articoli' => post('articoli'),
|
'articoli' => post('articoli'),
|
||||||
'iva' => post('iva'),
|
'iva' => post('iva'),
|
||||||
'conto' => post('conto'),
|
'conto' => post('conto'),
|
||||||
|
@@ -82,6 +82,14 @@ echo '
|
|||||||
</div>
|
</div>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
|
// Data ricezione
|
||||||
|
echo '
|
||||||
|
<div class="row" >
|
||||||
|
<div class="col-md-6">
|
||||||
|
{[ "type": "date", "label": "'.tr('Data ricezione').'", "name": "data_ricezione", "required": 0, "value": "" ]}
|
||||||
|
</div>
|
||||||
|
</div>';
|
||||||
|
|
||||||
// Blocco DatiPagamento è valorizzato (opzionale)
|
// Blocco DatiPagamento è valorizzato (opzionale)
|
||||||
$pagamenti = $fattura_pa->getBody()['DatiPagamento'];
|
$pagamenti = $fattura_pa->getBody()['DatiPagamento'];
|
||||||
if (!empty($pagamenti)) {
|
if (!empty($pagamenti)) {
|
||||||
|
@@ -266,7 +266,7 @@ class FatturaElettronica
|
|||||||
*
|
*
|
||||||
* @return Fattura
|
* @return Fattura
|
||||||
*/
|
*/
|
||||||
public function saveFattura($id_pagamento, $id_sezionale, $id_tipo)
|
public function saveFattura($id_pagamento, $id_sezionale, $id_tipo, $data_ricezione)
|
||||||
{
|
{
|
||||||
$anagrafica = $this->saveAnagrafica();
|
$anagrafica = $this->saveAnagrafica();
|
||||||
|
|
||||||
@@ -287,7 +287,10 @@ class FatturaElettronica
|
|||||||
|
|
||||||
// Per il destinatario, la data di ricezione della fattura assume grande rilievo ai fini IVA, poiché determina la decorrenza dei termini per poter esercitare il diritto alla detrazione.
|
// Per il destinatario, la data di ricezione della fattura assume grande rilievo ai fini IVA, poiché determina la decorrenza dei termini per poter esercitare il diritto alla detrazione.
|
||||||
// La data di ricezione della fattura è contenuta all’interno della “ricevuta di consegna” visibile al trasmittente della stessa.
|
// La data di ricezione della fattura è contenuta all’interno della “ricevuta di consegna” visibile al trasmittente della stessa.
|
||||||
$fattura->data_ricezione = $dati_generali['Data'];
|
if (empty($data_ricezione))
|
||||||
|
$fattura->data_ricezione = $dati_generali['Data'];
|
||||||
|
else
|
||||||
|
$fattura->data_ricezione = $data_ricezione;
|
||||||
|
|
||||||
$stato_documento = StatoFattura::where('descrizione', 'Emessa')->first();
|
$stato_documento = StatoFattura::where('descrizione', 'Emessa')->first();
|
||||||
$fattura->stato()->associate($stato_documento);
|
$fattura->stato()->associate($stato_documento);
|
||||||
@@ -328,7 +331,7 @@ class FatturaElettronica
|
|||||||
|
|
||||||
public function save($info = [])
|
public function save($info = [])
|
||||||
{
|
{
|
||||||
$this->saveFattura($info['id_pagamento'], $info['id_segment'], $info['id_tipo']);
|
$this->saveFattura($info['id_pagamento'], $info['id_segment'], $info['id_tipo'], $info['data_ricezione']);
|
||||||
|
|
||||||
$this->saveRighe($info['articoli'], $info['iva'], $info['conto'], $info['movimentazione']);
|
$this->saveRighe($info['articoli'], $info['iva'], $info['conto'], $info['movimentazione']);
|
||||||
|
|
||||||
|
@@ -24,13 +24,19 @@ class InvoiceHook extends HookManager
|
|||||||
});
|
});
|
||||||
|
|
||||||
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
||||||
|
|
||||||
|
if ($count>0){
|
||||||
|
$message = tr('Ci sono _NUM_ fatture passive da importare', [
|
||||||
|
'_NUM_' => $count,
|
||||||
|
]);
|
||||||
|
}else{
|
||||||
|
$message = tr('Nessuna fattura passiva da importare');
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'icon' => 'fa fa-file-text-o',
|
'icon' => 'fa fa-file-text-o',
|
||||||
'link' => $link,
|
'link' => $link,
|
||||||
'message' => tr('Ci sono _NUM_ fatture remote da importare', [
|
'message' => $message,
|
||||||
'_NUM_' => $count,
|
|
||||||
]),
|
|
||||||
'notify' => !empty($count),
|
'notify' => !empty($count),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -24,14 +24,21 @@ class ReceiptHook extends HookManager
|
|||||||
});
|
});
|
||||||
|
|
||||||
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
||||||
|
|
||||||
return [
|
if ($count>0){
|
||||||
'icon' => 'fa fa-dot-circle-o',
|
$message = tr('Ci sono _NUM_ ricevute da importare', [
|
||||||
'link' => $link,
|
'_NUM_' => $count,
|
||||||
'message' => tr('Ci sono _NUM_ ricevute da importare', [
|
]);
|
||||||
'_NUM_' => $count,
|
}else{
|
||||||
]),
|
$message = tr('Nessuna ricevuta da importare');
|
||||||
'notify' => !empty($count),
|
}
|
||||||
];
|
|
||||||
|
return [
|
||||||
|
'icon' => 'fa fa-ticket',
|
||||||
|
'link' => $link,
|
||||||
|
'message' => $message,
|
||||||
|
'notify' => !empty($count),
|
||||||
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user