1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
| var form = Ext.create('Ext.form.Panel', {
renderTo: 'form1',
title: 'RESULTAT DE VOTRE SIMULATION n°' + _countSim,
id: 'n°' + _countSim,
autoHeight: true,
collapsed: false,
collapsible: true,
closable: true,
width: 600,
bodyPadding: 10,
defaults: {
anchor: '100%',
labelWidth: 100
},
tools: [{
type: 'print',
tooltip: 'Imprimer cette simulation',
handler: function() {
var html = Ext.dom.Query.selectNode('n°' + _countSim);
alert(html);
var win = window.open('', 'Impression');
win.document.open();
win.document.write(html.outerHTML);
win.document.close();
}
}],
items: [{
xtype: 'fieldset',
title: 'Détails de la simulation',
collapsible: true,
defaults: {
labelWidth: 89,
anchor: '100%',
layout: {
type: 'hbox',
defaultMargins: {
top: 0,
right: 5,
bottom: 0,
left: 0
}
}
},
tpl: ['<ul class="details">',
'<li>Votre montant total à financer est de: <span style="color:red;"><b>{TF}</b></span> et la durée restante: <span style="color:red;"><b> {DR}</b></span> moi(s)</li>',
'<li>Gain / mois: <span style="color:green;"><b>{GM}</b></span> </li>',
'<li>Gain total: <span style="color:green;"><b>{GT}</b></span> </li>',
'</ul>'],
data: {
TF: _tf.toFixed(2),
DR: _dr,
GM: _gm.toFixed(2),
GT: _gt.toFixed(2)
}
}, {
xtype: 'fieldset',
title: 'Calcul des mensualités avec franchises',
collapsible: true,
defaults: {
labelWidth: 89,
anchor: '100%',
layout: {
type: 'hbox',
defaultMargins: {
top: 0,
right: 5,
bottom: 0,
left: 0
}
}
},
tpl: ['<ul class="details">',
'<li>Mensualité d\'amortissement hors assurance: <span style="color:green;"><b>{MSSA}</b></span> </li>',
'<li>Mensualité d\'amortissement avec assurance: : <span style="color:green;"><b>{MSAV}</b></span> </li>',
'<li>Coût mensuel de l\'assurance: <span style="color:green;"><b>{CMA}</b></span> </li>',
'</ul>'],
data: {
MSSA: Math.abs(m_.toFixed(2)),
MSAV: Math.abs(_mensassu.toFixed(2)),
CMA: _ass.toFixed(2)
}
}]
}); |
Partager