PIVOT SERVICES
Plateforme Chauffeur
'+Dhtml(x)+' ');printWin.document.close();printWin.focus();setTimeout(()=>{printWin.print();setTimeout(()=>printWin.close(),400)},250)} }catch(e){if(printWin)try{printWin.close()}catch(_){ }alert(e.message)}} function Dedit(x){Dform(x)} function DopenPrintWindow(html){ const w=window.open('','_blank','width=420,height=700'); if(!w){ alert('La fenêtre d’impression a été bloquée par le navigateur. Autorisez les fenêtres contextuelles pour ORACLE puis réessayez.'); return false; } const css=`@page{size:auto;margin:5mm}html,body{margin:0;padding:0;background:#fff}body{font-family:Arial,sans-serif;color:#111}.thermal{width:80mm;max-width:none;margin:0;padding:4mm;box-sizing:border-box;font-size:11px;line-height:1.25}.thermal.w58{width:58mm;font-size:10px;padding:3mm}.r-logo{display:block;max-width:70%;max-height:24mm;margin:0 auto 2mm;object-fit:contain}.r-center{text-align:center}.r-title{font-size:18px;font-weight:800;letter-spacing:.5px}.r-sub{font-size:10px}.r-line{border-top:1px dashed #222;margin:2.5mm 0}.r-meta{display:grid;grid-template-columns:1fr 1fr;gap:2mm;font-size:10px}.r-items{width:100%;border-collapse:collapse}.r-items th,.r-items td{padding:1.5mm 0;border-bottom:1px dotted #999;vertical-align:top}.r-items th{text-align:left}.r-items .amt{text-align:right;white-space:nowrap}.r-total{display:flex;justify-content:space-between;font-size:14px;font-weight:800;margin-top:2mm}.r-footer{text-align:center;font-size:10px;margin-top:3mm}`; w.document.open(); w.document.write('Reçu de versement'+html+' '); w.document.close(); w.focus(); setTimeout(()=>{w.print(); setTimeout(()=>w.close(),400)},250); return true; } function Dprint(){Dpreview();return DopenPrintWindow(dr_preview.innerHTML)} function DprintSaved(x){Dform(x);return DopenPrintWindow(Dhtml(x))} function Dwidth(w){document.getElementById('dr_preview').classList.toggle('w58',w===58)} function DnewReceipt(){Dform(Dnew())} window.PIVOTDriverReceipt={newReceipt:DnewReceipt,edit:Dedit,preview:Dpreview,save:Dsave,print:Dprint,printSaved:DprintSaved,width:Dwidth}; const oldShowDriver=window.show;window.show=function(m){if(m==='Reçu de versement'){document.querySelectorAll('.nav').forEach(b=>b.classList.toggle('active',b.dataset.m===m));Dform(Dnew());return}oldShowDriver(m)}; })();