Skip to content
Snippets Groups Projects
Commit 810b2b3c authored by Cosimo Antonio Volpicelli's avatar Cosimo Antonio Volpicelli
Browse files

Modifiche al 3-3-21

parent 7e612c1f
No related branches found
No related tags found
No related merge requests found
......@@ -85,19 +85,25 @@ class Settore(models.IntegerChoices):
ricerca_tecnologia = 0
didattica = 1
funzionamento =2
class Tipologia(models.IntegerChoices):
informatici = 0
largo_consumo = 1
altro = 2
class Aquisti(models.Model):
datarichiesta= models.DateField(auto_now_add=True)
datacreazione= models.DateField(auto_now_add=True)
datainvio= models.DateField(auto_now_add=True,blank=True, null=True)
descrizione = models.CharField( max_length=1000,blank=True, null=True)
motivazioneuso = models.CharField( max_length=1000,blank=True, null=True)
protocollo = models.CharField( max_length=1000,blank=True, null=True)
idrichiedente = models.IntegerField(blank=True, null=True)
idrup = models.IntegerField(blank=True, null=True)
tipologia = models.CharField(max_length=1000, blank=True, null=True)
tipologia = models.IntegerField(choices=Tipologia.choices,default=0)
settore = models.IntegerField(choices=Settore.choices,default=0)
importototale = models.DecimalField(max_digits=10, decimal_places=2,db_column='importoTotale', blank=True, null=True)
convenzione = models.IntegerField(blank=True, null=True)
nomeconvenzione = models.CharField(max_length=100, blank=True, null=True)
motivazionenonconvenzione = models.CharField( max_length=1000,blank=True, null=True)
mepa = models.IntegerField(blank=True, null=True)
"""
class StatoAcquisto(models.IntegerChoices):
......@@ -188,7 +194,7 @@ class Sede(models.Model):
managed = True
db_table = 'sede'
STATOACQUISTO= (
FLUSSOACQUISTO= (
'NUOVA',
'CREATA',
'INOLTRATA',
......@@ -207,7 +213,7 @@ STATOACQUISTO= (
'UA_RICHIESTA_NON_CONGRUA',
'UA_EMAIL_RICHIEDENTE_PRESA_IN_CARICO'
)
STATOACQUISTO = list(zip(STATOACQUISTO, STATOACQUISTO))
FLUSSOACQUISTO = list(zip(FLUSSOACQUISTO, FLUSSOACQUISTO))
class Statoaquisto(xwf_models.WorkflowEnabled,models.Model):
aquisti = models.OneToOneField(
Aquisti,
......
......@@ -7,11 +7,12 @@
<link href="{% static '/DataTables/dataTables.bootstrap5.min.css' %}" rel="stylesheet">
<link href="{% static '/datepicker/css/datepicker.css' %}" rel="stylesheet">
<!--
<link href="{% static '/smartwizard/css/smart_wizard_all.min.css' %}" rel="stylesheet">
-->
<link href="https://unpkg.com/smartwizard@5/dist/css/smart_wizard_all.min.css" rel="stylesheet" type="text/css" />
<!--
<link href="https://unpkg.com/smartwizard@5/dist/css/smart_wizard_all.min.css" rel="stylesheet" type="text/css" />
-->
{% endblock css %}
......@@ -121,7 +122,7 @@
</span> </a>
</li>
</ul>
<form>
<div class="tab-content">
<div id="step-1" class="tab-pane " role="tabpanel">
......@@ -133,7 +134,7 @@
<div class="form-group">
<button style="z-index:100" id="pollastro" type="button" data-toggle="popover" title="Info" data-html="true" data-content="Inserire parole chiave per agevolare la tracciabilità e la ricerca della richiesta di acquisto" data-original-title="Info"><span class="fa fa-1x fa-info-circle" aria-hidden="true"></span></button>
<label>Specificare un titolo breve per questo acquisto in modo da poter essere facilmente ricercato</label>
<input id="descrizione" name="descrizione" type="text" class="form-control required">
<input id="titolobreve" name="titolobreve" type="text" class="form-control required">
</div>
<div class="form-group ">
<label>Pino Torinese, il 30-05-2020 <br>
......@@ -143,7 +144,7 @@
<div class="input-group m-b">
<div class="form-check">
<input class="form-check-input" type="radio" name="settore" required>
<input class="form-check-input" type="radio" name="settore" value="ricercateconolgia" required>
<label class="form-check-label" for="pippo">
Ricerca,Trasferimento Tecnologico </label>
......@@ -152,14 +153,14 @@
<div class="input-group m-b">
<div class="form-check ">
<input class="form-check-input" type="radio" name="settore" required>
<input class="form-check-input" type="radio" value="didattica" name="settore" required>
<label class="form-check-label" for="pippo">
Didattica </label>
</div>
</div>
<div class="input-group m-b">
<div class="form-check">
<input class="form-check-input" type="radio" name="settore" required>
<input id="settore" class="form-check-input" type="radio" value="funzionamento" name="settore" required>
<label class="form-check-label" for="pippo">
Funzionamento Struttura </label>
</div>
......@@ -290,10 +291,19 @@
Avendo preso visione della normativa vigente e consapevole di quanto disposto dal DPR n. 445/2000 in tema di rilascio di false dichiarazioni,
<br> <b>Richiede di acquisire il seguente bene/servizio il cui prezzo complessivo presunto ( IVA esclusa ) e' inferiore a Euro 40.000,00</b><br>
Indicare per singolo articolo dell'ordine la quantita', il codice produttore, la descrizione ed il prezzo al netto dell'IVA trovati sul sito di acquistiinrete o nella documentazione della convenzione.
<br>
<br>
<br><br><br>
</div>
<div class="row">
<div class="col-7">
<h4>Lista Articolo/i e Prezzo/i</h4>
</div>
<div class="col-5">
<button title="Importa file xlsx" class="btn btn-success btn-xs float-right">Importa file xlsx</button>
<button title="Carica eventuali allegati " class="btn btn-success btn-xs float-right">Carica Allegati</button>
</div>
</div>
<br>
<div class="row">
<div class="col-md-1">Q.ta`</div>
......@@ -310,13 +320,14 @@
<div class="col-md-1"><input type="number" name="quantita" min="1" value="1" class="form-control" ></div>
<div class="col-md-2"><input type="text" name="codiceproduttore" placeholder="" class="form-control" ></div>
<div class="col-md-4"><input type="text" name="descrizione" placeholder="" class="form-control" ></div>
<div class="col-md-4"><input type="text" name="descrizionearticolo" placeholder="" class="form-control" ></div>
<div class="col-md-2"> <span class="input-number input-number-currency">
<input type="number" class="form-control" name="prezzo" placeholder="0,00" min="0">
<input type="number" class="form-control" name="prezzoarticolo" placeholder="0,00" min="0">
</span>
</div>
</div>
<br>
<div class="row" >
......@@ -337,7 +348,7 @@
<div class="row form-row">
<div class="col-md-4"></div>
<div class="col-md-2"> <b>Prezzo Totale </b> </div>
<div class="col-md-2"> <b>Prezzo Totale di questo acquisto <br> IVA esclusa </b> </div>
<div class="col-md-2">
<div class="input-group">
<span class="input-group-addon"></span>
......@@ -373,8 +384,7 @@
</select>
</div>
<!-- <input type="text" name="obiettivofunzione" readonly value="DESCRIZIONE" class="form-control" >
-->
</div>
<div class="col-md-2"> <div class="input-group">
<span class="input-group-addon"></span>
......@@ -386,7 +396,8 @@
<div class="col-md-1 " >
<button title="Aggiungi un nuovo Obiettivo" class="btn btn-success btn-xs add-obiettivo-row float-right"><i class="fa fa-plus-square-o"></i></button>
</div>
</div> </div>
</div>
</div>
<br/>
<div class="row form-row">
<div class="col-md-4"></div>
......@@ -406,7 +417,49 @@
</div>
<div id="step-5" class="tab-pane" role="tabpanel">
<h1>Riepilogo Acquisto</h1>
<h2>Terms and Conditions</h2>
<div class="row">
<div class="col-3">
<h2>Titolo breve per questo acquisto </h2>
</div>
<div class="col-5 titolobreve">
</div>
</div>
<div id="vueriepilogo">
<h2>Titolo breve per questo acquisto :<b> [[ titolobreve ]] </b> </h2>
<p >
<h2>Per svolgere compiti legati a : <b>[[ settore ]] </b> </h2>
<h2> per il seguente uso :<b> [[ motivazione ]] </b> </h2>
</p>
<span class="convenzione " v-if="convenzione === 'informatici'">
<h2> L'acquisto viene fatto utilizzando la convenzione/lotto : </h2>
</span>
<span class="noconvenzione d-none">
<h2> Non esiste una convenzione attiva che fornisca questo bene. </h2>
</span>
<span class="convenzionenonusabile d-none">
<h2> Esiste una convenzione attiva ma i beni/servizi presenti non sono compatibili <br> con quello/i richeisto/i per la seguente motivazione: </h2>
</span>
</div>
<div class="row">
Il bene/servizio in oggetto e' composto dai seguenti articoli:
</div>
<div class="row">
<div class="col-md-1">Q.ta`</div>
<div class="col-md-2">Codice CONSIP/MEPA</div>
<div class="col-md-4">Descrizione</div>
<div class="col-md-2">Prezzo Unitario (IVA esclusa )</div>
</div>
<div class="articolidiv ">
</div>
<input id="acceptTerms" name="acceptTerms" type="checkbox" class="required"> <label for="acceptTerms">I agree with the Terms and Conditions.</label>
</div>
......@@ -415,7 +468,10 @@
<h2>Terms and Conditions</h2>
<input id="acceptTerms" name="acceptTerms" type="checkbox" class="required"> <label for="acceptTerms">I agree with the Terms and Conditions.</label>
</div>
</div>
</form>
</div>
</div>
<!-- /page content -->
......@@ -431,10 +487,27 @@
<script src="{% static '/DataTables/dataTables.bootstrap5.min.js' %}"></script>
<script src="{% static '/datepicker/js/bootstrap-datepicker.js' %}"></script>
<script src="{% static '/smartwizard/js/jquery.smartWizard.min.js' %}"></script>
<!--
<script src="https://unpkg.com/smartwizard@5/dist/js/jquery.smartWizard.min.js" type="text/javascript"></script>
-->
<script id="articoli-riepilogo-template" type="text/x-custom-template" >
<div class="row form-row riepilogo-added-row ">
<div class="col-md-1"><input type="number" name="quantita" min="1" value="1" readonly class="form-control" ></div>
<div class="col-md-2"><input type="text" name="codiceproduttore" placeholder="" readonly class="form-control" ></div>
<div class="col-md-4"><input type="text" name="descrizionearticolo" placeholder="" readonly class="form-control" ></div>
<div class="col-md-2"> <span class="input-number input-number-currency">
<input type="number" class="form-control" name="prezzoarticolo" readonly placeholder="0,00" min="0">
</span>
</div>
</div>
</script>
<script id="hidden-template" type="text/x-custom-template" >
<div class="row ofitem">
......@@ -498,6 +571,9 @@ var app3 = new Vue({
console.log("OK",$(this).val());
if ($(this).val() == 'informatici') {
$('#informaticiPlus').removeClass("invisible").addClass("visible");
} else {
$('#informaticiPlus').removeClass("visible").addClass("invisible");
}
console.log("App3 1",app3.seen);
......@@ -581,11 +657,11 @@ function deleteObiettivo( btn) {
//newElement.find('.remove-form-row').parent().remove();
removebtn = '<div class="col-md-1" ><button class="btn btn-danger btn-xs remove-form-row"><i class="fa fa-minus-square-o"></i></button></div>';
newElement.append(removebtn);
newElement.find("input[name='prezzo']").val('0,00');
newElement.find("input[name='prezzoarticolo']").val('0,00');
newElement.find("input[name='quantita']").val('1');
newElement.find("input[name='codiceproduttore']").val('');
newElement.find("input[name='descrizione']").val('');
$(selector).after(newElement);
newElement.find("input[name='descrizionearticolo']").val('');
$('.added-row:last').after(newElement);
return false;
}
......@@ -606,7 +682,7 @@ $(document).on('click', '.calcolaTotale', function(e){
function calcolaTotale() {
//newElement.find("input[name='prezzo']").val('0,00)');
tot=0;
$('.form-row').find("input[name='prezzo']").each(function() {
$('.form-row').find("input[name='prezzoarticolo']").each(function() {
tot= tot+ ( $(this).val().length > 0 ? parseFloat($(this).val()) : 0.0 );
});
......@@ -614,6 +690,18 @@ function calcolaTotale() {
$('#prezzototaleacquisto').val(tot);
};
$(document).ready(function(){
var riepilogo = 0;
var riepilogo = new Vue({
delimiters: ['[[', ']]'],
el: '#vueriepilogo',
data: {
titolobreve: $('#titolobreve').val(),
settore: $("input[name='settore']:checked").val(),
motivazione : $('#motivazione').val(),
obfun : [],
convenzione: $("input[name='tipoacquisto']:checked").val()
}
});
// Toolbar extra buttons
var btnFinish = $('<button></button>').text('Finish')
.addClass('btn btn-info')
......@@ -622,11 +710,12 @@ var btnCancel = $('<button></button>').text('Cancel')
.addClass('btn btn-danger')
.on('click', function(){ $('#smartwizard').smartWizard("reset"); });
var myCurrentStepIndex = 0;
$('#smartwizard').smartWizard({
selected: 0, // Initial selected step, 0 = first step
theme: 'arrows', // theme for the wizard, related css need to include for other than default theme
justified: true, // Nav menu justification. true/false
darkMode:true, // Enable/disable Dark Mode if the theme supports. true/false
darkMode:false, // Enable/disable Dark Mode if the theme supports. true/false
autoAdjustHeight: false, // Automatically adjust content height
cycleSteps: false, // Allows to cycle the navigation of steps
backButtonSupport: true, // Enable the back button support
......@@ -648,7 +737,7 @@ $('#smartwizard').smartWizard({
enableAllAnchors: false, // Activates all anchors clickable all times
markDoneStep: true, // Add done state on navigation
markAllPreviousStepsAsDone: true, // When a step selected by url hash, all previous steps are marked done
removeDoneStepOnNavigateBack: false, // While navigate back done step after active step will be cleared
removeDoneStepOnNavigateBack: true, // While navigate back done step after active step will be cleared
enableAnchorOnDoneStep: true // Enable/Disable the done steps navigation
},
keyboardSettings: {
......@@ -664,6 +753,84 @@ $('#smartwizard').smartWizard({
errorSteps: [], // Highlight step with errors
hiddenSteps: [] // Hidden steps
});
// Initialize the leaveStep event
$("#smartwizard").on("leaveStep", function(e, anchorObject, currentStepIndex, nextStepIndex, stepDirection) {
//console.log("get", $("#smartwizard").steps("getCurrentStep") );
myCurrentStepIndex = currentStepIndex;
if ( stepDirection == 'forward') {
myCurrentStepIndex +=1 ;
} else {
myCurrentStepIndex -= 1 ;
}
console.log(currentStepIndex,myCurrentStepIndex,nextStepIndex);
//return confirm("Do you want to leave the step " + currentStepIndex + "?");
});
var trueStep =0;
$("#smartwizard").on("showStep", function(e, anchorObject, stepIndex, stepDirection) {
//alert("You are on step "+stepIndex+" now");
console.log("SI ->",stepIndex);
if ( stepDirection == 'forward') {
trueStep = stepIndex+1;
console.log("TrueStep ->",trueStep)
} else {
trueStep = stepIndex-1;
console.log("TrueStep ->",trueStep);
}
if (trueStep == 4 ) {
alert("step Riepilogo "+ stepIndex);
riepilogo.titolobreve= $('#titolobreve').val();
riepilogo.settore= $("input[name='settore']:checked").val();
riepilogo.motivazione = $('#motivazione').val();
riepilogo.obfun = []
let articoli=[];
$('.added-row').each(function(index){
row = {}
row['quantita'] = $(this).find("input[name='quantita']").val();
row['codiceproduttore'] = $(this).find("input[name='codiceproduttore']").val();
row['descrizionearticolo'] = $(this).find("input[name='descrizionearticolo']").val();
row['prezzoarticolo'] = $(this).find("input[name='prezzoarticolo']").val();
console.log(row);
articoli.push(row);
});
console.log(articoli);
//var newElement = $('.riepilogo-added-row:first').clone(true);
//var articoliTemplate = newElement;
//$('.riepilogo-added-row:first').remove();
$('.articolidiv').empty();
$.each(articoli,function(index,item){
var articoliTemplate = $($('#articoli-riepilogo-template').html() ) ; //$('.riepilogo-added-row:first').clone(true);
//articoliTemplate.removeClass('d-none');
//newElement.find('.remove-form-row').parent().remove();
articoliTemplate.find("input[name='prezzoarticolo']").val(articoli[index].prezzoarticolo);
articoliTemplate.find("input[name='quantita']").val(articoli[index].quantita);
articoliTemplate.find("input[name='codiceproduttore']").val(articoli[index].codiceproduttore);
articoliTemplate.find("input[name='descrizionearticolo']").val(articoli[index].descrizionearticolo);
$('.articolidiv').append(articoliTemplate);
alert(index);
})
$("input[name='prezzoobfun']").each(function(index){
console.log( index + ": " + $( this ).val() );
});
$("input[name='idobiettivofunzione']").each(function(index){
console.log( index + ": " + $( this ).val() );
});
$("input[name='capitolo']").each(function(index){
console.log( index + ": " + $( this ).val() );
});
//console.log('POLLO',$("input[name='capitolo']").val());
}
console.log(stepDirection);
});
var obiettivifun=[]
{% for one in ob_fun %}
j={'id':{{one.id}},'of':'{{one.obiettivofunzione}}','descr': '{{one.descrizione}}',
......@@ -706,6 +873,7 @@ $('#smartwizard').smartWizard({
console.log($(this).closest(".ofitem").find("input[name='capitolo']")) ; //.closest("input")); //[name='capitolo'").val('pollo'); //find("input[name='idobiettivofunzione'").val('POLLO');
$(this).closest(".ofitem").find("input[name='capitolo']").val(obiettivifun[$(this).val()].of);
$(this).closest(".ofitem").find("input[name='responsabilefondiobfun']").val(obiettivifun[$(this).val()].responsabile);
$(this).closest(".ofitem").find("input[name='idobiettivofunzione']").val(obiettivifun[$(this).val()].id);
})
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment