';
if(meta.logo)h=h.replace(/const LOGO='[^']*';/,()=>'const LOGO='+JSON.stringify(meta.logo)+';');
const sf=x=>String(x==null?'':x).replace(/\\/g,'/').replace(/"/g,'”').replace(/'/g,'’').replace(/`/g,'´').replace(//g,'>').replace(/\$\{/g,'${').replace(/[\u2028\u2029]/g,' ');
const ln=x=>String(x||'').split(/\r?\n/).map(sf).join(' ');
const rep={'__SHOP__':sf(meta.name).replace(/\r?\n/g,' '),'__PHONE__':sf(meta.phone||''),'__ADDR__':sf(meta.address||''),'__DOC__':sf(meta.doctor||meta.name),'__DEG__':ln(meta.degree),'__DOCUR__':sf(meta.doctorUr||meta.doctor||''),'__DEGUR__':ln(meta.degreeUr)};
for(const k in rep)h=h.split(k).join(rep[k]);return applyTheme(h,meta.theme)}
const THEMES=[['green','#0d7a5f','#0a5c47','#0f172a'],['blue','#2563eb','#1d4ed8','#0f172a'],['purple','#7c3aed','#6d28d9','#1e1b4b'],['red','#dc2626','#b91c1c','#27272a'],['orange','#ea580c','#c2410c','#292524'],['teal','#0e7490','#155e75','#083344'],['pink','#db2777','#be185d','#2a1022'],['black','#334155','#1e293b','#020617']];
function applyTheme(h,th){if(!th)return h;const m1=h.match(/',``):h}
async function mountApp(tid,user,imp){
const meta=ACC.tenants[tid];if(!meta)return;
HUB.ctx={tid,meta,user,imp:!!imp,noSave:false};
HUB.allowed=allowedFor(meta,imp?null:user);
HUB.can=k=>{if(k==='_del'){if(imp)return true;if(!(meta.delOK||meta.own))return false;if(!user||user.role!=='staff')return true;return !!(user.perms&&user.perms[k])}if(imp)return true;if(!user||user.role!=='staff')return true;return !!(user.perms&&user.perms[k])};
try{await cloudBeforeMount(tid)}catch(e){}
HUB.tdb=meta.type==='pharmacy'?null:await KV.get('t_'+tid);
if(meta.type==='lab'&&LANG!=='en'){LANG='en';try{localStorage.setItem('demoLang','en')}catch(e){}try{renderChrome()}catch(e){}}
remountApp();if(!imp&&user&&user.role==='staff'&&!allPageIds(meta.type).some(id=>user.perms&&user.perms[id]))setTimeout(()=>{try{atOpen()}catch(e){}},700)}
function remountApp(){const f=$('#appFrame');if(!f||!HUB.ctx)return;f.srcdoc=moduleHtml(HUB.ctx.meta)}
function unmountApp(){HUB.flush();HUB.ctx=null;HUB.tdb=null;const f=$('#appFrame');if(f)f.srcdoc=''}
/* ---------- login ---------- */
let _fails=0,_lock=0;
async function doLogin(id,pw){
id=normId(id);if(!id||!pw)return {err:t('Enter ID and password|آئی ڈی اور پاس ورڈ لکھیں')};
if(Date.now()<_lock)return {err:t('Too many tries — wait a few seconds|بہت کوششیں — چند سیکنڈ رکیں')};
const bad=()=>{_fails++;if(_fails>=5){_lock=Date.now()+20000;_fails=0}return {err:t('Wrong ID or password|آئی ڈی یا پاس ورڈ غلط ہے')}};
if(!ACC)return {err:t('No account on this device. Open your account file or start a free trial.|اس ڈیوائس پر کوئی اکاؤنٹ نہیں۔ اپنی اکاؤنٹ فائل کھولیں یا مفت ٹرائل شروع کریں۔')};
if(ACC.owner&&id===ACC.owner.id){const h=await hashPw(pw,ACC.owner.salt);if(h!==ACC.owner.hash)return bad();_fails=0;return {ok:'owner'}}
const u=allUsers().find(x=>x.id===id);if(!u)return bad();
const h=await hashPw(pw,u.salt);if(h!==u.hash)return bad();_fails=0;
return {ok:'user',user:u}}
/* ===== Naveed Business Softwares — screens ===== */
let SCR='load',SESS=null; // SESS={k:'owner'|'user',uid,imp:tid}
const OWNER_DEFAULT={name:'Muhammad Anwar Lehri',phone:'0336-3838047'};
function toast(msg,kind){const b=$('#toast');const d=document.createElement('div');d.className=kind||'';d.textContent=msg;b.appendChild(d);setTimeout(()=>d.remove(),kind==='err'?5000:2600)}
function hm(o){const ov=document.createElement('div');ov.className='hov';ov.innerHTML=`
`;
/* ---------- boot ---------- */
async function boot(){
renderChrome();showScr('load');loadingTxt();await KV.open();ACC=await KV.get('acc');if(ACC&&ACC.users){let _pm=0;Object.values(ACC.users).forEach(x=>{if('pwv' in x){delete x.pwv;_pm=1}});if(_pm)KV.set('acc',ACC)}await loadPub();
await cloudInit();
if(/[?&]report/.test(location.search)){showScr('portal');renderPortal();return}
const QTR=new URLSearchParams(location.search).get('trial');const QCH=new URLSearchParams(location.search).get('chat');if(/[?&]embed=1/.test(location.search))document.documentElement.classList.add('emb');
if(!ACC){if(new URLSearchParams(location.search).has('owner')){showScr('setup');renderSetup();return}showScr('login');renderLogin();if(QTR&&BUS[QTR])trialForm(QTR);else if(QCH!==null)pubChat(BUS[QCH]||QCH==='news'?QCH:'');return}
let s=null;try{s=JSON.parse(localStorage.getItem('shp_sess')||'null')}catch(e){}
if(s&&s.k==='owner'){SESS={k:'owner'};return goOwner()}
if(s&&s.k==='user'){const u=ACC.users[s.uid];if(u&&u.status==='active'){SESS={k:'user',uid:u.uid};return enterTenant(u)}}
showScr('login');renderLogin();if(new URLSearchParams(location.search).has('owner'))ownerHelp();else if(QTR&&BUS[QTR])trialForm(QTR);else if(QCH!==null)pubChat(BUS[QCH]||QCH==='news'?QCH:'')}
function saveSess(){try{if(SESS)localStorage.setItem('shp_sess',JSON.stringify({k:SESS.k,uid:SESS.uid}));else localStorage.removeItem('shp_sess')}catch(e){}}
function logout(){closeAll();HUB.flush();if(SESS&&SESS.k==='user'){CL.u=null;clSave()}unmountApp();SESS=null;saveSess();showScr('login');renderLogin()}
/* ---------- first-run setup (owner account) ---------- */
function renderSetup(){$('#scr-setup').innerHTML=`
${brandBlock()}
${t('Welcome — set up the Owner account|خوش آمدید — اونر اکاؤنٹ بنائیں')}
${t('This is done only once. The Owner controls every customer.|یہ صرف ایک بار ہوتا ہے۔ اونر ہر کسٹمر کو کنٹرول کرتا ہے۔')}
${langBtn()}
`}
async function doSetup(){const n=$('#so_n').value.trim(),p=$('#so_p').value.trim(),i=normId($('#so_i').value),a=$('#so_a').value,b=$('#so_b').value,e=$('#so_e');
if(!n||!validId(i)){e.textContent=t('Enter name and a valid ID (3-30 letters/numbers)|نام اور درست آئی ڈی لکھیں (3-30 حروف/ہندسے)');return}
if(a.length<6){e.textContent=t('Password too short|پاس ورڈ چھوٹا ہے');return}if(a!==b){e.textContent=t('Passwords do not match|پاس ورڈ مختلف ہیں');return}
const salt=newSalt();ACC={v:1,owner:{id:i,name:n,phone:p,salt,hash:await hashPw(a,salt)},tenants:{},users:{},logs:[]};const rc=await makeRecovery();await accSave();SESS={k:'owner'};saveSess();goOwner();showRecovery(rc)}
/* ---------- login ---------- */
/* ---------- patient report portal ---------- */
let PR=null;
function renderPortal(){const v=($('#pr_i')||{}).value||'',w=($('#pr_p')||{}).value||'';
$('#scr-portal').innerHTML=`
${brandBlock()}
📄 ${t('View my lab report|میری لیب رپورٹ دیکھیں')}
${t('Enter the Report ID and Password printed on your receipt.|رسید پر چھپی ہوئی رپورٹ آئی ڈی اور پاس ورڈ لکھیں۔')}
`}
async function openReport(){const id=($('#pr_i').value||'').trim().toUpperCase(),pw=($('#pr_p').value||'').trim(),e=$('#pr_e');e.textContent='';PR=null;$('#pr_r').innerHTML='';
const reps=(await KV.get('reps'))||{};let R=reps[id];if(!R)R=await cloudGetRep(id);await new Promise(r=>setTimeout(r,600));
if(!R&&!online()){e.textContent=t('No internet — please connect and try again.|انٹرنیٹ نہیں ہے — انٹرنیٹ چلا کر دوبارہ کوشش کریں۔');return}
if(!R||await hashPw(pw,R.salt)!==R.hash){e.textContent=t('Wrong ID or password. If the report was just made, wait a minute and try again.|آئی ڈی یا پاس ورڈ غلط ہے۔ اگر رپورٹ ابھی بنی ہے تو ایک منٹ بعد دوبارہ کوشش کریں۔')+(KV.db&&!Object.keys(reps).length?' — '+t('(no reports on this device yet)|(اس ڈیوائس پر ابھی کوئی رپورٹ نہیں)'):'');return}
if(!R.html){const done=R.status==='ready'||R.status==='delivered';if(done&&+R.due>0){const m=LANG==='ur'?`آپ کی رپورٹ تیار ہے، مگر آپ کے ذمے ${fmtMoney(R.due)} روپے بقایا ہیں۔ براہ کرم لیب تشریف لا کر بقایا جات ادا کریں اور اپنی رپورٹ وصول کریں۔ شکریہ`:`Your report is ready, but a balance of Rs ${fmtMoney(R.due)} is due. Please visit the lab, pay the balance and collect your report. Thank you.`;e.textContent=m;return}e.textContent=t('Your report is not ready yet. Please check again later.|آپ کی رپورٹ ابھی تیار نہیں ہوئی۔ کچھ دیر بعد دیکھیں۔');return}
PR=`
${esc(R.lab||'')} — ${esc(R.patient||'')}
`;$('#pr_r').innerHTML=PR}
function renderLogin(){const v=($('#li_i')||{}).value||new URLSearchParams(location.search).get('id')||'';$('#scr-login').innerHTML=`
`;setTimeout(welcomeBubble,1200)}
let _lt=[];function logoTap(){const n=Date.now();_lt=_lt.filter(x=>n-x<1600);_lt.push(n);if(_lt.length>=3){_lt=[];ownerHelp()}}
function ownerHelp(){hm({title:'👑 '+t('Owner & account file|اونر اور اکاؤنٹ فائل'),body:`
${t('This is only for the software owner. Customers just log in with their own ID.|یہ صرف سوفٹ ویئر کے مالک کے لیے ہے۔ کسٹمر اپنی آئی ڈی سے لاگ اِن کریں۔')}
${ACC&&ACC.owner&&ACC.owner.id?'':``}
`})}
async function submitLogin(){const e=$('#li_e');e.textContent='';const id0=normId($('#li_i').value),pw0=$('#li_p').value;let r=null;
if(id0&&pw0&&!(ACC&&ACC.owner&&id0===ACC.owner.id)){const c=await cloudLogin(id0,pw0);if(c&&c.err){e.textContent=c.err;return}if(c&&c.user)r={ok:'user',user:c.user}}
if(!r){r=await doLogin(id0,pw0);if(r.err){e.textContent=r.err;return}if(r.ok==='owner')cloudSilent('',pw0,true);else if(r.ok==='user')cloudSilent(id0,pw0,false)}
if(r.ok==='owner'){SESS={k:'owner'};saveSess();goOwner()}else{if(r.user.status!=='active'){e.textContent=t('This ID is switched off|یہ آئی ڈی بند ہے');return}SESS={k:'user',uid:r.user.uid};saveSess();let rc=null;if(!r.user.rec&&!r.user.fuid){const U=ACC.users[r.user.uid];if(U){const c=genRecCode(),s=newSalt();U.rec={salt:s,hash:await hashPw(normRec(c),s),at:Date.now()};await accSave();rc=c}}enterTenant(r.user);if(rc)setTimeout(()=>showRecovery(rc,true),1500)}}
/* ---------- customer session ---------- */
function tenantState(meta){if(meta.status==='blocked')return 'blocked';if(daysLeft(meta)<0)return 'expired';return 'ok'}
function renderBlocked(){const _m=SESS&&SESS.tid&&ACC&&ACC.tenants[SESS.tid];if(_m&&_m.trial&&_m.status!=='blocked'&&daysLeft(_m)<0){$('#scr-blocked').innerHTML=`
⌛
${t('Your free trial has ended|آپ کا مفت ٹرائل ختم ہو گیا')}
${t('Your data is safe. Choose a plan to continue, or download your data.|آپ کا ڈیٹا محفوظ ہے۔ جاری رکھنے کے لیے پلان لیں، یا اپنا ڈیٹا ڈاؤن لوڈ کریں۔')}
${st==='expired'?t('Your software has expired|آپ کے سوفٹ ویئر کی مدت ختم ہو گئی'):t('This account is blocked|یہ اکاؤنٹ بند ہے')}
${st==='expired'?t('Please renew your subscription to continue.|جاری رکھنے کے لیے تجدید کروائیں۔'):t('Please contact the software owner.|براہِ کرم سوفٹ ویئر کے مالک سے رابطہ کریں۔')}
`}
function enterTenant(user,imp){const meta=ACC.tenants[user.tid];if(!meta){toast(t('Customer not found|کسٹمر نہیں ملا'),'err');return logout()}
SESS=Object.assign(SESS||{},{tid:user.tid,imp:!!imp});
if(!imp&&tenantState(meta)!=='ok'){showScr('blocked');renderBlocked();return}
if(!imp&&meta.mode&&meta.mode.run==='online'&&!navigator.onLine){SESS.need='net';showScr('blocked');renderBlocked();return}
if(SESS)delete SESS.need;
showScr('app');renderBar();mountApp(user.tid,user,imp)}
function renderBar(){const u=SESS.imp?null:ACC.users[SESS.uid];const meta=ACC.tenants[SESS.tid];if(!meta)return;const imp=SESS.imp,isAdmin=imp||(u&&u.role==='admin');
const logo=meta.logo||BUS_ICON[meta.type]||ICON;const dl=daysLeft(meta);
let ban='';
if(meta.trial&&!imp){const d=daysLeft(meta);ban+=`
⏳ ${LANG==='ur'?`آپ کا ٹرائل بیس باقی ${Math.max(0,d)} دن میں ختم ہو جائے گا`:`Your trial ends in ${Math.max(0,d)} day${d===1?'':'s'}`}
`}
if(PUB&&PUB.ann&&!imp)ban+=`
📢 ${esc(PUB.ann)}
`;
if(imp&&!meta.own)ban+=`
🔓 ${t('Owner view — you opened this ID without a password|اونر ویو — آپ نے یہ آئی ڈی بغیر پاس ورڈ کھولی ہے')}${tenantState(meta)!=='ok'?' · '+(meta.status==='blocked'?t('BLOCKED|بلاک'):t('EXPIRED|ختم'))+'':''}
`;
else if(!meta.trial&&dl<=5&&dl>=0&&meta.expiry⚠ ${LANG==='ur'?`آپ کے سوفٹ ویئر کی مدت ${fmtDate(meta.expiry)} کو ختم ہو جائے گی (${dl} دن باقی) — پریشانی سے بچنے کے لیے ادائیگی کر دیں۔ رابطہ: ${esc(ACC.owner.phone||'')}`:`Your software expires on ${fmtDate(meta.expiry)} (${dl} day${dl===1?'':'s'} left) — please pay to avoid interruption. Contact: ${esc(ACC.owner.phone||'')}`}`;
if(meta.offer&&meta.offer!==meta.ver&&!imp)ban+=`
🔔 ${t('A new update is available|نیا اپ ڈیٹ دستیاب ہے')}: v${meta.offer} ${isAdmin?` ${t('What is new?|کیا نیا ہے؟')}`:t('— ask your admin to update|— اپنے ایڈمن سے اپ ڈیٹ کروائیں')}
${meta.mode&&meta.mode.store&&meta.mode.store!=='device'?'💾 '+t('On device (online save not connected yet)|ڈیوائس پر (آن لائن سیو ابھی جڑا نہیں)'):'💾 '+t('Saved on this device|اس ڈیوائس پر محفوظ')}
${imp&&meta.own?``:''}${!imp?``:''}${imp?``:''}
${ban}`;custBackupBar().then(h=>{if(h&&!document.getElementById('cbkBan'))$('#appBar').insertAdjacentHTML('beforeend',h)});setTimeout(()=>{try{atBoot()}catch(e){}},300)}
function barMenu(ev){ev.stopPropagation();const meta=ACC.tenants[SESS.tid],imp=SESS.imp,u=imp?null:ACC.users[SESS.uid],isAdmin=imp||(u&&u.role==='admin');
const items=[];if(isAdmin)items.push([`👥 ${t('Staff & permissions|عملہ اور اجازتیں')}`,`staffModal('${meta.tid}')`]);
if(imp)items.push([`🔄 ${t('Send update to this customer|اس کسٹمر کو اپ ڈیٹ بھیجیں')}`,`updateModal('${meta.tid}')`],[`✏ ${t('Edit customer details|کسٹمر کی تفصیل بدلیں')}`,`custForm('${meta.tid}')`],[`🧹 ${t('Wash data (test data)|ڈیٹا کی صفائی (ٹیسٹ ڈیٹا)')}`,`washDlg('${meta.tid}')`]);
else{items.push([`🔑 ${t('Change my password|میرا پاس ورڈ بدلیں')}`,`pwModal('${u.uid}')`],[`💬 ${t('Chat with owner|اونر سے چیٹ')}`,`chatModal()`],[`ℹ ${t('My subscription|میری سبسکرپشن')}`,`subModal()`],[`💰 ${t('Prices & plans|قیمتیں اور پلان')}`,`plansModal()`],[`🔑 ${t('Activate / renew with code|کوڈ سے فعال / تجدید')}`,`activateModal()`],[`🆘 ${t('Report a problem (WhatsApp)|مسئلہ بتائیں (واٹس ایپ)')}`,`supportWA2()`],[`⬇ ${t('Download my data backup|میرے ڈیٹا کا بیک اپ')}`,`exportMyData()`],[`🔄 ${t('Software version|سوفٹ ویئر ورژن')}`,`showNotes()`]);}
items.push([`🔃 ${t('Reload software|سوفٹ ویئر ری لوڈ')}`,'remountApp()']);
if(!imp)items.push([`🚪 ${t('Logout|لاگ آؤٹ')}`,'logout()']);else items.push([`⬅ ${t('Back to owner panel|اونر پینل میں واپس')}`,'backToOwner()']);
const m=document.createElement('div');m.className='menu';m.innerHTML=items.map(i=>``).join('');const b=ev.target.closest('button').getBoundingClientRect();document.body.appendChild(m);m.style.top=(b.bottom+4)+'px';if(LANG==='ur')m.style.left=Math.max(6,b.left)+'px';else m.style.right=Math.max(6,innerWidth-b.right)+'px';setTimeout(()=>document.addEventListener('click',()=>m.remove(),{once:true}),0)}
function subModal(){const m=ACC.tenants[SESS.tid];hm({title:'ℹ '+t('My subscription|میری سبسکرپشن'),body:`
${t('Alert sent|بھیجا گیا الرٹ')}${m.offer?'v'+m.offer:'—'}
${newer.length?`
${t('Choose version to send|بھیجنے کا ورژن چنیں')}
${newer.map(v=>`
${notesOf(m.type,v).map(x=>`
${esc(x)}
`).join('')}
`).join('')}`:`
✅ ${t('This customer is already on the latest version.|یہ کسٹمر تازہ ترین ورژن پر ہے۔')}
`}`,
foot:(newer.length?``:'')+(m.offer?``:'')})}
async function sendUpdate(tid,force){const m=ACC.tenants[tid];const r=$('input[name=uv]:checked');if(!r)return;const v=r.value;if(force){m.ver=v;m.offer='';m.updated=Date.now()}else m.offer=v;await accSave();closeAll();toast(force?t('Updated ✅|اپ ڈیٹ مکمل ✅'):t('Update alert sent ✅|اپ ڈیٹ الرٹ بھیج دیا ✅'),'ok');if(SCR==='app'){renderBar();if(force)remountApp()}else renderOwner()}
async function cancelOffer(tid){ACC.tenants[tid].offer='';await accSave();closeAll();SCR==='app'?renderBar():renderOwner()}
function bulkUpdateModal(){const rows=Object.keys(BUS).map(ty=>{const ts=Object.values(ACC.tenants).filter(m=>m.type===ty);const lv=latestVer(ty);const old=ts.filter(m=>verCmp(m.ver,lv)<0);return {ty,ts,lv,old}}).filter(r=>r.ts.length);
hm({title:'🔄 '+t('Updates for all customers|تمام کسٹمرز کے لیے اپ ڈیٹ'),wide:true,body:rows.length?rows.map(r=>`
${t('Create a login for each cashier and choose exactly which parts of the software they can use.|ہر کیشئر کی الگ آئی ڈی بنائیں اور طے کریں کہ وہ سوفٹ ویئر کے کون سے حصے استعمال کر سکتا ہے۔')}
${t('What can this cashier use?|یہ کیشئر کیا استعمال کر سکتا ہے؟')}
${u?'':`
${t('A new staff member can use only Attendance. Tick every other function by hand.|نیا عملہ صرف حاضری استعمال کر سکتا ہے۔ باقی ہر فنکشن اپنے ہاتھ سے ٹِک کریں۔')}
`,
foot:``})}
async function saveStaff(tid,uidv){const m=ACC.tenants[tid],n=$('#sf_n').value.trim(),i=normId($('#sf_i').value),p=$('#sf_p').value,e=$('#sf_e');const perms=readPerms($('#sf_g'));
if(!n){e.textContent=t('Enter name|نام لکھیں');return}
if(uidv){const u=ACC.users[uidv];u.name=n;u.perms=perms;if(p){if(p.length<6){e.textContent=t('Password min 6|پاس ورڈ کم از کم 6');return}u.salt=newSalt();u.hash=await hashPw(p,u.salt);await cloudNewUser(u,p,true)}await accSave();toast(t('Saved ✅|محفوظ ✅'),'ok');closeAll();staffModal(tid);return}
if(!validId(i)){e.textContent=t('ID: 3-30 letters/numbers|آئی ڈی: 3-30 حروف/ہندسے');return}if(idTaken(i)){e.textContent=t('This ID is already used|یہ آئی ڈی پہلے سے استعمال میں ہے');return}if(!p||p.length<6){e.textContent=t('Password min 6|پاس ورڈ کم از کم 6');return}
const u=await mkUser({id:i,name:n,tid,role:'staff',pw:p,perms});ACC.users[u.uid]=u;await cloudNewUser(u,p);await accSave();toast(t('Staff created ✅ — now enter bio-data (photo, name, post, location) to activate attendance|عملہ بن گیا ✅ — اب بائیو ڈیٹا (تصویر، عہدہ، لوکیشن) بھریں تاکہ حاضری فعال ہو')+' — '+i+' / '+p,'ok');closeAll();staffModal(tid);try{await atLoad(tid);atBioForm(u.uid)}catch(e){}}
async function toggleUser(u,tid){ACC.users[u].status=ACC.users[u].status==='active'?'off':'active';await accSave();closeAll();staffModal(tid)}
async function delUser(u,tid){if(!confirm(t('Delete this cashier?|یہ کیشئر حذف کریں؟')))return;const du=ACC.users[u];if(du&&du.fuid)try{await fsDel('users/'+du.fuid)}catch(e){}delete ACC.users[u];await accSave();closeAll();staffModal(tid)}
const genPw=()=>{const c='abcdefghjkmnpqrstuvwxyz23456789';let s='';for(let i=0;i<7;i++)s+=c[Math.floor(Math.random()*c.length)];return s};
function pwModal(uidv){const own=uidv==='owner';hm({title:'🔑 '+t('Change password|پاس ورڈ بدلیں'),body:``,foot:``})}
async function savePw(uidv){const e=$('#pw_e'),o=uidv==='owner'?ACC.owner:ACC.users[uidv];const c=await hashPw($('#pw0').value,o.salt);if(c!==o.hash){e.textContent=t('Current password is wrong|موجودہ پاس ورڈ غلط ہے');return}const a=$('#pw1').value;if(a.length<6){e.textContent=t('Password min 6|پاس ورڈ کم از کم 6');return}if(a!==$('#pw2').value){e.textContent=t('Passwords do not match|پاس ورڈ مختلف ہیں');return}const oldPw=$('#pw0').value;try{await cloudChangePw(o.id,o.ev,oldPw,a,uidv==='owner')}catch(e){}o.salt=newSalt();o.hash=await hashPw(a,o.salt);await accSave();closeAll();toast(t('Password changed ✅|پاس ورڈ بدل گیا ✅'),'ok')}
/* ---------- idle lock: after 60 minutes without any touch, go back to the login screen (data stays safe) ---------- */
const IDLE_MIN=60;let _idleT=Date.now();
['click','keydown','touchstart','mousemove','scroll'].forEach(ev=>document.addEventListener(ev,()=>{_idleT=Date.now()},{passive:true}));
setInterval(()=>{try{document.querySelectorAll('iframe').forEach(f=>{const d=f.contentDocument;if(d&&!d._idl){d._idl=1;['click','keydown','touchstart','mousemove','scroll'].forEach(ev=>d.addEventListener(ev,()=>{_idleT=Date.now()},{passive:true}))}})}catch(e){}},4000);
setInterval(()=>{try{if(SESS&&Date.now()-_idleT>IDLE_MIN*60000&&SCR!=='login'){toast(t('Locked after a long time of no use — please log in again|کافی دیر استعمال نہ ہونے پر لاک ہو گیا — دوبارہ لاگ اِن کریں'),'warn');logout()}}catch(e){}},60000);
/* ---------- password recovery ---------- */
function genRecCode(){const cs='ABCDEFGHJKLMNPQRSTUVWXYZ23456789',a=new Uint8Array(16);crypto.getRandomValues(a);let s='';a.forEach((x,i)=>{s+=cs[x%cs.length];if(i%4===3&&i<15)s+='-'});return s}
const normRec=s=>String(s||'').toUpperCase().replace(/[^A-Z0-9]/g,'');
async function makeRecovery(){const c=genRecCode(),salt=newSalt();ACC.owner.rec={salt,hash:await hashPw(normRec(c),salt),at:Date.now()};return c}
function showRecovery(c,usr){hm({title:'🛟 '+t('Your recovery code|آپ کا ریکوری کوڈ'),body:`
${usr?t('If you ever forget your password, this code lets you set a new one on the login screen (Forgot password). It is shown ONLY now — write it on paper or take a photo and keep it safe.|اگر آپ کبھی اپنا پاس ورڈ بھول جائیں تو لاگ اِن اسکرین پر "پاس ورڈ بھول گئے" میں یہ کوڈ نیا پاس ورڈ رکھنے دے گا۔ یہ صرف ابھی دکھایا جا رہا ہے — کاغذ پر لکھ لیں یا فوٹو لے لیں۔'):''}${usr?'':t('If you ever forget the owner password, this code lets you set a new one. It is shown ONLY now — write it on paper or take a photo and keep it safe. Do not share it.|اگر آپ کبھی اونر کا پاس ورڈ بھول جائیں تو یہ کوڈ نیا پاس ورڈ رکھنے دے گا۔ یہ صرف ابھی دکھایا جا رہا ہے — کاغذ پر لکھ لیں یا فوٹو لے لیں اور محفوظ رکھیں۔ کسی کو نہ دیں۔')}
${c}
`,foot:``})}
async function newRecovery(){if(!confirm(t('Make a NEW recovery code? The old one will stop working.|نیا ریکوری کوڈ بنائیں؟ پرانا بند ہو جائے گا۔')))return;const c=await makeRecovery();await accSave();showRecovery(c)}
function forgotPw(){const wa=ownerWA();hm({title:'🔑 '+t('Forgot password|پاس ورڈ بھول گئے'),body:`
👤 ${t('I am a customer / staff|میں کسٹمر / اسٹاف ہوں')}
${t('Enter your ID, the recovery code shown on your first login, and a new password.|اپنی آئی ڈی، پہلی بار لاگ اِن پر دکھایا گیا ریکوری کوڈ اور نیا پاس ورڈ لکھیں۔')}
${t('Lost the code? Ask the owner — he can set a new password for you.|کوڈ کھو گیا؟ اونر سے کہیں — وہ آپ کا نیا پاس ورڈ بنا دے گا۔')}
👑 ${t('I am the owner|میں اونر ہوں')}
${t('Enter your owner ID, the recovery code you saved, and a new password.|اپنی اونر آئی ڈی، محفوظ کیا ہوا ریکوری کوڈ اور نیا پاس ورڈ لکھیں۔')}
${t('No recovery code, or a new device? Open the owner menu (tap the logo 3 times) → restore from cloud or open your account file.|ریکوری کوڈ نہیں یا نئی ڈیوائس ہے؟ اونر مینو (لوگو پر 3 بار ٹیپ) → کلاؤڈ سے بحال کریں یا اکاؤنٹ فائل کھولیں۔')}
`})}
function forgotWA(){const id=($('#li_i')||{}).value||'';const msg=`السلام علیکم! میں اپنا پاس ورڈ بھول گیا ہوں۔ ${id?'میری آئی ڈی: '+id+'۔ ':''}براہ کرم نیا پاس ورڈ بنا دیں۔`;const n=ownerWA();if(!n){toast(t('Owner number is not set yet|اونر کا نمبر ابھی سیٹ نہیں'),'err');return}window.open(waURL(n,msg),'_blank')}
async function ownerReset(){const e=$('#fp_e');e.textContent='';const id=normId($('#fp_i').value),c=normRec($('#fp_c').value),a=$('#fp_a').value;
if(!ACC||!ACC.owner||!ACC.owner.id){e.textContent=t('No owner account on this device. Use the owner menu to restore.|اس ڈیوائس پر اونر اکاؤنٹ نہیں۔ اونر مینو سے بحال کریں۔');return}
if(Date.now()<_lock){e.textContent=t('Too many tries — wait a few seconds|بہت کوششیں — چند سیکنڈ رکیں');return}
const o=ACC.owner;if(id!==o.id||!o.rec||await hashPw(c,o.rec.salt)!==o.rec.hash){_fails++;if(_fails>=5){_lock=Date.now()+20000;_fails=0}e.textContent=t('ID or recovery code is wrong|آئی ڈی یا ریکوری کوڈ غلط ہے');return}
if(a.length<6){e.textContent=t('Password min 6|پاس ورڈ کم از کم 6');return}if(a!==$('#fp_b').value){e.textContent=t('Passwords do not match|پاس ورڈ مختلف ہیں');return}
_fails=0;o.salt=newSalt();o.hash=await hashPw(a,o.salt);const nc=await makeRecovery();await accSave();closeAll();toast(t('New password set ✅ — now login|نیا پاس ورڈ لگ گیا ✅ — اب لاگ اِن کریں'),'ok');setTimeout(()=>showRecovery(nc),400)}
async function userReset(){const e=$('#fu_e');e.textContent='';const id=normId($('#fu_i').value),c=normRec($('#fu_c').value),a=$('#fu_a').value;
if(Date.now()<_lock){e.textContent=t('Too many tries — wait a few seconds|بہت کوششیں — چند سیکنڈ رکیں');return}
const U=ACC&&Object.values(ACC.users||{}).find(x=>x.id===id);const bad=()=>{_fails++;if(_fails>=5){_lock=Date.now()+20000;_fails=0}e.textContent=t('ID or recovery code is wrong|آئی ڈی یا ریکوری کوڈ غلط ہے')};
if(!U||!U.rec||await hashPw(c,U.rec.salt)!==U.rec.hash){bad();return}
if(U.fuid){e.textContent=t('This ID is saved online — please ask the owner to reset it.|یہ آئی ڈی آن لائن ہے — براہ کرم اونر سے ری سیٹ کروائیں۔');return}
if(a.length<6){e.textContent=t('Password min 6|پاس ورڈ کم از کم 6');return}if(a!==$('#fu_b').value){e.textContent=t('Passwords do not match|پاس ورڈ مختلف ہیں');return}
_fails=0;U.salt=newSalt();U.hash=await hashPw(a,U.salt);const nc=genRecCode(),s=newSalt();U.rec={salt:s,hash:await hashPw(normRec(nc),s),at:Date.now()};await accSave();closeAll();toast(t('New password set ✅ — now login|نیا پاس ورڈ لگ گیا ✅ — اب لاگ اِن کریں'),'ok');setTimeout(()=>showRecovery(nc,true),400)}
const fmtMoney=n=>Math.round(+n||0).toLocaleString('en-US');
/* ===== Owner console ===== */
let OF={q:'',type:'',st:''};
function goOwner(){OF={q:'',type:'',st:''};showScr('owner');renderDash();setTimeout(()=>{try{bkBanner()}catch(e){}},800);setTimeout(async()=>{try{if(ACC&&ACC.owner&&ACC.owner.id&&!ACC.owner.rec&&!document.querySelector('.hov')){const c=await makeRecovery();await accSave();showRecovery(c)}}catch(e){}},1500)}
function goDash(){goOwner()}
function goCust(){OF={q:'',type:'',st:''};showScr('cust');renderCustomers()}
function custPanel(ty){if(SCR==='app'){unmountApp();SESS={k:'owner'};saveSess()}OF={q:'',type:ty||'',st:''};showScr('cust');renderCustomers()}
function renderOwner(){if(SCR==='cust')renderCustomers();else renderDash()}
function expChip(m){if(m.status==='blocked')return `⛔ ${t('Blocked|بلاک')}`;const d=daysLeft(m);if(m.expiry>=LIFETIME)return `♾ ${t('Lifetime|لائف ٹائم')}`;if(d<0)return `${t('Expired|ختم')} ${fmtDate(m.expiry)}`;if(d<=5)return `⚠ ${d} ${t('days left|دن باقی')}`;return `${d} ${t('days|دن')} · ${fmtDate(m.expiry)}`}
function setOF(k,v){OF[k]=OF[k]===v?'':v;renderOwner()}
function clearOF(){OF={q:'',type:'',st:''};renderOwner()}
function stOK(m,st){const d=daysLeft(m);return !st||(st==='blocked'?(m.status==='blocked'||d<0):st==='soon'?(m.status==='active'&&d>=0&&d<=7&&m.expiry=0):true)}
function renderCustomers(){const all=Object.values(ACC.tenants).filter(m=>!m.own).sort((a,b)=>b.created-a.created);const q=OF.q.toLowerCase();
const hit=m=>!q||(m.name+' '+(m.phone||'')+' '+tenantUsers(m.tid).map(u=>u.id).join(' ')).toLowerCase().includes(q);
let list=all.filter(m=>(!OF.type||m.type===OF.type)&&hit(m)&&stOK(m,OF.st));
const cnt=st=>all.filter(m=>stOK(m,st)).length;const filt=!!(OF.q||OF.type||OF.st);
const kp=(st,lab,cls)=>`
${all.length?t('No customer matches these filters.|ان فلٹرز میں کوئی کسٹمر نہیں۔'):t('No customers yet. Tap “New customer”, or “Sample customers” in the menu to try everything.|ابھی کوئی کسٹمر نہیں۔ “نیا کسٹمر” دبائیں، یا مینو سے “نمونہ کسٹمرز” بنا کر آزمائیں۔')}
👥 ${t('My customers — by software|میرے کسٹمرز — سوفٹ ویئر کے حساب سے')} ${t('tap one to see its customers|کسی پر دبائیں، اس کے کسٹمرز دیکھیں')}
${tiles}
${kp('all',t('All customers|سب کسٹمرز'))}${kp('active',t('Active|فعال'),'ok')}${kp('soon',t('Expiring ≤7d|7 دن میں ختم'),'warnc')}${kp('blocked',t('Blocked/Expired|بند/ختم'),'danger')}${kp('upd',t('Need update|اپ ڈیٹ چاہیے'),'blue')}
${filt?``:''}
${body}
`}
async function renderDash(){const pend=await pendingReqs();try{OUTN=((await KV.get('outbox'))||[]).length}catch(e){}
const all=Object.values(ACC.tenants).filter(m=>!m.own);const leads=(ACC.leads||[]);const soon=all.filter(m=>stOK(m,'soon')).length;
let unr=0;try{unr=Object.values(await pchatAll()).filter(x=>x.unread).length}catch(e){}
const ab=(ic,lab,fn,n,cls)=>``;
$('#scr-owner').innerHTML=`
NAVEED BUSINESS SOFTWARES${t('Owner|اونر')}: ${esc(ACC.owner.name)}
${langBtn()}
${CL.o?'☁ '+t('Online save is ON — records are saved online and can be opened on any device with the same ID.|آن لائن سیو چالو ہے — ریکارڈ آن لائن محفوظ ہو رہا ہے اور اسی آئی ڈی سے کسی بھی ڈیوائس پر کھلے گا۔'):'⚠ '+t('Online save is NOT connected yet. Records stay only on this device, so the same ID will NOT open on another phone/PC. Fix: press ☁ Cloud below → enter the cloud owner password → Connect.|آن لائن سیو ابھی جڑا نہیں۔ ریکارڈ صرف اسی ڈیوائس پر ہے، اس لیے یہی آئی ڈی دوسرے موبائل/پی سی پر نہیں کھلے گی۔ حل: نیچے "☁ کلاؤڈ" دبائیں ← کلاؤڈ اونر پاس ورڈ لکھیں ← "جوڑیں"۔')}${OUTN?` (${OUTN})`:''}
${moneyBox(all)}
${ab('👥',t('All customers|سب کسٹمرز'),'goCust()',all.length)}${ab('🔓',t('Open a customer ID (no password)|کسٹمر کی آئی ڈی کھولیں (بغیر پاس ورڈ)'),'openPick()','','hot')}${ab('🎁',t('Trials & leads|ٹرائل اور لیڈز'),'leadsModal()',leads.length)}${ab('🆕',t('New trials|نئے ٹرائل'),'newTrialsModal()',newTrials().length,newTrials().length?'hot':'')}${ab('📤',t('Send a trial|ٹرائل بھیجیں'),'sendTrialModal()')}${ab('📣',t('Ads (share pictures)|اشتہارات (تصویر شیئر)'),'adsModal()')}${ab('📰',t('Jobs News website|جابز نیوز ویب سائٹ'),'newsAdmin()')}${ab('💬',t('Chats & bot|چیٹس اور بوٹ'),'chatInbox()',unr)}${ab('☁',t('Cloud|کلاؤڈ'),'cloudPanel()',CL.o?'':'!')}${ab('🔗',t('Trial links|ٹرائل لنکس'),'trialLinksModal()')}${ab('💰',t('Prices & plans|قیمتیں اور پلان'),'plansModal()')}${ab('⚙',t('Edit prices|قیمتیں بدلیں'),'plansEdit()')}${ab('📈',t('Income report|آمدنی رپورٹ'),'incomeModal()')}${ab('🔔',t('Renewals|تجدید'),'renewModal()',renewCount()||'',renewCount()?'hot':'')}${ab('💤',t('Not used 30 days|30 دن سے استعمال نہیں'),'idleModal()',idleCount()||'')}${ab('📜',t('Payments|ادائیگیاں'),'paysModal()',(ACC.payments||[]).length)}${ab('📥',t('Delete requests|ڈیلیٹ درخواستیں'),'reqsModal()',pend,pend?'hot':'')}${soon?ab('⏳',t('Expiring soon|جلد ختم'),"OF={q:'',type:'',st:'soon'};showScr('cust');renderCustomers()",soon,'hot'):''}
🏠 ${t('My software — tap to open and use it for my own business|میرے سوفٹ ویئر — دبا کر کھولیں اور اپنے کاروبار میں استعمال کریں')} ${t('Inside each software: “My customers” button creates customer IDs|ہر سوفٹ ویئر کے اندر “میرے کسٹمرز” کے بٹن سے کسٹمر آئی ڈی بنائیں')}
`}
function ownerMenu(ev){ev.stopPropagation();const items=[[`💾 ${t('Backup & Restore (all customers)|بیک اپ اور بحالی (تمام کسٹمرز)')}`,'bkModal()'],[`🔄 ${t('Updates for all|سب کے لیے اپ ڈیٹ')}`,'bulkUpdateModal()'],[`🧪 ${t('Sample customers (one per software)|نمونہ کسٹمرز (ہر سوفٹ ویئر کا ایک)')}`,'makeSamples()'],[`📤 ${t('Settings file for hosting (WhatsApp no., prices)|ہوسٹنگ کی سیٹنگز فائل (واٹس ایپ نمبر، قیمتیں)')}`,'publishCfg()'],[`🔑 ${t('Make activation code|فعالیت کوڈ بنائیں')}`,"payModal('')"],[`📜 ${t('Owner access log|اونر رسائی لاگ')}`,'logsModal()'],[`📢 ${t('Announcement for all customers|سب کسٹمرز کے لیے اعلان')}`,'annModal()'],[`🧹 ${t('Wash log|صفائی کا ریکارڈ')}`,'washLogModal()'],[`👤 ${t('My account|میرا اکاؤنٹ')}`,'ownerAcct()'],[`⬇ ${t('Download accounts backup|اکاؤنٹس بیک اپ')}`,'exportAcc()'],[`🚪 ${t('Logout|لاگ آؤٹ')}`,'logout()']];
const m=document.createElement('div');m.className='menu';m.innerHTML=items.map(i=>``).join('');const b=ev.target.closest('button').getBoundingClientRect();document.body.appendChild(m);m.style.top=(b.bottom+4)+'px';if(LANG==='ur')m.style.left=Math.max(6,b.left)+'px';else m.style.right=Math.max(6,innerWidth-b.right)+'px';setTimeout(()=>document.addEventListener('click',()=>m.remove(),{once:true}),0)}
const ownOf=ty=>Object.values(ACC.tenants).find(m=>m.own&&m.type===ty);
async function openOwn(ty){let m=ownOf(ty);if(!m){const nm=prompt(t('Business name for your own use of this software|اس سوفٹ ویئر میں اپنے کاروبار کا نام'),ACC.owner.name);if(nm===null)return;const tid='t'+uid();m=ACC.tenants[tid]={tid,type:ty,name:(nm||'').trim()||ACC.owner.name,phone:ACC.owner.phone||'',address:'',plan:'lifetime',status:'active',features:{},demo:false,created:Date.now(),ver:latestVer(ty),offer:'',expiry:LIFETIME,own:true,delOK:true,mode:{run:'both',store:'device'}}}
m.ver=latestVer(ty);m.offer='';m.status='active';m.expiry=LIFETIME;await accSave();openAs(m.tid)}
async function openAs(tid){const m=ACC.tenants[tid];if(!m.own){ACC.logs.unshift({t:Date.now(),tid,name:m.name});ACC.logs=ACC.logs.slice(0,200);await accSave()}
let adm=tenantUsers(tid).find(u=>u.role==='admin');if(!adm)adm={uid:'owner-view',id:'owner',name:ACC.owner.name,tid,role:'admin',perms:{}};SESS={k:'owner',imp:true,tid};enterTenant(adm,true)}
async function toggleBlock(tid){const m=ACC.tenants[tid];if(m.status!=='blocked'&&!confirm(t('Block this customer? They will not be able to open the software.|اس کسٹمر کو بلاک کریں؟ وہ سوفٹ ویئر نہیں کھول سکے گا۔')))return;m.status=m.status==='blocked'?'active':'blocked';await accSave();renderOwner()}
function extendModal(tid){const m=ACC.tenants[tid];hm({title:'⏳ '+esc(m.name),body:`
`})}
async function extendBy(tid,d){const m=ACC.tenants[tid];if(d<0){m.expiry=LIFETIME;m.plan='lifetime'}else{const base=Math.max(Date.now(),m.expiry>=LIFETIME?Date.now():m.expiry);m.expiry=base+d*DAY;m.plan=d>=365?'yearly':d>=180?'half':d>=90?'quarterly':'monthly'}m.status='active';await accSave();closeAll();toast(t('Renewed ✅|تجدید ہو گئی ✅'),'ok');renderOwner()}
async function extendTo(tid){const v=$('#ex_d').value;if(!v)return;const m=ACC.tenants[tid];m.expiry=new Date(v+'T23:59:59').getTime();m.plan='custom';m.status='active';await accSave();closeAll();renderOwner()}
function logsModal(){hm({title:'📜 '+t('Owner access log|اونر رسائی لاگ'),wide:true,body:ACC.logs.length?`
${ACC.logs.map(l=>`
${esc(l.name)}
${fdt(l.t)}
`).join('')}
`:`
${t('Nothing yet|ابھی کچھ نہیں')}
`})}
function ownerAcct(){const o=ACC.owner;hm({title:'👤 '+t('My account|میرا اکاؤنٹ'),body:`
${t('Login ID|لاگ اِن آئی ڈی')}: ${esc(o.id)}
`,foot:``})}
async function saveOwner(){ACC.owner.name=$('#oa_n').value.trim()||ACC.owner.name;ACC.owner.phone=$('#oa_p').value.trim();await accSave();closeAll();renderOwner()}
function exportAcc(){const a=document.createElement('a');a.href=URL.createObjectURL(new Blob([JSON.stringify(ACC)],{type:'application/json'}));a.download='SHP-accounts-'+new Date().toISOString().slice(0,10)+'.json';a.click()}
/* ---------- customer create / edit ---------- */
const PLANS=[['monthly',30],['quarterly',90],['half',180],['yearly',365],['lifetime',-1]];
function resizeLogo(file){return new Promise(res=>{const r=new FileReader();r.onload=()=>{const im=new Image();im.onload=()=>{const s=Math.min(1,256/Math.max(im.width,im.height)),c=document.createElement('canvas');c.width=Math.round(im.width*s);c.height=Math.round(im.height*s);c.getContext('2d').drawImage(im,0,0,c.width,c.height);res(c.toDataURL('image/png'))};im.onerror=()=>res('');im.src=r.result};r.onerror=()=>res('');r.readAsDataURL(file)})}
let _logo='';
function custForm(tid,pt){const m=tid?ACC.tenants[tid]:null,adm=m&&tenantUsers(tid).find(u=>u.role==='admin');_logo=m?m.logo||'':'';const type=m?m.type:(pt&&BUS[pt]?pt:'lab');
hm({title:m?'✏ '+esc(m.name):'➕ '+t('New customer|نیا کسٹمر'),wide:true,body:`
🏫 ${t('Fee collection (owner only)|فیس وصولی کا طریقہ (صرف اونر)')}
${t('Payment accounts shown on the voucher (optional). In the first box write what it is: Easypaisa, JazzCash, Bank, other wallet…|ادائیگی کے اکاؤنٹ جو واؤچر پر آئیں گے (اختیاری)۔ پہلے خانے میں لکھیں یہ کیا ہے: ایزی پیسہ، جیز کیش، بینک، دوسرا والٹ…')}
${t('Login for this customer|اس کسٹمر کا لاگ اِن')}
${m?``:`
`}
${m?``:``}
🔧 ${t('Functions open for this customer|اس کسٹمر کے لیے کھلے فنکشنز')}
${t('Untick to close a function for this customer completely (even the admin cannot use it).|کسی فنکشن کا نشان ہٹائیں تو وہ اس کسٹمر کے لیے مکمل بند ہو جائے گا (ایڈمن بھی استعمال نہیں کر سکے گا)۔')}
🌐 ${t('How this customer works|اس کسٹمر کے کام کرنے کا طریقہ')}
${t('You can change this any time. Online parts switch on when online save (Firebase) is connected.|آپ کسی بھی وقت بدل سکتے ہیں۔ آن لائن حصے آن لائن سیو (Firebase) جڑنے پر فعال ہوں گے۔')}
🎨 ${t('Theme (colours of this customer\'s software)|تھیم (اس کسٹمر کے سوفٹ ویئر کے رنگ)')}${themeBox(m?m.theme:null)}
${type==='pharmacy'?`
${t('Leave OFF for a normal medical store — the Prescription and Templates pages are hidden.|عام میڈیکل اسٹور کے لیے بند رکھیں — پرسکرپشن اور ٹیمپلیٹس کے صفحات چھپ جاتے ہیں۔')}
`,foot:`${m?``:''}`});setTimeout(()=>{try{cfFee()}catch(e){}},30)}
function darken(h,f=.78){const n=parseInt(h.slice(1),16),r=Math.round((n>>16)*f),g=Math.round(((n>>8)&255)*f),b=Math.round((n&255)*f);return '#'+((1<<24)+(r<<16)+(g<<8)+b).toString(16).slice(1)}
function themeBox(th){th=th||{};const P=(id,lab,v,def)=>`
`;
return `
${t('Pick a ready theme, or colour each part separately. “↺” = keep original.|تیار تھیم چنیں، یا ہر حصے کا رنگ الگ چنیں۔ “↺” = اصل رنگ۔')}
${THEMES.map(x=>``).join('')}
${P('th_main',t('Main colour (buttons, highlights)|مین رنگ (بٹن، نمایاں حصے)'),th.main,'#0d7a5f')}${P('th_side',t('Side menu|سائیڈ مینو'),th.side,'#0f172a')}${P('th_top',t('Top bar|اوپر کی پٹی'),th.top,'#ffffff')}${P('th_bg',t('Page background|پس منظر'),th.bg,'#e8eef8')}${P('th_card',t('Cards / boxes|کارڈ / ڈبے'),th.card,'#ffffff')}
`}
function pickTheme(a,b,s){const e=$('#th_main');e.value=a||'#0d7a5f';e.dataset.set=a?1:0;e.dataset.m2=b;const sd=$('#th_side');sd.value=s||'#0f172a';sd.dataset.set=s?1:0}
function readTheme(){const g=i=>{const e=$('#'+i);return e&&e.dataset.set==='1'?e.value:''};const th={main:g('th_main'),side:g('th_side'),top:g('th_top'),bg:g('th_bg'),card:g('th_card'),radius:$('#th_rad').value};if(th.main)th.main2=darken(th.main);if(th.top)th.topTx=lum(th.top)>150?'#0f172a':'#ffffff';Object.keys(th).forEach(k=>{if(th[k]==='')delete th[k]});return Object.keys(th).length?th:null}
const lum=h=>{const n=parseInt(h.slice(1),16);return .299*(n>>16)+.587*((n>>8)&255)+.114*(n&255)};
const featOn=m=>{const o={};allPageIds(m.type).forEach(id=>o[id]=!(m.features&&m.features[id]===false));return o};
function cfFee(){const b=($('#cf_fm')||{}).value==='bank';if($('#cf_fb'))$('#cf_fb').style.display=b?'block':'none';if($('#cf_fs'))$('#cf_fs').style.display=b?'none':'block'}
function cfType(){const ty=$('#cf_t').value;$('#cf_doc').style.display=ty==='pharmacy'?'block':'none';if($('#cf_fee'))$('#cf_fee').style.display=ty==='school'?'block':'none';$('#cf_f').innerHTML=permGrid(ty,Object.assign({},...allPageIds(ty).map(id=>({[id]:true}))),{defOn:true})}
async function cfLogo(inp){const f=inp.files[0];if(!f)return;_logo=await resizeLogo(f);$('#cf_lp').innerHTML=_logo?``:'🖼'}
async function saveCust(tid){const e=$('#cf_e');const name=$('#cf_n').value.trim(),ty=tid?ACC.tenants[tid].type:$('#cf_t').value,id=normId($('#cf_i').value),pw=$('#cf_pw').value;e.textContent='';
if(!name){e.textContent=t('Enter business name|کاروبار کا نام لکھیں');return}
const pr=readPerms($('#cf_f'));const features={};Object.keys(pr).forEach(k=>{if(!pr[k])features[k]=false});
const base={name,phone:$('#cf_p').value.trim(),ownerWA:(($('#cf_ow')||{}).value||'').trim(),address:$('#cf_a').value.trim(),logo:_logo,features,plan:$('#cf_pl').value,doctor:($('#cf_d')||{}).value||'',degree:($('#cf_g')||{}).value||'',doctorUr:($('#cf_du')||{}).value||'',degreeUr:($('#cf_gu')||{}).value||''};
base.ownerName=($('#cf_on')||{}).value.trim();base.email=($('#cf_em')||{}).value.trim();
if($('#cf_fm')){const bk=$('#cf_fm').value==='bank';base.fee={mode:bk?'bank':'self',bank:{name:$('#cf_bn').value.trim(),title:$('#cf_bt').value.trim(),acc:$('#cf_ba').value.trim(),branch:$('#cf_bb').value.trim()},pay:[0,1].map(i=>({ty:$('#cf_pt'+i).value.trim(),no:$('#cf_pn'+i).value.trim(),nm:$('#cf_pb'+i).value.trim()})).filter(x=>x.ty||x.no||x.nm)}}
base.waMode=($('#cf_wa')||{}).value||'web';if($('#cf_clinic'))base.clinic=$('#cf_clinic').checked;{const A={};document.querySelectorAll('.cf_act').forEach(c=>{if(!c.checked)A[c.dataset.k]=false});base.actions=A}base.theme=readTheme();base.delOK=$('#cf_del').checked;base.mode={run:$('#cf_run').value,store:$('#cf_store').value};if($('#th_all')&&$('#th_all').checked){const ty0=tid?ACC.tenants[tid].type:ty;Object.values(ACC.tenants).forEach(x=>{if(x.type===ty0)x.theme=base.theme})}
if(tid){const m=ACC.tenants[tid];Object.assign(m,base);const pl=PLANS.find(p=>p[0]===base.plan);const xd=$('#cf_x').value;if(xd)m.expiry=new Date(xd+'T23:59:59').getTime();if(base.plan==='lifetime')m.expiry=LIFETIME;
const adm=tenantUsers(tid).find(u=>u.role==='admin');if(adm){adm.name=$('#cf_c').value.trim()||adm.name;if(pw){if(pw.length<6){e.textContent=t('Password min 6|پاس ورڈ کم از کم 6');return}adm.salt=newSalt();adm.hash=await hashPw(pw,adm.salt);await cloudNewUser(adm,pw,true)}}
await accSave();closeAll();toast(t('Saved ✅|محفوظ ✅'),'ok');if(SCR==='app'){renderBar();remountApp()}else renderOwner();return}
if(!validId(id)){e.textContent=t('Login ID: 3-30 letters/numbers (a-z, 0-9 . _ -)|لاگ اِن آئی ڈی: 3-30 حروف/ہندسے (a-z, 0-9 . _ -)');return}if(idTaken(id)){e.textContent=t('This ID is already used|یہ آئی ڈی پہلے سے استعمال میں ہے');return}if(!pw||pw.length<6){e.textContent=t('Password min 6|پاس ورڈ کم از کم 6');return}
await makeTenant(Object.assign(base,{type:ty,demo:$('#cf_demo').checked}),id,pw,$('#cf_c').value.trim()||name);closeAll();toast(`${t('Customer created ✅|کسٹمر بن گیا ✅')} — ID: ${id} / ${pw}`,'ok');renderOwner()}
async function makeTenant(base,id,pw,contact){const tid='t'+uid(),pl=PLANS.find(p=>p[0]===base.plan)||PLANS[0];
const meta=Object.assign({tid,type:'lab',plan:'monthly',status:'active',features:{},demo:false,created:Date.now(),ver:latestVer(base.type),offer:'',expiry:pl[1]<0?LIFETIME:Date.now()+pl[1]*DAY},base);meta.ver=latestVer(meta.type);
ACC.tenants[tid]=meta;const u=await mkUser({id,name:contact,tid,role:'admin',pw});ACC.users[u.uid]=u;await cloudNewUser(u,pw);if(meta.own&&CL.o&&meta.type!=='pharmacy'){meta.mode=meta.mode||{run:'both',store:'device'};meta.mode.store='online'}await accSave();return meta}
async function delCust(tid){const m=ACC.tenants[tid];if(prompt(t('Type DELETE to remove this customer and ALL their data|اس کسٹمر اور اس کا تمام ڈیٹا ہٹانے کے لیے DELETE لکھیں'))!=='DELETE')return;tenantUsers(tid).forEach(u=>delete ACC.users[u.uid]);delete ACC.tenants[tid];await wipeTenantData(tid);await accSave();closeAll();renderOwner()}
async function resetCust(tid){if(prompt(t('Type ERASE to delete all records of this customer (accounts stay)|اس کسٹمر کا تمام ریکارڈ مٹانے کے لیے ERASE لکھیں (اکاؤنٹ رہے گا)'))!=='ERASE')return;await wipeTenantData(tid);closeAll();toast(t('Data erased|ڈیٹا صاف ہو گیا'),'ok')}
const SAMPLE_NAMES={lab:['Al-Shifa Diagnostic Lab|الشفاء ڈائیگناسٹک لیب'],pharmacy:['Al-Noor Clinic & Medical Store|النور کلینک اینڈ میڈیکل اسٹور'],merchant:['Green Merchant Traders|گرین مرچنٹ ٹریڈرز'],kiryana:['Madina Kiryana Store|مدینہ کریانہ اسٹور'],store:['City General Store|سٹی جنرل اسٹور'],school:['Iqra Public School|اقرا پبلک اسکول'],office:['Smart Office Services|سمارٹ آفس سروسز'],hotel:['Grand Hotel & Restaurant|گرینڈ ہوٹل اینڈ ریسٹورنٹ'],daftar:['Easy Daftar Office|آسان دفتر']};
async function makeSamples(){let n=0;for(const ty of Object.keys(BUS)){const id='demo_'+ty;if(idTaken(id))continue;const nm=SAMPLE_NAMES[ty][0].split('|');await makeTenant({name:LANG==='ur'?nm[1]:nm[0],type:ty,phone:'0300-0000000',address:'',demo:true,plan:'yearly'},id,'demo123',nm[0]);n++}toast(n?t('Sample customers created — password demo123|نمونہ کسٹمرز بن گئے — پاس ورڈ demo123'):t('Samples already exist|نمونے پہلے سے موجود ہیں'),'ok');renderOwner()}
/* ---------- owner: see customer's ID + password, make a new one, send on WhatsApp ---------- */
function credMsg(m,adm,pw){return `${t('Naveed Business Softwares — your login|نوید بزنس سافٹ ویئرز — آپ کا لاگ اِن')}\n${busName(m.type)} · ${m.name}\n${t('ID|آئی ڈی')}: ${adm.id}\n${t('Password|پاس ورڈ')}: ${pw}\n${location.origin+location.pathname}?id=${adm.id}\n${t('Tap the link — ID is filled, just type the password.|لنک دبائیں — آئی ڈی خود بھری ہو گی، صرف پاس ورڈ لکھیں۔')}`}
let _credPw={};
function credModal(tid){const m=ACC.tenants[tid],adm=tenantUsers(tid).find(u=>u.role==='admin');if(!adm)return;const pw=_credPw[tid]||'';
hm({title:'🔑 '+esc(m.name),body:`
${t('ID|آئی ڈی')}${esc(adm.id)}
${t('Password|پاس ورڈ')}${pw?esc(pw):'••••••'}
${pw?t('This new password is shown only now. Send it to the customer.|یہ نیا پاس ورڈ صرف ابھی دکھایا جا رہا ہے۔ کسٹمر کو بھیج دیں۔'):t('For safety passwords are not stored. If the customer forgot it, press “New password” and send it on WhatsApp.|حفاظت کے لیے پاس ورڈ محفوظ نہیں رکھے جاتے۔ کسٹمر بھول جائے تو "نیا پاس ورڈ" دبائیں اور واٹس ایپ پر بھیج دیں۔')}
${pw?``:``}
`})}
async function credNew(tid){const m=ACC.tenants[tid],adm=tenantUsers(tid).find(u=>u.role==='admin');const pw=String(100000+Math.floor(Math.random()*900000));
adm.salt=newSalt();adm.hash=await hashPw(pw,adm.salt);await cloudNewUser(adm,pw,true);await accSave();_credPw[tid]=pw;toast(t('New password set ✅|نیا پاس ورڈ سیٹ ✅'),'ok');closeAll();credModal(tid);setTimeout(()=>{delete _credPw[tid]},10*60*1000)}
function credLink(tid){const m=ACC.tenants[tid],adm=tenantUsers(tid).find(u=>u.role==='admin');const ph=String(m.phone||'').replace(/\D/g,'');window.open(waURL(ph.length>=10?ph:'',`${t('Naveed Business Softwares — login|نوید بزنس سافٹ ویئرز — لاگ اِن')}\n${t('ID|آئی ڈی')}: ${adm.id}\n${location.origin+location.pathname}?id=${adm.id}`),'_blank')}
function credSend(tid){const m=ACC.tenants[tid],adm=tenantUsers(tid).find(u=>u.role==='admin');const ph=String(m.phone||'').replace(/\D/g,'');window.open(waURL(ph.length>=10?ph:'',credMsg(m,adm,_credPw[tid])),'_blank')}
function credCopy(tid){const m=ACC.tenants[tid],adm=tenantUsers(tid).find(u=>u.role==='admin');try{navigator.clipboard.writeText(credMsg(m,adm,_credPw[tid]));toast(t('Copied ✅|کاپی ہو گیا ✅'),'ok')}catch(e){prompt('',credMsg(m,adm,_credPw[tid]))}}
/* big "open a customer's software without password" picker */
function openPick(){const rows=()=>Object.values(ACC.tenants).filter(m=>!m.own);
const draw=q=>{q=(q||'').toLowerCase();const L=rows().filter(m=>!q||(m.name+' '+(m.phone||'')+' '+busName(m.type)).toLowerCase().includes(q));
document.getElementById('opkL').innerHTML=L.length?L.map(m=>`
`};
hm({title:'🔓 '+t('Open a customer ID|کسٹمر کی آئی ڈی کھولیں'),wide:true,body:`
${t('Type name / phone, then press Open. No password is needed — you enter his software as owner. You can also update his software from inside.|نام یا فون لکھیں، پھر "کھولیں" دبائیں۔ پاس ورڈ نہیں چاہیے — آپ مالک بن کر اس کے سوفٹ ویئر میں جائیں گے۔')}
`});window._opkD=draw;draw('');setTimeout(()=>{const e=document.getElementById('opkQ');e&&e.focus()},50)}
/* ===== Business layer: plans & prices, trial, leads, payments, licence codes, support, delete requests, account files ===== */
const TRIAL_DAYS=14;
const pf=n=>'Rs '+Number(n||0).toLocaleString('en-US');
const normWA=n=>{let d=String(n||'').replace(/\D/g,'');if(d.startsWith('00'))d=d.slice(2);if(d.startsWith('0'))d='92'+d.slice(1);return d};
const waURL=(n,msg)=>'https://wa.me/'+normWA(n)+'?text='+encodeURIComponent(msg);
let LINKWA='';try{LINKWA=new URLSearchParams(location.search).get('w')||''}catch(e){}
let PUB=null,OUTN=0;
async function loadPub(){try{PUB=await KV.get('pubcfg')}catch(e){}
if(location.protocol.startsWith('http')){try{const r=await fetch('shp-config.json?'+Date.now(),{cache:'no-store'});if(r.ok){const j=await r.json();if(j&&j.name!==undefined){PUB=j;await KV.set('pubcfg',j)}}}catch(e){}}
try{OUTN=((await KV.get('outbox'))||[]).length}catch(e){}}
/* ---------- outbox: things that must reach the cloud once Firebase is connected ---------- */
async function outbox(type,data){const q=(await KV.get('outbox'))||[];q.push({id:'o'+uid(),type,data,ts:Date.now()});await KV.set('outbox',q);OUTN=q.length;try{cloudKick()}catch(e){}}
/* ---------- plans ---------- */
const DEF_PLANS=[
{id:'pc',ur:'کمپیوٹر آف لائن سوفٹ ویئر',en:'Computer Offline Software',buy:10000,month:0,year:0,run:'offline',store:'device',on:1,
pts:[['Runs on your computer (PC) — no internet needed|','صرف کمپیوٹر (پی سی) پر چلتا ہے — انٹرنیٹ ضروری نہیں'],['Records stay in your own computer|','ریکارڈ آپ کے اپنے کمپیوٹر میں محفوظ رہتا ہے'],['You keep your own backup on your computer|','بیک اپ آپ کو اپنے کمپیوٹر میں رکھنا ہوگا'],['Step-by-step guidance and lifetime support|','ہر قدم پر رہنمائی اور لائف ٹائم سپورٹ']]},
{id:'online',ur:'کمپیوٹر + موبائل آن لائن سوفٹ ویئر',en:'Computer + Mobile Online Software',buy:15000,month:700,year:5000,run:'both',store:'device',on:1,
pts:[['Works on computer AND mobile|','کمپیوٹر اور موبائل دونوں پر چلتا ہے'],['Guidance available at all times|','ہر وقت رہنمائی دستیاب'],['You keep your backup on your own computer|','بیک اپ آپ کو اپنے کمپیوٹر میں رکھنا ہوگا'],['Yearly advance payment gets a special discount|','سال کی پیشگی ادائیگی پر خصوصی رعایت']]},
{id:'cloud',ur:'آن لائن ریکارڈ سیو (اضافی سہولت)',en:'Online Record Saving (add-on)',buy:0,month:1000,year:10000,addon:1,run:'both',store:'online',on:1,
pts:[['Run the software from any corner of the world|','دنیا کے کسی بھی کونے سے سوفٹ ویئر چلائیں'],['Records auto-save on the internet|','ریکارڈ انٹرنیٹ پر خود بخود سیو ہوتا رہے گا'],['Instant guidance whenever a problem comes up|','کوئی مسئلہ آنے پر فوری رہنمائی'],['Yearly advance payment gets a special discount|','سال کی پیشگی ادائیگی پر خصوصی رعایت']]},
{id:'full',ur:'مکمل پیکج — آن لائن + آف لائن، پی سی + موبائل، آن لائن ریکارڈ',en:'Complete Package — Online + Offline, PC + Mobile, Online Records',buy:20000,month:1500,year:15000,run:'both',store:'online',on:1,
pts:[['Online + Offline, PC + Mobile|','آن لائن + آف لائن، پی سی + موبائل'],['Records saved online automatically|','ریکارڈ آن لائن خود بخود محفوظ'],['Instant guidance and lifetime support|','فوری رہنمائی اور لائف ٹائم سپورٹ'],['Yearly subscription at a special discount|','سالانہ سبسکرپشن رعایتی قیمت پر']]}];
const clone=o=>JSON.parse(JSON.stringify(o));
const cfgPlans=()=>((ACC&&ACC.plans)||(PUB&&PUB.plans)||DEF_PLANS).filter(p=>p.on!==0);
const allPlans=()=>(ACC&&ACC.plans)||(PUB&&PUB.plans)||DEF_PLANS;
const planOf=id=>allPlans().find(p=>p.id===id);
const planTitle=p=>LANG==='ur'?p.ur:p.en;
const DEF_PAY={methods:[{n:'JazzCash',no:'',title:''},{n:'Easypaisa',no:'',title:''},{n:'Bank Transfer / بینک ٹرانسفر',no:'',title:''}],note:''};
const cfgPay=()=>(ACC&&ACC.pay)||(PUB&&PUB.pay)||DEF_PAY;
const ownerName=()=>(ACC&&ACC.owner&&ACC.owner.name)||(PUB&&PUB.name)||'Muhammad Anwar Lehri';
const ownerWA=()=>(ACC&&ACC.owner&&ACC.owner.phone)||(PUB&&PUB.wa)||LINKWA||'';
const baseUrl=()=>location.href.split('#')[0].split('?')[0];
function hubShareLink(ty){return baseUrl()+'?chat='+(ty||'daftar')+'&ref=share'+(ownerWA()?'&w='+normWA(ownerWA()):'')}
const trialUrl=ty=>baseUrl()+'?trial='+ty+(ownerWA()?'&w='+normWA(ownerWA()):'');
const homeUrl=()=>baseUrl()+(ownerWA()?'?w='+normWA(ownerWA()):'');
const BUSD={lab:['Patient receipts, lab reports, doctor commission, online reports|','مریض کی رسید، لیب رپورٹ، ڈاکٹر کمیشن، آن لائن رپورٹ'],pharmacy:['Medicine sales, prescriptions, clinic, stock & expiry (AL-RAQEEB)|','دوا کی فروخت، پرچی، کلینک، اسٹاک اور ایکسپائری (الرقیب)'],merchant:['Grain trading: farmers/buyers accounts, maund/kg slips, godown stock|','اجناس کی خرید و فروخت: کسان/خریدار کھاتے، من/کلو پرچی، گودام'],kiryana:['Kiryana billing, udhaar accounts, stock|','کریانہ بلنگ، ادھار کھاتے، اسٹاک'],store:['General store billing, stock, suppliers|','جنرل اسٹور بلنگ، اسٹاک، سپلائر'],school:['Students, fees, attendance, results|','طلبہ، فیس، حاضری، نتائج'],office:['Office / services: clients, invoices, expenses|','آفس / سروسز: کلائنٹ، انوائس، اخراجات'],hotel:['Hotel & restaurant: rooms, bookings, check-out bill, menu, tables, kitchen order|','ہوٹل اور ریسٹورنٹ: کمرے، بکنگ، چیک آؤٹ بل، مینو، میزیں، کچن آرڈر'],daftar:['Employees, GPF advance, pension & retirement guidance, official forms, WhatsApp/PDF guides|','ملازمین، جی پی فنڈ ایڈوانس، پنشن اور ریٹائرمنٹ کی رہنمائی، سرکاری فارم، واٹس ایپ / پی ڈی ایف ہدایات'],architect:['House & building planner: 2D plans, 3D, 360, elevations|','گھر اور عمارت کا نقشہ ساز: 2D، 3D، 360، ایلیویشن']};
const busDesc=k=>{const d=BUSD[k];return d?t(d[0]+d[1].replace(/^/,'')):''};
/* ---------- rate card (official look) ---------- */
function planBlock(p,pick){const sv=p.month&&p.year?Math.max(0,p.month*12-p.year):0;const L=(a,b,c)=>`
`}
function buyMsg(p){const m=SESS&&SESS.tid&&ACC&&ACC.tenants[SESS.tid];return `${t('Assalam o Alaikum! I want to buy this software plan:|السلام علیکم! مجھے یہ سوفٹ ویئر پلان لینا ہے:')}\n${p?planTitle(p):''}\n${m?busName(m.type)+' — '+m.name:''}${SESS&&SESS.uid&&ACC&&ACC.users[SESS.uid]?'\nID: '+ACC.users[SESS.uid].id:''}`}
function rateCard(pick){const pay=cfgPay();
return `
NAVEED BUSINESS SOFTWARES${t('Owner|اونر')}: ${esc(ownerName())}${ownerWA()?` · ${esc(ownerWA())}`:''}
💰 ${t('Prices & Plans|قیمتیں اور پلان')}
${cfgPlans().map(p=>planBlock(p,pick)).join('')}
📌 ${t('Online + offline, PC + mobile with online record saving — see the Complete Package.|آن لائن پلس آف لائن، پی سی پلس موبائل اور آن لائن ریکارڈ سیو والے سوفٹ ویئر کے لیے مکمل پیکج دیکھیں۔')}
🧾 ${t('How to pay|ادائیگی کا طریقہ')}
${t('Choose your plan and message the owner on WhatsApp.|اپنا پلان چنیں اور اونر کو واٹس ایپ پر پیغام کریں۔')}
${t('Pay by any method below.|نیچے دیے گئے کسی بھی طریقے سے ادائیگی کریں۔')}
${t('Send the payment screenshot / receipt on WhatsApp.|ادائیگی کا اسکرین شاٹ / رسید واٹس ایپ پر بھیجیں۔')}
${t('The owner activates your ID and sends you an official receipt.|اونر آپ کی آئی ڈی فعال کر کے آپ کو سرکاری رسید بھیج دے گا۔')}
${pay.methods.map(m=>`
${esc(m.n)}${esc(m.no||t('Ask the owner|اونر سے پوچھیں'))}${m.title?`${esc(m.title)}`:''}
`).join('')}
${pay.note?`
${esc(pay.note)}
`:''}
🤝 ${t('You get guidance from the software owner at every step, and lifetime support. If any problem comes up in your software, inform the owner and you will get immediate guidance.|سوفٹ ویئر کے مالک کی طرف سے ہر قدم پر آپ کو رہنمائی ملے گی اور لائف ٹائم سپورٹ بھی۔ اگر آپ کے سوفٹ ویئر میں کوئی مسئلہ بن جائے تو اونر کو اطلاع کرنے پر آپ کو فوری رہنمائی مل جائے گی۔')}
${t('Owner WhatsApp number is not set yet.|اونر کا واٹس ایپ نمبر ابھی سیٹ نہیں۔')}
`}
`}
function plansModal(){hm({title:'💰 '+t('Prices & Plans|قیمتیں اور پلان'),wide:true,body:rateCard(true),foot:``})}
/* ---------- support (WhatsApp, one tap) ---------- */
function supportMsg(){const m=ACC.tenants[SESS.tid],u=SESS.imp?null:ACC.users[SESS.uid];
return `🆘 ${t('Support request|سپورٹ درخواست')}\n${m.name}\nID: ${u?u.id:''}\n${busName(m.type)} v${m.ver}\n${m.trial?t('Trial|ٹرائل')+' ('+Math.max(0,daysLeft(m))+' '+t('days left|دن باقی')+')':t('Valid until|مدت')+': '+fmtDate(m.expiry)}\n\n${t('My problem:|میرا مسئلہ:')} `}
function supportWA(){const w=ownerWA();if(!w){toast(t('Owner WhatsApp number is not set|اونر کا واٹس ایپ نمبر سیٹ نہیں'),'err');return}window.open(waURL(w,supportMsg()),'_blank')}
/* ---------- trial ---------- */
const LEAD_ST={new:['New|نیا'],sent:['Link sent|لنک بھیجا'],trial:['On trial|ٹرائل پر'],contacted:['Contacted|رابطہ ہوا'],bought:['Bought|خرید لیا'],lost:['Lost|چھوڑ دیا']};
function trialTiles(){return `
🎁 ${t(TRIAL_DAYS+'-day FREE trial — try any software|'+TRIAL_DAYS+' دن مفت ٹرائل — کوئی بھی سوفٹ ویئر آزمائیں')}
${t('Works on mobile and PC. All functions visible. Guidance from the owner at every step, lifetime support.|موبائل اور پی سی دونوں پر چلتا ہے۔ تمام فنکشنز نظر آتے ہیں۔ ہر قدم پر اونر کی رہنمائی اور لائف ٹائم سپورٹ۔')}
`}
function shareMsg(k){return `${t('Try this software free for 14 days:|یہ سوفٹ ویئر 14 دن مفت آزمائیں:')}\n${busName(k)}\n${busDesc(k)}\n${trialUrl(k)}\n${t('Opens on mobile and PC with one link.|ایک ہی لنک موبائل اور پی سی دونوں پر کھلتا ہے۔')}`}
let TR={sw:'',id:'',ph:'',pw:''};
function trialNorm(x){let d=String(x||'').replace(/\D/g,'');if(d.startsWith('92')&&d.length===12)d='0'+d.slice(2);else if(d.length===10&&d[0]==='3')d='0'+d;return /^03\d{9}$/.test(d)?d:''}
function trialForm(k){TR={sw:BUS[k]?k:'',id:'',ph:'',pw:''};
hm({title:'🎁 '+t('Free trial|مفت ٹرائل'),body:`
`,
foot:``})}
async function trialNext(){const e=$('#tr_e');e.textContent='';const id=trialNorm($('#tr_p').value),pw=($('#tr_w').value||'').trim();
if(!id){e.textContent=t('Write a correct WhatsApp number (03xx-xxxxxxx)|درست واٹس ایپ نمبر لکھیں (03xx-xxxxxxx)');return}
if(pw.length<6){e.textContent=t('Password: at least 6 letters or digits|پاس ورڈ: کم از کم 6 حروف یا ہندسے');return}
if(!ACC)ACC={v:1,owner:null,tenants:{},users:{},logs:[]};ACC.leads=ACC.leads||[];
if(idTaken(id)||await cloudIdTaken(id)){e.innerHTML=t('This number already has an ID — close this and log in.|اس نمبر کی آئی ڈی پہلے سے بنی ہوئی ہے — اسے بند کر کے لاگ اِن کریں۔');return}
TR.id=id;TR.ph=id;TR.pw=pw;
let lead=ACC.leads.find(l=>l.phone===id);if(!lead){lead={id:'l'+uid(),name:id,phone:id,biz:'',type:'',src:(new URLSearchParams(location.search).get('ref'))||'link',start:Date.now(),status:'new',note:''};ACC.leads.push(lead)}
await outbox('lead',lead);await accSave();
if(TR.sw)trialConfirm(TR.sw);else trialPick()}
function trialPick(){hm({title:'🧰 '+t('Choose your software|اپنا سوفٹ ویئر چنیں'),body:`
${t('Click the software you need.|آپ کو جس طرح کا سوفٹ ویئر چاہیے اس پر کلک کریں۔')} ${t('One number gets one software.|ایک نمبر پر ایک ہی سوفٹ ویئر ملتا ہے۔')}
${Object.keys(BUS).map(k=>``).join('')}
`})}
function trialConfirm(k){TR.sw=k;hm({title:BUS[k].i+' '+busName(k),body:`
${t('Do you want to start the free trial of this software?|کیا آپ اسی سوفٹ ویئر کا مفت ٹرائل شروع کرنا چاہتے ہیں؟')} ${esc(busDesc(k))}
${t('One number gets one software.|ایک نمبر پر ایک ہی سوفٹ ویئر ملتا ہے۔')}
`,
foot:``})}
async function startTrial(k){const e=$('#tr_e');const id=TR.id,ph=TR.ph,pw=TR.pw;if(!id||!pw){closeAll();return trialForm(k)}
if(idTaken(id)){e.textContent=t('This number already has an ID|اس نمبر کی آئی ڈی پہلے سے موجود ہے');return}
const m=await makeTenant({name:ph,type:k,phone:ph,address:'',demo:true,plan:'monthly',mode:{run:'both',store:'device'}},id,pw,ph);
m.plan='trial';m.expiry=Date.now()+TRIAL_DAYS*DAY;m.delOK=true;m.trial={start:Date.now(),days:TRIAL_DAYS,name:ph,phone:ph,src:(new URLSearchParams(location.search).get('ref'))||'link'};
let lead=ACC.leads.find(l=>l.phone===ph);if(!lead){lead={id:'l'+uid(),name:ph,phone:ph,biz:'',src:m.trial.src,start:Date.now(),note:''};ACC.leads.push(lead)}
Object.assign(lead,{type:k,tid:m.tid,status:'trial'});await outbox('lead',lead);await accSave();
const u=tenantUsers(m.tid)[0];closeAll();SESS={k:'user',uid:u.uid};saveSess();
hm({title:'🎉 '+t('Your trial has started|آپ کا ٹرائل شروع ہو گیا'),body:`
📸 ${t('Please save your ID and password.|اپنی آئی ڈی اور پاس ورڈ محفوظ کر لیں۔')}
💬 ${t('Inside the software, tap the chat button to talk to us any time.|سوفٹ ویئر کے اندر چیٹ کا بٹن دبا کر کسی بھی وقت ہم سے بات کریں۔')}
`,
foot:`${ownerWA()?`📲 ${t('Tell the owner|اونر کو بتائیں')}`:''}`})}
function daysLeftTxt(m){const d=daysLeft(m);return d<0?t('ended|ختم'):d+' '+t('days left|دن باقی')}
/* ---------- activation / licence codes ---------- */
const b64u=x=>{const b=typeof x==='string'?new TextEncoder().encode(x):new Uint8Array(x);let s='';b.forEach(c=>s+=String.fromCharCode(c));return btoa(s).replace(/\+/g,'-').replace(/\//g,'_').replace(/=+$/,'')};
const unb64u=s=>{s=s.replace(/-/g,'+').replace(/_/g,'/');while(s.length%4)s+='=';const b=atob(s),a=new Uint8Array(b.length);for(let i=0;i!!(window.crypto&&crypto.subtle&&crypto.subtle.generateKey);
async function ensureKeys(){if(!ACC.owner.keys&&hasSubtle()){const kp=await crypto.subtle.generateKey({name:'ECDSA',namedCurve:'P-256'},true,['sign','verify']);ACC.owner.keys={pub:await crypto.subtle.exportKey('jwk',kp.publicKey),priv:await crypto.subtle.exportKey('jwk',kp.privateKey)};await accSave()}return ACC.owner.keys}
async function signCode(p){const body=b64u(JSON.stringify(p));const k=await ensureKeys();if(!k)return 'SHP0-'+body;const key=await crypto.subtle.importKey('jwk',k.priv,{name:'ECDSA',namedCurve:'P-256'},false,['sign']);const sig=await crypto.subtle.sign({name:'ECDSA',hash:'SHA-256'},key,new TextEncoder().encode(body));return 'SHP1-'+body+'.'+b64u(sig)}
async function readCode(code){code=String(code||'').trim().replace(/\s+/g,'');let signed=false;
if(code.startsWith('SHP1-')){const [body,sig]=code.slice(5).split('.');const pub=(ACC&&ACC.owner&&ACC.owner.keys&&ACC.owner.keys.pub)||(PUB&&PUB.pk);
if(pub&&hasSubtle()){const key=await crypto.subtle.importKey('jwk',pub,{name:'ECDSA',namedCurve:'P-256'},false,['verify']);const ok=await crypto.subtle.verify({name:'ECDSA',hash:'SHA-256'},key,unb64u(sig),new TextEncoder().encode(body));if(!ok)return {err:t('This code is not valid|یہ کوڈ درست نہیں')};signed=true}
return {p:JSON.parse(new TextDecoder().decode(unb64u(body))),signed}}
if(code.startsWith('SHP0-'))return {p:JSON.parse(new TextDecoder().decode(unb64u(code.slice(5)))),signed:false};
return {err:t('This code is not valid|یہ کوڈ درست نہیں')}}
function activateModal(){hm({title:'🔑 '+t('Activate / renew with code|کوڈ سے فعال / تجدید کریں'),body:`
${t('Paste the activation code the owner sent you on WhatsApp.|اونر نے واٹس ایپ پر جو کوڈ بھیجا ہے وہ یہاں لگائیں۔')}
`,foot:``})}
async function applyCode(){const e=$('#ac_e');e.textContent='';let r;try{r=await readCode($('#ac_c').value)}catch(x){r={err:t('This code is not valid|یہ کوڈ درست نہیں')}}
if(r.err){e.textContent=r.err;return}const p=r.p;const u=allUsers().find(x=>x.id===normId(p.id)&&x.role==='admin');if(!u){e.textContent=t('This code is for another ID|یہ کوڈ کسی اور آئی ڈی کا ہے');return}
if(!r.signed&&!confirm(t('This code could not be verified on this device. Continue?|اس ڈیوائس پر کوڈ کی تصدیق نہیں ہو سکی۔ جاری رکھیں؟')))return;
const m=ACC.tenants[u.tid];m.expiry=p.exp;m.plan=p.plan||m.plan;if(p.pid)m.planId=p.pid;if(p.mode)m.mode=p.mode;delete m.trial;m.status='active';m.delOK=m.delOK;if(m.offer===undefined)m.offer='';
await accSave();closeAll();toast(t('Activated ✅ — valid until |فعال ✅ — مدت: ')+fmtDate(m.expiry),'ok');if(SESS&&SESS.tid===m.tid){showScr('app');renderBar()}else if(SCR==='blocked'){SESS={k:'user',uid:u.uid};saveSess();enterTenant(u)}}
/* ---------- data / account files ---------- */
function dl(name,obj){const a=document.createElement('a');a.href=URL.createObjectURL(new Blob([typeof obj==='string'?obj:JSON.stringify(obj)],{type:'application/json'}));a.download=name;a.click()}
async function exportMyData(tid){tid=tid||SESS.tid;const m=ACC.tenants[tid];const d=await KV.get('t_'+tid);if(!d){toast(t('No saved data here (pharmacy keeps its own backup inside the software)|یہاں ڈیٹا نہیں (فارمیسی کا بیک اپ سوفٹ ویئر کے اندر ہے)'),'err');return}dl('backup-'+(m.name||'data').replace(/[^\w]+/g,'_')+'-'+new Date().toISOString().slice(0,10)+'.json',{kind:'shp-data',tid,type:m.type,data:d})}
async function exportCust(tid){const m=ACC.tenants[tid];const d=await KV.get('t_'+tid);const pk=(await ensureKeys());dl((m.name||'customer').replace(/[^\w]+/g,'_')+'.shpacc',{kind:'shp-acc',v:1,tenant:m,users:tenantUsers(tid),data:d||null,pk:pk&&pk.pub,owner:{name:ownerName(),wa:ownerWA()},plans:allPlans(),pay:cfgPay()});toast(t('Account file downloaded — send it to the customer on WhatsApp|اکاؤنٹ فائل ڈاؤن لوڈ ہو گئی — کسٹمر کو واٹس ایپ پر بھیجیں'),'ok')}
function importAccPick(){const i=document.createElement('input');i.type='file';i.accept='.shpacc,.json';i.onchange=async()=>{const f=i.files[0];if(!f)return;try{await importAcc(JSON.parse(await f.text()))}catch(e){toast(t('Invalid file|فائل درست نہیں'),'err')}};i.click()}
async function importAcc(j){if(!j||j.kind!=='shp-acc')throw 0;if(!ACC)ACC={v:1,owner:null,tenants:{},users:{},logs:[]};
if(ACC.owner){toast(t('This is the owner device — customer files are for customer devices|یہ اونر کی ڈیوائس ہے — کسٹمر فائل کسٹمر کی ڈیوائس کے لیے ہے'),'err');return}
const m=j.tenant;if(ACC.tenants[m.tid]&&!confirm(t('This account already exists here. Replace it?|یہ اکاؤنٹ یہاں پہلے سے ہے۔ بدل دیں؟')))return;
ACC.tenants[m.tid]=m;j.users.forEach(u=>ACC.users[u.uid]=u);if(j.data)await KV.set('t_'+m.tid,j.data);
PUB=Object.assign({},PUB||{},{name:j.owner&&j.owner.name,wa:j.owner&&j.owner.wa,pk:j.pk,plans:j.plans,pay:j.pay,faq:j.faq,fx:j.fx,welcome:j.welcome});await KV.set('pubcfg',PUB);await accSave();toast(t('Account added ✅ — now log in|اکاؤنٹ شامل ہو گیا ✅ — اب لاگ اِن کریں'),'ok');renderLogin()}
async function publishCfg(){await ensureKeys();dl('shp-config.json',{v:Date.now(),name:ownerName(),wa:ownerWA(),plans:allPlans(),pay:cfgPay(),pk:ACC.owner.keys&&ACC.owner.keys.pub,faq:ACC.owner.faq||[],fx:ACC.owner.fx||{},welcome:ACC.owner.welcome||''});
hm({title:'📤 '+t('Settings file ready|سیٹنگز فائل تیار'),body:`
${t('The file shp-config.json was downloaded. Upload it next to index.html on your hosting. Then every trial user and customer sees your latest WhatsApp number, prices and payment methods.|فائل shp-config.json ڈاؤن لوڈ ہو گئی۔ اسے ہوسٹنگ پر index.html کے ساتھ اپلوڈ کر دیں۔ اس کے بعد ہر ٹرائل والے اور کسٹمر کو آپ کا تازہ واٹس ایپ نمبر، قیمتیں اور ادائیگی کے طریقے نظر آئیں گے۔')}
`})}
/* ---------- owner: plans editor ---------- */
function plansEdit(){const P=allPlans(),pay=cfgPay();
hm({title:'⚙ '+t('Edit prices & plans|قیمتیں اور پلان بدلیں'),wide:true,body:`
${t('Change any price any time. Tick “Show” to show a plan in the trial price list.|کسی بھی وقت کوئی بھی قیمت بدلیں۔ “دکھائیں” پر ٹک لگائیں تو پلان ٹرائل کی قیمتوں میں نظر آئے گا۔')}
${P.map((p,i)=>peRow(p,i)).join('')}
🧾 ${t('Payment methods|ادائیگی کے طریقے')}
${pay.methods.map((m,i)=>pmRow(m)).join('')}
`,foot:``})}
const peRow=(p,i)=>`
`;
const pmRow=m=>`
`;
function peAdd(){$('#pe_l').insertAdjacentHTML('beforeend',peRow({id:'p'+uid(),ur:'نیا پلان',en:'New plan',buy:0,month:0,year:0,run:'both',store:'device',on:1,pts:[]},0))}
async function peSave(pub){const rows=[...document.querySelectorAll('.perow')].map(r=>{const q=c=>r.querySelector('.'+c);return {id:r.dataset.id,ur:q('pe_ur').value.trim(),en:q('pe_en').value.trim()||q('pe_ur').value.trim(),buy:num0(q('pe_buy').value),month:num0(q('pe_month').value),year:num0(q('pe_year').value),run:q('pe_run').value,store:q('pe_store').value,on:q('pe_on').checked?1:0,addon:q('pe_add').checked?1:0,pts:JSON.parse(q('pe_pts').value||'[]')}});
const methods=[...document.querySelectorAll('.pmrow')].map(r=>({n:r.querySelector('.pm_n').value.trim(),no:r.querySelector('.pm_no').value.trim(),title:r.querySelector('.pm_t').value.trim()})).filter(m=>m.n);
ACC.plans=rows;ACC.pay={methods,note:$('#pe_note').value.trim()};ACC.owner.phone=$('#pe_wa').value.trim();await accSave();closeAll();toast(t('Saved ✅|محفوظ ✅'),'ok');if(pub)publishCfg();else renderOwner()}
const num0=v=>{const n=parseFloat(v);return Number.isFinite(n)?n:0};
/* ---------- owner: payments / renewal ---------- */
const PAYKINDS=[['buy',['One-time purchase|ایک بار خرید']],['month',['Monthly|ماہانہ']],['year',['Yearly (advance)|سالانہ (پیشگی)']],['buymonth',['Purchase + first month|خرید + پہلا مہینہ']],['buyyear',['Purchase + yearly|خرید + سالانہ']]];
function payAmount(p,kind){return (kind.includes('buy')?num0(p.buy):0)+(kind.endsWith('month')?num0(p.month):0)+(kind.endsWith('year')?num0(p.year):0)}
let _payTid='';
function payModal(tid,codeFor){_payTid=tid||'';const m=tid?ACC.tenants[tid]:null,adm=m&&tenantUsers(tid).find(u=>u.role==='admin');
const P=allPlans().filter(p=>p.on!==0);const cur=m&&m.planId&&P.find(p=>p.id===m.planId)?m.planId:(P[1]||P[0]).id;
hm({title:'💰 '+(m?esc(m.name):t('Activation code for a customer|کسٹمر کے لیے فعالیت کوڈ')),body:`${m?'':``}
`,
foot:``});payCalc()}
function payCalc(){const p=planOf($('#py_p').value),k=$('#py_k').value;if(!p)return;$('#py_a').value=payAmount(p,k)||'';const r=newExpiry(p,k,ACC.tenants[_payTid]);$('#py_r').textContent=t('New validity|نئی مدت')+': '+fmtDate(r)}
function newExpiry(p,kind,m){const base=m&&!m.trial&&m.expiryDate.now()?m.expiry:Date.now()+30*DAY)}
async function paySave(tid){const p=planOf($('#py_p').value),k=$('#py_k').value;let m=tid?ACC.tenants[tid]:null,adm=null;
if(!m){const id=normId($('#py_id').value);adm=allUsers().find(u=>u.id===id&&u.role==='admin');if(id&&adm)m=ACC.tenants[adm.tid];if(!id){toast(t('Enter customer ID|کسٹمر کی آئی ڈی لکھیں'),'err');return}}else adm=tenantUsers(tid).find(u=>u.role==='admin');
const exp=newExpiry(p,k,m),amt=num0($('#py_a').value),mode={run:p.run,store:p.store==='both'?'both':p.store};
let local=!!m;const id=adm?adm.id:normId($('#py_id').value);
if(m){m.expiry=exp;m.plan=exp>=LIFETIME?'lifetime':k.endsWith('year')?'yearly':'monthly';m.planId=p.id;m.mode=mode;m.status='active';delete m.trial;if(m.delOK===undefined)m.delOK=false}
ACC.payments=ACC.payments||[];ACC.paySeq=(ACC.paySeq||0)+1;const rec={id:'y'+uid(),no:'R-'+String(ACC.paySeq).padStart(4,'0'),tid:m?m.tid:'',cid:id,name:m?m.name:id,phone:m?m.phone:'',planId:p.id,planName:planTitle(p),kind:k,amount:amt,method:$('#py_m').value,note:$('#py_n').value.trim(),ts:Date.now(),exp};
ACC.payments.push(rec);(ACC.leads||[]).forEach(l=>{if(m&&l.tid===m.tid)l.status='bought'});await outbox('payment',rec);await accSave();
const code=await signCode({id,pid:p.id,plan:exp>=LIFETIME?'lifetime':k.endsWith('year')?'yearly':'monthly',exp,mode,ts:Date.now()});closeAll();payReceipt(rec,code,!!m);if(SCR==='cust'||SCR==='owner')renderOwner()}
function payReceipt(r,code,local){const kt=t((PAYKINDS.find(k=>k[0]===r.kind)||['',[r.kind]])[1][0]);const msg=`${t('Payment received — thank you!|ادائیگی وصول — شکریہ!')}\n${t('Receipt|رسید')} ${r.no}\n${r.planName}\n${kt}: ${pf(r.amount)}\n${t('Valid until|مدت')}: ${fmtDate(r.exp)}${code?`\n\n${t('Activation code (paste in your software: ☰ → Activate):|فعالیت کوڈ (اپنے سوفٹ ویئر میں ☰ ← فعال کریں میں لگائیں):')}\n${code}`:''}`;
hm({title:'🧾 '+r.no,wide:true,body:`
NAVEED BUSINESS SOFTWARES${esc(ownerName())}${ownerWA()?' · '+esc(ownerWA()):''}
`}`,foot:``})}
/* ---------- owner: leads / trials ---------- */
const LEADMSG={
welcome:['Welcome to your free trial|ٹرائل میں خوش آمدید',l=>`السلام علیکم ${l.name}!\n${ownerName()} کی طرف سے ${busName(l.type)} کے مفت ٹرائل میں خوش آمدید۔ ہر قدم پر میں آپ کی رہنمائی کروں گا۔ کوئی بھی مسئلہ ہو تو اسی نمبر پر لکھیں۔`],
d10:['Day-10 reminder|دن 10 کی یاد دہانی',l=>`السلام علیکم ${l.name}!\nآپ کے ${busName(l.type)} ٹرائل کے چند دن باقی ہیں۔ کیا آپ کو سوفٹ ویئر پسند آیا؟ کوئی سوال ہو تو بتائیں۔ قیمتیں اور پلان بھیج دوں؟`],
d13:['Last-day reminder|آخری دن کی یاد دہانی',l=>`السلام علیکم ${l.name}!\nآپ کا ٹرائل کل ختم ہو رہا ہے۔ اپنا ڈیٹا ضائع ہونے سے بچانے کے لیے آج ہی پلان لے لیں — میں فوراً آپ کی آئی ڈی فعال کر دوں گا۔`],
price:['Send prices|قیمتیں بھیجیں',l=>`السلام علیکم ${l.name}!\n${ACC.pc?'':''}`+cfgPlans().map(p=>`• ${p.ur}\n${p.buy?' خرید: '+pf(p.buy)+'\n':''}${p.month?' ماہانہ: '+pf(p.month)+'\n':''}${p.year?' سالانہ پیشگی: '+pf(p.year)+'\n':''}`).join('\n')+'\nہر قدم پر رہنمائی اور لائف ٹائم سپورٹ شامل ہے۔']};
function leadsModal(){ACC.leads=ACC.leads||[];const L=ACC.leads.slice().sort((a,b)=>b.start-a.start);const cnt=s=>L.filter(l=>l.status===s).length;
hm({title:'🎁 '+t('Trials & leads|ٹرائل اور لیڈز'),wide:true,body:`
${L.length}${t('All|سب')}
${cnt('trial')+cnt('sent')}${t('On trial / sent|ٹرائل پر / بھیجا')}
${t('No trials yet. Share a trial link — people who open it appear here.|ابھی کوئی ٹرائل نہیں۔ ٹرائل لنک بھیجیں — جو بھی کھولے گا یہاں نظر آئے گا۔')}
`}
☁ ${t('Trials started on other people\'s phones appear here automatically once online save (Firebase) is connected. Until then add them with “Add lead”.|دوسروں کے فون پر شروع ہونے والے ٹرائل آن لائن سیو (Firebase) جڑنے پر خود یہاں آئیں گے۔ تب تک “لیڈ شامل کریں” سے درج کریں۔')} ${OUTN?`(${OUTN} ${t('waiting|انتظار میں')})`:''}
`,
foot:``})}
async function setLead(id,s){const l=ACC.leads.find(x=>x.id===id);if(l){l.status=s;await accSave()}}
async function delLead(id){if(!confirm(t('Remove this lead?|یہ لیڈ ہٹائیں؟')))return;ACC.leads=ACC.leads.filter(x=>x.id!==id);await accSave();closeAll();leadsModal()}
function leadWA(id,ev){ev.stopPropagation();const l=ACC.leads.find(x=>x.id===id);const m=document.createElement('div');m.className='menu';m.innerHTML=Object.keys(LEADMSG).map(k=>``).join('');const b=ev.target.closest('button').getBoundingClientRect();document.body.appendChild(m);m.style.top=(b.bottom+4)+'px';m.style.left=Math.max(6,Math.min(b.left,innerWidth-230))+'px';m.style.zIndex=9999;
m.onclick=async e=>{const k=e.target.dataset&&e.target.dataset.k;if(!k)return;m.remove();window.open(waURL(l.phone,LEADMSG[k][1](l)),'_blank');if(l.status==='trial'||l.status==='new'||l.status==='sent'){l.status='contacted';await accSave()}};setTimeout(()=>document.addEventListener('click',()=>m.remove(),{once:true}),0)}
function leadForm(){hm({title:'➕ '+t('Add lead|لیڈ شامل کریں'),body:``,foot:``})}
async function saveLead(){const n=$('#ld_n').value.trim();if(!n)return;ACC.leads=ACC.leads||[];const l={id:'l'+uid(),name:n,phone:$('#ld_p').value.trim(),type:$('#ld_t').value,src:$('#ld_s').value.trim()||'manual',start:Date.now(),status:'new',biz:''};ACC.leads.push(l);await accSave();closeAll();leadsModal()}
function sendTrialModal(){hm({title:'📤 '+t('Send a trial to a person|کسی کو ٹرائل بھیجیں'),body:`
${t('Pick the software the person needs. One tap opens WhatsApp with the trial link ready.|جو سوفٹ ویئر اس شخص کو چاہیے وہ چنیں۔ ایک ٹچ میں واٹس ایپ کھلے گا اور ٹرائل لنک تیار ہوگا۔')}
`,
foot:``})}
async function doSendTrial(){const k=$('#st_t').value,n=$('#st_n').value.trim(),p=$('#st_p').value.trim();ACC.leads=ACC.leads||[];if(n||p){ACC.leads.push({id:'l'+uid(),name:n||p,phone:p,type:k,src:'sent by owner',start:Date.now(),status:'sent',biz:''});await accSave()}
const msg=`${n?'السلام علیکم '+n+'!\n':''}${ownerName()} ${t('invites you to a free 14-day trial of|آپ کو 14 دن کے مفت ٹرائل کی دعوت دیتا ہے:')} ${busName(k)}\n${busDesc(k)}\n${trialUrl(k)}\n${t('Opens on mobile and PC. Guidance at every step and lifetime support.|موبائل اور پی سی دونوں پر کھلتا ہے۔ ہر قدم پر رہنمائی اور لائف ٹائم سپورٹ۔')}`;closeAll();window.open(p?waURL(p,msg):'https://wa.me/?text='+encodeURIComponent(msg),'_blank')}
function trialLinksModal(){const warn=location.protocol==='file:'?`
${t('This link works for others only after you put the software on a website (hosting). Until then it opens only on this computer.|یہ لنک دوسروں کے لیے تب کام کرے گا جب آپ سوفٹ ویئر کو ویب سائٹ (ہوسٹنگ) پر رکھیں گے۔ تب تک یہ صرف اسی کمپیوٹر پر کھلے گا۔')}
`:'';
hm({title:'🔗 '+t('Trial links (one link for mobile & PC)|ٹرائل لنکس (موبائل اور پی سی کے لیے ایک ہی لنک)'),wide:true,body:`${warn}
`})}
async function doReq(id,yes){const R=await reqList();const r=R.find(x=>x.id===id);if(!r)return;
if(yes){try{await tsync(r.tid,null)}catch(e){}const d=await KV.get('t_'+r.tid);if(!d||!d.c||!d.c[r.coll]){toast(t('Cannot find the data|ڈیٹا نہیں ملا'),'err');return}d.c[r.coll]=d.c[r.coll].filter(x=>x.id!==r.rid);await KV.set('t_'+r.tid,d);try{await tsync(r.tid,null)}catch(e){}r.status='approved'}else r.status='rejected';r.done=Date.now();await KV.set('reqs',R);
if(HUB.ctx&&HUB.ctx.tid===r.tid&&yes){HUB.tdb=await KV.get('t_'+r.tid);remountApp()}closeAll();toast(yes?t('Deleted ✅ — cash & accounts adjust automatically|حذف ✅ — کیش اور حساب خود درست ہو گئے'):t('Rejected|رد کر دیا'),'ok');reqsModal();renderOwner()}
/* ---------- helpers used by dashboard ---------- */
async function pendingReqs(){return (await reqList()).filter(r=>r.status==='pending').length}
/* ---------- owner WhatsApp per customer + in-app chat ---------- */
const custWA=tid=>{const m=ACC&&ACC.tenants[tid||(SESS&&SESS.tid)];return (m&&m.ownerWA)||ownerWA()};
function supportWA2(){const w=custWA();if(!w){toast(t('Owner WhatsApp number is not set|اونر کا واٹس ایپ نمبر سیٹ نہیں'),'err');return}window.open(waURL(w,supportMsg()),'_blank')}
async function chatAll(){return (await KV.get('chat'))||{}}
async function chatSend(tid,from,txt,lgx){const el=$('#ch_t');const x=(txt||(el&&el.value)||'').trim();if(!x)return;const all=await chatAll();const th=all[tid]=all[tid]||[];const msg={id:'c'+uid(),tid,from,text:chipLabel(x),ts:Date.now()};th.push(msg);await outbox('chat',msg);if(from==='cust'&&!th.some(c=>c.auto)){const w={id:'c'+uid(),tid,from:'owner',auto:true,text:welcomeMsg(tid),chips:['sw','f:d30','f:np01'],ts:Date.now()+1};th.push(w);await outbox('chat',w)}
if(from==='cust'){const r=botReply(x,{sw:(ACC.tenants[tid]||{}).type,lg:(txt&&lgx)||''});const bm={id:'c'+uid(),tid,from:'owner',auto:true,bot:true,text:r.text,chips:r.chips||[],ts:Date.now()+2};th.push(bm);await outbox('chat',bm)}await KV.set('chat',all);if(el)el.value='';chatDraw(tid,from)}
/* show the START of the newest incoming reply (not its end); highlight it so the reader notices a reply arrived */
function chatScrollNew(box){if(!box)return;const ms=[...box.querySelectorAll('.chm')];if(!ms.length)return;let k=ms.length;while(k>0&&ms[k-1].classList.contains('ot'))k--;
if(k===ms.length){box.scrollTop=box.scrollHeight;return}
const first=ms[k];first.classList.add('newrep');if(!first.querySelector('.nwtag')){const g=document.createElement('span');g.className='nwtag';g.textContent='🔔 '+t('New reply|نیا جواب');first.insertBefore(g,first.firstChild)}
box.scrollTop=Math.max(0,box.scrollTop+first.getBoundingClientRect().top-box.getBoundingClientRect().top-6)}
async function chatDraw(tid,from){const all=await chatAll();const th=all[tid]||[];const box=$('#ch_box');if(!box)return;
box.innerHTML=th.length?th.map(c=>`
${esc(c.text)}
${fdt(c.ts)}
`).join(''):`
${t('No messages yet — write the first one.|ابھی کوئی پیغام نہیں — پہلا پیغام لکھیں۔')}
`;chatScrollNew(box);const ch=$('#ch_chips');if(ch)ch.innerHTML=from==='cust'?chipRow('chatChip',(()=>{const lb=[...th].reverse().find(c=>c.from==='owner'&&c.chips);return lb?lb.chips:null})()):''}
function chatModal(tid){const own=!!(SESS&&SESS.k==='owner'||SESS&&SESS.imp);tid=tid||SESS.tid;const m=ACC.tenants[tid];const from=(SESS&&SESS.imp&&!m.own)||(SESS&&SESS.k==='owner')?'owner':'cust';const w=from==='owner'?(m.phone||''):custWA(tid);
hm({title:'💬 '+(from==='owner'?esc(m.name):t('Chat with the owner|اونر سے چیٹ')),body:`
${t('Messages are saved here and reach the other side when online save is connected. For an instant reply use WhatsApp.|پیغامات یہاں محفوظ ہوتے ہیں اور آن لائن سیو جڑتے ہی دوسری طرف پہنچ جائیں گے۔ فوری جواب کے لیے واٹس ایپ استعمال کریں۔')}
`,
foot:w?`📲 WhatsApp`:''});chatDraw(tid,from);if(from==='cust')chatPullCust(tid).then(n=>{if(n)chatDraw(tid,from)}).catch(()=>{})}
function welcomeMsg(tid){const m=(ACC&&ACC.tenants&&ACC.tenants[tid])||{};const wm=(ACC&&ACC.owner&&ACC.owner.welcome)||(PUB&&PUB.welcome);if(wm)return wm.replace('{name}',m.name||'');
return LANG==='ur'?`السلام علیکم ${m.name||''}! 🌸\nنوید بزنس سافٹ ویئرز میں خوش آمدید۔ سرکاری اور نجی ملازمین: جی پی فنڈ، ایڈوانس، ریٹائرمنٹ اور پنشن کے کاغذات کے بارے میں نیچے سے سوال چنیں یا اپنا سوال لکھیں، فوراً جواب ملے گا۔ فوری مدد کے لیے واٹس ایپ پر رابطہ کریں۔`:`Assalam o Alaikum ${m.name||''}! 🌸\nWelcome to Naveed Business Softwares. Government and private employees: ask about GPF, advance, retirement and pension papers — tap a question below or type your own. For urgent help, contact us on WhatsApp.`}
function chatChip(x,lg){chatSend(SESS.tid,'cust',x,lg)}
/* ===== Ads: one beautiful poster per software (and for house plans) -> JPG + clickable link, share on WhatsApp / Facebook ===== */
const AD_BRAND='نوید بزنس سوفٹ ویئرز';
const adEsc=s=>String(s==null?'':s).replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"');
const adShade=(h,k)=>{const n=parseInt(h.slice(1),16);let r=n>>16,g=(n>>8)&255,b=n&255;const f=x=>Math.max(0,Math.min(255,Math.round(k<0?x*(1+k):x+(255-x)*k)));return '#'+((1<<24)|(f(r)<<16)|(f(g)<<8)|f(b)).toString(16).slice(1)};
const AD_PLANS={i:'📐',c:'#7c3aed',ur:'مکان، دکان، فلیٹ اور اپارٹمنٹ کے نقشے',en:'House, Shop, Flat & Apartment Plans',tag:'خوبصورت 2D اور 3D نقشے — خصوصی رعایتی قیمت پر',feat:['📐 2D نقشہ','🧊 3D منظر','🏠 مکان','🏪 دکان','🏢 فلیٹ','🏬 اپارٹمنٹ','🏷 رعایتی قیمت','💬 واٹس ایپ پر آرڈر']};
function adKinds(){return Object.keys(BUS).filter(k=>(funcsOf(k)||[]).length||BUSD[k]).concat(['plans'])}
function adInfo(k){if(k==='plans')return AD_PLANS;const b=BUS[k];const d=BUSD[k];const fs=[];(funcsOf(k)||[]).forEach(g=>g.items.forEach(i=>{const t=BT(i.t,'ur');if(t&&!fs.includes((i.i||'•')+' '+t))fs.push((i.i||'•')+' '+t)}));
return {i:b.i,c:b.c,ur:b.ur,en:b.en,tag:d?d[1]:'',feat:fs.slice(0,12)}}
function adLink(k){const w=(typeof ownerWA==='function'&&ownerWA())?'&w='+normWA(ownerWA()):'';return baseUrl()+'?chat='+(k==='plans'?'':k)+'&ref=ad'+w}
const AD_CTA='مزید معلومات کے لیے لنک پر کلک کریں اور آن لائن سوال کریں';
function adText(k,extra){const a=adInfo(k);return (extra?extra.trim()+'\n\n':'')+'🌟 *'+a.ur+'*\n'+(a.tag?a.tag+'\n':'')+'\n💊 فارمیسی · 🧪 لیب · 🏫 اسکول · 🛒 جنرل اسٹور · 🏪 کریانہ اسٹور · 🏢 آفس · 🏨 ہوٹل و ریسٹورنٹ\n📐 دکان، مکان، فلیٹ اور اپارٹمنٹ کے نقشے رعایتی قیمت پر\n\n👇 '+AD_CTA+'\n'+adLink(k)+'\n— '+AD_BRAND}
/* ---- small drawings for the house-plan poster (2D plan + 3D box house), all made by code ---- */
function adPlan2D(c){const R=(x,y,w,h,f,l,lx,ly)=>`${l}`;
return ``}
function adPlan3D(c){const d=adShade(c,-.2);return ``}
function adHtml(k){const a=adInfo(k),c1=a.c,c2=adShade(a.c,-.45),W=1080,H=1350;const w=(typeof ownerWA==='function'&&ownerWA())?ownerWA():'';
const tile=f=>`
${adEsc(f)}
`;
const grid=k==='plans'
?`
2D نقشہ
${adPlan2D(c1)}
3D منظر
${adPlan3D(c1)}
${a.feat.slice(2).map(f=>`
${tile(f)}
`).join('')}
`
:`
${a.feat.map(f=>`
${tile(f)}
`).join('')}
`;
const badges=['📱💻 موبائل اور کمپیوٹر','🌐 آن لائن اور آف لائن','🎁 '+TRIAL_DAYS+' دن مفت ٹرائل'].map(b=>`
${adEsc(b)}
`).join('');
return `
🌐 ${AD_BRAND}
${adEsc(a.en||'')}
${a.i}
${adEsc(a.ur)}
${adEsc(a.tag||'')}
✨ ${k==='plans'?'ہم کیا بناتے ہیں':'اس میں کیا کیا ہے'}
`}
let AD_FONT=null;
async function adFont(){if(AD_FONT!==null)return AD_FONT;try{const r=await fetch('jameel-noori.woff');if(!r.ok)throw 0;const b=new Uint8Array(await r.arrayBuffer());let s='';for(let i=0;i${adHtml(k)}`;
const u8=new TextEncoder().encode(svg);let bs='';for(let i=0;i{const i=new Image();i.onload=()=>ok(i);i.onerror=()=>no(new Error('svg'));i.src='data:image/svg+xml;base64,'+btoa(bs)});
const c=document.createElement('canvas');c.width=Math.round(W*scale);c.height=Math.round(H*scale);const x=c.getContext('2d');x.fillStyle='#fff';x.fillRect(0,0,c.width,c.height);x.scale(scale,scale);x.drawImage(img,0,0);return c}
const adBlob=(c,q)=>new Promise((ok,no)=>c.toBlob(b=>b?ok(b):no(new Error('blob')),'image/jpeg',q));
const AD_CACHE={};let AD_CUR='';
async function adFull(k){if(!AD_CACHE[k])AD_CACHE[k]=await adBlob(await adCanvas(k,3),0.95);return AD_CACHE[k]}
function adsModal(k){const kinds=adKinds();AD_CUR=kinds.includes(k)?k:kinds[0];
hm({title:'📣 '+t('Ads — share on WhatsApp & Facebook|اشتہارات — واٹس ایپ اور فیس بک پر شیئر کریں'),wide:true,body:`
${t('Write a message to go with the picture (optional). The link is added automatically.|تصویر کے ساتھ جانے والا پیغام لکھیں (اختیاری)۔ لنک خود بخود ساتھ لگ جائے گا۔')}
`,
foot:``});
adDraw()}
function adDraw(){const box=document.getElementById('ad_chips');if(!box)return;box.innerHTML=adKinds().map(k=>{const a=adInfo(k);return ``}).join('');adPrev();adPreview()}
function adPick(k){AD_CUR=k;adDraw()}
function adPrev(){const p=document.getElementById('ad_prev');if(p)p.textContent=adText(AD_CUR,(document.getElementById('ad_msg')||{}).value||'')}
async function adPreview(){const im=document.getElementById('ad_img');if(!im)return;const k=AD_CUR;try{const c=await adCanvas(k,0.5);if(AD_CUR===k)im.src=c.toDataURL('image/jpeg',0.8)}catch(e){im.alt='…'}}
const adName=k=>'naveed-'+k+'-ad.jpg';
async function adShare(){const k=AD_CUR,text=adText(k,(document.getElementById('ad_msg')||{}).value||'');toast(t('Preparing high-quality picture…|اعلیٰ کوالٹی کی تصویر تیار ہو رہی ہے…'));
try{const blob=await adFull(k),file=new File([blob],adName(k),{type:'image/jpeg'});
if(navigator.canShare&&navigator.canShare({files:[file]})){try{await navigator.share({files:[file],text});return}catch(e){if(e&&e.name==='AbortError')return}}
adSave(blob,adName(k));try{navigator.clipboard.writeText(text)}catch(e){}toast(t('Direct share is not available here. The picture is downloaded and the message is copied — attach the picture in WhatsApp and paste.|یہاں براہِ راست شیئر نہیں ہو سکتا۔ تصویر ڈاؤن لوڈ ہو گئی اور پیغام کاپی ہو گیا؛ واٹس ایپ میں تصویر لگائیں اور پیغام پیسٹ کریں۔'));window.open('https://wa.me/?text='+encodeURIComponent(text),'_blank')
}catch(e){toast(t('Could not make the picture on this browser.|اس براؤزر میں تصویر نہیں بن سکی۔')+' ['+String((e&&e.message)||e).slice(0,40)+']')}}
async function adShareLink(){const text=adText(AD_CUR,(document.getElementById('ad_msg')||{}).value||'');if(navigator.share){try{await navigator.share({text});return}catch(e){if(e&&e.name==='AbortError')return}}try{navigator.clipboard.writeText(text)}catch(e){}window.open('https://wa.me/?text='+encodeURIComponent(text),'_blank')}
function adSave(blob,name){const a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download=name;document.body.appendChild(a);a.click();setTimeout(()=>{URL.revokeObjectURL(a.href);a.remove()},4000)}
async function adDownload(){try{adSave(await adFull(AD_CUR),adName(AD_CUR))}catch(e){toast(t('Could not make the picture.|تصویر نہیں بن سکی۔'))}}
function adCopy(){const text=adText(AD_CUR,(document.getElementById('ad_msg')||{}).value||'');try{navigator.clipboard.writeText(text);toast(t('Copied|کاپی ہو گیا'))}catch(e){}}
/* ===== Jobs News website: owner manager (items, local news, site settings) -> exports news-data.json for the public page news.html ===== */
const NW_TYPES=[['job','💼 آسامی'],['test','📝 ٹیسٹ'],['interview','🎤 انٹرویو'],['result','🎓 رزلٹ'],['admit','🎒 داخلہ']];
const NW_PROV=['','بلوچستان','پنجاب','سندھ','خیبر پختونخوا','اسلام آباد','آزاد کشمیر','گلگت بلتستان'];
function nwData(){ACC.news=ACC.news||{items:[],local:[],site:{name:'نوید جابز نیوز',wa:''}};ACC.news.items=ACC.news.items||[];ACC.news.local=ACC.news.local||[];ACC.news.site=ACC.news.site||{name:'نوید جابز نیوز',wa:''};return ACC.news}
function nwTypeName(k){return (NW_TYPES.find(x=>x[0]===k)||['',k])[1]}
function nwExport(){const d=nwData();const out={updated:new Date().toISOString(),site:{name:d.site.name||'نوید جابز نیوز',wa:d.site.wa||''},items:d.items.map(i=>({id:i.id,type:i.type,title:i.title,org:i.org||'',city:i.city||'',prov:i.prov||'',deadline:i.deadline||'',src:i.src||'',srcName:i.srcName||'',note:i.note||'',img:i.img||'',ts:i.ts})),local:d.local.map(i=>({id:i.id,title:i.title,src:i.src||'',srcName:i.srcName||'',ts:i.ts})),sources:(d.sources||[]).map(x=>({name:x.name,url:x.url,prov:x.prov||'',org:x.org||''})),hide:(d.hide||[]).slice(-500)};return out}
function nwDownload(){const o=nwExport();dl('news-data.json',JSON.stringify(o));toast(t('news-data.json downloaded. Upload it to Cloudflare next to index.html.|news-data.json ڈاؤن لوڈ ہو گئی۔ اسے Cloudflare میں index.html کے ساتھ اپ لوڈ کریں۔'),'ok')}
function newsAdmin(){const d=nwData();const rows=d.items.slice().sort((a,b)=>(b.ts||0)-(a.ts||0)).map(i=>`
${t('Add ads here, then press "Download news-data.json" and upload that file to Cloudflare (replace the old one) next to index.html. The public page is the main address of your domain.|یہاں اشتہار ڈالیں، پھر "news-data.json ڈاؤن لوڈ" دبائیں اور وہ فائل Cloudflare میں index.html کے ساتھ اپ لوڈ کر دیں (پرانی کی جگہ)۔ عوامی صفحہ آپ کے ڈومین کا مرکزی پتہ ہے۔')}
${t('Ads|اشتہارات')} (${d.items.length})${rows}${loc?`${t('Local news|لوکل خبریں')}${loc}`:''}`})}
function nwForm(id){const d=nwData(),i=d.items.find(x=>x.id===id)||{type:'job',prov:'بلوچستان'};
hm({title:id?t('Edit ad|اشتہار میں ترمیم'):t('New ad|نیا اشتہار'),body:`
`,
foot:``})}
function nwPic(inp){const f=inp.files&&inp.files[0];if(!f)return;const r=new FileReader();r.onload=()=>{const im=new Image();im.onload=()=>{const M=1400,k=Math.min(1,M/Math.max(im.width,im.height));const c=document.createElement('canvas');c.width=Math.round(im.width*k);c.height=Math.round(im.height*k);c.getContext('2d').drawImage(im,0,0,c.width,c.height);const u=c.toDataURL('image/jpeg',.82);$('#nw_img').value=u;const p=$('#nw_im');p.src=u;p.style.display='';if(u.length>700000)$('#nw_e').textContent=t('Picture is large; the file will be heavy. Use a smaller one if possible.|تصویر بڑی ہے، فائل بھاری ہوگی۔ ہو سکے تو چھوٹی تصویر لیں۔')};im.src=r.result};r.readAsDataURL(f)}
async function nwSave(id){const d=nwData(),ti=$('#nw_ti').value.trim(),e=$('#nw_e');if(!ti){e.textContent=t('Enter a title|عنوان لکھیں');return}
const src=$('#nw_s').value.trim();if(src&&!/^https?:\/\//i.test(src)){e.textContent=t('Link must start with http:// or https://|لنک http:// یا https:// سے شروع ہو');return}
const o=d.items.find(x=>x.id===id)||{id:'n'+uid(),ts:Date.now()};Object.assign(o,{type:$('#nw_t').value,title:ti,org:$('#nw_o').value.trim(),city:$('#nw_c').value.trim(),prov:$('#nw_p').value,deadline:$('#nw_d').value,srcName:$('#nw_sn').value.trim(),src,note:$('#nw_n').value.trim(),img:$('#nw_img').value});if(!id)d.items.push(o);await accSave();closeAll();newsAdmin()}
async function nwDel(id){if(!confirm(t('Delete this ad?|یہ اشتہار حذف کریں؟')))return;const d=nwData();d.items=d.items.filter(x=>x.id!==id);await accSave();closeAll();newsAdmin()}
function nwLocalForm(){hm({title:t('Local news|لوکل خبر'),body:`
${t('Do not publish anything against the state or state institutions.|ریاست یا ریاستی اداروں کے خلاف کوئی خبر نہ لگائیں۔')}
`,foot:``})}
async function nwLocalSave(){const d=nwData(),ti=$('#nl_t').value.trim(),s=$('#nl_s').value.trim();if(!ti){$('#nl_e').textContent=t('Enter a headline|عنوان لکھیں');return}if(s&&!/^https?:\/\//i.test(s)){$('#nl_e').textContent=t('Link must start with http(s)://|لنک http(s):// سے شروع ہو');return}d.local.push({id:'l'+uid(),title:ti,srcName:$('#nl_sn').value.trim(),src:s,ts:Date.now()});await accSave();closeAll();newsAdmin()}
async function nwLocalDel(id){const d=nwData();d.local=d.local.filter(x=>x.id!==id);await accSave();closeAll();newsAdmin()}
function nwSite(){const d=nwData();hm({title:t('Site name|سائٹ کا نام'),body:``,foot:``})}
async function nwSiteSave(){const d=nwData();d.site.name=$('#ns_n').value.trim()||'نوید جابز نیوز';d.site.wa=$('#ns_w').value.trim();await accSave();closeAll();newsAdmin()}
/* ===== Live chat of the Jobs News website: auto answers about the website + respectful reply to opinions; every message lands in the owner's chat inbox ===== */
const NEWS_THANKS='آپ کا قیمتی مشورہ ہمارے لیے بہت اہمیت رکھتا ہے۔ آپ کی رائے کا احترام کرتے ہوئے اس پر سنجیدگی سے غور کیا جائے گا۔ ہمیں بہتر بنانے میں مدد کا شکریہ! 🌸';
const NEWS_ASKED='آپ کا سوال ہم تک پہنچ گیا ہے۔ جلد ہی آپ کو یہیں جواب دیا جائے گا۔ اگر جواب اس چیٹ میں نہ آئے تو کچھ دیر بعد یہی صفحہ دوبارہ کھول لیں۔ شکریہ! 🌸';
const NEWS_WELCOME='السلام علیکم! 🌸 خوش آمدید۔ یہاں آپ ویب سائٹ کے بارے میں کوئی بھی سوال پوچھ سکتے ہیں، یا اپنی رائے اور مشورہ لکھ سکتے ہیں۔ ہر پیغام ہم خود پڑھتے ہیں۔\n\nنیچے کے بٹن دبا کر بھی پوچھ سکتے ہیں۔';
const NEWS_CHIPS=['رزلٹ کیسے دیکھوں؟','بینظیر انکم سپورٹ کی قسط کیسے چیک کروں؟','میں اپنی رائے دینا چاہتا ہوں'];
const NEWS_FB=['رائے','مشورہ','تجویز','شکایت','شکایات','feedback','suggestion','complaint','suggest','شامل کریں','شامل کر دیں','اضافہ کریں','ہونا چاہیے','ہونی چاہیے','کمی ہے','بہتر بنائیں'];
const NEWS_FAQ=[
[['یہ ویب سائٹ','ویب سائٹ کیا','کیا ہے','تعارف','کیا کام','مقصد'],'یہ ویب سائٹ معلومات عامہ کے لیے ہے۔ اس میں سرکاری و نجی اداروں کی آسامیوں، ٹیسٹ، انٹرویو، رزلٹ اور عوامی نوٹیفکیشنز کی معلومات ایک جگہ جمع کی جاتی ہیں، ہر معلومات کے ساتھ اصل ماخذ کا نام اور لنک ہوتا ہے۔'],
[['رزلٹ','نتیجہ','نتائج','result','roll','رول نمبر','رول','بورڈ','ڈیٹ شیٹ','سلپ'],'رزلٹ کے لیے: صفحے پر "رزلٹ" کا خانہ کھولیں، قسم (بورڈ، یونیورسٹی، میڈیکل، ٹیسٹ، کمیشن) چنیں، ادارہ اور امتحان چنیں، رول نمبر لکھیں اور "تلاش" دبائیں۔ رول نمبر کاپی ہو جاتا ہے اور ادارے کا سرکاری صفحہ کھلتا ہے جہاں نتیجہ دیکھیں۔ فی الحال نتیجہ ادارے کے اپنے صفحے پر ہی ملتا ہے۔'],
[['آسامی','آسامیاں','نوکری','نوکریاں','jobs','job','ملازمت','وکینسی','اشتہارات'],'آسامیاں، ٹیسٹ اور انٹرویو کے اشتہارات "تازہ آسامیاں" کے حصے میں ہیں۔ آپ آسامی، ٹیسٹ، انٹرویو یا صوبے کے حساب سے چھانٹ سکتے ہیں اور تلاش کے خانے میں ادارہ یا شہر لکھ سکتے ہیں۔ آخری تاریخ قریب ہو تو سرخ نشان نظر آتا ہے۔ درخواست دینے سے پہلے اصل ماخذ سے تصدیق ضرور کر لیں۔'],
[['ڈاؤن لوڈ','ڈاون لوڈ','download','محفوظ','تصویر'],'جس اشتہار کے ساتھ تصویر لگی ہو، اس پر "⬇ ڈاؤن لوڈ" کا بٹن آتا ہے۔ اصل ماخذ کے لیے "🔗 اصل ماخذ" دبائیں۔'],
[['شیئر','share','واٹس ایپ','whatsapp','بھیجنا'],'ہر اشتہار پر "📤 شیئر" کا بٹن ہے، جس سے آپ اسے واٹس ایپ یا دوسری جگہ لنک کے ساتھ بھیج سکتے ہیں۔'],
[['بینظیر','انکم سپورٹ','bisp','قسط','وظیفہ','کفالت','نشونما','ہنرمند'],'بینظیر انکم سپورٹ پروگرام کی قسط اور معلومات کے لیے "سرکاری امداد اور اسکیمیں" کے حصے میں بٹن ہیں، جو سرکاری ویب سائٹ bisp.gov.pk پر لے جاتے ہیں۔ ہیلپ لائن: 0800-26477۔ احتیاط: اپنا شناختی کارڈ نمبر اس چیٹ یا اس سائٹ پر نہ لکھیں، صرف سرکاری سائٹ پر لکھیں، اور فون پر کسی کو پن کوڈ نہ بتائیں۔'],
[['سرکاری','نمائندہ','official','جعلی','اصل'],'یہ ویب سائٹ کسی سرکاری ادارے کی نمائندہ نہیں ہے۔ یہاں معلومات اصل ماخذ کے لنک کے ساتھ جمع کی جاتی ہیں۔ کسی بھی کارروائی سے پہلے اصل ادارے سے تصدیق ضرور کر لیں۔'],
[['موسم','weather','درجہ حرارت'],'اوپر کونے میں کوئٹہ کا موسم نظر آتا ہے۔'],
[['اخبار','اخبارات','newspaper','جنگ','ڈان','ایکسپریس'],'"اخبارات" کے حصے میں بڑے روزناموں کی ویب سائٹس کے لنک ہیں۔'],
[['لوکل','خبر','خبریں','news','مقامی'],'"لوکل خبریں" میں مقامی خبریں ماخذ کے نام کے ساتھ آتی ہیں۔ ہم ریاست یا ریاستی اداروں کے خلاف کوئی خبر نہیں لگاتے۔'],
[['فیس','قیمت','مفت','پیسے','charges','free'],'اس ویب سائٹ کو دیکھنا بالکل مفت ہے۔'],
[['سوفٹویئر','سوفٹ ویئر','سافٹ ویئر','software','فارمیسی','اسکول','لیب','نقشہ','نقشے','پلان'],'ہم فارمیسی، لیب، اسکول، جنرل اسٹور، کریانہ اسٹور، آفس، ہوٹل و ریسٹورنٹ کے سوفٹویئر اور دکان، مکان، فلیٹ اور اپارٹمنٹ کے نقشے رعایتی قیمت پر بناتے ہیں۔ نیچے "مزید معلومات کے لیے لنک پر کلک کریں" دبائیں، وہاں پورا چیٹ اور 14 دن کا مفت ٹرائل ملے گا۔'],
[['اپنا اشتہار','اشتہار لگوانا','تشہیر','advertise','ad لگانا'],'اپنا اشتہار لگوانے کے لیے اپنا پیغام یہیں لکھ دیں، ہم آپ سے رابطہ کریں گے۔'],
[['غلط','پرانی','غلطی','wrong','error','درست نہیں'],'غلط یا پرانی معلومات کی نشاندہی کا شکریہ۔ براہِ مہربانی لکھ دیں کہ کون سی معلومات غلط ہے، ہم جانچ کر درست کر دیں گے۔ اصل ماخذ سے تصدیق ہر حال میں کر لیں۔'],
[['السلام','سلام','hello','hi','ہیلو'],'وعلیکم السلام! 🌸 فرمائیے، میں آپ کی کیا مدد کر سکتا ہوں؟']
];
function newsHas(n,w){const x=botNorm(w);if(!x)return false;return x.length<=3?(' '+n+' ').includes(' '+x+' '):n.includes(x)}
function newsBotReply(text,ctx){const n=botNorm(text);
if(NEWS_FB.some(w=>newsHas(n,w))){ctx.fb=true;return {text:NEWS_THANKS,lang:'ur',sw:'news',chips:[],fb:1}}
let best=null,bs=0;NEWS_FAQ.forEach(r=>{let c=0;r[0].forEach(w=>{if(newsHas(n,w))c+=botNorm(w).length>3?2:1});if(c>bs){bs=c;best=r}});
if(best&&bs>=1)return {text:best[1],lang:'ur',sw:'news',chips:[]};
ctx.fb=true;return {text:NEWS_ASKED,lang:'ur',sw:'news',chips:[],fb:1,asked:1}}
/* ===== Jobs News: automatic ads (Worker) — status, own sources, hide unwanted ===== */
async function nwAuto(fresh){const d=nwData();d.sources=d.sources||[];d.hide=d.hide||[];
hm({title:'🤖 '+t('Automatic ads|خودکار آسامیاں'),wide:true,body:`
${t('Checking the automatic system…|خودکار نظام چیک ہو رہا ہے…')}
`});
let j=null,err='';try{const r=await fetch('/api/news'+(fresh?'?fresh=1':''));const tx=await r.text();j=JSON.parse(tx)}catch(e){err=String(e&&e.message||e)}
const own=d.sources.map((s,i)=>`
${esc(s.name)}${esc(s.url)}
`).join('');
let body='';
if(!j){body=`
${t('The automatic system is not running on this address yet (it works only on the live Cloudflare site, after uploading the new zip).|خودکار نظام اس پتے پر ابھی نہیں چل رہا (یہ صرف Cloudflare کی لائیو سائٹ پر نئی zip اپلوڈ کرنے کے بعد چلتا ہے)۔')} ${esc(err)}
${t('These ads come automatically from official websites (every 30 minutes) and appear on your site with the source link. They are NOT copied in full — only title + original link. Add your own source pages below (a government page, a newspaper jobs page or an RSS feed). After changing sources or hidden items press "Download news-data.json" in the Jobs News window and upload it.|یہ اشتہارات سرکاری ویب سائٹس سے خود بخود (ہر 30 منٹ بعد) آ کر اصل ماخذ کے لنک کے ساتھ آپ کی سائٹ پر دکھتے ہیں۔ پورا مواد کاپی نہیں ہوتا، صرف عنوان اور اصل لنک۔ نیچے اپنے ماخذ صفحے (سرکاری صفحہ، اخبار کا جابز صفحہ یا RSS) شامل کر سکتے ہیں۔ ماخذ یا چھپائے ہوئے اشتہار بدلنے کے بعد "جابز نیوز" والی کھڑکی میں "news-data.json ڈاؤن لوڈ" دبا کر اپلوڈ کریں۔')}
${own?`${t('My sources|میرے ماخذ')}${own}`:''}${body}`});}
function nwSrcForm(){hm({title:t('Add source|ماخذ شامل کریں'),body:``,foot:``})}
async function nwSrcSave(){const d=nwData();d.sources=d.sources||[];const u=$('#ns_u').value.trim(),n=$('#ns_nm').value.trim();if(!/^https?:\/\/[^ ]+\.[^ ]+/i.test(u)){$('#ns_er').textContent=t('Enter a full link starting with https://|مکمل لنک https:// سے لکھیں');return}
d.sources.push({name:n||u,url:u,prov:$('#ns_pv').value,org:n});await accSave();closeAll();nwAuto()}
async function nwSrcDel(i){const d=nwData();d.sources.splice(i,1);await accSave();closeAll();nwAuto()}
async function nwHide(id){const d=nwData();d.hide=d.hide||[];if(!d.hide.includes(id))d.hide.push(id);await accSave();toast(t('Hidden. Download news-data.json and upload it.|چھپا دیا۔ news-data.json ڈاؤن لوڈ کر کے اپلوڈ کریں۔'),'ok');closeAll();nwAuto()}
/* ===== Built-in questions & answers for the chat-bot (owner can see, edit, switch off, or add more) =====
Row = [id, keywords, question Urdu, question English, answer Urdu, answer English]
Keywords are comma separated phrases (Urdu / Roman Urdu / English). A reply needs a phrase of 2+ words or 2 separate hits. */
const FAQ_DEF=[
/* ---- general ---- */
['g01','نوید بزنس سافٹ ویئرز کیا ہے,software hub kya hai,what is software hub,software hub kya','نوید بزنس سافٹ ویئرز کیا ہے؟','What is Naveed Business Softwares?','یہ پاکستانی کاروبار کے لیے تیار شدہ سوفٹ ویئرز کا مجموعہ ہے: لیب، فارمیسی، گرین مرچنٹ، کریانہ، جنرل اسٹور، اسکول اور آفس۔ سب ایک ہی لنک پر چلتے ہیں۔','It is a set of ready-made business software for Pakistan: Lab, Pharmacy, Grain Merchant, Kiryana, General Store, School and Office. All run from one link.'],
['g02','ایک ہی لنک,one link,single link,ایک لنک پر,ek hi link','کیا سب کچھ ایک ہی لنک پر چلتا ہے؟','Does everything run from one link?','جی ہاں۔ ایک ہی لنک پر آپ اپنی آئی ڈی اور پاس ورڈ سے لاگ اِن کرتے ہیں اور آپ کا اپنا سوفٹ ویئر کھل جاتا ہے۔','Yes. You log in at one link with your own ID and password and your own software opens.'],
['g03','موبائل اور کمپیوٹر,mobile and pc,mobile aur computer,phone and computer,موبائل پر چلتا,mobile par chalta','کیا موبائل اور کمپیوٹر دونوں پر چلتا ہے؟','Does it work on both mobile and computer?','جی ہاں۔ اینڈرائیڈ، آئی فون اور ونڈوز کمپیوٹر، سب پر ایک ہی لنک سے کھلتا ہے۔','Yes. It opens with the same link on Android, iPhone and Windows computers.'],
['g04','ایپ کی طرح,install app,install karna,app banana,home screen,ایپ انسٹال','کیا اسے ایپ کی طرح انسٹال کر سکتے ہیں؟','Can I install it like an app?','جی ہاں۔ براؤزر کے مینو سے "Add to Home screen" یا "Install" دبائیں، پھر یہ ایپ کی طرح کھلے گا۔','Yes. From the browser menu choose "Add to Home screen" or "Install" and it opens like an app.'],
['g05','انٹرنیٹ کے بغیر,بغیر انٹرنیٹ,without internet,offline chalta,no internet,آف لائن چلتا','کیا انٹرنیٹ کے بغیر چلتا ہے؟','Does it work without internet?','آف لائن طریقے پر کمپیوٹر پر بغیر انٹرنیٹ کے چلتا ہے۔ آن لائن طریقے پر انٹرنیٹ چاہیے۔ آپ کا پلان جو ہو اسی کے مطابق چلتا ہے۔','In offline mode it works on the computer without internet. Online mode needs internet. It follows the plan you choose.'],
['g06','کہیں سے بھی,anywhere,کسی بھی جگہ,ghar se,dukan se door,remote access,دور سے','کیا میں دور سے اپنا حساب دیکھ سکتا ہوں؟','Can I see my accounts from far away?','جی ہاں، جب آپ کا ریکارڈ آن لائن محفوظ ہو۔ پھر آپ کسی بھی جگہ سے اپنی آئی ڈی سے لاگ اِن کر کے حساب دیکھ سکتے ہیں۔','Yes, when your records are saved online. Then you can log in from anywhere and see your accounts.'],
['g07','زبان بدل,اردو انگلش,language change,urdu english both,زبان کیسے','کیا اردو اور انگلش دونوں میں ہے؟','Is it in both Urdu and English?','جی ہاں۔ پورا سوفٹ ویئر اردو اور انگلش دونوں میں ہے۔ ایک بٹن سے زبان بدل جاتی ہے۔','Yes. The whole software is in Urdu and English. One button changes the language.'],
['g08','کمپیوٹر کا علم,technical knowledge,پڑھا لکھا,easy to use,آسان ہے,asan hai,use karna mushkil','کیا چلانا آسان ہے؟ کیا کمپیوٹر کا علم ضروری ہے؟','Is it easy? Do I need computer knowledge?','بہت آسان ہے۔ ہر کام کا بٹن صاف لکھا ہوتا ہے اور زیادہ تر کام ایک کلک میں ہو جاتے ہیں۔ شروع میں ہم رہنمائی بھی کرتے ہیں۔','Very easy. Every button is clearly named and most jobs take one click. We also guide you at the start.'],
['g09','سکھانا,تربیت,training,sikhana,کیسے چلاؤں,how to learn,how to use it,رہنمائی ملے گی','کیا چلانا سکھایا جائے گا؟','Will you teach me how to use it?','جی ہاں۔ ہر قدم پر رہنمائی ملتی ہے۔ کوئی مسئلہ ہو تو واٹس ایپ پر یا سوفٹ ویئر کے اندر چیٹ سے پوچھیں۔','Yes. You get guidance at every step. If you have a problem, ask on WhatsApp or in the chat inside the software.'],
['g10','کتنے سوفٹ ویئر,which softwares,کون کون سے سوفٹ ویئر,software list,softwares kon kon se','آپ کے پاس کون کون سے سوفٹ ویئر ہیں؟','Which software do you have?','لیب، فارمیسی/کلینک، گرین مرچنٹ (اناج)، کریانہ اسٹور، جنرل اسٹور، اسکول اور آفس/سروسز۔ نقشہ بنانے کا سوفٹ ویئر تیاری میں ہے۔','Lab, Pharmacy/Clinic, Grain Merchant, Kiryana Store, General Store, School and Office/Services. A house-planning software is in preparation.'],
['g11','میرے کاروبار کے لیے,which software for me,mere liye konsa,kon sa software lun,میرے لیے کون سا','میرے کاروبار کے لیے کون سا سوفٹ ویئر ٹھیک رہے گا؟','Which software suits my business?','اپنے کاروبار کا نام بتائیں، مثلاً لیب، میڈیکل اسٹور، اناج کی آڑھت، کریانہ، اسکول یا دفتر۔ میں اسی کا سوفٹ ویئر اور اس کی سہولتیں بتا دوں گا۔','Tell me your business, such as lab, medical store, grain trading, kiryana, school or office. I will show the right software and its functions.'],
['g12','دو دکانیں,برانچ,کئی دکانیں,multiple shops,branches,more than one shop,two branches','اگر میری ایک سے زیادہ دکانیں یا برانچیں ہوں؟','What if I have more than one shop or branch?','ہر دکان یا برانچ کے لیے الگ آئی ڈی بن سکتی ہے تاکہ ہر ایک کا ریکارڈ الگ رہے۔ تفصیل کے لیے مالک سے بات کریں۔','A separate ID can be made for each shop or branch so each keeps its own records. Ask the owner for details.'],
['g13','کتنے لوگ,کتنے افراد,multiple users,many users,how many users,عملہ شامل','کتنے لوگ ایک ساتھ استعمال کر سکتے ہیں؟','How many people can use it together?','آپ اپنے کیشئر اور عملے کے الگ آئی ڈی بنا سکتے ہیں اور ہر ایک کو صرف اس کے کام کی اجازت دے سکتے ہیں۔','You can create separate IDs for your cashiers and staff and give each only the permissions they need.'],
['g14','اپنا لوگو,اپنا نام,logo lagana,my logo,business name,دکان کا نام,letterhead','کیا رسید پر میری دکان کا نام اور لوگو آئے گا؟','Will my shop name and logo appear on receipts?','جی ہاں۔ آپ اپنا نام، پتہ، فون اور لوگو لگا سکتے ہیں اور وہ رسید اور بل پر چھپتے ہیں۔','Yes. You can add your name, address, phone and logo and they print on receipts and bills.'],
['g15','پرنٹر,print karna,printer lagana,receipt print,رسید پرنٹ,رسید چھاپنا','کیا پرنٹر سے رسید نکل سکتی ہے؟','Can I print receipts on a printer?','جی ہاں۔ بل اور رسید براؤزر کے پرنٹ سے عام پرنٹر یا چھوٹے رسید پرنٹر پر نکل سکتی ہے۔','Yes. Bills and receipts print through the browser on an ordinary or a small receipt printer.'],
['g16','نقشہ بنانے کا,architect software,naqsha software,house plan,گھر کا نقشہ,آرکیٹیکٹ سوفٹ ویئر','کیا گھر کا نقشہ بنانے کا سوفٹ ویئر بھی ہے؟','Do you have a house-plan software too?','نقشہ بنانے کا سوفٹ ویئر (2D، 3D) تیاری میں ہے اور جلد آئے گا۔ سب سے پہلے اطلاع کے لیے ہمیں واٹس ایپ کریں۔','A house-planning software (2D, 3D) is in preparation and will come soon. Message us on WhatsApp to be told first.'],
/* ---- trial ---- */
['t01','ٹرائل کیسے,how to start trial,trial kaise,trial shuru,مفت ٹرائل کا طریقہ,free trial kaise','مفت ٹرائل کیسے شروع کروں؟','How do I start the free trial?','لنک کھولیں اور "ٹرائل حاصل کرنے کے لیے یہاں کلک کریں" دبائیں۔ اپنا واٹس ایپ نمبر اور پاس ورڈ لکھیں، پھر اپنا سوفٹ ویئر چنیں۔','Open the link and tap "Click here to get a free trial". Enter your WhatsApp number and a password, then choose your software.'],
['t02','کتنے دن ٹرائل,trial kitne din,how many days trial,trial duration,ٹرائل کتنے دن','ٹرائل کتنے دن کا ہے؟','How long is the trial?','مفت ٹرائل 14 دن کا ہے۔ ان دنوں میں تمام سہولتیں کھلی ہوتی ہیں۔','The free trial is 14 days. All functions are open during the trial.'],
['t03','ٹرائل کے پیسے,trial free hai,کارڈ ضروری,card required,trial mein payment,ٹرائل مفت ہے','کیا ٹرائل کے لیے پیسے یا کارڈ لگتا ہے؟','Do I pay or need a card for the trial?','نہیں۔ ٹرائل بالکل مفت ہے۔ نہ کوئی پیسہ لگتا ہے نہ کارڈ۔','No. The trial is completely free. No payment and no card.'],
['t04','ٹرائل کے بعد,trial ke baad,after trial,trial khatam,trial ends,ٹرائل ختم ہو','ٹرائل ختم ہونے کے بعد کیا ہوگا؟','What happens after the trial ends?','آپ کا ریکارڈ محفوظ رہتا ہے۔ جاری رکھنے کے لیے پلان چنیں اور ہمیں واٹس ایپ کریں۔ ہم سوفٹ ویئر چالو کر دیں گے اور آپ کا ڈیٹا وہیں کا وہیں ملے گا۔','Your records stay safe. To continue, choose a plan and message us on WhatsApp. We will activate it and your data will be there.'],
['t05','ٹرائل میں ڈیٹا,trial data,trial ka data,ٹرائل کا ڈیٹا,data trial mein','کیا ٹرائل میں ڈالا ہوا ڈیٹا بعد میں بھی رہے گا؟','Will the data I enter in the trial stay afterwards?','جی ہاں۔ پلان لینے کے بعد آپ کا وہی ڈیٹا چلتا رہتا ہے، دوبارہ شروع سے نہیں کرنا پڑتا۔','Yes. After you buy a plan, the same data continues. You do not start again.'],
['t06','نمونہ ڈیٹا,sample data,demo data,مثال کا ڈیٹا,نمونے کا ریکارڈ','ٹرائل میں نمونہ ڈیٹا کیوں ہوتا ہے؟','Why is there sample data in the trial?','تاکہ آپ شروع میں ہی سب کچھ چلتا ہوا دیکھ لیں۔ جب چاہیں آپ اسے صاف کر کے اپنا ڈیٹا ڈال سکتے ہیں۔','So you can see everything working from the start. You can clear it any time and enter your own data.'],
['t07','ایک سے زیادہ ٹرائل,two trials,دوسرا سوفٹ ویئر ٹرائل,another software trial,ایک نمبر پر','کیا ایک نمبر پر ایک سے زیادہ سوفٹ ویئر کا ٹرائل مل سکتا ہے؟','Can one number get more than one software trial?','ایک نمبر پر ایک ہی سوفٹ ویئر کا ٹرائل ملتا ہے۔ اپنے کام کا سوفٹ ویئر دیکھ بھال کر چنیں۔ کوئی بات ہو تو ہمیں واٹس ایپ کریں۔','One number gets one software trial. Please choose the software for your work carefully. Message us if there is a problem.'],
['t08','غلط سوفٹ ویئر چن,wrong software chosen,software badalna,change software,غلط چنا گیا','اگر میں نے غلط سوفٹ ویئر چن لیا؟','What if I chose the wrong software?','ہمیں واٹس ایپ پر بتا دیں۔ ہم آپ کا انتخاب ٹھیک کر دیں گے۔','Tell us on WhatsApp and we will correct your choice.'],
['t09','پاس ورڈ بھول,password bhool,forgot password,id bhool,آئی ڈی بھول,پاس ورڈ یاد نہیں','میں اپنا پاس ورڈ یا آئی ڈی بھول گیا؟','I forgot my ID or password?','گھبرائیں نہیں۔ ہمیں واٹس ایپ کریں۔ ہم آپ کو نیا پاس ورڈ بنا کر بھیج دیں گے۔ آپ کی آئی ڈی آپ کا واٹس ایپ نمبر ہی ہے۔','Do not worry. Message us on WhatsApp and we will make a new password for you. Your ID is your WhatsApp number.'],
['t10','آئی ڈی کیا ہو,my id,login id,user id kya,یوزر آئی ڈی کیا','میری لاگ اِن آئی ڈی کیا ہوگی؟','What will my login ID be?','ٹرائل میں آپ کا واٹس ایپ نمبر ہی آپ کی آئی ڈی ہے اور پاس ورڈ وہ جو آپ نے خود لکھا۔ اسے یاد رکھیں۔','In the trial your WhatsApp number is your ID and your password is the one you chose. Please remember it.'],
/* ---- buying / plans ---- */
['b01','کیسے خریدوں,how to buy,kaise kharidun,purchase kaise,software lena hai,سوفٹ ویئر لینا','سوفٹ ویئر کیسے خریدوں؟','How do I buy the software?','پہلے مفت ٹرائل دیکھیں، پھر اپنا پلان چنیں اور ہمیں واٹس ایپ کریں۔ ادائیگی کے بعد ہم آپ کا سوفٹ ویئر چالو کر دیں گے۔','First try the free trial, then choose a plan and message us on WhatsApp. After payment we activate your software.'],
['b02','ادائیگی کا طریقہ,payment method,payment kaise,easypaisa,jazzcash,bank transfer,پیسے کیسے بھیجوں','پیسے کیسے بھیجوں؟','How do I send the payment?','ادائیگی کا طریقہ ہم آپ کو واٹس ایپ پر بتا دیں گے۔ ادائیگی بھیجنے کے بعد رسید کی تصویر بھیج دیں۔','We will tell you the payment method on WhatsApp. After paying, send us a photo of the receipt.'],
['b03','ماہانہ یا سالانہ,monthly or yearly,monthly yearly,سالانہ پلان,yearly plan,ماہانہ پلان','ماہانہ اور سالانہ پلان میں کیا فرق ہے؟','What is the difference between monthly and yearly?','ماہانہ پلان ہر مہینے ادا ہوتا ہے۔ سالانہ پلان ایک ساتھ پورے سال کا پیشگی ادا ہوتا ہے اور عموماً سستا پڑتا ہے۔ موجودہ رقم کے لیے "قیمتیں" لکھیں۔','Monthly is paid every month. Yearly is paid in advance for the whole year and is usually cheaper. Write "prices" to see current amounts.'],
['b04','ایک بار ادائیگی,one time payment,lifetime,زندگی بھر,ایک بار خریدنا,pay once','کیا ایک بار پیسے دے کر ہمیشہ استعمال کر سکتا ہوں؟','Can I pay once and use it forever?','کمپیوٹر آف لائن سوفٹ ویئر ایک بار قیمت دے کر خریدا جاتا ہے۔ آن لائن سہولتوں کی ماہانہ یا سالانہ فیس ہوتی ہے۔ تفصیل کے لیے "قیمتیں" لکھیں۔','The computer offline software is bought once. Online features have a monthly or yearly fee. Write "prices" for details.'],
['b05','ڈسکاؤنٹ,رعایت,discount milega,kam qeemat,sasta,کم قیمت,رعایت ملے گی','کیا رعایت مل سکتی ہے؟','Is a discount possible?','سالانہ پیشگی ادائیگی پر خاص رعایت ہوتی ہے۔ اس کے علاوہ رعایت کے لیے مالک سے براہ راست بات کریں۔','There is a special discount on yearly advance payment. For any other discount please talk to the owner directly.'],
['b06','قسطوں,قسط,installment,instalment,qist,قسطوں پر,pay in parts','کیا قسطوں پر مل سکتا ہے؟','Can I pay in instalments?','اس کے لیے مالک سے واٹس ایپ پر بات کریں، وہ آپ کی ضرورت کے مطابق بتائیں گے۔','Please talk to the owner on WhatsApp; he will tell you according to your need.'],
['b07','مدت ختم,expired,subscription expired,validity khatam,renew karna,تجدید,مدت پوری','اگر مدت ختم ہو جائے تو؟','What if my validity ends?','ختم ہونے سے پہلے سوفٹ ویئر میں یاد دہانی آتی ہے۔ مدت ختم ہونے پر ریکارڈ محفوظ رہتا ہے۔ تجدید کروانے پر دوبارہ چل پڑتا ہے۔','You get a reminder before it ends. Your records stay safe when it ends. After renewal it works again.'],
['b08','تجدید کیسے,renew kaise,renewal,how to renew,مدت بڑھانا,مدت کیسے بڑھاؤں','مدت کیسے بڑھاؤں (تجدید)؟','How do I renew?','ہمیں واٹس ایپ پر ادائیگی کی رسید بھیجیں۔ ہم آپ کی مدت بڑھا دیں گے اور سوفٹ ویئر میں اطلاع آ جائے گی۔','Send us the payment receipt on WhatsApp. We extend your validity and you get a notice in the software.'],
['b09','آن لائن ریکارڈ,online record save,records online,ریکارڈ آن لائن,cloud save,کلاؤڈ','آن لائن ریکارڈ محفوظ کرنے کی سہولت کیا ہے؟','What is the online record saving option?','اس میں آپ کا ریکارڈ انٹرنیٹ پر بھی محفوظ ہوتا ہے، تو آپ کسی بھی موبائل یا کمپیوٹر سے وہی ریکارڈ دیکھ سکتے ہیں۔ اس کی الگ فیس ہے، "قیمتیں" لکھ کر دیکھیں۔','Your records are also saved online, so you can see the same records from any phone or computer. It has a separate fee; write "prices" to see it.'],
['b10','پلان بدلنا,upgrade plan,change plan,پلان تبدیل,plan upgrade,آف لائن سے آن لائن','کیا بعد میں پلان بدل سکتا ہوں؟','Can I change my plan later?','جی ہاں۔ آپ کا ڈیٹا وہی رہتا ہے۔ پلان بڑھانے کے لیے ہمیں واٹس ایپ کریں۔','Yes. Your data stays the same. Message us on WhatsApp to upgrade.'],
['b11','گارنٹی,warranty,guarantee,refund,پیسے واپس,رقم واپس','اگر پسند نہ آیا تو؟','What if I do not like it?','اسی لیے پہلے 14 دن کا مفت ٹرائل ہے۔ سب کچھ آزما کر ہی خریدیں۔ پیسوں کے بارے میں مالک سے بات کریں۔','That is why there is a 14-day free trial first. Try everything before buying. For payments please talk to the owner.'],
/* ---- data & safety ---- */
['s01','ڈیٹا محفوظ,data safe,my data,میرا ڈیٹا,data secure,ریکارڈ محفوظ','کیا میرا ڈیٹا محفوظ ہے؟','Is my data safe?','جی ہاں۔ ہر کسٹمر کا ریکارڈ دوسروں سے بالکل الگ ہوتا ہے۔ پاس ورڈ محفوظ طریقے سے رکھے جاتے ہیں اور آپ بیک اپ بھی لے سکتے ہیں۔','Yes. Each customer\'s records are completely separate. Passwords are stored safely and you can also take a backup.'],
['s02','کوئی اور دیکھ,others see my data,دوسرے دیکھ,کسی کو نظر,who can see my data,ریکارڈ کون دیکھ','کیا میرا ریکارڈ کوئی دوسرا دیکھ سکتا ہے؟','Can someone else see my records?','نہیں۔ کوئی دوسرا کسٹمر آپ کا ریکارڈ نہیں دیکھ سکتا۔ صرف مدد کی ضرورت ہو تو سوفٹ ویئر کا مالک آپ کے اکاؤنٹ میں آ کر مسئلہ ٹھیک کر سکتا ہے۔','No. No other customer can see your records. Only if you need help, the software owner can open your account to fix a problem.'],
['s03','بیک اپ,backup kaise,backup lena,data backup,ڈیٹا کی کاپی,بیک اپ کیسے','بیک اپ کیسے لوں؟','How do I take a backup?','سوفٹ ویئر کے مینو میں بیک اپ کا بٹن ہے۔ ایک کلک سے آپ کے ڈیٹا کی فائل بن جاتی ہے۔ اسے کمپیوٹر یا موبائل میں سنبھال کر رکھیں۔','There is a backup button in the menu. One click makes a file of your data. Keep it safely on your computer or phone.'],
['s04','موبائل گم,phone lost,mobile kho,computer kharab,ڈیٹا ضائع,data lost,phone kharab','اگر موبائل یا کمپیوٹر خراب یا گم ہو جائے؟','What if my phone or computer is lost or broken?','اگر ریکارڈ آن لائن محفوظ ہے تو نئی ڈیوائس پر لاگ اِن کر کے سب مل جاتا ہے۔ ورنہ آپ کی بیک اپ فائل سے ریکارڈ واپس آ جاتا ہے۔ اسی لیے بیک اپ لیتے رہیں۔','If records are saved online, just log in on a new device. Otherwise your backup file brings them back. So keep taking backups.'],
['s05','پاس ورڈ بدلنا,change password,password badalna,نیا پاس ورڈ,پاس ورڈ تبدیل','پاس ورڈ کیسے بدلوں؟','How do I change my password?','سوفٹ ویئر کے مینو میں "میرا پاس ورڈ بدلیں" دبائیں۔ پرانا پاس ورڈ لکھ کر نیا لکھیں۔','In the menu press "Change my password". Enter the old password and then the new one.'],
['s06','لاگ آؤٹ,logout,exit kaise,باہر نکلنا,sign out,لاگ آؤٹ کیسے','لاگ آؤٹ کیسے کروں؟','How do I log out?','اوپر "Exit" یا "باہر" کا بٹن دبائیں۔ زیادہ دیر کام نہ ہو تو سوفٹ ویئر خود بھی لاک ہو جاتا ہے۔','Press the "Exit" button at the top. If nothing is done for a long time, it also locks itself.'],
['s07','دوسرے ڈیوائس پر,other device,naye phone par,نئے موبائل,same id another phone,دوسرے موبائل پر','کیا اپنی آئی ڈی دوسرے موبائل پر چلا سکتا ہوں؟','Can I use my ID on another phone?','جی ہاں۔ اسی لنک پر اپنی آئی ڈی اور پاس ورڈ سے لاگ اِن کریں۔ ریکارڈ سب ڈیوائسز پر تب ملے گا جب وہ آن لائن محفوظ ہو۔','Yes. Log in at the same link with your ID and password. Records appear on all devices when they are saved online.'],
['s08','ڈیلیٹ,delete nahi,record delete,بل مٹانا,delete karna,غلط بل,بل غلط ہو گیا','غلط بل یا اندراج کیسے مٹاؤں؟','How do I remove a wrong bill or entry?','حفاظت کے لیے مٹانے کا اختیار صرف مالک کے پاس ہوتا ہے۔ عملہ مٹانے کی درخواست بھیجتا ہے، مالک منظور کرے تو مٹتا ہے اور کیش کا حساب خود ٹھیک ہو جاتا ہے۔','For safety only the owner can delete. Staff send a delete request, and when the owner approves it the entry is removed and the cash adjusts automatically.'],
['s09','ہیک,hacked,hacker,hack,چوری,security,سیکیورٹی کیسی,hack ho','کیا ہیک ہونے کا خطرہ ہے؟','Can it be hacked?','پاس ورڈ مضبوط طریقے سے محفوظ ہوتے ہیں، ہر کسٹمر کا ریکارڈ الگ ہے اور زیادہ دیر کام نہ ہو تو سوفٹ ویئر لاک ہو جاتا ہے۔ آپ اپنا پاس ورڈ مضبوط رکھیں اور کسی کو نہ بتائیں۔','Passwords are stored in a strong way, each customer\'s records are separate and the software locks after a long idle time. Keep your password strong and do not share it.'],
/* ---- staff ---- */
['u01','کیشئر کیسے بناؤں,cashier banana,add cashier,نیا کیشئر,staff id,عملے کی آئی ڈی,کیشئر بنانا','کیشئر یا عملے کی آئی ڈی کیسے بناؤں؟','How do I create a cashier or staff ID?','ایڈمن کے طور پر لاگ اِن کریں، مینو میں "عملہ" کھولیں اور نیا عملہ شامل کریں۔ نام، آئی ڈی اور پاس ورڈ لکھ کر محفوظ کریں۔','Log in as admin, open "Staff" in the menu and add a new person. Enter name, ID and password and save.'],
['u02','کام کی اجازت,permission,اجازتیں,ٹک لگا,per function,access control,کیا دیکھ سکتا','کیا میں ہر ملازم کو الگ اجازت دے سکتا ہوں؟','Can I give each employee separate permissions?','جی ہاں۔ ہر فنکشن کے سامنے ٹک لگا کر طے کریں کہ وہ کیا دیکھے اور کیا کرے، مثلاً کیشئر صرف بل بنائے اور رپورٹ نہ دیکھے۔','Yes. Tick function by function what each person may see and do, for example a cashier only makes bills and cannot see reports.'],
['u03','کیشئر نے غلطی,cashier ghalti,cashier ne,عملہ غلط,staff mistake,کیشئر کی نگرانی','کیا کیشئر کی غلطی یا گڑبڑ پکڑی جا سکتی ہے؟','Can I catch a cashier\'s mistake or misuse?','ہر بل اور اندراج کے ساتھ اس کا ریکارڈ رہتا ہے اور مٹانے کا اختیار کیشئر کے پاس نہیں ہوتا، تو گڑبڑ مشکل ہو جاتی ہے۔','Every bill and entry is recorded, and cashiers cannot delete, so misuse becomes difficult.'],
['u04','عملے کا پاس ورڈ,staff password,cashier password bhool,عملہ پاس ورڈ بھول','عملے کا پاس ورڈ بھول جائے تو؟','What if staff forget their password?','ایڈمن عملے کی فہرست میں اس کا پاس ورڈ بدل سکتا ہے۔','The admin can reset it from the staff list.'],
/* ---- updates & support ---- */
['p01','اپ ڈیٹ کیسے,update kaise,new version,نیا ورژن,software update,اپڈیٹ کیسے ہوتا','سوفٹ ویئر کی اپ ڈیٹ کیسے ہوتی ہے؟','How does the software update?','نیا ورژن آنے پر سوفٹ ویئر کے اندر اطلاع آتی ہے۔ "اپ ڈیٹ" بٹن دبائیں، بس۔ آپ کا ریکارڈ محفوظ رہتا ہے۔','When a new version comes you get a notice inside the software. Press "Update". Your records stay safe.'],
['p02','اپ ڈیٹ کی فیس,update free,update charges,اپ ڈیٹ مفت,updates ke paise','کیا اپ ڈیٹ کے پیسے لگتے ہیں؟','Do updates cost money?','اپ ڈیٹ کی تفصیل کے لیے مالک سے بات کریں۔ آپ کی مدت جاری ہو تو اطلاع آپ کو سوفٹ ویئر میں ملتی ہے۔','Please ask the owner about update terms. While your validity is active the notice reaches you inside the software.'],
['p03','مسئلہ آ گیا,problem aa gaya,software masla,خرابی,error aa raha,چل نہیں رہا,not working,نہیں چل رہا','سوفٹ ویئر میں مسئلہ یا خرابی آ جائے؟','What if there is a problem or an error?','اوپر 🆘 بٹن دبا کر مسئلہ لکھ دیں، یا ہمیں واٹس ایپ کریں۔ ہم آپ کی مدد کریں گے۔ ہمیشہ مدد ملتی ہے۔','Press the 🆘 button and write the problem, or message us on WhatsApp. We will help you. Support is always available.'],
['p04','سپورٹ کب,support time,کب جواب,reply kab,کتنی دیر میں جواب,support timing','مدد کب ملتی ہے؟','When do I get support?','آپ کا پیغام ہمیں مل جاتا ہے اور ہم جلد جواب دیتے ہیں۔ فوری مدد کے لیے واٹس ایپ پر رابطہ کریں۔','We receive your message and reply soon. For urgent help contact us on WhatsApp.'],
['p05','نئی سہولت,new feature,feature chahiye,نیا فیچر,ہمارے لیے بنا دیں,custom feature,اپنی مرضی','کیا میری مرضی کی نئی سہولت بن سکتی ہے؟','Can you add a new feature I need?','جی ہاں، اپنی ضرورت ہمیں لکھ کر بھیجیں۔ ہم دیکھیں گے اور مالک آپ کو بتائیں گے کہ کب اور کیسے ہو سکتی ہے۔','Yes, write your need to us. We will check and the owner will tell you when and how it can be done.'],
/* ---- lab ---- */
['l01','لیب میں کیا,lab software,lab ki features,لیب سوفٹ ویئر,لیب کی سہولت,lab software features,لیبارٹری سوفٹ','لیب کے سوفٹ ویئر میں کیا کیا ہے؟','What is in the Lab software?','نئی لیب رسید، نمونوں کی فہرست، نتائج کا اندراج، ٹیسٹ کی فہرست اور ریٹ، مریض، ڈاکٹر اور کمیشن، رپورٹ اور رسید کا پیڈ، ری ایجنٹ اور سپلائر، اخراجات، کیش بک اور رپورٹس۔','New lab receipt, sample worklist, entering results, test catalogue and rates, patients, doctors and commission, report and receipt pad, reagents and suppliers, expenses, cash book and reports.'],
['l02','رپورٹ پرنٹ,report print,lab report,رپورٹ کیسے بنتی,رپورٹ بنانا,report banana,رپورٹ کا پیڈ','لیب رپورٹ کیسے بنتی اور چھپتی ہے؟','How is a lab report made and printed?','نتائج لکھیں اور محفوظ کریں۔ رپورٹ آپ کے لیٹر ہیڈ (نام، لوگو، ڈاکٹر کی تفصیل) کے ساتھ خوبصورت شکل میں خود بن جاتی ہے۔ ایک کلک سے پرنٹ ہوتی ہے۔','Enter and save the results. The report forms itself with your letterhead (name, logo, doctor details) in a neat layout. One click prints it.'],
['l03','لیٹر ہیڈ,letterhead,رپورٹ پیڈ,report pad,pad edit,پیڈ بدلنا,رپورٹ کا ڈیزائن','کیا رپورٹ کا پیڈ اپنی مرضی سے بن سکتا ہے؟','Can I design my own report pad?','جی ہاں۔ "رپورٹ اور رسید پیڈ" میں اپنی مرضی سے نام، ڈاکٹر کی ڈگری، پتہ اور لوگو بدل سکتے ہیں۔','Yes. In "Report & Receipt Pad" you can change the name, doctor degree, address and logo.'],
['l04','ڈاکٹر کمیشن,doctor commission,commission kaise,کمیشن کا حساب,doctor ka hissa,ڈاکٹر کا حصہ','ڈاکٹر کا کمیشن کیسے لگتا ہے؟','How is the doctor commission worked out?','ڈاکٹر شامل کر کے اس کا کمیشن (فیصد یا رقم) لکھ دیں۔ جب اس کے حوالے سے رسید بنتی ہے تو کمیشن اس کے کھاتے میں خود جمع ہو جاتا ہے۔','Add the doctor and set his commission (percent or amount). When a receipt is made on his reference, the commission is credited to his account automatically.'],
['l05','آن لائن رپورٹ,online report,patient report online,مریض رپورٹ,report mobile par,رپورٹ موبائل پر','کیا مریض رپورٹ اپنے موبائل پر دیکھ سکتا ہے؟','Can a patient see the report on his mobile?','جی ہاں۔ رپورٹ آن لائن لنک سے آئی ڈی اور پاس ورڈ کے ساتھ دیکھی جا سکتی ہے۔ یہ سہولت آن لائن ریکارڈ کے ساتھ چلتی ہے۔','Yes. The report can be opened through an online link with an ID and password. This works with online records.'],
['l06','ٹیسٹ کی فہرست,test list,test rates,ٹیسٹ کے ریٹ,test add,نیا ٹیسٹ,test catalogue','کیا اپنے ٹیسٹ اور ریٹ خود بدل سکتا ہوں؟','Can I change my tests and rates?','جی ہاں۔ "ٹیسٹ کیٹلاگ" میں ٹیسٹ، ان کے ریٹ، نارمل رینج اور یونٹ خود شامل یا ایڈٹ کریں۔','Yes. In "Test Catalogue" add or edit tests, rates, normal ranges and units yourself.'],
['l07','مریض کی ہسٹری,patient history,patient record,پرانا ریکارڈ مریض,مریض کا ریکارڈ,patient phone,مریض کا نمبر','کیا مریض کا پرانا ریکارڈ اور فون نمبر محفوظ ہوتا ہے؟','Is the patient\'s old record and phone number kept?','جی ہاں۔ "مریض" میں ہر مریض کا نام، فون نمبر اور پچھلی رسیدیں اور رپورٹس محفوظ رہتی ہیں۔','Yes. In "Patients" each patient\'s name, phone number and previous receipts and reports are kept.'],
['l08','ری ایجنٹ,reagent,reagents,kit stock,لیب اسٹاک,lab stock,کیمیکل','کیا ری ایجنٹ اور لیب کا سامان ریکارڈ ہو سکتا ہے؟','Can reagents and lab supplies be recorded?','جی ہاں۔ ری ایجنٹ اور سامان کی خریداری، سپلائر اور اخراجات سب درج ہوتے ہیں۔','Yes. Purchases of reagents and supplies, suppliers and expenses are all recorded.'],
['l09','کلیکشن سینٹر,collection centre,sample collection,نمونے کی فہرست,worklist,سیمپل','نمونوں کی فہرست (ورک لسٹ) کا کیا فائدہ ہے؟','What is the sample worklist for?','اس میں آج کے سارے نمونے اور ان کے نتائج کی حالت نظر آتی ہے، تو کوئی رپورٹ رہ نہیں جاتی۔','It shows all today\'s samples and the state of their results, so no report is missed.'],
['l10','لیب کا حساب,lab cash,lab daily cash,دن کا حساب لیب,lab profit,لیب منافع,cash book lab','کیا لیب کا روزانہ حساب اور منافع نظر آتا ہے؟','Can I see the lab\'s daily accounts and profit?','جی ہاں۔ ڈیش بورڈ اور کیش بک میں آج کی آمدنی، اخراجات اور بقایا نظر آتا ہے، اور رپورٹس میں مدت کے حساب سے دیکھ سکتے ہیں۔','Yes. The dashboard and cash book show today\'s income, expenses and balance, and reports show any period.'],
/* ---- pharmacy ---- */
['m01','فارمیسی میں کیا,pharmacy software,medical store software,فارمیسی سوفٹ ویئر,میڈیکل اسٹور سوفٹ ویئر,pharmacy features,pharmacy ki','فارمیسی کے سوفٹ ویئر میں کیا کیا ہے؟','What is in the Pharmacy software?','کاؤنٹر سیل، پرچی، ادویات اور اسٹاک، کم اسٹاک کی فہرست، سپلائر، بل ہسٹری اور واپسی، روزانہ کیش، ڈے کلوز، کسٹمر لیجر، اخراجات، رپورٹس اور بیک اپ۔','Counter sale, prescription, medicines and stock, low-stock list, suppliers, bill history and returns, daily cash, day close, customer ledger, expenses, reports and backup.'],
['m02','الرقیب,alraqeeb,al raqeeb,الرقیب فارمیسی,raqeeb pharma,raqeeb','کیا فارمیسی وہی الرقیب والی ہے؟','Is the Pharmacy the same as Al-Raqeeb?','جی ہاں۔ فارمیسی/کلینک سوفٹ ویئر الرقیب فارما اسٹور ہی کی طرز کا ہے، جو مالک اپنے میڈیکل اسٹور میں خود چلاتے ہیں۔','Yes. The Pharmacy/Clinic software follows the Al-Raqeeb Pharma Store, which the owner runs in his own medical store.'],
['m03','ایکسپائری,expiry,expire dawai,معیاد ختم دوا,expiry alert,ایکسپائری الرٹ,expiry date','کیا دوا کی ایکسپائری کا الرٹ آتا ہے؟','Do I get an alert for medicine expiry?','جی ہاں۔ ایکسپائری کے قریب والی ادویات کی فہرست اور تنبیہ آتی ہے تاکہ آپ وقت پر انہیں ہٹا یا واپس کر سکیں۔','Yes. Medicines near expiry are listed and flagged so you can remove or return them in time.'],
['m04','کم اسٹاک,low stock,order list,دوا ختم,next order,اگلا آرڈر,stock khatam','کم ہوتی ہوئی دوائیں کیسے پتا چلیں؟','How do I know which medicines are running low?','"اگلا آرڈر / کم" کی فہرست میں وہ ادویات نظر آتی ہیں جو کم ہو چکی ہیں۔ وہیں سے آرڈر بنایا جا سکتا ہے۔','The "Next Order / Low" list shows the medicines that are running low, and you can make the order from there.'],
['m05','نسخہ,prescription,پرچی,clinic,ڈاکٹر کی پرچی,prescription print,کلینک کی پرچی','کیا ڈاکٹر کی پرچی (نسخہ) بن سکتی ہے؟','Can I make a doctor\'s prescription?','جی ہاں۔ "پرچی" میں مریض اور دوائیں لکھیں اور ڈاکٹر کے نام، ڈگری اور پتے کے ساتھ پرنٹ کریں۔','Yes. In "Prescription" write the patient and medicines and print it with the doctor\'s name, degree and address.'],
['m06','ادھار,customer ledger,کسٹمر لیجر,udhar dawai,ادھار کھاتہ,credit customer,بقایا رقم','کیا گاہک کا ادھار کھاتہ رکھا جا سکتا ہے؟','Can I keep a credit account for customers?','جی ہاں۔ "کسٹمر لیجر" میں ہر گاہک کا ادھار، وصولی اور بقایا نظر آتا ہے۔','Yes. In "Customer Ledger" each customer\'s credit, payments and balance are shown.'],
['m07','ڈے کلوز,day close,roz ka hisab,دن بند,daily close,cash close,رات کا حساب','دن کا حساب بند (ڈے کلوز) کیسے ہوتا ہے؟','How does day close work?','شام کو "ڈے کلوز" دبائیں۔ آج کی فروخت، کیش اور اخراجات کا حساب ملا کر بند ہو جاتا ہے اور اگلے دن نیا شروع ہوتا ہے۔','In the evening press "Day Close". Today\'s sales, cash and expenses are totalled and closed, and a new day starts.'],
['m08','سیل واپسی,sale return,return medicine,واپس دوا,bill return,واپسی کا بل','کیا واپس آئی دوا کا بل بن سکتا ہے؟','Can I make a return for returned medicine?','جی ہاں۔ "سیل ریٹرن" میں اصل بل چن کر واپسی درج کریں۔ اسٹاک اور کیش خود ٹھیک ہو جاتے ہیں۔','Yes. In "Sale Return" pick the original bill and enter the return. Stock and cash adjust by themselves.'],
['m09','دوائیں شامل,add medicine,نئی دوا,medicine list,دوا کی فہرست,medicines import,ادویات کیسے ڈالوں','ادویات کیسے ڈالوں؟','How do I add medicines?','"ادویات / شامل" میں نام، قیمت اور اسٹاک لکھ کر شامل کریں۔ آپ خریداری کے وقت بھی ڈال سکتے ہیں۔','In "Medicines / Add" enter the name, price and stock. You can also add them while buying.'],
['m10','پرانی فارمیسی,already have software,پرانا ڈیٹا,ریکارڈ منتقل,old data transfer,data import,پہلے سے سوفٹ ویئر','اگر میرا ریکارڈ پہلے سے کسی اور سوفٹ ویئر میں ہو؟','What if my records are already in another software?','ہمیں واٹس ایپ پر بتائیں۔ ہم دیکھیں گے کہ پرانا ریکارڈ کیسے لایا جا سکتا ہے۔','Tell us on WhatsApp. We will see how the old records can be brought in.'],
/* ---- grain merchant ---- */
['a01','اناج کا سوفٹ ویئر,grain software,merchant software,آڑھت سوفٹ ویئر,arhat software,گرین مرچنٹ میں,mandi software,اناج میں کیا','گرین مرچنٹ (اناج) کے سوفٹ ویئر میں کیا ہے؟','What is in the Grain Merchant software?','کسان سے خرید، خریدار کو فروخت، آج کے ریٹ، وزن کیلکولیٹر، گودام اسٹاک، کسان اور خریدار کے کھاتے، اجناس، کمی بیشی، اخراجات، کیش بک اور رپورٹس۔','Buying from farmers, selling to buyers, today\'s rates, weight calculator, godown stock, farmer and buyer accounts, commodities, shortage/wastage, expenses, cash book and reports.'],
['a02','من اور کلو,maund,من کلو,40 کلو,maund kg,من کا وزن,mund kilo,من کتنے کلو','کیا من اور کلو دونوں میں وزن لکھ سکتے ہیں؟','Can I enter weight in both maund and kg?','جی ہاں۔ من اور کلو کے الگ خانے ہیں، جیسے 1 من اور 0 کلو۔ ایک من عام طور پر 40 کلو ہے اور کسی جنس کا من الگ ہو تو وہ بھی لگ سکتا ہے۔','Yes. There are separate boxes for maund and kg, such as 1 maund and 0 kg. A maund is normally 40 kg, and a commodity can have its own maund weight.'],
['a03','وزن کیلکولیٹر,weight calculator,کانٹے پر,kanta,قیمت فوراً,بوریاں حساب,bags calculator,بوری کا حساب','وزن کیلکولیٹر کیا کرتا ہے؟','What does the weight calculator do?','جنس چنیں، بوریوں کی تعداد، ایک بوری کا وزن اور فی من قیمت لکھیں۔ کل وزن، من اور رقم فوراً آ جاتی ہے، تاکہ کانٹے پر کسان کو اسی وقت قیمت بتا دیں۔','Pick the commodity and enter bags, weight of one bag and the price per maund. Total weight, maunds and amount appear at once, so you can tell the farmer the price at the scale.'],
['a04','کون سی اجناس,commodities,کون کون سی جنس,wheat rice,گندم چاول,اجناس کی فہرست,which grains','کون کون سی اجناس شامل ہیں؟','Which commodities are included?','گندم، چاول، شالی، سرسوں، چنا، مٹر، جھنتر، جانبھو، جوار، مکئی، باجرہ، دال مونگ، دال ماش اور آپ اپنی مرضی کی جنس بھی شامل کر سکتے ہیں۔','Wheat, rice, paddy, mustard, gram, peas, jhantar, jambhu, sorghum, maize, millet, moong dal, mash dal, and you can add any commodity of your own.'],
['a05','کسان کا کھاتہ,farmer account,kisan khata,کسان کا حساب,farmer ledger,آڑھتی کھاتہ,buyer khata','کسان اور خریدار کا کھاتہ کیسے رکھا جاتا ہے؟','How are farmer and buyer accounts kept?','"کسان" اور "خریدار / ملز" میں ہر ایک کا الگ کھاتہ ہے۔ خرید، فروخت، ادائیگی اور بقایا سب نظر آتا ہے۔','"Farmers" and "Buyers / Mills" each have a separate account. Purchases, sales, payments and balance are all visible.'],
['a06','مزدوری,کرایہ,labour,bardana,مزدوری کرایہ,transport charges,اخراجات مزدوری','کیا مزدوری اور کرایہ الگ لکھ سکتے ہیں؟','Can I enter labour and freight separately?','جی ہاں۔ مزدوری اور کرایہ الگ الگ خانوں میں لکھے جا سکتے ہیں، اور یہ اختیاری ہیں۔ ایک ہی لائن میں آ جاتے ہیں۔','Yes. Labour and freight go in separate optional boxes, on the same line.'],
['a07','گودام اسٹاک,godown stock,godown,گودام میں مال,stock grain,مال کتنا پڑا','گودام میں کتنا مال ہے، کیسے پتا چلے؟','How do I know how much stock is in the godown?','"گودام اسٹاک" میں ہر جنس کا موجودہ مال من اور کلو میں نظر آتا ہے۔ کمی بیشی بھی درج ہو سکتی ہے۔','"Godown Stock" shows each commodity\'s current stock in maunds and kg. Shortage or wastage can also be recorded.'],
['a08','کسان سے خرید,buy from farmer,farmer se kharid,kisan se khareed,پرچی کسان,خرید کی پرچی,purchase slip','کیا کسان سے خرید کی پرچی بنتی ہے؟','Is a slip made when buying from a farmer?','جی ہاں۔ "کسان سے خرید" میں جنس، وزن اور ریٹ لکھیں۔ خرید کی پرچی پرنٹ ہوتی ہے اور کسان کے کھاتے میں درج ہو جاتی ہے۔ کسان کا نام لکھنا اختیاری ہے۔','Yes. In "Buy from Farmer" enter the commodity, weight and rate. The purchase slip prints and is entered in the farmer\'s account. Entering the farmer is optional.'],
/* ---- kiryana / general store ---- */
['k01','کریانہ سوفٹ ویئر,kiryana software,kirana software,کریانہ میں کیا,grocery software,راشن کی دکان,کریانہ کی سہولت','کریانہ اسٹور کے سوفٹ ویئر میں کیا ہے؟','What is in the Kiryana software?','نیا بل (POS)، سیل ریٹرن، سپلائر سے خرید، آئٹمز اور ریٹ، اسٹاک، گاہکوں کا ادھار کھاتہ، سپلائر، اخراجات، کیش بک اور رپورٹس۔','New bill (POS), sale return, buying from suppliers, items and prices, stock, customers\' credit accounts, suppliers, expenses, cash book and reports.'],
['k02','ادھار کھاتہ,udhar khata,ادھار گاہک,credit khata,udhaar,ادھار کا حساب,ادھار وصولی','کیا ادھار کا حساب رکھ سکتے ہیں؟','Can I keep a credit (udhar) account?','جی ہاں۔ "گاہک (ادھار)" میں ہر گاہک کا ادھار، جمع شدہ رقم اور بقایا نظر آتا ہے۔','Yes. In "Customers (Udhar)" each customer\'s credit, payments and balance are shown.'],
['k03','بار کوڈ,barcode,بار کوڈ اسکینر,scanner,barcode scan,اسکین','کیا بار کوڈ اسکینر چلتا ہے؟','Does a barcode scanner work?','جی ہاں۔ عام یو ایس بی اسکینر سے آئٹم اسکین کر کے بل میں ڈالا جا سکتا ہے۔ ہاتھ سے نام لکھ کر بھی بل بن سکتا ہے۔','Yes. A normal USB scanner can scan items into the bill. You can also pick items by name.'],
['k04','دکان کا اسٹاک,shop stock,stock kam,اسٹاک کم,kiryana stock,مال کا حساب,stock check','دکان کا اسٹاک اور کم ہوتا مال کیسے دیکھوں؟','How do I see shop stock and what is running low?','"اسٹاک" میں ہر آئٹم کا موجودہ مال نظر آتا ہے، اور کم ہونے والے آئٹم الگ نشان کے ساتھ دکھتے ہیں۔','"Stock" shows each item\'s current quantity, and low items are marked.'],
['k05','جنرل اسٹور,general store software,store software,جنرل اسٹور میں کیا,جنرل اسٹور کی سہولت','جنرل اسٹور کے سوفٹ ویئر میں کیا ہے؟','What is in the General Store software?','کریانہ جیسی ہی سہولتیں ہیں: بل (POS)، ریٹرن، خرید، آئٹمز، اسٹاک، ادھار، سپلائر، اخراجات، کیش بک اور رپورٹس۔','It has similar functions to Kiryana: bill (POS), returns, purchases, items, stock, credit, suppliers, expenses, cash book and reports.'],
['k06','بل جلدی,fast billing,جلدی بل,quick bill,counter speed,بل کیسے بناؤں,bill kaise banta','بل کیسے اور کتنی جلدی بنتا ہے؟','How fast and how is a bill made?','"نیا بل" کھولیں، آئٹم چنیں یا اسکین کریں، مقدار لکھیں اور بل محفوظ کر کے پرنٹ کریں۔ چند سیکنڈ کا کام ہے۔','Open "New Bill", pick or scan items, enter quantity, save and print. It takes only a few seconds.'],
['k07','منافع,profit,munafa,نفع,profit kitna,آج کا منافع,daily profit','کیا دکان کا منافع نظر آتا ہے؟','Can I see my shop\'s profit?','جی ہاں۔ ڈیش بورڈ اور رپورٹس میں فروخت، خرید اور اخراجات کے بعد کا منافع نظر آتا ہے۔','Yes. The dashboard and reports show profit after sales, purchases and expenses.'],
/* ---- school ---- */
['c01','اسکول سوفٹ ویئر,school software,school management,اسکول کی سہولت,school mein kya,اسکول میں کیا','اسکول کے سوفٹ ویئر میں کیا ہے؟','What is in the School software?','فیس وصولی، فیس واؤچر، حاضری، فیس نہ دینے والے، طلبہ، کلاسیں، امتحان اور نمبر، اساتذہ اور عملہ، تنخواہیں، کیش بک، اخراجات اور رپورٹس۔','Fee collection, fee vouchers, attendance, defaulters, students, classes, exams and marks, teachers and staff, salaries, cash book, expenses and reports.'],
['c02','فیس واؤچر,fee voucher,fee slip,فیس کی پرچی,fee collect,فیس وصول,fee jama','فیس کیسے وصول اور واؤچر کیسے بنتا ہے؟','How are fees collected and vouchers made?','"فیس وصولی" میں طالب علم چن کر فیس لکھیں، رسید پرنٹ کریں۔ فیس واؤچر کی فہرست میں سب واؤچر محفوظ رہتے ہیں۔','In "Collect Fee" pick the student, enter the fee and print the receipt. Fee vouchers are kept in the voucher list.'],
['c03','فیس نادہندہ,defaulters,fee baqaya,فیس نہ دینے والے,بقایا فیس,fee pending,fee due','کس بچے کی فیس رہتی ہے، کیسے پتا چلے؟','How do I know whose fee is due?','"فیس نادہندہ" کی فہرست میں وہ سب طلبہ آ جاتے ہیں جن کی فیس بقایا ہے۔','The "Defaulters" list shows all students whose fee is due.'],
['c04','حاضری,attendance,hazri,طلبہ کی حاضری,roz hazri,students attendance','کیا بچوں کی حاضری لگ سکتی ہے؟','Can I mark student attendance?','جی ہاں۔ "حاضری" میں کلاس چن کر ہر بچے کے سامنے حاضر یا غیر حاضر لگائیں۔','Yes. In "Attendance" pick the class and mark each child present or absent.'],
['c05','نتیجہ,result card,exam marks,امتحان کے نمبر,رزلٹ,marks entry,نمبر درج','امتحان کے نمبر اور نتیجہ کیسے بنتا ہے؟','How are exam marks and results made?','"امتحان اور نمبر" میں ہر مضمون کے نمبر لکھیں۔ نتیجہ اور کل نمبر خود بن جاتے ہیں۔','In "Exams & Marks" enter marks per subject. Results and totals are made automatically.'],
['c06','اساتذہ کی تنخواہ,teacher salary,salaries,تنخواہ,staff salary,تنخواہ کا حساب,teachers','کیا اساتذہ اور عملے کی تنخواہ کا حساب ہوتا ہے؟','Does it handle teachers\' and staff salaries?','جی ہاں۔ "اساتذہ اور عملہ" اور "تنخواہیں" میں ہر ایک کی تنخواہ، ایڈوانس اور ادائیگی درج ہوتی ہے۔','Yes. In "Teachers & Staff" and "Salaries" each person\'s salary, advance and payment are recorded.'],
/* ---- office ---- */
['o01','آفس سوفٹ ویئر,office software,services software,دفتر کا سوفٹ ویئر,office mein kya,آفس میں کیا','آفس / سروسز کے سوفٹ ویئر میں کیا ہے؟','What is in the Office / Services software?','نیا انوائس، کوٹیشن، جابز / ورک آرڈر، رسیدیں، کیش بک، روزانہ کام اور یاد دہانی، کلائنٹ، سروسز اور فیس، ملازمین، حاضری، تنخواہیں، اخراجات اور رپورٹس۔','New invoice, quotation, jobs / work orders, receipts, cash book, daily tasks and reminders, clients, services and fees, employees, attendance, salaries, expenses and reports.'],
['o02','کوٹیشن,quotation,quote,اندازہ قیمت,estimate,کوٹیشن کیسے,quotation banana','کوٹیشن کیسے بنتی ہے؟','How is a quotation made?','"نئی کوٹیشن" میں کلائنٹ اور سروسز لکھیں۔ خوبصورت کوٹیشن پرنٹ ہوتی ہے اور منظوری کے بعد اسے انوائس میں بدلا جا سکتا ہے۔','In "New Quotation" enter the client and services. A neat quotation prints and can be converted to an invoice once approved.'],
['o03','انوائس,invoice banana,bill client,کلائنٹ کا بل,invoice print,انوائس کیسے','انوائس کیسے بنتی ہے؟','How is an invoice made?','"نیا انوائس" میں کلائنٹ اور سروس چنیں، رقم لکھیں اور پرنٹ کریں۔ ادائیگی اور بقایا بھی ساتھ درج رہتا ہے۔','In "New Invoice" pick the client and service, enter the amount and print. Payment and balance are recorded too.'],
['o04','جابز,work order,job card,کام کا آرڈر,jobs kaise,ورک آرڈر,کام کی فہرست','جابز یا ورک آرڈر کا کیا فائدہ ہے؟','What are jobs / work orders for?','ہر کام کی حالت (شروع، جاری، مکمل) اور اس کی تاریخ نظر آتی ہے، تو کوئی کام بھولتا نہیں۔','You see each job\'s status (new, in progress, done) and date, so no job is forgotten.'],
['o05','یاد دہانی,reminder,daily tasks,روزانہ کام,task list,کام یاد,reminders','کیا روزانہ کے کاموں کی یاد دہانی رکھ سکتا ہوں؟','Are there reminders for daily tasks?','جی ہاں۔ "روزانہ کام اور یاد دہانی" میں کام لکھیں اور تاریخ لگائیں، روزانہ کام کی فہرست میں نظر آتا ہے۔','Yes. In "Daily Tasks & Reminders" write a task and a date and it shows in your daily task list.'],
['o06','ملازمین,employees,ملازم کی حاضری,staff attendance,tankhwah office,ملازم کی تنخواہ','کیا ملازمین کی حاضری اور تنخواہ کا حساب ہوتا ہے؟','Does it handle employees\' attendance and salary?','جی ہاں۔ "ملازمین"، "حاضری" اور "تنخواہیں" میں سب درج ہوتا ہے۔','Yes. It is all recorded in "Employees", "Attendance" and "Salaries".'],
/* ---- reports / accounts ---- */
['r01','رپورٹس,reports,reports kaise,رپورٹ دیکھنا,monthly report,ماہانہ رپورٹ,sales report','کون کون سی رپورٹس ملتی ہیں؟','Which reports do I get?','ڈیش بورڈ پر آج کا خلاصہ ہے اور "رپورٹس" میں روزانہ، ماہانہ اور مدت کے حساب سے فروخت، خرید، اخراجات اور منافع دیکھ سکتے ہیں۔','The dashboard has today\'s summary and "Reports" shows sales, purchases, expenses and profit by day, month or any period.'],
['r02','اخراجات,expenses,kharcha,خرچہ,expense entry,دکان کا خرچہ,اخراجات درج','اخراجات کیسے لکھوں؟','How do I record expenses?','"اخراجات" میں تاریخ، وجہ اور رقم لکھ کر محفوظ کریں۔ منافع میں وہ خود منہا ہو جاتے ہیں۔','In "Expenses" enter the date, reason and amount. They are deducted from profit automatically.'],
['r03','کیش بک,cash book,cashbook,نقد کھاتہ,cash in hand,روزانہ کیش,cash balance','کیش بک کا کیا فائدہ ہے؟','What is the cash book for?','اس میں روز کی نقد آمدنی اور خرچ ایک جگہ نظر آتا ہے اور دن کے آخر میں ہاتھ میں کتنے پیسے ہونے چاہئیں یہ پتا چل جاتا ہے۔','It shows each day\'s cash income and expense in one place and tells how much cash should be in hand at day end.'],
['r04','ایکسل,excel,pdf,فائل بنانا,export,ایکسپورٹ,download report,رپورٹ ڈاؤن لوڈ','کیا رپورٹ کی فائل نکال سکتا ہوں؟','Can I export a report as a file?','رپورٹ پرنٹ کر کے PDF بنا سکتے ہیں اور بیک اپ کی فائل بھی ڈاؤن لوڈ ہوتی ہے۔','You can print a report to PDF and also download a backup file.'],
['r05','سپلائر,supplier,suppliers,سپلائر کا حساب,supplier ledger,supplier se kharid','کیا سپلائر کا حساب رکھا جا سکتا ہے؟','Can I keep supplier accounts?','جی ہاں۔ "سپلائر" میں ہر سپلائر سے خرید، ادائیگی اور بقایا درج ہوتا ہے۔','Yes. In "Suppliers" purchases, payments and balance of each supplier are recorded.'],
/* ---- chat / contact / misc ---- */
['x01','مالک سے بات,owner se baat,بات کرنی ہے,speak to owner,talk to owner,مالک کا نمبر','میں مالک سے براہ راست بات کرنا چاہتا ہوں؟','I want to talk to the owner directly?','اپنا پیغام یہیں لکھ دیں، مالک خود آپ کو جواب دیں گے۔ آپ واٹس ایپ پر بھی رابطہ کر سکتے ہیں۔','Write your message here and the owner will reply personally. You can also contact on WhatsApp.'],
['x02','شکایت,complaint,shikayat,ناراض,بہت برا,complaint karni,نقصان ہوا','مجھے شکایت ہے؟','I have a complaint?','معاف کیجیے۔ اپنی شکایت یہاں لکھ دیں۔ مالک خود دیکھ کر آپ سے رابطہ کریں گے۔','We are sorry. Write your complaint here. The owner will look into it and contact you.'],
['x03','دکان کھلنے کا وقت,timing,office time,کب ملیں,کب بات,available time,آپ کا وقت','آپ سے کس وقت رابطہ ہو سکتا ہے؟','What time can I reach you?','آپ کسی بھی وقت پیغام لکھ سکتے ہیں۔ مالک فرصت ملتے ہی جواب دیتے ہیں۔','You can write any time. The owner replies as soon as he is free.'],
['x04','شہر,which city,کہاں ہیں آپ,location,ایڈریس کیا,address kya,دفتر کہاں','آپ کہاں ہیں؟ کیا ملاقات ہو سکتی ہے؟','Where are you? Can we meet?','ملاقات یا رہنمائی کے لیے مالک سے واٹس ایپ پر وقت لے لیں۔','For a meeting or guidance please fix a time with the owner on WhatsApp.'],
['x05','دوسرے ملک,outside pakistan,abroad,overseas,باہر ملک,پاکستان سے باہر','کیا پاکستان سے باہر بھی چل سکتا ہے؟','Can it work outside Pakistan?','جی ہاں، انٹرنیٹ ہو تو کہیں سے بھی لاگ اِن ہو سکتا ہے۔ تفصیل کے لیے مالک سے بات کریں۔','Yes, with internet you can log in from anywhere. Ask the owner for details.'],
['x06','ہمارے لوگو کے ساتھ,white label,اپنے نام سے بیچنا,resell,dealer,ڈیلر شپ,agency','کیا میں یہ سوفٹ ویئر آگے بیچ سکتا ہوں (ڈیلر)؟','Can I resell this software (dealer)?','اس کے لیے مالک سے براہ راست بات کریں۔','Please talk to the owner directly about this.'],
['x07','نمونہ دیکھنا,demo dekhna,live demo,demo chahiye,مثال دیکھنی,sample dekhna','کیا میں پہلے نمونہ دیکھ سکتا ہوں؟','Can I see a sample first?','جی ہاں، مفت ٹرائل شروع کریں۔ اس میں نمونہ ڈیٹا کے ساتھ سب کچھ چلتا ہوا نظر آتا ہے۔','Yes, start the free trial. It runs with sample data so you can see everything working.'],
['x08','تعارف ویڈیو,video,demo video,ویڈیو دکھائیں,tutorial,سکھانے والی ویڈیو,video guide','کیا سکھانے والی ویڈیو ہے؟','Is there a tutorial video?','ہر اسکرین پر بٹن صاف لکھے ہیں۔ ویڈیو اور رہنمائی کے لیے ہمیں واٹس ایپ کریں۔','Every screen has clearly named buttons. For videos and guidance message us on WhatsApp.'],
['x09','پرانا ورژن,v1,which version,ورژن کون سا,my version,current version','میرا ورژن کون سا ہے؟','Which version do I have?','ورژن کا نمبر لاگ اِن اسکرین کے نیچے اور سوفٹ ویئر کے مینو میں لکھا ہوتا ہے۔','The version number is shown at the bottom of the login screen and in the software menu.'],
['x10','براؤزر,browser,chrome,کون سا براؤزر,which browser,safari,firefox','کون سا براؤزر استعمال کروں؟','Which browser should I use?','گوگل کروم بہتر رہتا ہے۔ دوسرے جدید براؤزر بھی چلتے ہیں۔','Google Chrome works best. Other modern browsers work too.'],
['x11','کتنے آئٹم,آئٹم کتنے,items limit,how many items,کتنی دوائیں,کتنی ادویات,گنجائش,limit,capacity,ہزار آئٹم,جنرل اسٹور آئٹم,فارمیسی آئٹم','جنرل اسٹور یا فارمیسی میں کتنے آئٹم آ سکتے ہیں؟','How many items fit in a general store or pharmacy?','جنرل اسٹور / کریانہ: کوئی مقررہ حد نہیں۔ ہم نے 20,000 آئٹم ڈال کر جانچا؛ فہرست اور بل دونوں فوراً کھلتے ہیں۔ فہرست میں پہلے 200 آئٹم نظر آتے ہیں، باقی کے لیے تلاش لکھیں یا "مزید دکھائیں" دبائیں۔ عام دکان میں 5,000 سے 20,000 آئٹم ہوتے ہیں، یہ سب آسانی سے آ جاتے ہیں۔ فارمیسی: عام فارمیسی کے ہزاروں دوا کے نام آرام سے چلتے ہیں؛ بہت بڑی تعداد (20,000 سے اوپر) کا الگ ٹیسٹ ابھی نہیں ہوا۔ اصل حد آپ کے فون یا کمپیوٹر کی جگہ پر ہے، اور ڈیٹا آن لائن بھی محفوظ ہوتا ہے۔','General store / kiryana: no fixed limit. We tested 20,000 items; the list and billing both open instantly. The list shows the first 200 items; type in Search or press "Show more" for the rest. A normal shop has 5,000 to 20,000 items, which fits easily. Pharmacy: a normal pharmacy with thousands of medicine names runs comfortably; a very large count (over 20,000) has not been tested separately yet. The real limit is the free space on your phone or computer, and your data is also saved online.']
];
/* ===== One question & answer for EVERY function of EVERY software (generated rows use these texts) ===== */
const FN_DESC={
lab:{
dash:['آج کا خلاصہ: آج کی رسیدیں، آمدنی، اخراجات اور کیش ایک نظر میں۔ یہیں سے نئی رسید اور باقی کام کے بٹن ملتے ہیں۔','Today\'s summary: receipts, income, expenses and cash at a glance, with quick buttons for new receipt and other jobs.'],
inv:['مریض کا نام، فون، ریفر کرنے والا ڈاکٹر اور ٹیسٹ چنیں۔ رقم، رعایت اور وصولی لکھ کر رسید محفوظ کریں اور پرنٹ کریں۔ ہر رسید کا نمبر خود بنتا ہے۔','Enter the patient name, phone, referring doctor and pick the tests. Add discount and payment, then save and print the receipt. The receipt number is automatic.'],
work:['آج کے نمونوں اور رپورٹس کی فہرست۔ یہاں نظر آتا ہے کس کی رپورٹ تیار ہے اور کس کی باقی ہے، تاکہ کوئی رپورٹ رہ نہ جائے۔','The list of today\'s samples and reports. You see whose report is ready and whose is pending, so none is missed.'],
res:['ہر ٹیسٹ کے نتیجے لکھیں۔ نارمل رینج ساتھ نظر آتی ہے۔ محفوظ کرنے پر لیٹر ہیڈ کے ساتھ رپورٹ بن جاتی ہے جو پرنٹ ہو سکتی ہے۔','Enter each test\'s result. The normal range is shown beside it. On saving, the report forms with your letterhead and can be printed.'],
cash:['روز کی نقد آمدنی اور اخراجات کی کیش بک۔ شروع کا بیلنس، آمد، خرچ اور آخر کا بیلنس نظر آتا ہے۔','The daily cash book of income and expenses: opening balance, money in, money out and closing balance.'],
tests:['اپنے ٹیسٹ شامل اور ایڈٹ کریں: ٹیسٹ کا نام، کوڈ، قسم، نمونہ، قیمت، رپورٹ کا وقت (گھنٹے) اور پیرامیٹرز کے ساتھ نارمل رینج۔ رسید میں یہی فہرست آتی ہے۔','Add and edit your tests: name, code, type, sample, price, report time (hours) and parameters with normal ranges. Receipts use this list.'],
patients:['ہر مریض کا نام، فون اور اس کی پچھلی رسیدیں اور رپورٹس محفوظ رہتی ہیں۔ پرانے مریض کو تلاش کر کے نئی رسید فوراً بن جاتی ہے۔','Each patient\'s name, phone and previous receipts and reports are kept. Find an old patient and make a new receipt quickly.'],
doctors:['ریفر کرنے والے ڈاکٹر شامل کریں اور ان کا کمیشن فیصد لکھیں۔ ہر رسید پر کمیشن خود جمع ہوتا ہے۔ یہاں کل کمیشن، ادا شدہ اور باقی نظر آتا ہے اور ڈاکٹر کو ادائیگی بھی درج ہوتی ہے۔','Add referring doctors and set their commission percentage. Commission builds up on every receipt. Here you see total, paid and payable, and you record payments to the doctor.'],
pad:['رپورٹ اور رسید کا پیڈ اپنی مرضی سے بنائیں: لیب کا نام، ڈاکٹر کی ڈگری، پتہ، فون اور لوگو۔ یہی ہر رپورٹ اور رسید پر چھپتا ہے۔','Design your report and receipt pad: lab name, doctor degree, address, phone and logo. It prints on every report and receipt.'],
reagents:['لیب کے ری ایجنٹس اور سامان کی فہرست: نام، اکائی (کٹ، ڈبہ…)، شروع کا اسٹاک، موجودہ اسٹاک اور آخری ریٹ۔','The list of reagents and supplies: name, unit (kit, box…), opening stock, current stock and last rate.'],
rpur:['ری ایجنٹ یا سامان کی خریداری درج کریں: سپلائر، تاریخ، چیزیں، مقدار اور ریٹ۔ اسٹاک خود بڑھ جاتا ہے اور سپلائر کا حساب بن جاتا ہے۔','Enter a purchase of reagents or supplies: supplier, date, items, quantity and rate. Stock rises automatically and the supplier account updates.'],
suppliers:['سپلائرز کی فہرست اور ہر ایک کا حساب: کتنی خریداری ہوئی، کتنی ادائیگی ہوئی اور کتنا باقی ہے۔','The list of suppliers and each one\'s account: how much was bought, paid and what is still due.'],
exp:['لیب کے اخراجات (بجلی، کرایہ، تنخواہ وغیرہ) تاریخ، وجہ اور رقم کے ساتھ لکھیں۔ یہ کیش اور منافع کے حساب میں خود شامل ہوتے ہیں۔','Record lab expenses (electricity, rent, salary etc.) with date, reason and amount. They enter the cash and profit figures automatically.'],
invh:['اب تک کی تمام لیب رسیدیں۔ تاریخ یا مریض کے نام سے تلاش کریں، کھول کر دیکھیں، دوبارہ پرنٹ کریں۔','All lab receipts so far. Search by date or patient name, open, and reprint.'],
rpurh:['ری ایجنٹ اور سامان کی پرانی خریداریوں کی فہرست، سپلائر اور تاریخ کے ساتھ۔','The history of reagent and supply purchases, with supplier and date.'],
rep:['لیب کی رپورٹس: کسی بھی مدت کی آمدنی، اخراجات، ڈاکٹر کمیشن اور منافع کا خلاصہ۔','Lab reports: income, expenses, doctor commission and profit summary for any period.'],
settings:['سوفٹ ویئر کی ترتیب: لیب کا نام، پتہ، رسید کے خانے اور دوسری عمومی سیٹنگز یہاں بدلتی ہیں۔','Software settings: lab name, address, receipt options and other general settings are changed here.']},
pharmacy:{
dash:['آج کی فروخت، نقد، اخراجات، ڈاکٹر فیس، بقایا اور منافع کا خلاصہ ایک جگہ۔ اوپر سے فوری بٹن سے نیا کام شروع ہوتا ہے۔','Today\'s sales, cash, expenses, doctor fee, dues and profit in one place, with quick buttons to start new work.'],
counter:['کاؤنٹر پر تیز فروخت: دوا کا نام لکھیں یا اسکین کریں، مقدار ڈالیں، بل بنائیں اور پرنٹ کریں۔ اسٹاک خود کم ہوتا ہے۔','Fast counter sale: type or scan the medicine, enter quantity, make the bill and print. Stock reduces automatically.'],
sale:['ڈرپ اور علاج والی فروخت کے لیے الگ سیل اسکرین، جہاں دوائیں لکھ کر بل بنایا جاتا ہے۔','A separate sale screen for drip / treatment sales, where you add the medicines and make the bill.'],
rx:['ڈاکٹر کی پرچی (نسخہ): مریض اور دوائیں لکھیں، ڈاکٹر کے نام، ڈگری اور پتے کے ساتھ خوبصورت پرچی پرنٹ کریں۔','Doctor\'s prescription: write the patient and medicines and print a neat slip with the doctor\'s name, degree and address.'],
med:['ادویات کی فہرست: نئی دوا کا نام، قیمت، اسٹاک اور ایکسپائری لکھ کر شامل کریں، یا پرانی دوا کو ایڈٹ کریں۔','The medicine list: add a new medicine with name, price, stock and expiry, or edit an existing one.'],
next:['وہ ادویات جو کم ہو چکی ہیں اور جن کا اگلا آرڈر دینا ہے، ایک فہرست میں۔ یہاں سے سپلائر کو بھیجنے کا آرڈر بنایا جا سکتا ہے۔','Medicines that are low and need to be ordered next, in one list. An order to send to the supplier can be made from here.'],
supplier:['سپلائرز کی فہرست اور حساب: کس سے کتنی خریداری ہوئی، کتنی ادائیگی ہوئی اور کتنا باقی ہے۔','Suppliers and their accounts: how much was bought, paid and what is due.'],
bills:['اب تک کے تمام بل۔ تاریخ، نمبر یا نام سے تلاش کریں، کھولیں اور دوبارہ پرنٹ کریں۔','All bills so far. Search by date, number or name, open and reprint.'],
sret:['واپس آئی دوا کی واپسی درج کریں۔ اصل بل چن کر واپسی لکھیں؛ اسٹاک اور کیش کا حساب خود ٹھیک ہو جاتا ہے۔','Enter a return of medicine. Pick the original bill and enter the return; stock and cash adjust by themselves.'],
report:['فروخت، خرید، اخراجات اور منافع کی رپورٹ کسی بھی مدت کی۔','Report of sales, purchases, expenses and profit for any period.'],
dcash:['روز کا نقد حساب: آج کتنی نقد آمدنی ہوئی اور کتنا خرچ ہوا۔','The daily cash account: how much cash came in and went out today.'],
close:['شام کو دن کا حساب بند کریں: آج کی فروخت، نقد اور اخراجات ملا کر بند ہو جاتے ہیں اور اگلے دن نیا حساب شروع ہوتا ہے۔','Close the day in the evening: sales, cash and expenses are totalled and closed, and a new day starts.'],
dms:['روزانہ کی بنیاد پر ہر دوا کی فروخت کی فہرست، یعنی آج کون سی دوا کتنی بکی۔','A daily list of each medicine\'s sales, i.e. how much of each was sold today.'],
recon:['حساب ملانے کی اسکرین: سسٹم کا نقد اور ہاتھ میں موجود نقد ملا کر فرق دیکھیں۔','The reconciliation screen: compare system cash with the cash in hand and see the difference.'],
heads:['ادھار والے گاہکوں کا کھاتہ: ہر ایک کا ادھار، جمع کروائی گئی رقم اور بقایا۔','Credit customers\' ledger: each one\'s credit, payments received and balance.'],
exp:['دکان یا کلینک کے اخراجات تاریخ، وجہ اور رقم کے ساتھ لکھیں۔ منافع میں خود منہا ہوتے ہیں۔','Record shop or clinic expenses with date, reason and amount. They are deducted from profit automatically.'],
owner:['مالک کا اپنا کھاتہ، جس کا حساب دکان کے باقی حساب سے الگ رہتا ہے۔','The owner\'s own account, kept separate from the shop\'s other accounts.'],
templates:['بل اور پرچی کے ٹیمپلیٹس اور ڈاکٹر / دکان کی تفصیل یہاں بدلتی ہے۔','Bill and prescription templates and doctor / shop details are changed here.'],
backup:['بیک اپ: ایک کلک سے اپنے ڈیٹا کی فائل بنائیں اور پرانی فائل سے ریکارڈ واپس لائیں۔','Backup: make a file of your data in one click and restore records from an old file.']},
merchant:{
dash:['آج کی خرید و فروخت، گودام کا مال، زمیندار/پارٹی اور خریداروں کا بقایا اور کیش کا خلاصہ۔','Today\'s purchases and sales, godown stock, farmers\' and buyers\' balances and cash summary.'],
pur:['زمیندار/پارٹی سے مال کی خرید: جنس، من اور کلو میں وزن، ریٹ فی من، مزدوری اور کرایہ (اختیاری) لکھیں۔ خرید کی پرچی پرنٹ ہوتی ہے اور کسان کا کھاتہ بن جاتا ہے۔ کسان کا نام لکھنا اختیاری ہے۔','Buy goods from a farmer: commodity, weight in maund and kg, rate per maund, labour and freight (optional). A purchase slip prints and the farmer\'s account updates. Naming the farmer is optional.'],
sal:['خریدار یا مل کو مال کی فروخت: جنس، وزن اور ریٹ لکھیں، فروخت کی پرچی بنائیں۔ گودام سے مال خود کم ہوتا ہے اور خریدار کا کھاتہ بنتا ہے۔','Sell goods to a buyer or mill: commodity, weight and rate; make the sale slip. Godown stock reduces and the buyer\'s account updates.'],
calc:['جنس چنیں، بوریاں، ایک بوری کا وزن اور فی من قیمت لکھیں؛ کل وزن، من اور رقم فوراً آ جاتی ہے۔ کانٹے پر کسان کو اسی وقت قیمت بتانے کے لیے۔','Pick the commodity and enter bags, weight of one bag and the price per maund; total weight, maunds and amount appear at once. Use it at the scale to tell the farmer the price immediately.'],
cash:['روز کی نقد آمد و خرچ کی کیش بک، ادائیگیوں اور وصولیوں کے ساتھ۔','The daily cash book of money in and out, with payments and receipts.'],
stock:['گودام میں ہر جنس کا موجودہ مال من اور کلو میں، اوسط خرید قیمت اور مال کی کل قیمت۔','Current stock of each commodity in the godown in maunds and kg, average cost and total stock value.'],
farmers:['زمیندار/پارٹی کی فہرست اور ہر ایک کا کھاتہ: مال، ادائیگی، ایڈوانس اور بقایا — سب ایک ہی کھاتے میں۔ ابتدائی وصول کھاتہ اور جمع کھاتہ تاریخوں کے ساتھ۔','Landlord/party list and each one\'s single ledger: goods, payments, advance and balance. Opening wasool and jama accounts with dates.'],
owners:['مالکان کے الگ کھاتے (مالک 1، مالک 2…): مالک نے رقم لگائی یا نکالی۔','Separate owner accounts: money the owner put in or took out.'],
buyers:['خریداروں اور ملوں کی فہرست اور ہر ایک کا کھاتہ: فروخت، وصولی اور بقایا۔','The list of buyers and mills and each one\'s account: sales, receipts and balance.'],
items:['اجناس کی فہرست: نئی جنس شامل کریں، ایک من کتنے کلو کا ہے (عام طور پر 40) لکھیں، شروع کا اسٹاک اور ریٹ ڈالیں۔','The commodity list: add a commodity, set kg per maund (normally 40), opening stock and rate.'],
wastage:['مال میں کمی یا ضیاع (گرد، بارش، چوہے وغیرہ) کا وزن اور وجہ لکھیں۔ گودام کا اسٹاک خود ٹھیک ہو جاتا ہے۔','Record shortage or wastage (dust, rain, rats etc.) with the weight lost and reason. Godown stock adjusts automatically.'],
exp:['اخراجات (مزدوری، کرایہ، دکان کے خرچ) لکھیں؛ منافع میں خود منہا ہوتے ہیں۔','Record expenses (labour, freight, shop costs); they are deducted from profit automatically.'],
purh:['اب تک کی تمام خرید پرچیاں، کسان یا تاریخ سے تلاش اور دوبارہ پرنٹ کے ساتھ۔','All purchase slips so far, with search by farmer or date and reprint.'],
salh:['اب تک کی تمام فروخت پرچیاں، خریدار یا تاریخ سے تلاش اور دوبارہ پرنٹ کے ساتھ۔','All sale slips so far, with search by buyer or date and reprint.'],
rep:['خرید، فروخت، گودام اور منافع کی رپورٹس کسی بھی مدت کی۔','Reports of purchases, sales, godown and profit for any period.'],
settings:['فرم کا نام، پتہ، پرچی کے خانے اور عمومی سیٹنگز۔','Firm name, address, slip options and general settings.']},
kiryana:{
dash:['آج کی فروخت، نقد، ادھار، کم اسٹاک اور منافع کا خلاصہ۔','Today\'s sales, cash, credit, low stock and profit summary.'],
sal:['کاؤنٹر پر بل بنائیں: آئٹم لکھ کر یا بار کوڈ اسکین کر کے چنیں، مقدار لکھیں، نقد یا ادھار منتخب کریں اور پرنٹ کریں۔ اسٹاک خود کم ہوتا ہے۔','Make a bill at the counter: pick items by typing or scanning a barcode, enter quantity, choose cash or credit and print. Stock reduces automatically.'],
ret:['گاہک کی واپس کی ہوئی چیز کی واپسی درج کریں۔ اسٹاک اور حساب خود ٹھیک ہو جاتے ہیں۔','Enter a customer\'s return. Stock and account adjust by themselves.'],
pur:['سپلائر سے خرید درج کریں: آئٹم، مقدار اور ریٹ۔ اسٹاک بڑھتا ہے اور سپلائر کا حساب بنتا ہے۔','Enter a purchase from a supplier: item, quantity and rate. Stock rises and the supplier account updates.'],
cash:['روز کی نقد آمد و خرچ کی کیش بک۔','The daily cash book of money in and out.'],
items:['آئٹمز کی فہرست: نام، کوڈ، کیٹگری، برانڈ، اکائی، خرید قیمت، فروخت قیمت، بار کوڈ اور کم اسٹاک کی حد۔','The item list: name, code, category, brand, unit, cost price, sale price, barcode and low-stock level.'],
stock:['ہر آئٹم کا موجودہ اسٹاک اور مالیت؛ کم ہونے والے آئٹم الگ نشان کے ساتھ نظر آتے ہیں۔','Current stock and value of each item; low items are marked.'],
custs:['گاہکوں کا ادھار کھاتہ: ہر ایک کا ادھار، جمع شدہ رقم اور بقایا۔ وصولی بھی یہیں درج ہوتی ہے۔','Customers\' credit (udhar) accounts: each one\'s credit, payments and balance. Receipts are entered here too.'],
supps:['سپلائرز کی فہرست اور حساب: خرید، ادائیگی اور باقی۔','Suppliers and accounts: purchases, payments and balance.'],
exp:['دکان کے اخراجات لکھیں؛ منافع میں خود منہا ہوتے ہیں۔','Record shop expenses; they are deducted from profit automatically.'],
salh:['اب تک کے تمام فروخت بل؛ تلاش اور دوبارہ پرنٹ۔','All sale bills so far; search and reprint.'],
reth:['اب تک کی تمام واپسیاں۔','All returns so far.'],
purh:['اب تک کے تمام خرید واؤچر۔','All purchase vouchers so far.'],
rep:['فروخت، خرید، اخراجات اور منافع کی رپورٹس کسی بھی مدت کی۔','Reports of sales, purchases, expenses and profit for any period.'],
settings:['دکان کا نام، پتہ، بل کے خانے اور عمومی سیٹنگز۔','Shop name, address, bill options and general settings.']},
school:{
dash:['آج کی فیس وصولی، حاضری، بقایا اور اخراجات کا خلاصہ۔','Today\'s fee collection, attendance, dues and expenses summary.'],
col:['طالب علم چن کر فیس وصول کریں، رعایت اور بقایا نظر آتا ہے، رسید پرنٹ ہوتی ہے۔','Pick a student and collect the fee; discount and dues are visible and the receipt prints.'],
fee:['فیس کے واؤچر بنائیں اور پرنٹ کریں، پرانے واؤچر دیکھیں۔','Make and print fee vouchers and view old vouchers.'],
att:['کلاس چن کر ہر بچے کے سامنے حاضر یا غیر حاضر لگائیں۔','Pick a class and mark each child present or absent.'],
def:['وہ سب طلبہ جن کی فیس بقایا ہے، رقم کے ساتھ ایک فہرست میں۔','All students whose fee is due, with the amount, in one list.'],
stu:['طلبہ کا داخلہ: نام، رول نمبر، کلاس، والد کا نام، فون، ماہانہ فیس، رعایت اور ٹرانسپورٹ فیس۔','Student admission: name, roll number, class, father\'s name, phone, monthly fee, discount and transport fee.'],
cls:['کلاسیں اور سیکشن بنائیں، ہر کلاس کی ماہانہ فیس اور کلاس ٹیچر لکھیں۔','Create classes and sections and set each class\'s monthly fee and class teacher.'],
exm:['امتحان اور نمبر درج کریں؛ کل نمبر اور نتیجہ بنتا ہے۔','Enter exams and marks; totals and results are made.'],
stf:['اساتذہ اور عملے کی فہرست: نام، کردار، مضمون، فون، ماہانہ تنخواہ اور تاریخ تقرری۔','Teachers and staff list: name, role, subject, phone, monthly salary and joining date.'],
sal:['اساتذہ اور عملے کی ماہانہ تنخواہ اور ادائیگی کا حساب۔','Monthly salaries and payments of teachers and staff.'],
cash:['اسکول کی روز کی نقد آمد و خرچ کی کیش بک۔','The school\'s daily cash book of money in and out.'],
exp:['اسکول کے اخراجات لکھیں؛ حساب میں خود شامل ہوتے ہیں۔','Record school expenses; they enter the accounts automatically.'],
rep:['فیس، بقایا، حاضری اور اخراجات کی رپورٹس۔','Reports on fees, dues, attendance and expenses.'],
settings:['اسکول کا نام، پتہ، فیس رسید کے خانے اور عمومی سیٹنگز۔','School name, address, fee receipt options and general settings.']},
office:{
dash:['آج کی انوائسز، وصولی، جاری کام، کاموں کی یاد دہانی اور کیش کا خلاصہ۔','Today\'s invoices, receipts, jobs in progress, task reminders and cash summary.'],
inv:['کلائنٹ اور سروس چن کر نئی انوائس بنائیں، رقم لکھیں اور پرنٹ کریں؛ ادائیگی اور بقایا بھی درج رہتا ہے۔','Pick the client and service to make a new invoice, enter the amount and print; payment and balance are recorded.'],
quo:['کلائنٹ کے لیے کوٹیشن (اندازہ قیمت) بنائیں اور پرنٹ کریں۔ منظوری پر اسے انوائس میں بدلا جا سکتا ہے۔','Make a quotation (estimate) for a client and print it. When approved it can be converted into an invoice.'],
jobs:['کام کے آرڈر: کام کی تفصیل، کلائنٹ، متعلقہ شخص، آخری تاریخ اور فیس۔ حالت: نیا، جاری، تیار برائے ڈیلیوری، دیر سے۔','Work orders: work details, client, assigned person, due date and fee. Status: new, in progress, ready to deliver, overdue.'],
rcpt:['کلائنٹ سے وصول کی گئی رقم کی رسیدیں بنائیں اور پرنٹ کریں۔','Make and print receipts for money received from clients.'],
cash:['روز کی نقد آمد و خرچ کی کیش بک۔','The daily cash book of money in and out.'],
tasks:['روزانہ کے کام اور یاد دہانیاں: کام، تاریخ، ترجیح (زیادہ / عام) اور نوٹ۔ آج کے اور دیر ہوئے کام الگ نظر آتے ہیں۔','Daily tasks and reminders: task, date, priority (high / normal) and note. Today\'s and overdue tasks show separately.'],
clients:['کلائنٹس کی فہرست اور ہر ایک کا حساب: انوائس، وصولی اور بقایا۔','The client list and each one\'s account: invoices, receipts and balance.'],
svc:['اپنی خدمات اور ان کی معیاری فیس کی فہرست۔ انوائس بناتے وقت یہی چنی جاتی ہیں۔','Your services and their standard fees. They are picked when making invoices.'],
invh:['اب تک کی تمام انوائسز؛ تلاش، دیکھنا اور دوبارہ پرنٹ۔','All invoices so far; search, view and reprint.'],
quoh:['اب تک کی تمام کوٹیشنز؛ حالت دیکھیں اور منظور شدہ کو انوائس میں بدلیں۔','All quotations so far; see their status and convert approved ones to invoices.'],
emps:['ملازمین کی فہرست: نام، کردار، فون، ماہانہ تنخواہ اور ایڈوانس کی رقم۔','The employee list: name, role, phone, monthly salary and advance balance.'],
att:['ملازمین کی روزانہ حاضری لگائیں۔','Mark employees\' daily attendance.'],
sal:['ملازمین کی ماہانہ تنخواہ، ایڈوانس اور ادائیگی کا حساب۔','Employees\' monthly salary, advances and payments.'],
exp:['دفتر کے اخراجات لکھیں؛ حساب میں خود شامل ہوتے ہیں۔','Record office expenses; they enter the accounts automatically.'],
rep:['انوائس، وصولی، اخراجات اور منافع کی رپورٹس کسی بھی مدت کی۔','Reports on invoices, receipts, expenses and profit for any period.'],
settings:['دفتر کا نام، پتہ، انوائس کے خانے اور عمومی سیٹنگز۔','Office name, address, invoice options and general settings.']}
};
FN_DESC.store=FN_DESC.kiryana;
/* build one row per function: [id, keywords, question ur, question en, answer ur, answer en] */
function faqFnRows(){if(window._faqFn)return window._faqFn;const out=[];
Object.keys(BUS).forEach(k=>{const swU=BUS[k].ur,swE=BUS[k].en;funcsOf(k).forEach(g=>g.items.forEach(i=>{const tu=BT(i.t,'ur'),te=BT(i.t,'en');const d=(FN_DESC[k]||{})[i.id]||[`یہ سہولت ${swU} کے "${BT(g.g,'ur')}" حصے میں موجود ہے۔ اسے کھول کر استعمال کریں، اور مدد چاہیے تو چیٹ میں پوچھیں۔`,`This function is in the "${BT(g.g,'en')}" section of ${swE}. Open it to use it, and ask in the chat if you need help.`];
out.push(['f_'+k+'_'+i.id,(BOT_AL[k]||[]).slice(0,6).join(', '),`${swU}: "${tu}" کیا ہے اور کیسے استعمال کروں؟`,`${swE}: "${te}" — what is it and how do I use it?`,`${i.i||''} ${tu}: ${d[0]}`,`${i.i||''} ${te}: ${d[1]}`])}))});
window._faqFn=out;return out}
/* ===== FAQ batch 3 (generated by faq3_gen.py) ===== */
FAQ_DEF.push(...[["n01", "اگلا آرڈر,next order,agla order,آرڈر لسٹ,order list,کم اسٹاک آرڈر", "اگلا آرڈر کیا ہے؟", "What is Next Order?", "\"اگلا آرڈر\" وہ لسٹ ہے جس میں کم ہونے والا مال خود آ جاتا ہے۔ یوں آپ کو یاد نہیں رکھنا پڑتا کہ کیا منگوانا ہے۔ یہ کیریانہ، جنرل اسٹور، فارمیسی اور خریداری والے دوسرے سوفٹ ویئرز میں ہے۔", "Next Order is a list where items that are running low arrive by themselves, so you never have to remember what to order. It is in Kiryana, General Store, Pharmacy and other software that buys goods."], ["n02", "آئٹم خود آرڈر میں,خود لسٹ میں,automatic order,auto order,کم از کم اسٹاک,minimum stock,min stock", "آئٹم آرڈر لسٹ میں خود کیسے آتا ہے؟", "How does an item get into the order list by itself?", "ہر آئٹم میں \"کم از کم اسٹاک\" کا خانہ ہے، آپ اپنی مرضی کا عدد لکھیں۔ جیسے ہی اسٹاک اس عدد پر یا اس سے نیچے آتا ہے، آئٹم خود \"اگلا آرڈر\" میں آ جاتا ہے۔", "Every item has a \"Minimum stock\" box where you write your own number. As soon as stock reaches or falls below it, the item moves into Next Order automatically."], ["n03", "کم از کم اسٹاک کہاں لکھوں,minimum stock kahan,min stock set,کم از کم مقدار,minimum quantity,low stock limit", "کم از کم اسٹاک کہاں لکھوں؟", "Where do I set the minimum stock?", "آئٹمز کے صفحے میں آئٹم کھولیں اور \"کم از کم اسٹاک\" میں عدد لکھ دیں۔ فارمیسی میں اسٹاک کی فہرست میں \"Min\" کا خانہ ہے۔ ہر آئٹم کا الگ عدد رکھ سکتے ہیں۔", "Open the item in the Items page and write a number in \"Minimum stock\". In Pharmacy, the stock list has a \"Min\" box. Each item can have its own number."], ["n04", "آرڈر کی مقدار بدلیں,quantity change,تعداد بدلنا,order quantity,مقدار تبدیل", "اگلے آرڈر میں مقدار کیسے بدلوں؟", "How do I change the quantity in Next Order?", "لسٹ میں ہر آئٹم کے آگے مقدار کا خانہ ہے۔ اس میں نیا عدد لکھیں، کل رقم خود بدل جائے گی۔", "Each item has a quantity box in the list. Type the new number and the total updates by itself."], ["n05", "آئٹم ہٹانا,آرڈر سے ڈیلیٹ,delete from order,remove order item,آرڈر لسٹ سے نکالیں", "اگلے آرڈر سے آئٹم کیسے ہٹاؤں؟", "How do I remove an item from Next Order?", "آئٹم کے آگے ✕ کا بٹن دبائیں۔ ہٹایا ہوا آئٹم دوبارہ خود نہیں آئے گا جب تک اس کا اسٹاک پھر سے کم نہ ہو۔", "Press the ✕ button beside the item. A removed item does not return by itself until its stock becomes low again."], ["n06", "بجٹ کے مطابق آرڈر,budget order,میرا بجٹ,my budget,بجٹ میں آرڈر,کتنے پیسے ہیں آرڈر", "کیا میں اپنے بجٹ کے حساب سے آرڈر بنا سکتا ہوں؟", "Can I build the order to my budget?", "جی ہاں۔ اوپر \"میرا بجٹ\" میں رقم لکھیں۔ کل لاگت اس سے بڑھے تو سرخ میں \"بجٹ سے اتنی زیادہ\" لکھا آتا ہے، ورنہ ہرا \"بجٹ کے اندر، اتنی رقم بچی\"۔ مقدار گھٹا بڑھا کر بجٹ پورا کریں۔", "Yes. Write your amount in \"My budget\". If the total cost is above it, red text shows how much over; otherwise green text shows how much is left. Adjust quantities to fit."], ["n07", "خرید لیا,bought it,مال آ گیا,add to stock from order,آرڈر سے اسٹاک,آرڈر والا مال اسٹاک میں", "مال آنے پر اسٹاک میں کیسے ڈالوں؟", "How do I add the bought goods to stock?", "\"خرید لیا — اسٹاک میں ڈالیں\" دبائیں۔ خرید کا فارم اسی لسٹ کی مقدار اور قیمت خرید کے ساتھ بھرا ہوا کھلتا ہے۔ محفوظ کرتے ہی اسٹاک بڑھ جاتا ہے اور وہ آئٹم لسٹ سے نکل جاتے ہیں۔", "Press \"Bought it — add to stock\". The purchase form opens already filled with the list quantities and purchase prices. When you save, stock increases and those items leave the list."], ["n08", "آرڈر لسٹ بھیجیں,send order,order whatsapp,سپلائر کو لسٹ,share order list,آرڈر بھیجنا", "آرڈر کی لسٹ سپلائر کو کیسے بھیجوں؟", "How do I send the order list to the supplier?", "\"لسٹ بھیجیں\" کا بٹن دبائیں۔ لسٹ واٹس ایپ یا پرنٹ کے لیے تیار ہو جاتی ہے۔", "Press \"Send list\". It is ready for WhatsApp or printing."], ["n09", "آرڈر میں خود آئٹم,add item order,manual order,آئٹم خود ڈالیں,add by hand", "کیا آرڈر میں اپنی مرضی کا آئٹم ڈال سکتا ہوں؟", "Can I add my own item to the order?", "جی ہاں۔ \"آئٹم خود شامل کریں\" دبا کر نام اور مقدار لکھیں۔ اسٹاک کم نہ بھی ہو تو آئٹم لسٹ میں آ جائے گا۔", "Yes. Press \"Add item by hand\", write the name and quantity. The item joins the list even if stock is not low."], ["n10", "مرچنٹ آرڈر,school order,اسکول آرڈر,which software next order,کن میں اگلا آرڈر", "اگلا آرڈر کن سوفٹ ویئرز میں ہے؟", "Which software has Next Order?", "فارمیسی، کریانہ، جنرل اسٹور اور وہ سوفٹ ویئرز جن میں خریداری ہوتی ہے۔ گرین مرچنٹ اور اسکول میں نہیں، کیونکہ وہاں مال کا آرڈر نہیں ہوتا۔", "Pharmacy, Kiryana, General Store and other software where you purchase goods. Not in Green Merchant or School, where goods are not ordered."], ["n11", "لسٹ صاف,clear order list,آرڈر لسٹ خالی,empty order", "آرڈر کی پوری لسٹ کیسے صاف کروں؟", "How do I clear the whole order list?", "\"لسٹ صاف\" کا بٹن دبائیں۔ پوچھنے پر ہاں کریں۔ اگر اسٹاک پھر کم ہوا تو آئٹم دوبارہ خود آ جائیں گے۔", "Press \"Clear list\" and confirm. Items will return by themselves if their stock is low again."], ["p01", "قیمت خرید,purchase price,cost price,لاگت قیمت,قیمت خرید کیا ہے,قیمت فروخت کیا ہے", "قیمت خرید اور قیمت فروخت میں کیا فرق ہے؟", "What is the difference between purchase price and sale price?", "قیمت خرید وہ ہے جس پر آپ نے مال خریدا، قیمت فروخت وہ جس پر گاہک کو بیچتے ہیں۔ دونوں کا فرق آپ کا منافع ہے۔ ہر سوفٹ ویئر میں یہی دو نام استعمال ہوتے ہیں۔", "Purchase price (قیمت خرید) is what you paid for the goods; sale price (قیمت فروخت) is what the customer pays. The difference is your profit. Every software uses these two names."], ["p02", "بل پر قیمت خرید,cost on bill,bill par cost,گاہک کو قیمت خرید,customer cost price,لاگت نظر آتی", "کیا بل پر یا گاہک کو میری قیمت خرید نظر آتی ہے؟", "Will my purchase price show on the bill or to customers?", "نہیں۔ قیمت خرید کبھی گاہک کے بل یا رسید پر نہیں چھپتی۔ وہ صرف آپ کے اندر کے حساب، منافع اور اسٹاک کی ویلیو کے لیے ہے۔", "No. The purchase price never prints on a customer bill or receipt. It is only for your own accounts, profit and stock value."], ["p03", "عملے سے قیمت خرید چھپائیں,hide cost,staff cost hide,ملازم کو قیمت خرید,cost permission,hide purchase price from staff", "کیا عملے سے قیمت خرید چھپائی جا سکتی ہے؟", "Can I hide the purchase price from staff?", "جی ہاں۔ مالک کے حصے میں عملے کی اجازتوں میں \"قیمت خرید دیکھنا\" کا خانہ ہے۔ اسے بند رکھیں تو اس ملازم کو قیمت خرید، اسٹاک کی ویلیو اور خرید کی قیمتیں نظر نہیں آئیں گی۔ مالک کو ہمیشہ نظر آتی ہیں۔", "Yes. In the owner section, the staff permissions have a \"See purchase price\" box. Keep it off and that staff member cannot see purchase prices or stock value. The owner always sees them."], ["p04", "قیمت فروخت بدلنا,change sale price,ریٹ بدلنا,sale price change,قیمت بدلیں", "قیمت فروخت کہاں بدلوں؟", "Where do I change the sale price?", "آئٹمز کے صفحے میں آئٹم کھول کر \"قیمت فروخت\" بدلیں۔ فارمیسی میں اسٹاک کی فہرست میں قیمت کا خانہ براہ راست بدل سکتے ہیں۔ بل بناتے وقت بھی اس بل کی قیمت بدل سکتے ہیں۔", "Open the item in Items and change \"Sale price\". In Pharmacy you can edit the price box in the stock list directly. You can also change the price on one bill while billing."], ["p05", "نقصان میں فروخت,loss sale,sale below cost,قیمت فروخت کم,منافع نقصان", "اگر قیمت فروخت، قیمت خرید سے کم ہو تو؟", "What if the sale price is lower than the purchase price?", "فارمیسی خبردار کرتی ہے کہ قیمت فروخت، قیمت خرید سے کم ہے۔ باقی سوفٹ ویئرز کی رپورٹ میں منافع کم یا منفی نظر آئے گا۔ فیصلہ آپ کا ہے۔", "Pharmacy warns you that the sale price is below the purchase price. In other software the report shows low or negative profit. The decision is yours."], ["h01", "ہدایات کا بٹن,help button,ہدایات,instructions button,مدد کا بٹن,ہدایات کہاں", "ہدایات کا بٹن کہاں ہے؟", "Where is the Help button?", "اوپر اردو/English کے بٹن کے ساتھ \"ℹ️ ہدایات\" کا بٹن ہے۔ ایک بار دبائیں تو اس صفحے کی آسان اردو ہدایات کھل جاتی ہیں، دوبارہ دبائیں تو چھپ جاتی ہیں۔ دوسرے صفحے پر جائیں تو خود چھپ جاتی ہیں۔", "Next to the Urdu/English button is \"ℹ️ Help\". Press once to open simple instructions for the page you are on, press again to hide. They hide by themselves when you go to another page."], ["h02", "ہدایات کن میں,help which software,ہدایات سوفٹ ویئر,help in kiryana,کریانہ ہدایات,جنرل اسٹور ہدایات,مرچنٹ ہدایات", "ہدایات کا بٹن کن سوفٹ ویئرز میں ہے؟", "Which software has the Help button?", "گرین مرچنٹ، کریانہ اور جنرل اسٹور میں ہر صفحے کی ہدایات موجود ہیں۔ باقی سوفٹ ویئرز میں بھی یہی سہولت بڑھائی جا رہی ہے۔", "Green Merchant, Kiryana and General Store have instructions for every page. The same is being extended to the other software."], ["h03", "ہلکی تحریر,خانوں میں تحریر,placeholder,grey text,خالی خانے میں,خانے میں کیا لکھوں", "خانوں میں ہلکی گرے تحریر کیا ہے؟", "What is the light grey text inside the boxes?", "ہر خالی خانے میں ہلکی تحریر بتاتی ہے کہ یہاں کیا لکھنا ہے، جیسے \"طالب علم کا نام لکھیں\"۔ جب آپ لکھنا شروع کریں تو وہ خود غائب ہو جاتی ہے۔", "Each empty box shows a light hint saying what to write, like \"Type student name\". It disappears when you start typing."], ["h04", "اختیاری,optional field,optional khana,ضروری خانہ,required field,ستارہ,کون سے خانے ضروری", "کون سے خانے ضروری ہیں اور کون سے اختیاری؟", "Which boxes are required and which optional?", "ستارہ (*) والا خانہ ضروری ہے۔ جس خانے میں \"اختیاری\" لکھا ہو اسے خالی چھوڑ سکتے ہیں۔ مثلاً فون نمبر یا پتہ۔", "A box with a star (*) is required. A box saying \"optional\" can be left empty, for example phone or address."], ["m21", "گرین مرچنٹ میں ریٹ,merchant rate,ریٹ کہاں لکھوں,rate manual,پرچی میں ریٹ,ریٹ کیسے", "گرین مرچنٹ میں ریٹ کہاں لکھوں؟", "Where do I write the rate in Green Merchant?", "ریٹ ہر پرچی میں خود لکھا جاتا ہے، کیونکہ ہر سودے کا ریٹ الگ ہوتا ہے۔ اس لیے \"آج کے ریٹ\" والا صفحہ ختم کر دیا گیا ہے۔", "The rate is written by hand in each slip, since every deal has its own rate. So the \"Today's rates\" page has been removed."], ["m22", "بوری کا وزن,bag weight,bori weight,خود وزن,بوری وزن خود,auto weight,بوری کے کلو", "بوری کا وزن کیسے لکھوں؟", "How do I enter the bag weight?", "جنس میں ایک بار بوری کا وزن لکھ دیں تو ہر پرچی میں خود آ جاتا ہے۔ ہر پرچی میں بدل بھی سکتے ہیں۔ یہ خانہ اختیاری ہے۔", "Write the bag weight once in the commodity and it comes in every slip by itself. You can change it per slip. This box is optional."], ["m23", "مال کس کا,whose goods,own godown,اپنے گودام کا مال,زمیندار کا مال,کسان کا مال بیچا", "فروخت میں \"مال کس کا\" کیا ہے؟", "What is \"Whose goods\" in a sale?", "فروخت کرتے وقت چنیں کہ مال اپنے گودام کا ہے یا کسی زمیندار/کسان کا۔ کسان کا ہو تو اس کا نام چن لیں، فروخت اس کے کھاتے میں آ جاتی ہے۔", "While selling, choose whether the goods are from your own godown or from a landlord/farmer. If a farmer, pick the name and the sale goes to his account."], ["m24", "مل کا حساب,mill account,مل کو فروخت,کمیشن,commission,کرایہ,مزدوری,cartage,labour,وزن کٹوتی", "مل کو بیچنے پر کمیشن، کرایہ، مزدوری اور کٹوتی کیسے لگاؤں؟", "How do I add commission, cartage, labour and weight deduction when selling to a mill?", "فروخت کی پرچی میں کمیشن، کرایہ، مزدوری اور وزن کٹوتی کے خانے ہیں۔ جتنا لکھیں گے مل کے حساب سے خود کم یا زیادہ ہو جائے گا اور مل کا کھاتہ الگ بنے گا۔", "The sale slip has boxes for commission, cartage, labour and weight deduction. What you write adjusts the mill's bill automatically and the mill gets its own account."], ["m25", "لپ,lap,lip,لپ کا آپشن", "مرچنٹ میں \"لپ\" کا کیا مطلب ہے؟", "What does \"Lap\" mean in Merchant?", "لپ کے لیے سلپ میں الگ خانہ رکھا گیا ہے جہاں آپ اپنی مقدار لکھ سکتے ہیں۔ اگر آپ کے علاقے میں اس کا مطلب مختلف ہو تو مجھے بتائیں تاکہ اسے ٹھیک کر دیا جائے۔", "There is a separate box in the slip for it where you can write your amount. If it means something different in your area, tell us and it will be adjusted."], ["m26", "زمیندار کسان کا کھاتہ,farmer account,landlord account,کسان کا حساب,کتنا وصول کتنا بقایا,زمیندار کھاتہ", "زمیندار/کسان کا الگ کھاتہ کہاں دیکھوں؟", "Where do I see a landlord/farmer account?", "\"زمیندار/کسان\" کے صفحے میں نام دبائیں۔ وہاں اس کا مال، اس کے مال کی فروخت، آپ نے کتنا ادا کیا اور کتنا بقایا ہے سب لکھا ہوتا ہے۔", "Open the \"Landlord/Farmer\" page and press the name. It shows his goods, sales of his goods, how much you paid and the balance."], ["m27", "کھاتہ بک کی طرح,ledger book,کھاتہ پرنٹ,statement book,لال لائنوں والا کھاتہ,paper book style", "کیا کھاتہ پرانی بہی کھاتہ بک جیسا نکلتا ہے؟", "Does the statement look like the old paper ledger?", "جی ہاں۔ مرچنٹ میں کھاتے کا پرنٹ لال لکیروں والی بک کی طرح ہے: تاریخ، تفصیل، نام (ن) جمع (ج) اور باقی۔", "Yes. In Merchant, the account print looks like a red-ruled book: date, detail, debit, credit and balance."], ["s21", "کلاسیں,classes,montessori,nursery,prep,class 1,اسکول کلاسیں,کون سی کلاسیں", "اسکول میں کون سی کلاسیں پہلے سے ہیں؟", "Which classes are already in School?", "مونٹیسوری، نرسری، پریپ اور کلاس 1 سے 10۔ ضرورت ہو تو اپنی کلاس بھی بنا سکتے ہیں۔", "Montessori, Nursery, Prep and Class 1 to 10. You can add your own class if needed."], ["s22", "فیس واؤچر,fee voucher,کلاس وار واؤچر,voucher class,فیس پرچی,واؤچر کلاس", "فیس واؤچر کلاس کے حساب سے کیسے بنیں؟", "How do fee vouchers come class-wise?", "فیس واؤچر کے صفحے میں پہلے کلاس چنیں، پھر اس کلاس کے تمام بچوں کے واؤچر الگ بنتے اور چھپتے ہیں۔", "In the fee voucher page choose the class first; vouchers of all children of that class are made and printed together."], ["s23", "امتحان,new exam,نیا امتحان,exam add,امتحان بنانا", "نیا امتحان کیسے بناؤں؟", "How do I create a new exam?", "امتحان کے صفحے میں امتحان کا نام اور کلاس لکھ کر \"نیا امتحان\" دبائیں، پھر مضمون وار نمبر لکھیں۔", "In the exam page write the exam name and class, press \"New exam\", then enter marks subject-wise."], ["b01", "ہفتہ وار بیک اپ,weekly backup,سب کا بیک اپ,full backup,ایک کلک بیک اپ,all customers backup,مکمل بیک اپ", "سب کسٹمرز کا بیک اپ کیسے لوں؟", "How do I back up all customers?", "مالک کے مینو میں \"بیک اپ اور بحالی\" کھولیں اور \"ابھی سب کا بیک اپ لیں\" دبائیں۔ ایک فائل بنتی ہے جس میں ہر کسٹمر کا ریکارڈ ہے۔ ہفتے میں ایک بار بنائیں؛ ہفتہ گزرنے پر اوپر یاد دہانی بھی آ جاتی ہے۔", "In the owner menu open \"Backup & Restore\" and press \"Backup everything now\". One file is made with every customer's records. Do it weekly; a reminder appears when a week has passed."], ["b02", "بحالی,restore backup,ہیک ہو جائے,hacked,ریکور,recover,ڈیٹا واپس,restore data", "اگر ڈیٹا ضائع یا ہیک ہو جائے تو واپس کیسے لاؤں؟", "How do I get data back if lost or hacked?", "\"بیک اپ اور بحالی\" میں محفوظ کاپی یا اپنی فائل چنیں، جن کسٹمرز کو واپس لانا ہے ان پر نشان لگائیں اور \"منتخب بحال کریں\" دبائیں۔ ہر کسٹمر کا ریکارڈ اس کی اپنی آئی ڈی میں واپس جاتا ہے۔ بحالی سے پہلے موجودہ ڈیٹا کی حفاظتی کاپی خود بن جاتی ہے۔", "In \"Backup & Restore\" choose a saved copy or your file, tick the customers to bring back, and press \"Restore selected\". Each customer's records return to their own ID. A safety copy of the current data is made first."], ["b03", "کتنی بیک اپ کاپیاں,backup copies,تین کاپیاں,last 3 backups,پرانا بیک اپ,old backup delete", "کتنے بیک اپ رکھے جاتے ہیں؟", "How many backups are kept?", "ایپ میں آخری 3 کاپیاں رہتی ہیں۔ نئی کاپی کی جانچ ہو جائے تب ہی سب سے پرانی ہٹتی ہے، اس لیے کبھی ایسا نہیں ہوتا کہ پرانی ہٹ جائے اور نئی خراب ہو۔", "The app keeps the last 3 copies. The oldest is removed only after the new one is verified, so you are never left without a good copy."], ["b04", "ایک کسٹمر کی بحالی,restore one customer,single customer restore,صرف ایک کسٹمر,ایک کسٹمر واپس", "کیا صرف ایک کسٹمر کا ڈیٹا واپس لا سکتے ہیں؟", "Can I restore just one customer?", "جی ہاں۔ بحالی کی فہرست میں صرف اس کسٹمر پر نشان رکھیں، باقی کے نشان ہٹا دیں۔ باقی کسٹمرز کا ڈیٹا نہیں چھوا جاتا۔", "Yes. Tick only that customer in the restore list and untick the others. Other customers' data is not touched."], ["b05", "بیک اپ فائل کہاں رکھوں,where keep backup,backup file safe,usb,گوگل ڈرائیو,فائل محفوظ", "بیک اپ فائل کہاں رکھوں؟", "Where should I keep the backup file?", "فائل کو USB یا گوگل ڈرائیو میں بھی رکھیں، صرف اسی کمپیوٹر میں نہیں۔ کمپیوٹر خراب ہو تو فائل دوسرے کمپیوٹر پر بحالی میں کام آتی ہے۔", "Keep the file on a USB or Google Drive too, not only on this computer. If the computer fails the file can be restored on another one."], ["y01", "سال بند,close year,year end,سال کی بندش,نیا سال,new year,سال ختم,year closing", "سال بند کرنا کیا ہے؟", "What is closing the year?", "سیٹنگز میں \"سال بند کریں\" دبائیں۔ پہلے پرانے سال کی فائل ڈاؤن لوڈ ہوتی ہے، پھر ہر باقیہ (ادھار)، اسٹاک اور نقد نئے سال کے ابتدائی اعداد بن جاتے ہیں اور پرانی پرچیاں ہٹ جاتی ہیں۔ یوں سوفٹ ویئر تیز رہتا ہے اور حساب وہی رہتا ہے۔", "In Settings press \"Close year\". The old year's file is downloaded first, then every balance (udhar), stock and cash becomes the opening figure of the new year and old slips are removed. The software stays fast and your accounts stay exactly the same."], ["y02", "ادھار مٹ جائے,udhar delete,ادھار ضائع,باقیہ مٹ,balance lost,بقایا ختم,قرض مٹ جاتا", "کیا سال بند کرنے سے ادھار یا باقیہ مٹ جاتا ہے؟", "Does closing the year delete udhar or balances?", "نہیں۔ ہر کھاتے کا باقیہ \"ابتدائی باقیہ\" بن کر آگے چلا جاتا ہے۔ ادھار کبھی نہیں مٹتا، چاہے وہ کتنا ہی پرانا ہو۔", "No. Every account's balance carries forward as its \"opening balance\". Udhar is never deleted, however old."], ["y03", "سال بند فائل,year file,archive file,پرانی پرچیاں,old slips,آرکائیو,archive", "بند کیے گئے سال کی فائل میں کیا ہے؟", "What is in the closed-year file?", "اس سال کی تمام پرچیاں، ادائیگیاں اور خرچ، اور آگے بھیجے گئے باقیہ و اسٹاک کی فہرست۔ اسے سنبھال کر رکھیں، پرانی پرچی دیکھنی ہو تو اسی سے دیکھی جائے گی۔", "All slips, payments and expenses of that year, and the list of balances and stock carried forward. Keep it safe; it is how you look at an old slip later."], ["y04", "مرچنٹ چالیس ماہ,40 months,merchant 40 month,چالیس مہینے,پرانا ریکارڈ مرچنٹ,merchant old records", "گرین مرچنٹ میں کتنا پرانا ریکارڈ رہتا ہے؟", "How much old data does Green Merchant keep?", "آخری 40 ماہ کا ریکارڈ سوفٹ ویئر میں رہتا ہے۔ اس سے پرانا ریکارڈ \"سال بند کریں\" سے فائل میں چلا جاتا ہے اور کھاتوں کا باقیہ آگے چل جاتا ہے۔ یہ خود بخود نہیں مٹتا؛ آپ کے بٹن دبانے پر ہی ہوتا ہے۔", "The last 40 months stay in the software. Older records move into a file with \"Close year\" and account balances carry forward. Nothing is deleted automatically; it happens only when you press the button."], ["y05", "سال بند یاد دہانی,year close reminder,alert year,سال بند الرٹ,یاد دہانی سال", "سال بند کرنے کی یاد دہانی کب آتی ہے؟", "When does the close-year reminder appear?", "نیا سال شروع ہونے کے بعد ڈیش بورڈ پر پیلی پٹی آتی ہے: \"سال ختم ہو گیا — سال بند کریں\"۔ \"بعد میں\" دبائیں تو اس دن چھپ جاتی ہے۔", "After a new year begins, a yellow bar appears on the dashboard: \"The year is over — close the year\". Press \"Later\" to hide it for that day."], ["y06", "کن میں سال بند,year close which software,سال بند کن سوفٹ ویئر,year closing software list", "سال بند کی سہولت کن سوفٹ ویئرز میں ہے؟", "Which software has Close Year?", "کریانہ، جنرل اسٹور، گرین مرچنٹ اور آفس میں۔ باقی سوفٹ ویئرز میں بھی بتدریج شامل ہو رہی ہے۔", "Kiryana, General Store, Green Merchant and Office. It is being added to the others step by step."], ["t01", "اسٹاف حاضری,staff attendance,attendance system,حاضری سسٹم,حاضری کیسے,حاضری کا نظام,ملازم کی حاضری", "اسٹاف حاضری کا نظام کیا ہے؟", "What is the staff attendance system?", "ہر سوفٹ ویئر کے اوپر \"🕘 حاضری\" کا بٹن ہے۔ ملازم اپنے موبائل سے اِن اور آؤٹ لگاتا ہے، ساتھ لوکیشن اور سیلفی محفوظ ہوتی ہے، اور مالک رنگین شیٹ میں لیٹ، غیر حاضر اور آؤٹ نہ لگنے والے دن دیکھتا ہے۔", "Every software has a \"🕘 Attendance\" button on top. Staff mark IN and OUT from their own phone with location and selfie saved, and the owner sees late, absent and OUT-missed days in a colour sheet."], ["t02", "حاضری چالو,enable attendance,attendance on,حاضری شروع,حاضری سیٹ,attendance setup,دکان کی لوکیشن,shop location", "حاضری کیسے چالو کروں؟", "How do I switch attendance on?", "ایڈمن \"🕘 حاضری\" کھول کر \"سیٹنگز\" میں: دکان کے اندر کھڑے ہو کر \"موجودہ لوکیشن کو دکان کی لوکیشن بنائیں\" دبائیں، ڈیوٹی کے اوقات اور چھٹی کے دن لکھیں، \"حاضری چالو ہے\" پر نشان لگا کر محفوظ کریں۔", "Admin opens \"🕘 Attendance\" > \"Settings\": stand inside the shop and press \"Save my current location\", write duty times and off days, tick \"Attendance is ON\" and save."], ["t03", "بائیو ڈیٹا,bio data,staff biodata,اسٹاف بائیو ڈیٹا,ملازم کی معلومات,شناختی کارڈ ملازم", "اسٹاف کا بائیو ڈیٹا کہاں درج کروں؟", "Where do I enter staff bio-data?", "\"حاضری\" > \"اسٹاف بائیو ڈیٹا\" میں ہر ملازم کے آگے \"درج کریں\" دبائیں: والد کا نام، شناختی کارڈ، فون، عہدہ، تاریخ شمولیت وغیرہ۔ بائیو ڈیٹا درج ہونے کے بعد ہی اس کی حاضری لگتی ہے۔", "In \"Attendance\" > \"Staff bio-data\" press \"Enter\" beside each person: father name, CNIC, phone, designation, joining date and so on. Attendance works only after bio-data is entered."], ["t04", "چہرہ درج,face register,face recognition,چہرے کی پہچان,face match,چہرہ پہچان,ai face", "چہرے کی پہچان کیسے کام کرتی ہے؟", "How does face recognition work?", "بائیو ڈیٹا کے ساتھ ملازم کا چہرہ 3 تصاویر سے درج ہوتا ہے۔ ہر اِن/آؤٹ پر سیلفی کا چہرہ درج شدہ چہرے سے ملایا جاتا ہے؛ نہ ملے تو حاضری نہیں لگتی اور مالک کو \"چہرہ نہ ملنے کی کوشش\" نظر آتی ہے۔ پہلی بار انٹرنیٹ چاہیے، پھر فون میں محفوظ رہتی ہے۔", "The face is registered from 3 photos with the bio-data. On each IN/OUT the selfie is matched to it; if it does not match, attendance is not marked and the owner sees the failed try. It needs internet the first time, then stays on the phone."], ["t05", "لوکیشن حاضری,location attendance,geofence,جگہ پر حاضری,باہر سے حاضری,دور سے حاضری", "کیا دکان سے باہر حاضری لگ سکتی ہے؟", "Can attendance be marked outside the shop?", "نہیں۔ محفوظ کی گئی دکان کی لوکیشن سے مقررہ فاصلے (پہلے سے 150 میٹر، آپ بدل سکتے ہیں) سے باہر سے اِن یا آؤٹ نہیں لگتا، اور بتاتا ہے کہ کتنا دور ہیں۔", "No. IN or OUT cannot be marked from outside the allowed distance of the saved shop location (150 m by default, you can change it), and it tells how far you are."], ["t06", "ان آؤٹ ضروری,in out compulsory,آؤٹ نہ لگا,out not marked,آؤٹ بھول گیا,absent if no out", "اگر آؤٹ نہ لگائے تو؟", "What if the staff forgets OUT?", "اِن اور آؤٹ دونوں ضروری ہیں۔ آؤٹ نہ لگے تو دن \"آؤٹ نہیں لگا\" (جامنی) نظر آتا ہے اور غیر حاضری میں گنا جاتا ہے۔", "IN and OUT are both required. If OUT is missed the day shows as \"OUT not marked\" (purple) and counts as absent."], ["t07", "لیٹ حساب,late calculation,late minutes,لیٹ منٹ,کتنے منٹ لیٹ,grace time,رعایتی وقت", "لیٹ کا حساب کیسے ہوتا ہے؟", "How is lateness calculated?", "ڈیوٹی شروع ہونے کے وقت کے بعد \"اتنے منٹ بعد لیٹ\" (رعایتی وقت، پہلے سے 10 منٹ) گزر جائے تو دن لیٹ (نارنجی) ہے اور لیٹ منٹ ماہانہ شیٹ میں جمع ہوتے ہیں۔ مختصر چھٹی اس وقت کو معاف کر دیتی ہے۔", "If IN comes after duty start plus the grace minutes (10 by default) the day is Late (orange) and late minutes add up in the monthly sheet. A short leave excuses that time."], ["t08", "رنگ,colours,color meaning,رنگ کا مطلب,سبز لال,حاضری رنگ,sheet colours", "حاضری شیٹ کے رنگوں کا کیا مطلب ہے؟", "What do the sheet colours mean?", "سبز: حاضر۔ نارنجی: لیٹ۔ جامنی: آؤٹ نہیں لگا۔ لال: غیر حاضر۔ نیلا: منظور شدہ چھٹی۔ خاکستری: چھٹی کا دن یا آنے والا دن۔", "Green: present. Orange: late. Purple: OUT not marked. Red: absent. Blue: approved leave. Grey: off day or upcoming day."], ["t09", "چھٹی درخواست,leave application,leave request,چھٹی کی درخواست,درخواست تصویر,paper application,کاغذی درخواست", "ملازم چھٹی کی درخواست کیسے دے؟", "How does staff apply for leave?", "\"حاضری\" > \"چھٹیاں\" > \"چھٹی کی درخواست\": تاریخیں چنیں، وجہ اردو یا انگلش میں لکھیں، یا کاغذی درخواست کی تصویر لگا دیں۔ ایڈمن ✔ منظور یا ✖ مسترد کرتا ہے۔ منظور شدہ چھٹی غیر حاضری میں نہیں گنی جاتی۔", "\"Attendance\" > \"Leaves\" > \"Apply for leave\": pick dates, write the reason in Urdu or English, or attach a photo of the paper application. The admin approves ✔ or rejects ✖. Approved leave is not counted as absent."], ["t10", "مختصر چھٹی,short leave,گھنٹے کی چھٹی,short leave add,تھوڑی دیر چھٹی", "مختصر چھٹی کیسے لگاؤں؟", "How do I add a short leave?", "مالک یا ایڈمن \"حاضری\" > \"چھٹیاں\" > \"مختصر چھٹی لگائیں\" میں ملازم، تاریخ اور وقت (جیسے 9 سے 11) لکھ دے۔ ملازم خود بھی درخواست دے سکتا ہے۔", "Owner or admin: \"Attendance\" > \"Leaves\" > \"Add short leave\", pick the staff, date and time (like 9 to 11). Staff can also request it."], ["t11", "آف لائن حاضری,offline attendance,بغیر نیٹ حاضری,net nahi,انٹرنیٹ نہیں,auto sync,آٹو سنک", "کیا انٹرنیٹ نہ ہو تو حاضری لگ سکتی ہے؟", "Can attendance be marked without internet?", "جی ہاں۔ حاضری فون میں محفوظ ہو جاتی ہے اور انٹرنیٹ آتے ہی خود بخود بھیج دی جاتی ہے؛ اوپر \"بھیجنا باقی\" کا نشان دکھتا ہے۔ البتہ سیلفی کی چہرہ جانچ اس وقت ہوتی ہے جب چہرے کا ٹول فون میں پہلے سے محفوظ ہو، ورنہ \"چہرہ جانچا نہیں\" کا نشان لگتا ہے۔", "Yes. It is saved on the phone and sent automatically when internet returns; a \"waiting to be sent\" mark shows on top. Face checking works offline only if the face tool was already saved on the phone; otherwise the record is flagged \"face not checked\"."], ["t12", "اجازتیں حاضری,attendance permission,staff access attendance,کس کو حاضری دکھائیں,who can see attendance,ایکسس حاضری", "کون سا ملازم کتنی حاضری دیکھ سکتا ہے؟", "Which staff can see how much attendance data?", "\"عملہ اور اجازتیں\" میں ہر ملازم کے لیے تین خانے ہیں: اپنی حاضری لگائے، سب کی حاضری دیکھے، انتظام (چھٹی منظور، بائیو ڈیٹا، سیٹنگز)۔ مالک اور ایڈمن کو پوری آزادی ہے۔", "In \"Staff & permissions\" each staff has three boxes: mark own attendance, see everyone's attendance, manage (approve leave, bio-data, settings). Owner and admin have full freedom."], ["t13", "چھٹی کا دن,off day,weekly off,اتوار چھٹی,جمعہ چھٹی,holiday,خاص چھٹی,عید چھٹی", "چھٹی کا دن اور عید کی چھٹی کیسے لگاؤں؟", "How do I set off days and special holidays?", "\"حاضری\" > \"سیٹنگز\" میں ہفتے کے چھٹی کے دن چنیں (اتوار پہلے سے منتخب ہے) اور خاص چھٹیوں کی تاریخیں لکھیں۔ ان دنوں کو خود \"چھٹی کا دن\" شمار کیا جاتا ہے، غیر حاضری نہیں۔", "In \"Attendance\" > \"Settings\" pick the weekly off days (Sunday is selected by default) and write special holiday dates. Those days are marked \"Off day\" automatically, not absent."], ["t14", "ہر ملازم کی تفصیل,staff details,individual attendance,ایک ملازم کی حاضری,تمام ملازم حاضری,ماہانہ شیٹ,monthly sheet", "سب کی اور ایک ایک ملازم کی حاضری کیسے دیکھوں؟", "How do I see everyone's and each person's attendance?", "\"ماہانہ شیٹ\" میں سب ملازم رنگوں کے ساتھ ایک نظر میں ہیں۔ کسی کا نام دبائیں تو اس کے ہر دن کا اِن، آؤٹ، تصویر، فاصلہ، لیٹ منٹ اور خلاصہ کھل جاتا ہے۔", "The \"Month sheet\" shows all staff with colours at a glance. Press a name to open that person's every day: IN, OUT, photo, distance, late minutes and summary."], ["t15", "حاضری آن لائن,attendance online,دوسرے فون سے حاضری,owner sees attendance,مالک حاضری دیکھے,کلاؤڈ حاضری", "ملازم کی حاضری مالک کے فون پر کیسے آتی ہے؟", "How does staff attendance reach the owner's phone?", "جب کسٹمر کا \"آن لائن سیو\" چالو ہو تو ہر حاضری ملازم کے فون سے مالک اور ایڈمن کے فون پر خود پہنچ جاتی ہے۔ آن لائن سیو چالو نہ ہو تو حاضری صرف اسی فون میں رہتی ہے۔", "When the customer's \"online save\" is on, every mark goes from the staff phone to the owner and admin phones by itself. If online save is not on, attendance stays on that phone only."], ["o01", "آفس کی قسم,office type,typing shop,ٹائپنگ شاپ,فوٹو کاپی شاپ,photocopy shop,کمپیوٹر شاپ,آفس پیک", "ٹائپنگ / فوٹو کاپی شاپ کے لیے آفس سوفٹ ویئر کیسے سیٹ کروں؟", "How do I set the Office software up for a typing / photocopy shop?", "آفس میں سیٹنگز کھولیں، \"آفس کی قسم\" میں \"ٹائپنگ / کمپیوٹر / فوٹو کاپی شاپ\" چنیں اور لاگو کریں۔ مینو بدل جاتا ہے، \"فوری کاؤنٹر\" آ جاتا ہے اور فوٹو کاپی، پرنٹ، اسکین، ٹائپنگ کی خدمات اور کاغذ، ٹونر، انک کا اسٹاک خود شامل ہو جاتا ہے۔ ریکارڈ نہیں مٹتا۔", "Open Settings in Office, choose \"Typing / Computer / Photocopy shop\" under Office type and apply. The menu changes, the Quick Counter appears, and services (copy, print, scan, typing) and paper / toner / ink stock are added. Nothing is deleted."], ["o02", "فوری کاؤنٹر,quick counter,پوس,pos,تیز بل,quick bill,فوٹو کاپی بل", "فوری کاؤنٹر کیسے چلتا ہے؟", "How does the Quick Counter work?", "خدمت (فوٹو کاپی، پرنٹ…) کے بٹن دبائیں، صفحات کی تعداد لکھیں، نام صرف ادھار کے لیے لکھیں اور \"محفوظ کریں اور پرنٹ\" دبائیں۔ بل فوراً بن جاتا ہے۔", "Tap a service button (copy, print…), enter the number of pages, type a name only for udhar, and press Save & Print. The bill is ready at once."], ["o03", "سامان اسٹاک,supplies stock,کاغذ اسٹاک,ٹونر,toner,paper stock,آفس سامان", "آفس میں کاغذ، ٹونر کا اسٹاک کیسے رکھوں؟", "How do I keep paper and toner stock in Office?", "\"سامان / اسٹاک\" میں آئٹم اور کم از کم مقدار لکھیں۔ خریدیں تو \"سامان کی خرید\" میں لکھیں، استعمال یا ضائع ہو تو \"استعمال / ضائع\" میں لکھیں۔ کم ہونے والا سامان خود \"اگلا آرڈر\" میں آ جاتا ہے۔", "Add items and a minimum in Supplies Stock. Record purchases in Buy Supplies and use / waste in Used / Wasted. Items running low appear in Next Order by themselves."], ["o04", "بارکوڈ,barcode,کیمرہ اسکین,scan camera,بار کوڈ اسکین,qr scan,بارکوڈ سے بل", "کیمرے سے بارکوڈ اسکین کیسے کروں؟", "How do I scan a barcode with the camera?", "بل میں آئٹم کے خانے کے ساتھ 📷 بٹن دبائیں، کیمرے کی اجازت دیں اور بارکوڈ کیمرے کے سامنے رکھیں۔ آئٹم خود بل میں آ جاتا ہے۔ آئٹم میں کوڈ پہلے سے لکھا ہونا چاہیے۔ پہلی بار انٹرنیٹ چاہیے، پھر آف لائن بھی چلتا ہے۔", "Press the 📷 button next to the item box in a bill, allow the camera and show the barcode. The item is added to the bill. The item must already have its code saved. Needs internet the first time, then works offline."], ["x01", "ہوٹل ریسٹورنٹ,hotel restaurant,ہوٹل سوفٹ ویئر,restaurant software,ہوٹل کی قسم,صرف ریسٹورنٹ,صرف ہوٹل,دونوں,both", "ہوٹل اور ریسٹورنٹ سوفٹ ویئر میں ریسٹورنٹ، ہوٹل یا دونوں کیسے چنوں؟", "How do I choose restaurant, hotel or both?", "سیٹنگز (یا پہلی بار ڈیش بورڈ) میں \"کاروبار کی قسم\" سے \"صرف ریسٹورنٹ\"، \"صرف ہوٹل\" یا \"ہوٹل + ریسٹورنٹ\" چنیں۔ دونوں چنیں تو کمرے میں کھانے کا بل کمرے کے بل میں شامل ہو جاتا ہے۔ بدلنے سے ریکارڈ نہیں مٹتا۔", "Choose Restaurant only, Hotel only or Hotel + Restaurant under Business type in Settings (or on the first dashboard). With both, room-service food is added to the room bill. Changing never deletes records."], ["x02", "کچن آرڈر,kot,kitchen order,کچن پرچی,آرڈر لینا,order lena,ٹیبل آرڈر,table order", "کچن کو آرڈر کیسے بھیجوں؟", "How do I send an order to the kitchen?", "\"ریسٹورنٹ کاؤنٹر\" میں میز دبائیں، ڈشیں دبائیں اور \"کچن کو بھیجیں\" دبائیں۔ KOT پرنٹ ہوتا ہے۔ بعد میں اسی میز پر مزید ڈش ڈالیں اور دوبارہ بھیجیں — صرف نئی ڈشیں پرنٹ ہوں گی۔", "In the Restaurant Counter tap a table, tap dishes and press Send to kitchen. The KOT prints. Later add more dishes to the same table and send again — only the new dishes print."], ["x03", "ریسٹورنٹ بل,restaurant bill,بل بنانا,pay table,میز کا بل,پارسل,takeaway,ادھار گاہک", "ریسٹورنٹ کا بل اور ادائیگی کیسے کروں؟", "How do I bill and take payment in the restaurant?", "میز کھولیں اور \"بل اور ادائیگی\" دبائیں۔ رعایت اور وصول رقم لکھ سکتے ہیں۔ ادھار ہو تو گاہک کا نام لکھیں، باقیہ \"ریسٹورنٹ ادھار گاہک\" میں چلا جاتا ہے۔ پارسل کے لیے اوپر \"پارسل\" چنیں۔", "Open the table and press Bill & Pay. You can give a discount and enter the amount received. For credit type the customer name; the balance goes to Restaurant Credit Customers. For takeaway choose Takeaway at the top."], ["x04", "مینو,menu,ڈش,dish,قیمت بدلنا,menu price,ڈش ختم,dish finished,آج دستیاب", "مینو میں ڈش اور قیمت کیسے بدلوں؟", "How do I change dishes and prices?", "\"مینو اور قیمتیں\" میں ڈش شامل کریں یا ✏ دبا کر قیمت بدلیں۔ کوئی ڈش ختم ہو جائے تو \"آج دستیاب ہے\" بند کر دیں، وہ کاؤنٹر سے ہٹ جائے گی۔", "In Menu & Prices add a dish or press ✏ to change the price. If a dish is finished switch off Available today and it disappears from the counter."], ["x05", "کمرہ چیک ان,check in,چیک ان,room check in,مہمان کمرہ,guest check in,کمرہ بک", "مہمان کو کمرے میں چیک ان کیسے کروں؟", "How do I check a guest in?", "\"فرنٹ ڈیسک\" میں سبز (خالی) کمرہ دبائیں، \"ابھی چیک ان\" چنیں، مہمان کا نام، فون، شناختی کارڈ، راتیں اور ایڈوانس لکھیں۔ رجسٹریشن کارڈ پرنٹ ہو جاتا ہے۔", "On the Front Desk tap a green (free) room, choose Check-in now and enter name, phone, ID card, nights and advance. A registration card prints."], ["x06", "بکنگ,booking,advance booking,پیشگی بکنگ,reservation,بکنگ منسوخ,cancel booking", "پہلے سے بکنگ کیسے کروں؟", "How do I take an advance booking?", "خالی کمرہ دبائیں اور \"بعد کے لیے بکنگ\" چنیں، آمد کی تاریخ اور ایڈوانس لکھیں۔ ان تاریخوں میں وہی کمرہ دوبارہ بک نہیں ہو سکتا۔ مہمان آئے تو کمرہ دبا کر \"چیک ان\" کریں۔ منسوخ کرنے پر ایڈوانس واپس بھی کر سکتے ہیں۔", "Tap a free room and choose Book for later, enter the arrival date and advance. The same room cannot be booked twice for those dates. When the guest arrives tap the room and Check-in. If you cancel you can also return the advance."], ["x07", "چیک آؤٹ,check out,ہوٹل بل,hotel bill,final bill,آخری بل,کمرہ بل,folio", "چیک آؤٹ اور ہوٹل کا بل کیسے بنتا ہے؟", "How does check-out and the hotel bill work?", "آباد (سرخ) کمرہ دبائیں اور \"چیک آؤٹ\" چنیں۔ بل = کمرے کی راتیں + اضافی خرچے (لانڈری وغیرہ) + کمرے میں کھایا ہوا کھانا − ایڈوانس۔ رعایت دے سکتے ہیں، باقی رقم نہ ملے تو مہمان کے کھاتے میں باقیہ رہتا ہے۔", "Tap an occupied (red) room and choose Check-out. Bill = room nights + extras (laundry etc.) + room-service food − advance. You can give a discount; any unpaid amount stays as the guest balance."], ["x08", "اضافی خرچہ,extra charge,لانڈری,laundry,minibar,منی بار,کمرے میں کھانا,room service,مدت بڑھانا,extend stay,کمرہ بدلنا,change room", "کمرے میں اضافی خرچہ، کھانا، مدت یا کمرہ کیسے بدلوں؟", "How do I add extras, room service, extend stay or change room?", "آباد کمرہ دبائیں: \"خرچہ شامل کریں\" (لانڈری، منی بار)، \"کمرے میں کھانا\" (ریسٹورنٹ کا آرڈر کمرے کے بل میں)، \"مدت بڑھائیں\" اور \"کمرہ بدلیں\" کے بٹن ہیں۔", "Tap an occupied room: buttons are Add charge (laundry, mini-bar), Room service (restaurant order goes to the room bill), Extend and Change room."], ["x09", "کمرے اور کرایہ,rooms rate,کمرہ شامل,add rooms,مرمت,repair room,کمرہ بند", "کمرے اور کرایہ کہاں لکھوں؟", "Where do I add rooms and rates?", "\"کمرے اور کرایہ\" میں ہر کمرہ نمبر، قسم، منزل، اے سی اور فی رات کرایہ کے ساتھ شامل کریں۔ مرمت والے کمرے پر \"بند / مرمت میں\" لگائیں۔", "Add every room with number, type, floor, AC and rate per night in Rooms & Rates. Tick Out of service for a room under repair."], ["x10", "ہوٹل کچن اسٹاک,kitchen stock,آٹا تیل,flour oil,ہاؤس کیپنگ,housekeeping stock,تولیے صابن", "ہوٹل میں کچن اور ہاؤس کیپنگ کا اسٹاک کیسے رکھوں؟", "How do I keep kitchen and housekeeping stock?", "\"کچن اسٹاک\" میں سامان (آٹا، تیل، صابن، تولیے) اور کم از کم مقدار لکھیں۔ خرید اور استعمال لکھتے رہیں، کم ہونے والا سامان خود \"اگلا آرڈر\" میں آ جاتا ہے۔", "Add stock items (flour, oil, soap, towels) with a minimum quantity. Record purchases and use; items running low come to Next Order by themselves."], ["c01", "آئٹم کی حد,item limit,کتنی اشیاء,maximum items,زیادہ سے زیادہ آئٹم", "ایک سوفٹ ویئر میں آئٹم کی کوئی حد ہے؟", "Is there an item limit?", "عام دکان کے ہزاروں آئٹم آرام سے آ جاتے ہیں۔ زیادہ آئٹم ہوں تو تلاش استعمال کریں، پوری فہرست ایک دم نہیں کھلتی۔", "Thousands of items for a normal shop are fine. With many items use search; the whole list is not shown at once."]]);
if(typeof FN_DESC!=='undefined'){['kiryana','store'].forEach(k=>{FN_DESC[k]=FN_DESC[k]||{};FN_DESC[k].next=["نیکسٹ آرڈر: کم ہونے والا مال خود اس لسٹ میں آتا ہے۔ مقدار بدلیں، بجٹ لکھیں اور مال آنے پر \"خرید لیا\" دبائیں۔", "Next Order: items running low arrive here by themselves. Change quantity, set a budget, and press \"Bought it\" when goods arrive."]});}
if(typeof FN_DESC!=='undefined'){FN_DESC.hotel=FN_DESC.hotel||{};Object.assign(FN_DESC.hotel,{rpos:["ریسٹورنٹ کاؤنٹر: میز، پارسل یا کمرہ چنیں، ڈشیں دبائیں، کچن کو بھیجیں اور بل بنائیں۔","Restaurant counter: pick a table, takeaway or room, tap dishes, send to the kitchen and bill."],front:["فرنٹ ڈیسک: کمروں کا رنگین بورڈ، چیک ان، بکنگ، چیک آؤٹ۔","Front desk: colour board of rooms, check-in, booking and check-out."],stays:["بکنگ اور مہمان: تمام مہمانوں اور بکنگ کی فہرست۔","Bookings & guests: list of all guests and bookings."],rooms:["کمرے اور کرایہ: کمرے، قسم اور فی رات کرایہ۔","Rooms & rates: rooms, type and rate per night."],menu:["مینو اور قیمتیں: ڈشیں اور قیمتیں۔","Menu & prices: dishes and prices."],tables:["میزیں: ریسٹورنٹ کی میزیں۔","Tables: restaurant tables."],ropen:["کھلے آرڈر: وہ آرڈر جن کا بل بننا باقی ہے۔","Open orders: orders not yet billed."],folh:["ہوٹل بل: چیک آؤٹ کے پرانے بل۔","Hotel bills: old check-out bills."]});}
/* ===== FAQ batch 4: new features (lab, pads, print preview, keyboard, school fees/results) ===== */
FAQ_DEF.push(...[["q01", "لیب نمبر,lab no,001/26,نمبر سال,lab number", "لیب نمبر کیسے بنتا ہے؟", "How is the Lab No. made?", "لیب نمبر 001/26 کی شکل میں بنتا ہے: پہلا حصہ ترتیب وار نمبر اور \"/\" کے بعد سال۔ نیا سال شروع ہوتے ہی نمبر دوبارہ 001 سے شروع ہو جاتا ہے، جیسے 001/27۔", "The Lab No. looks like 001/26: a running number, then \"/\" and the year. When a new year starts it begins again at 001, e.g. 001/27."], ["q02", "پرانی رپورٹ,نتائج کی ہسٹری,results history,search report,رپورٹ تلاش,old report", "پرانے مریض کی رپورٹ کیسے ڈھونڈوں؟", "How do I find an old patient's report?", "لیب میں \"نتائج کی ہسٹری\" کھولیں۔ لیب نمبر، موبائل نمبر یا مریض کا نام لکھیں۔ صرف 001 لکھیں تو اسی سال کی رپورٹ آتی ہے، پرانے سال کی لیے 001/25 لکھیں۔ نام یا موبائل لکھیں تو تمام سالوں کی رپورٹیں آ جاتی ہیں۔", "Open \"Results History\" in the lab. Type the Lab No., mobile number or patient name. Typing just 001 searches the current year; for an older year type 001/25. Name or mobile finds all years."], ["q03", "رپورٹ ہسٹری میں,خود محفوظ,auto save report", "کیا رپورٹ خود محفوظ ہوتی ہے؟", "Is a report saved automatically?", "جی ہاں۔ جیسے ہی رپورٹ تیار ہوتی ہے وہ نتائج کی ہسٹری میں مستقل محفوظ ہو جاتی ہے۔ ایک سال یا اس سے زیادہ بعد بھی مریض آئے تو مل جاتی ہے۔", "Yes. As soon as a report is ready it is saved permanently in Results History, so it can be found even a year or more later."], ["q04", "ڈاکٹر کمیشن,doctor commission,ڈاکٹر فیصد,doctor percent,ڈاکٹر کھاتہ", "ڈاکٹر کا کمیشن کیسے لگاؤں؟", "How do I set a doctor's commission?", "لیب میں \"ڈاکٹرز\" کھولیں، ڈاکٹر شامل کریں اور اس کا فیصد خود لکھیں۔ جو ڈاکٹر کچھ نہیں لیتا اس کے لیے 00 لکھیں۔ مریض اسی ڈاکٹر کے نام سے آئے تو فیصد کی رقم خود ڈاکٹر کے کھاتے میں جمع ہو جاتی ہے۔ مریض کے بل پر صرف عام قیمتیں آتی ہیں۔", "Open \"Doctors\" in the lab, add the doctor and type the percentage yourself. Use 00 for a doctor who takes none. When a patient is entered under that doctor, the percentage amount posts to the doctor's account automatically. The patient's bill shows only the normal prices."], ["q05", "نیا ڈاکٹر,ڈاکٹر نام ہاتھ سے,manual doctor,new doctor", "کیا ڈاکٹر کا نام لسٹ سے باہر ہاتھ سے لکھ سکتے ہیں؟", "Can I type a doctor's name that is not in the list?", "جی ہاں۔ رسید میں ڈاکٹر کا نام ہاتھ سے لکھ سکتے ہیں۔ کمیشن خود صرف اسی وقت جمع ہوگا جب وہ نام ڈاکٹرز میں موجود ہو اور اس کا فیصد لگا ہو۔", "Yes, you can type any doctor name on the receipt. Commission posts automatically only if that name exists in Doctors with a percentage set."], ["q06", "پہلا حرف کیپیٹل,auto capital,capital letter,بڑا حرف,نام کیپیٹل", "نام خود کیپیٹل میں کیوں آتے ہیں؟", "Why do names turn into capital letters by themselves?", "سافٹ ویئر ہر لفظ کا پہلا حرف خود بڑا کر دیتا ہے، جیسے \"sikandar ali\" سے \"Sikandar Ali\"۔ یوں نام صاف اور ایک جیسے لکھے جاتے ہیں۔ ای میل، نمبر اور پاس ورڈ کے خانے اس سے محفوظ ہیں۔", "The software capitalises the first letter of each word, e.g. \"sikandar ali\" becomes \"Sikandar Ali\", so names stay neat and consistent. Email, number and password boxes are left alone."], ["q07", "ٹوکن پیغام,whatsapp token,Dear,ڈئیر", "لیب کا واٹس ایپ ٹوکن پیغام کیسا ہوتا ہے؟", "What does the lab's WhatsApp token message look like?", "پیغام \"Dear <مریض کا نام>\" سے شروع ہوتا ہے، پھر لیب کا نام، ٹوکن نمبر اور رپورٹ کی تفصیل۔ یوں مریض کو اپنا نام نظر آتا ہے۔", "The message starts with \"Dear \", then the lab name, token number and report details, so the patient sees his own name."], ["q08", "نارمل رینج,normal range,معیاری رینج", "نارمل رینج کہاں سے آتی ہے؟", "Where do normal ranges come from?", "ہر ٹیسٹ کے ساتھ معیاری نارمل رینج پہلے سے لگی ہوتی ہے اور رپورٹ میں نتیجے کے سامنے چھپتی ہے۔ اپنے ٹیسٹ میں آپ رینج بدل بھی سکتے ہیں۔ حد سے باہر نتیجہ سرخ نظر آتا ہے۔", "Every test comes with a standard normal range printed beside the result. You can change the range in your own tests. A result outside the range shows in red."], ["q09", "پرنٹ بٹن,نتائج پرنٹ,print result,save and print", "نتائج لکھ کر پرنٹ کیسے کروں؟", "How do I print after entering results?", "نتائج کی اسکرین پر \"محفوظ اور پرنٹ\" بٹن دبائیں۔ رپورٹ محفوظ ہو کر پرنٹ پریویو میں کھل جاتی ہے۔", "On the results screen press \"Save & Print\". The report is saved and opens in the print preview."], ["q10", "پیڈ,pad,لیٹر ہیڈ,letterhead,خود پیڈ,auto pad", "پیڈ خود کیسے بنتا ہے؟", "How is the pad made automatically?", "جب مالک کسٹمر کی آئی ڈی بناتا ہے تو کاروبار کا نام، فون، پتہ اور لوگو بھرنے سے پیڈ خود بن جاتا ہے اور ہر پرنٹ پر آتا ہے۔ الگ سے ڈیزائن نہیں کرنا پڑتا۔ لوگو نہ ہو تو نام کا پہلا حرف دائرے میں آتا ہے۔", "When the owner creates a customer ID, the business name, phone, address and logo build the pad automatically for every print. No separate design is needed. If there is no logo, the first letter of the name appears in a circle."], ["q11", "مالک کا نام,ای میل,owner name,email on pad,پیڈ پر ای میل", "کیا پیڈ پر مالک کا نام اور ای میل آ سکتی ہے؟", "Can the owner name and email appear on the pad?", "جی ہاں، یہ دونوں اختیاری ہیں۔ کسٹمر فارم میں بھریں گے تو پیڈ پر آئیں گے، خالی چھوڑیں گے تو نہیں آئیں گے۔", "Yes, both are optional. If filled in the customer form they print on the pad; if left empty they do not appear."], ["q12", "پرنٹ پریویو,print preview,A4,legal,80mm,کاغذ,کاپیاں,copies per page", "پرنٹ سے پہلے کاغذ اور کاپیاں کیسے چنوں؟", "How do I choose paper and copies before printing?", "پرنٹ دبانے پر پریویو کھلتا ہے۔ وہاں کاغذ A4، Legal یا 80mm رسید چنیں اور ایک صفحے پر 1، 2 یا 3 کاپیاں رکھیں۔ مواد زیادہ ہو تو خود چھوٹا ہو کر سما جاتا ہے۔ آپ کی پسند یاد رہتی ہے۔", "Pressing Print opens a preview. Choose A4, Legal or 80mm receipt paper and 1, 2 or 3 copies per page. Long content shrinks to fit. Your choice is remembered."], ["q13", "تین کاپیاں,three copies,ایک صفحے پر تین,3 per page", "کیا ایک صفحے پر تین رسیدیں یا واؤچر آ سکتے ہیں؟", "Can three receipts or vouchers fit on one page?", "جی ہاں۔ پریویو میں \"ایک صفحے پر 3\" چنیں۔ کاپیوں پر لیبل بھی لگ سکتے ہیں، جیسے اسکول، طالب علم، بینک۔ لیب رپورٹ ہمیشہ ایک صفحے پر ایک ہی رہتی ہے۔", "Yes. Choose \"3 per page\" in the preview. Copies can carry labels such as School, Student, Bank. The lab report always stays one per page."], ["q14", "تاریخ فارمیٹ,date format,DD-MM-YYYY,01-01-2026", "تاریخ کس شکل میں لکھی جاتی ہے؟", "What date format is used?", "پورے سافٹ ویئر میں تاریخ دن-مہینہ-سال میں چھپتی اور دکھتی ہے، جیسے 01-01-2026۔ تاریخ چننے کا خانہ براؤزر کی اپنی شکل میں دکھ سکتا ہے۔", "Dates are shown and printed as DD-MM-YYYY everywhere, e.g. 01-01-2026. The date-picker box itself may appear in the browser's own format."], ["q15", "کی بورڈ,keyboard,arrow keys,ایرو,Tab,ٹیب,اوپر نیچے", "کی بورڈ سے تیزی سے کام کیسے کروں؟", "How can I work faster with the keyboard?", "اوپر نیچے والے تیر خانوں اور فہرست کی چیزوں کے درمیان چلتے ہیں، Enter سے منتخب اور Esc سے بند۔ Tab اگلے خانے میں لے جاتا ہے اور اس میں لکھا ہوا خود سلیکٹ ہو جاتا ہے تاکہ سیدھا نیا لکھ سکیں۔", "Up/Down arrows move between fields and list items, Enter selects and Esc closes. Tab goes to the next field and selects its text so you can type over it."], ["q16", "کلاس ٹائلز,class tiles,کلاس کے خانے,طلبہ فہرست,students list", "اسکول میں طلبہ کیسے دیکھوں؟", "How do I view students in the school software?", "\"کلاسیں اور طلبہ\" کھولیں۔ پہلے ہر کلاس کا خانہ آتا ہے جس میں طلبہ کی تعداد اور بقایا ہوتا ہے۔ کلاس کھولیں تو صرف اسی کلاس کے طلبہ رول نمبر، نام، ولدیت اور فیس کی حالت کے ساتھ آتے ہیں۔ اوپر سرچ بار سے نام، رول نمبر یا والد لکھ کر سیدھا ڈھونڈ سکتے ہیں۔", "Open \"Classes & Students\". First you see a tile for each class with student count and dues. Open a class to see only its students with roll no., name, father and fee status. The search bar on top finds a student by name, roll no. or father."], ["q17", "پیڈ ادا بقایا جزوی,paid due partial,فیس حالت,fee status", "فیس کی حالت (ادا، بقایا، جزوی) کا کیا مطلب ہے؟", "What do Paid, Due and Partial mean?", "ادا: پوری فیس جمع ہے۔ بقایا: فیس باقی ہے۔ جزوی: کچھ رقم جمع ہوئی مگر کچھ باقی ہے۔ ہر طالب علم کے سامنے یہ حالت اور باقی رقم نظر آتی ہے۔", "Paid: all fee received. Due: fee outstanding. Partial: some received, some still due. Each student shows the status and the balance."], ["q18", "ایک کلک فیس,collect one click,فیس وصول,mark paid", "ایک کلک میں فیس وصول کیسے کروں؟", "How do I collect a fee in one click?", "طالب علم کی قطار میں سبز ✔ بٹن دبائیں، تصدیق کریں، پوری بقایا رقم وصول ہو کر \"ادا\" ہو جاتی ہے اور رسید کھل جاتی ہے۔ جزوی رقم کے لیے \"فیس وصولی\" استعمال کریں۔", "Press the green ✔ button on the student's row and confirm. The full due amount is received, the status becomes Paid and the receipt opens. For a part payment use \"Collect Fee\"."], ["q19", "ووچر بینک,bank voucher,3 کاپیاں,اسکول کاپی,بینک کاپی", "بینک والے اسکول کا ووچر کیسا ہوتا ہے؟", "What is the voucher like for a school that collects fees through a bank?", "ایک ہی ووچر کی 3 کاپیاں ایک صفحے پر آتی ہیں: اسکول، طالب علم اور بینک۔ ووچر پر بینک کا نام، اکاؤنٹ ٹائٹل، اکاؤنٹ نمبر اور برانچ (اگر بھری ہو) چھپتی ہے۔", "Three copies of the same voucher print on one page: School, Student and Bank. The bank name, account title, account number and branch (if filled) are printed."], ["q20", "ووچر خود وصول,self collect,3 طلبہ,تین بچے ایک صفحے", "جو اسکول خود فیس لیتا ہے اس کا ووچر؟", "What about a school that collects fees itself?", "ہر طالب علم کا ایک ہی ووچر بنتا ہے اور ایک صفحے پر تین مختلف طلبہ کے ووچر آتے ہیں۔ اسکول صفحے کو تین حصوں میں کاٹ لیتا ہے۔ ادائیگی کے لیے ایزی پیسہ، جیز کیش یا بینک کی لائنیں اور واٹس ایپ پر رسید بھیجنے کی ہدایت بھی چھپ سکتی ہے۔", "One voucher per student, and three different students' vouchers on one page that the school cuts into three. Easypaisa, JazzCash or bank lines and an instruction to send the receipt on WhatsApp can also print."], ["q21", "فیس طریقہ سیٹنگ,fee mode,owner setting,بینک یا خود", "فیس وصولی کا طریقہ کون بدلتا ہے؟", "Who changes the fee collection method?", "یہ صرف سافٹ ویئر کا مالک کسٹمر کی آئی ڈی کے فارم میں طے کرتا ہے، اسکول خود نہیں بدل سکتا۔ مالک اسکول سے ضرورت پوچھ کر بینک یا \"اسکول خود\" چنتا ہے۔", "Only the software owner sets it in the customer's ID form; the school cannot change it. The owner asks the school and chooses Bank or \"School itself\"."], ["q22", "خود ووچر,auto voucher,فیس کی تاریخ,fee date", "ووچر خود کب بنتے ہیں؟", "When are vouchers created automatically?", "\"فیس واؤچر\" کی سیٹنگ میں فیس کی تاریخ لکھیں۔ اس تاریخ کو یا اس کے بعد جب سافٹ ویئر کھلے گا تو اس ماہ کے ووچر خود بن جائیں گے۔ سافٹ ویئر بند ہو تو بنیں گے نہیں، کھلتے ہی بن جائیں گے۔ چاہیں تو ایک طالب علم کا ووچر ہاتھ سے بھی بنا سکتے ہیں۔", "Set the fee date in the voucher settings. When the software is opened on or after that date, the month's vouchers are created automatically. If it is closed they wait until it is opened. You can also make a single student's voucher by hand."], ["q23", "سب ووچر پرنٹ,print all vouchers,ادا شدہ چھوڑ", "سب ووچر ایک ساتھ کیسے پرنٹ کروں؟", "How do I print all vouchers together?", "\"تمام واؤچر پرنٹ کریں\" دبائیں یا کلاس کھول کر \"واؤچر پرنٹ\" دبائیں۔ سب ایک قطار میں بن کر تمام صفحات ایک ساتھ پرنٹ ہوتے ہیں۔ جن کی فیس ادا ہو چکی وہ خود چھوٹ جاتے ہیں، جب تک آپ ادا شدہ شامل کرنے کا نشان نہ لگائیں۔", "Press \"Print all vouchers\" or open a class and press \"Print vouchers\". All pages queue and print in one go. Students who have already paid are skipped unless you tick \"include paid\"."], ["q24", "سابقہ بقایا,previous balance,کئی مہینے,arrears", "اگر کئی مہینے کی فیس باقی ہو؟", "What if several months are unpaid?", "پچھلے مہینوں کا بقایا \"سابقہ بقایا\" کی لائن میں ایک ہی ووچر میں جمع ہو کر قابلِ ادا رقم میں شامل ہو جاتا ہے۔", "Earlier unpaid months are added into one voucher as \"Previous balance\" and included in the payable amount."], ["q25", "والدین واٹس ایپ نمبر,parent whatsapp,نمبر درج", "والدین کا واٹس ایپ نمبر کہاں لکھوں؟", "Where do I enter the parent's WhatsApp number?", "طالب علم کے داخلے میں \"والدین کا واٹس ایپ نمبر\" کا خانہ ہے، 03xxxxxxxxx کی شکل میں لکھیں۔ غلط یا خالی نمبر والوں کی الگ فہرست بنتی ہے۔", "The student's admission form has a \"Parent WhatsApp no.\" box; write it as 03xxxxxxxxx. Students with a wrong or empty number are listed separately."], ["q26", "واٹس ایپ قطار,whatsapp queue,اگلا والدین,next parent,کلاس کے والدین", "پوری کلاس کے والدین کو واٹس ایپ کیسے بھیجوں؟", "How do I message a whole class's parents on WhatsApp?", "کلاس کھول کر \"فیس یاد دہانی\" یا \"کلاس کو پیغام\" دبائیں۔ صرف اسی کلاس کے والدین کی فہرست آتی ہے۔ \"اگلا والدین\" دبائیں تو اگلے والدین کی چیٹ نمبر سمیت کھلتی ہے، آپ بھیجیں اور اگلا دبائیں۔ ہر بھیجا ہوا ✔ سے نشان زد ہوتا ہے۔", "Open the class and press \"fee reminders\" or \"Message class\". Only that class's parents are listed. Press \"Next parent\" to open the next parent's chat with the number filled in; send and press Next again. Sent ones are ticked ✔."], ["q27", "سب کو ایک کلک,bulk whatsapp,ایک ساتھ بھیجنا,واٹس ایپ بزنس", "کیا واٹس ایپ ایک کلک پر سب کو بھیج دے گا؟", "Can WhatsApp send to everyone in one click?", "نہیں۔ واٹس ایپ عام طریقے سے ایک بار میں ایک ہی چیٹ کھولتا ہے، اس لیے ہر والدین کے لیے ایک بار بٹن دبانا پڑتا ہے۔ ایک کلک پر سب کو خود بھیجنا صرف واٹس ایپ بزنس API سے ممکن ہے جو الگ اور ادائیگی والی سروس ہے۔", "No. Normal WhatsApp opens one chat at a time, so you press once per parent. Sending to everyone automatically needs the WhatsApp Business API, which is a separate paid service."], ["q28", "ایک بچے کو پیغام,performance report,شکایت,complaint,کارکردگی", "ایک بچے کی کارکردگی یا شکایت صرف اس کے والدین کو کیسے بھیجوں؟", "How do I send one child's performance or complaint to only his parent?", "طالب علم کو ڈھونڈیں اور اس کی قطار میں ✉ دبائیں۔ پیغام کی قسم چنیں یا خود لکھیں اور WhatsApp دبائیں۔ پیغام صرف اسی کے والدین کو جاتا ہے۔", "Find the student and press ✉ on his row. Choose a message type or write your own and press WhatsApp. It goes only to that parent."], ["q29", "جے پی جی لیٹر,jpg letter,سرکلر,circular,نوری فونٹ,تصویر", "واٹس ایپ پر نوری فونٹ میں سرکلر یا لیٹر کیسے بھیجوں؟", "How do I send a circular or letter in the Noori font on WhatsApp?", "واٹس ایپ کے متن میں فونٹ نہیں جاتا، اس لیے پیغام لکھ کر \"جے پی جی\" دبائیں۔ اسکول کے پیڈ پر نوری فونٹ میں لیٹر کی تصویر بنتی ہے۔ اسے ڈاؤن لوڈ کر کے واٹس ایپ میں بھیج دیں۔ شیئر بٹن سب کانٹیکٹ دکھاتا ہے، اس لیے ڈاؤن لوڈ زیادہ محفوظ ہے۔", "WhatsApp text cannot carry a font, so write the message and press \"JPG\". A letter image is made on the school pad in the Noori font. Download it and send it on WhatsApp. The Share button shows all your contacts, so Download is safer."], ["q30", "آن لائن لنک سرکلر,online circular,لنک صفحہ", "کیا سرکلر آن لائن لنک سے بھیج سکتے ہیں؟", "Can I send a circular as an online link?", "جی ہاں۔ \"آن لائن لنک صفحہ\" دبائیں۔ لنک، ID اور پاس ورڈ بنتے ہیں جو واٹس ایپ پر بھیج سکتے ہیں۔ والدین لنک کھول کر نوری فونٹ میں سرکلر پڑھتے ہیں۔", "Yes. Press \"Online link page\". A link, ID and password are made that you can send on WhatsApp. Parents open the link and read the circular in the Noori font."], ["q31", "رزلٹ کارڈ,result card,منتھلی ٹیسٹ,monthly test,رزلٹ", "رزلٹ کارڈ کیسے بناؤں؟", "How do I make a result card?", "اسکول میں \"رزلٹ\" کھولیں۔ ٹیسٹ کی قسم (ماہانہ، سہ ماہی، مڈ ٹرم، سالانہ)، کلاس اور طالب علم چنیں، مضامین کے کل اور حاصل نمبر لکھیں اور \"محفوظ اور پریویو\" دبائیں۔ کارڈ اسکول کے پیڈ پر بنتا ہے۔", "In the school software open \"Results\". Choose the test type (monthly, quarterly, mid-term, annual), class and student, enter total and obtained marks for each subject and press \"Save & preview\". The card is made on the school pad."], ["q32", "خالی خانہ,empty box hidden,خانہ چھپ,only filled", "کیا خالی خانے رزلٹ میں چھپ جاتے ہیں؟", "Are empty boxes hidden in the result?", "جی ہاں۔ جو مضمون یا خانہ خالی چھوڑیں گے وہ پریویو اور پرنٹ میں نہیں آئے گا۔ صرف بھرے ہوئے خانے چھپتے ہیں۔ نام، ولدیت اور رول نمبر لازمی ہیں۔", "Yes. Any subject or box you leave empty does not appear in the preview or print; only filled boxes print. Name, father and roll no. are compulsory."], ["q33", "سالانہ رزلٹ ہفتم,annual result,بورڈ کلاس,8th 9th 10th", "کیا آٹھویں، نویں، دسویں کا سالانہ رزلٹ بنتا ہے؟", "Is the annual result made for classes 8, 9 and 10?", "نہیں۔ ان کا سالانہ رزلٹ بورڈ دیتا ہے، اس لیے سالانہ رزلٹ مونٹیسری سے ہفتم تک بنتا ہے۔ ماہانہ، سہ ماہی اور مڈ ٹرم ٹیسٹ تمام کلاسوں کے بن سکتے ہیں۔", "No. The board issues their annual result, so annual results are made from Montessori to Class 7. Monthly, quarterly and mid-term tests can be made for every class."], ["q34", "پاس فیل,pass fail,گریڈ پیمانہ,grade scale,گریڈ", "پاس فیل اور گریڈ کیسے طے ہوتے ہیں؟", "How are pass/fail and grades decided?", "فیصد نمبروں سے: A+ 90 سے 100، A 80 سے 89، B 70 سے 79، C 60 سے 69، D 50 سے 59، E 40 سے 49، اور 40 سے کم F۔ ہر مضمون میں کم از کم 40% ہوں تو پاس، ورنہ فیل (فیل مضمون سرخ دکھتا ہے)۔ گریڈ کا پیمانہ کارڈ پر بھی چھپتا ہے۔", "From percentage marks: A+ 90–100, A 80–89, B 70–79, C 60–69, D 50–59, E 40–49 and below 40 is F. At least 40% in each subject is a Pass, otherwise Fail (the failed subject shows in red). The grade scale also prints on the card."], ["q35", "رزلٹ واٹس ایپ,send result whatsapp,نتیجہ بھیجنا", "کیا رزلٹ واٹس ایپ پر بھیج سکتے ہیں؟", "Can results be sent on WhatsApp?", "سالانہ کے علاوہ باقی سب رزلٹ (ماہانہ، سہ ماہی، مڈ ٹرم) والدین کو واٹس ایپ پر بھیجے جا سکتے ہیں۔ سالانہ رزلٹ صرف پرنٹ ہوتا ہے۔", "All results except the annual one (monthly, quarterly, mid-term) can be sent to parents on WhatsApp. The annual result is print only."], ["q36", "رزلٹ ڈیزائن,result design,رنگ,theme", "رزلٹ کارڈ کا ڈیزائن کیسے بدلوں؟", "How do I change the result card design?", "رزلٹ صفحے پر ڈیزائن کا خانہ ہے۔ سالانہ کے لیے کلاسک، جدید اور سرٹیفکیٹ جبکہ ماہانہ وغیرہ کے لیے سبز جدول اور نارنجی کارڈ میں سے چنیں۔", "The Results page has a design box. For annual choose Classic, Modern or Certificate; for monthly and other tests choose Green table or Orange cards."], ["q37", "پوری کلاس رزلٹ,print class results,class cards", "پوری کلاس کے رزلٹ کارڈ ایک ساتھ پرنٹ؟", "Print a whole class's result cards at once?", "رزلٹ صفحے پر \"پوری کلاس پرنٹ کریں\" دبائیں۔ جن طلبہ کے نمبر محفوظ ہیں ان سب کے کارڈ رول نمبر کی ترتیب سے ہر ایک الگ صفحے پر پرنٹ ہوں گے۔", "Press \"Print whole class\" on the Results page. Cards of all students with saved marks print in roll-number order, one per page."], ["q38", "لیب پیڈ,lab report pad,رپورٹ پیڈ,A4 رپورٹ", "لیب کی رپورٹ کیسی بنتی ہے؟", "What does the lab report look like?", "رپورٹ A4 پر بنتی ہے۔ اوپر لیب کا پیڈ، پھر لیب نمبر، تاریخ، مریض اور ریفر کرنے والے ڈاکٹر کی تفصیل، پھر ٹیسٹ کی جدول نارمل رینج کے ساتھ، اور آخر میں انگریزی لائن \"This is a computer-generated report. No signature is required.\"۔", "The report prints on A4: the lab pad on top, then Lab No., date, patient and referring doctor, then the test table with normal ranges, and at the end the line \"This is a computer-generated report. No signature is required.\""], ["q39", "آن لائن رپورٹ لنک,report link,رپورٹ آئی ڈی,online report", "مریض آن لائن رپورٹ کیسے دیکھے؟", "How does a patient see his report online?", "رپورٹ پر لنک، رپورٹ آئی ڈی اور پاس ورڈ چھپتا ہے۔ مریض لنک کھول کر یہ دونوں لکھتا ہے۔ اگر مریض کا بقایا باقی ہو تو رپورٹ نہیں کھلتی اور لیب آ کر بقایا ادا کرنے کا پیغام آتا ہے۔", "The link, Report ID and password are printed on the report. The patient opens the link and enters them. If a balance is still due, the report stays closed and a message asks him to visit the lab and pay."], ["q40", "اپ ڈیٹ,update now,نیا ورژن,new version", "نئی سہولتیں مجھ تک کیسے پہنچیں گی؟", "How will new features reach me?", "جب مالک اپ ڈیٹ بھیجے گا تو اسکرین پر پیغام آئے گا۔ \"ابھی اپ ڈیٹ کریں\" دبائیں، آپ کا سارا ریکارڈ محفوظ رہتا ہے۔", "When the owner sends an update a message appears. Press \"Update now\"; all your records stay safe."]]);
if(typeof FN_DESC!=="undefined"){FN_DESC.lab=FN_DESC.lab||{};FN_DESC.school=FN_DESC.school||{};
FN_DESC.lab.rhist=["ہر تیار رپورٹ یہاں مستقل محفوظ ہوتی ہے۔ لیب نمبر (001 یا 001/25)، موبائل یا مریض کا نام لکھ کر ڈھونڈیں اور رپورٹ دوبارہ کھول کر پرنٹ کریں۔","every finished report is saved here permanently. Search by Lab No. (001 or 001/25), mobile or patient name, then reopen and print the report."];
FN_DESC.school.cs=["پہلے کلاسوں کے خانے (طلبہ اور بقایا)، کلاس کھولیں تو طلبہ کی فہرست جس میں ادا/بقایا/جزوی، ایک کلک وصولی، ووچر، رسید اور والدین کو پیغام کے بٹن ہیں۔ اوپر سرچ بار۔","class tiles first (students and dues); open a class for its students with Paid/Due/Partial, one-click collect, voucher, receipt and parent-message buttons. Search bar on top."];
FN_DESC.school.rs=["ماہانہ، سہ ماہی، مڈ ٹرم اور سالانہ (ہفتم تک) رزلٹ کارڈ۔ مضامین کے کل اور حاصل نمبر لکھیں، پاس/فیل اور گریڈ خود بنتے ہیں، خالی خانے چھپ جاتے ہیں، پیڈ پر پرنٹ ہوتا ہے اور سالانہ کے علاوہ واٹس ایپ پر جاتا ہے۔","monthly, quarterly, mid-term and annual (up to Class 7) result cards. Enter total and obtained marks; pass/fail and grade are automatic, empty boxes are hidden, it prints on the school pad and all but annual can go on WhatsApp."];
FN_DESC.school.fee=["ماہانہ واؤچر خود (فیس کی تاریخ پر) یا ہاتھ سے بنیں۔ بینک والے اسکول کے لیے 3 کاپیاں، خود وصول کرنے والے کے لیے ایک صفحے پر 3 طلبہ۔ سب ایک ساتھ پرنٹ، ادا شدہ خود چھوٹ جاتے ہیں۔","monthly vouchers are made automatically (on the fee date) or by hand. 3 copies for bank schools, 3 students per page for self-collecting schools. Print all at once; paid students are skipped."];}
FAQ_DEF.push(...[["q41", "پوزیشن,خودکار پوزیشن,position,rank,ٹرافی,مبارک ہو,trophy", "رزلٹ کارڈ پر پوزیشن کیسے آتی ہے؟", "How does the position appear on the result card?", "پوزیشن خود نکلتی ہے: ایک ہی کلاس اور ایک ہی ٹیسٹ کے محفوظ شدہ رزلٹس میں کل نمبروں سے ترتیب بنتی ہے۔ پہلی، دوسری اور تیسری پوزیشن پر ٹرافی اور \"مبارک ہو!\" کی پٹی آتی ہے۔ باقی کے لیے صرف \"پوزیشن 4 / 100\" کی شکل میں لکھا آتا ہے۔ اگر پوزیشن والا خانہ خود بھر دیں تو وہی لکھا آئے گا۔", "The position is worked out automatically from total marks among saved results of the same class and test. 1st, 2nd and 3rd get a trophy and a \"Congratulations!\" banner; others just show \"Position 4 / 100\". If you fill the Position box yourself, that value is used."], ["q42", "لوگو,ہلکا لوگو,واٹر مارک,watermark,logo,پیچھے", "رزلٹ کارڈ کے پیچھے ہلکا لوگو کیسے بند کروں؟", "How do I turn off the faint logo behind the result?", "رزلٹ کے صفحے پر \"رزلٹ کے پیچھے ہلکا لوگو\" کے سامنے والا ٹک ہٹا دیں۔ لوگو نام اور رول نمبر والے خانے کو چھوئے بغیر نیچے ہلکا سا نظر آتا ہے اور لکھائی صاف رہتی ہے۔", "Untick \"Faint logo behind result\" on the Results page. The logo sits below the student info box, very light, so the text stays clear."], ["q43", "سیشن,تعلیمی سیشن,session,مہینہ", "رزلٹ کارڈ پر تعلیمی سیشن کہاں سے آتا ہے؟", "Where does the session on the result card come from?", "سیشن خود بنتا ہے، جیسے 2026 – 2027۔ رزلٹ کے صفحے پر \"سیشن شروع ہوتا ہے\" میں مہینہ چن لیں (عام طور پر اپریل)۔ ماہانہ، سہ ماہی اور مڈ ٹرم پر مہینہ یا ٹیسٹ کا نام بھی لکھا آتا ہے، سالانہ پر نہیں۔", "The session (e.g. 2026 – 2027) is automatic. Pick the month your session starts in on the Results page (usually April). Monthly, quarterly and mid-term cards also show the month/test name; annual does not."]]);
FAQ_DEF.push(...[["q44", "صفائی,wash,ٹیسٹ ڈیٹا,ڈیٹا صاف,مٹانا,test data", "ٹیسٹ کا ڈیٹا کیسے صاف کروں؟", "How do I wash the test data?", "صفائی کا اختیار صرف مالک کے پاس ہے۔ مالک کسٹمر کی تفصیل میں «🧹 ڈیٹا کی صفائی» دبائے، یا اس کا سوفٹ ویئر کھول کر مینو (☰) میں «ڈیٹا کی صفائی» چنے۔ جو چیزیں صاف کرنی ہیں (دوائیں، کیش، بل، گاہک وغیرہ) ان پر ٹک لگائے، WASH یا صاف لکھے۔ پہلے خود بخود بیک اپ فائل ڈاؤن لوڈ ہوتی ہے۔ دکان کا نام، لوگو، یوزر اور سیٹنگز نہیں مٹتیں۔", "Only the owner can wash data. Open the customer's details and press «🧹 Wash data», or open the software and choose «Wash data» from the ☰ menu. Tick what to wash (medicines, cash, bills, customers…), type WASH. A backup file downloads first. Shop name, logo, users and settings are not touched."], ["q45", "اعلان,announcement,سب کسٹمرز,پیغام", "سب کسٹمرز کو ایک پیغام کیسے دکھاؤں؟", "How do I show one message to all customers?", "اونر پینل کے مینو میں «📢 سب کسٹمرز کے لیے اعلان» کھولیں، پیغام لکھیں اور محفوظ کریں۔ وہ ہر کسٹمر کے سوفٹ ویئر میں اوپر نظر آئے گا (جب وہ آن لائن ہو)۔ ہٹانے کے لیے خالی کر کے محفوظ کریں۔", "Open «📢 Announcement for all customers» in the owner menu, write the message and save. It shows at the top of every customer's software (when online). Empty it to remove."], ["q46", "واٹس ایپ,whatsapp,نیا ٹیب,ایپ,کاپی,new tab", "واٹس ایپ کا بٹن بار بار نیا ٹیب کھولتا ہے، کیا کروں؟", "The WhatsApp button keeps opening new tabs. What can I do?", "کسٹمر کی تفصیل میں «واٹس ایپ کا بٹن کھولے» کی سیٹنگ ہے: براؤزر ٹیب، واٹس ایپ ڈیسک ٹاپ ایپ (کمپیوٹر پر ایپ نصب ہو تو نیا ٹیب نہیں کھلتا)، یا صرف پیغام کاپی کرنا۔", "In the customer's details choose «WhatsApp button opens»: browser tab, WhatsApp desktop app (no new tab when the app is installed), or copy the message only."],["q47", "موبائل,کارڈ,ٹیبل,اسکرین,mobile,cards", "موبائل پر لسٹ کیسے دکھتی ہے؟", "How do lists look on a phone?", "موبائل پر ہر ٹیبل کی قطار ایک کارڈ بن جاتی ہے جس میں ہر خانے کے ساتھ اس کا نام لکھا ہوتا ہے، اور ایڈٹ/حذف جیسے بٹنوں پر نام لکھے ہوتے ہیں۔", "On a phone every table row becomes a card with the column name beside each value, and buttons such as Edit / Delete carry their names."],["q48", "ایکسل,csv,ایکسپورٹ,امپورٹ,excel,import,export", "ایکسل میں ڈیٹا کیسے نکالوں یا شامل کروں؟", "How do I export to or import from Excel?", "ہر لسٹ کے اوپر «ایکسل (CSV)» بٹن ہے جو فائل ڈاؤن لوڈ کرتا ہے۔ آئٹم، پارٹی، ملازم جیسے صفحات پر «CSV امپورٹ» اور «نمونہ فائل» بھی ہے؛ نمونہ فائل کے کالم کے نام رکھ کر بھریں۔ پرانے ریکارڈ نہیں بدلتے، صرف نئے شامل ہوتے ہیں۔", "Every list has an «Excel (CSV)» button. List pages (items, parties, employees…) also have «Import CSV» and «Sample file»; fill the sample's columns. Existing records are never changed, only new ones are added."],["q49", "ری سائیکل بن,حذف,بحال,لاگ,recycle,restore,log", "ڈیلیٹ ہوا ریکارڈ واپس آ سکتا ہے؟ کس نے کیا بدلا؟", "Can I get back a deleted record? Who changed what?", "مینو کے آخر میں «ری سائیکل بن» ہے: صرف آئٹم، پارٹی، ملازم جیسے مستقل ریکارڈ واپس آتے ہیں۔ بل اور ادائیگیاں واپس نہیں آتیں تاکہ حساب نہ بگڑے۔ «کس نے کیا کیا» میں آخری 300 تبدیلیاں ہیں۔", "«Recycle Bin» is at the end of the menu: only master records (items, parties, employees…) can be restored. Bills and payments never come back so accounts stay correct. «Activity Log» shows the last 300 changes."],["q50", "اسٹاف,بایو ڈیٹا,حاضری,فعال,staff,bio,attendance,active", "نیا اسٹاف کیسے بنائیں اور حاضری کیسے فعال کریں؟", "How do I add staff and activate their attendance?", "عملہ اور اجازتیں میں نیا اسٹاف بنائیں؛ فوراً بایو ڈیٹا کا فارم کھلتا ہے (تصویر، عہدہ، پتہ، لوکیشن)۔ محفوظ کرنے پر حاضری فعال ہو جاتی ہے۔ نئے اسٹاف کو صرف حاضری ملتی ہے، باقی فنکشن آپ ہاتھ سے ٹِک کرتے ہیں۔", "Create staff in Staff & permissions; the bio-data form (photo, post, address, location) opens at once. Saving it activates attendance. New staff get Attendance only — tick other functions by hand."],["q51", "ٹرائل,نیا,ہدایات,واٹس ایپ,trial,new,instructions", "نئے ٹرائل والوں کو ہدایات کیسے بھیجوں؟", "How do I send instructions to new trial users?", "اونر اسکرین پر «نئے ٹرائل» بٹن (نمبر کے ساتھ) دبائیں، ہر شخص کے آگے «ہدایات بھیجیں» سے واٹس ایپ پیغام کھلتا ہے۔", "On the owner screen press «New trials» (with a count), then «Send instructions» beside each person to open the WhatsApp message."],["q52", "فارمیسی,پرسکرپشن,کلینک,ڈاکٹر,pharmacy,prescription,clinic", "فارمیسی میں پرسکرپشن کا صفحہ کیسے چھپاؤں؟", "How do I hide the Prescription page in a pharmacy?", "فارمیسی کسٹمر کی تفصیل میں «ڈاکٹر / کلینک ہے» کا خانہ ہے۔ نئی فارمیسی کے لیے یہ بند ہوتا ہے (پرسکرپشن اور ٹیمپلیٹس چھپے)۔ پرانی فارمیسیاں جیسی تھیں ویسی رہیں۔", "Pharmacy customers have a «has doctor / clinic» box. It is OFF for new pharmacies (Prescription and Templates hidden). Existing pharmacies are unchanged."],["q53", "حاضری,کیمرہ,لوکیشن,چیک ان,attendance,camera,location,check in", "اسٹاف حاضری کیسے لگاتا ہے؟", "How does staff mark attendance?", "«چیک اِن» دبائیں۔ پہلے لوکیشن چیک ہوتی ہے (بند ہو تو اردو میں کھولنے کا طریقہ آتا ہے)، پھر کیمرہ کھلتا ہے۔ تصویر کھینچ کر «جمع کریں» دبائیں؛ اسکین کے بعد «مبارک ہو» آتا ہے۔ انٹرنیٹ نہ ہو تو بھی لگتی ہے اور بعد میں خود سنک ہو جاتی ہے۔", "Tap Check IN. Location is checked first (if off, simple steps are shown), then the camera opens. Take the photo and press Submit; after the scan a congratulations sheet appears. It works offline and syncs later."],["q54", "رپورٹ,سی وی,فیصد,لیٹ,report,cv,percentage,late", "اسٹاف کی حاضری رپورٹ اور فیصد کہاں دیکھوں؟", "Where do I see staff attendance reports and percentages?", "حاضری میں «آج / مہینہ / سال» چنیں۔ کسی بندے پر دبائیں تو سی وی جیسا صفحہ کھلتا ہے: تصویر، بایو ڈیٹا، ہر دن کی تاریخ و وقت، اوسط، حاضری %، لیٹ %۔ پرنٹ اور ایکسل بھی ہے۔ جلدی آؤٹ پر نشان لگتا ہے۔", "In Attendance choose Today / Month / Year. Open a person for a CV-style page: photo, bio-data, every day with times, averages, attendance % and late %. Print and CSV available. Early OUT is flagged."],["q55", "تنخواہ,کٹوتی,چھوٹ,salary,deduction,relaxation", "حاضری سے تنخواہ کیسے جڑتی ہے؟", "How is salary linked to attendance?", "حاضری کی سیٹنگ میں کٹوتی کے اصول (کتنے لیٹ معاف، کتنے لیٹ پر ایک چھٹی وغیرہ) رکھیں۔ ملازم کے فارم میں «حاضری لاگ اِن سے جوڑیں» چنیں تو تنخواہ کے صفحے پر خودکار کٹوتی آتی ہے؛ ادائیگی کے وقت رقم بدل سکتے ہیں۔", "Set deduction rules in Attendance settings (free lates, lates per absent day, etc.). Choose «Link to attendance login» in the employee form and the salary page suggests the deduction; you can still edit the amount when paying."],["q56", "غلط حاضری,درست,ٹھیک,correct,fix attendance,edit attendance", "غلط لگی حاضری کیسے ٹھیک کروں؟", "How do I correct a wrong attendance?", "حاضری میں بندے کا سی وی صفحہ کھولیں، اس دن کی لائن پر ✏ دبائیں، اِن/آؤٹ کا صحیح وقت اور وجہ لکھیں۔ دن پر «اونر نے درست کیا» لکھا رہے گا۔ ریکارڈ ہٹانے سے وہ دن غیر حاضر ہو جاتا ہے۔", "Open the person's CV page in Attendance, press ✏ on that day, enter the right IN/OUT time and a reason. The day keeps a «Corrected by owner» mark. Removing the record makes that day absent."],["q57", "واٹس ایپ,رپورٹ,روزانہ,whatsapp,daily report", "روزانہ حاضری کی رپورٹ واٹس ایپ پر کیسے بھیجوں؟", "How do I send the daily attendance report on WhatsApp?", "حاضری میں «آج» کا ٹیب کھولیں اور سبز بٹن «آج کی رپورٹ واٹس ایپ پر بھیجیں» دبائیں۔ حاضر، لیٹ، غیر حاضر اور چھٹی کے نام کا پیغام تیار ہو کر کھل جاتا ہے۔", "Open the Today tab in Attendance and press the green «Send today's report on WhatsApp» button. A ready message with present, late, absent and leave names opens."],["q58", "اسکین,بارکوڈ,کیمرہ,دوا,scan,barcode,camera", "فارمیسی میں بارکوڈ اسکین کیسے کام کرتا ہے؟", "How does barcode scanning work in the pharmacy?", "کاؤنٹر یا نیا سیل میں 📷 دبائیں: کیمرہ کھلتا ہے اور اسی جگہ آپ نام بھی لکھ سکتے ہیں۔ پیک دکھائیں تو دوا خود بل میں لگ جاتی ہے اور کیمرہ جاری رہتا ہے۔ نیا بارکوڈ ہو تو دوا کے نام کے 2–3 حرف لکھ کر دوا چنیں، صرف ایک بار؛ اگلی بار نام خود آئے گا۔ دور کے لیے زوم اور ٹارچ ہیں۔", "Press 📷 in Counter or New Sale: the camera opens and you can also type a name in the same place. Show a pack and the medicine is added to the bill, camera keeps running. For a new barcode type 2–3 letters of the name and pick the medicine once; next time the name appears by itself. Zoom and torch help from a distance."],["q59", "ہولڈ,بل روکنا,hold bill", "بل روک کر دوسرے گاہک کو کیسے نمٹاؤں؟", "How do I hold a bill and serve another customer?", "سیل کے صفحے پر «⏸ روکیں» دبائیں۔ بل اوپر «رکے ہوئے» میں آ جاتا ہے؛ اس کے نام پر دبائیں تو واپس کھل جاتا ہے۔", "Press «⏸ Hold» on the sale page. The bill appears under «On hold» at the top; tap its name to bring it back."],["q60", "ادائیگی,ایزی پیسہ,جاز کیش,بینک,payment mode", "ایزی پیسہ یا بینک سے ملی رقم کہاں لکھوں؟", "Where do I record money received by Easypaisa or bank?", "بل میں «ادائیگی کا طریقہ» چنیں۔ روزنامچے میں طریقے کے حساب سے الگ دکھے گا اور دراز کے نقد میں شامل نہیں ہوگا۔", "Choose the «Payment mode» on the bill. The Day Book shows it by mode and it is not counted in the cash drawer."],["q61", "شارٹ کٹ,واپس,ctrl z,undo,print", "کون کون سے کی بورڈ شارٹ کٹ ہیں؟", "Which keyboard shortcuts are there?", "Ctrl+Z آخری تبدیلی واپس (پوچھ کر)، Ctrl+P پرنٹ، Ctrl+S کھلا فارم محفوظ، Ctrl+Enter بل محفوظ، / یا Ctrl+K سرچ، Alt+1…9 مینو، F1 فہرست۔", "Ctrl+Z undo the last change (asks first), Ctrl+P print, Ctrl+S save the open form, Ctrl+Enter save the bill, / or Ctrl+K search, Alt+1…9 menu, F1 for the list."],["q62", "لوکیشن سے باہر,درخواست,request,outside", "دکان کی جگہ سے باہر ہوں تو حاضری کیسے لگے؟", "How can I mark attendance when I am outside the shop place?", "لوکیشن والی اسکرین پر «یہاں سے درخواست بھیجیں» دبائیں، سیلفی لیں اور وجہ لکھیں۔ اونر کو حاضری میں چھٹیوں کے ٹیب پر سرخ نمبر نظر آئے گا؛ ✔ دبائے تو آپ کی حاضری لگ جاتی ہے اور لائن پر «باہر سے — منظور» لکھا آتا ہے۔ یہ سہولت سیٹنگ میں بند بھی ہو سکتی ہے۔", "On the location screen press «Request from here», take a selfie and write the reason. The owner sees a red number on the Leaves tab; pressing ✔ marks your attendance with an «outside — approved» note. It can be switched off in settings."],["q63", "اوور ٹائم,تنخواہ سلپ,چھٹیاں,چھٹی کا حساب,overtime,salary slip,holidays", "اوور ٹائم، تنخواہ سلپ اور سرکاری چھٹیاں کہاں ہیں؟", "Where are overtime, salary slip and public holidays?", "سیٹنگ میں «پاکستان کی مقررہ چھٹیاں» کا بٹن، سالانہ چھٹیوں کی حد اور اوور ٹائم کے منٹ رکھیں۔ بندے کے سی وی میں اوور ٹائم نظر آتا ہے اور «تنخواہ سلپ» سے پرنٹ یا واٹس ایپ ہوتی ہے۔ «مہینہ» ٹیب پر سب اسٹاف کی شیٹ پرنٹ اور ایکسل میں ہے۔ «آج» میں آؤٹ بھولنے والوں کی فہرست اور یاد دہانی ہے۔", "In settings use «Pakistan fixed holidays», the yearly leave limit and overtime minutes. The CV shows overtime and «Salary slip» prints or sends it on WhatsApp. The Month tab has a print/Excel sheet for all staff. Today lists people who forgot OUT, with a reminder."],["q64", "بیک,back,واپس,نیا ورژن,اپڈیٹ", "Back بٹن دبانے سے کیا ہوتا ہے؟ نیا ورژن کیسے آتا ہے؟", "What does the Back button do? How does a new version arrive?", "موبائل کا Back بٹن اب پہلے کھلی ہوئی ونڈو بند کرتا ہے، پھر پچھلے صفحے پر جاتا ہے، آخر میں اونر اسکرین پر۔ سافٹ ویئر سے باہر جانے کے لیے ہوم اسکرین پر دو بار Back دبائیں۔ نیا ورژن آئے تو نیچے «نیا ورژن تیار ہے» کا پیغام آتا ہے؛ «دوبارہ کھولیں» دبائیں۔", "The phone's Back button first closes an open window, then goes to the previous page, finally to the owner screen. Press Back twice on the home screen to leave. When a new version is ready a «new version is ready» bar appears; press Reload."]]);
/* ===== FAQ batch 5: Easy Daftar (آسان دفتر) — simple Urdu ===== */
FAQ_DEF.push(...[["d01", "آسان دفتر,asan daftar,aasan daftar,easy daftar,کیا ہے,kya hai,what is", "آسان دفتر کیا ہے؟", "What is Easy Daftar?", "یہ سرکاری اور پرائیویٹ دفتر کے کام کا سوفٹ ویئر ہے۔ اس میں ملازم کا ریکارڈ رکھتے ہیں۔ جی پی فنڈ، پنشن اور ریٹائرمنٹ کا کام پوچھنے پر یہ بتاتا ہے کہ کون سے کاغذ چاہییں اور کون سا فارم لگے گا۔", "Easy Daftar is software for government and private office work. It keeps employee records and, for GPF, pension and retirement work, tells you which papers and forms are needed."], ["d02", "آسان دفتر,asan daftar,aasan daftar,easy daftar,کس کے لیے,who is it for,فائدہ,benefit", "یہ کس کے کام آتا ہے؟", "Who is it useful for?", "جو شخص ملازموں کے کاغذی کام کرتا ہے۔ جیسے دفتر کا کلرک، اکاؤنٹنٹ یا وہ آدمی جو ملازموں کے فارم بھرتا ہے۔ ملازم کو بھی صاف لکھی ہوئی ہدایت مل جاتی ہے۔", "A clerk, accountant or anyone who does paperwork for employees. The employee also gets a clear written guide."], ["d03", "آسان دفتر,asan daftar,aasan daftar,easy daftar,پیج,صفحے,menu,مینو,functions,فنکشن", "آسان دفتر میں کون کون سے صفحے ہیں؟", "Which pages are in Easy Daftar?", "ہوم، کیس اور رہنمائی، ملازمین، فارم، سوال و جواب، قواعد اور حدیں، اور سیٹنگز۔", "Home, Cases & Guidance, Employees, Forms, Questions & Answers, Rules & Limits and Settings."], ["d04", "آسان دفتر,asan daftar,aasan daftar,easy daftar,آف لائن,بغیر نیٹ,offline,internet", "کیا بغیر انٹرنیٹ چلتا ہے؟", "Does it work without internet?", "جی ہاں۔ ایک بار کھلنے کے بعد بغیر نیٹ چلتا ہے۔ صرف سرکاری لنک کھولنے، واٹس ایپ بھیجنے اور پی ڈی ایف فائل اپ لوڈ کے لیے نیٹ چاہیے۔", "Yes, once opened. Internet is only needed to open official links, send WhatsApp and to upload a PDF file the first time."], ["d05", "آسان دفتر,asan daftar,aasan daftar,easy daftar,ڈیٹا,محفوظ,data,cloud,کلاؤڈ,فائر بیس", "میرا ڈیٹا کہاں رہتا ہے؟", "Where is my data kept?", "آپ کا ڈیٹا اسی موبائل یا کمپیوٹر میں محفوظ ہوتا ہے۔ اگر اونر نے کلاؤڈ جوڑا ہو تو وہ انٹرنیٹ پر بھی محفوظ ہو جاتا ہے۔ ہر دفتر کا ڈیٹا الگ رہتا ہے۔", "It is saved on your phone or computer, and also online if the owner has connected the cloud. Each office’s data is separate."], ["d10", "آسان دفتر,asan daftar,aasan daftar,easy daftar,ملازم شامل,نیا ملازم,add employee,employee", "ملازم کیسے شامل کروں؟", "How do I add an employee?", "\"ملازمین\" کھولیں۔ \"ملازم شامل کریں\" دبائیں۔ نام، ولدیت، شناختی کارڈ، عہدہ اور گریڈ لکھیں۔ پھر \"محفوظ کریں\" دبائیں۔ ایک ہی بار لکھنا ہے، بار بار نہیں۔", "Open Employees, press Add employee, write name, father’s name, CNIC, post and grade, then Save. Write it once only."], ["d11", "آسان دفتر,asan daftar,aasan daftar,easy daftar,جی پی فنڈ بیلنس,gpf balance,بیلنس,بنیادی تنخواہ,basic pay", "ملازم کے ریکارڈ میں بیلنس اور تنخواہ کیوں لکھوں؟", "Why enter balance and pay in the employee record?", "سوفٹ ویئر انہی سے حساب لگاتا ہے کہ ایڈوانس کی حد کتنی ہے۔ تازہ جی پی فنڈ اسٹیٹمنٹ سے بیلنس دیکھ کر لکھیں۔", "The software uses them to work out the advance limit. Copy the balance from the latest GPF statement."], ["d12", "آسان دفتر,asan daftar,aasan daftar,easy daftar,ملازم تلاش,search employee,تلاش", "ملازم کو کیسے ڈھونڈوں؟", "How do I find an employee?", "\"ملازمین\" میں اوپر والے خانے میں نام، شناختی کارڈ یا جی پی فنڈ نمبر لکھیں۔ فہرست خود چھوٹی ہو جاتی ہے۔", "In Employees, type the name, CNIC or GPF number in the top box; the list shortens by itself."], ["d13", "آسان دفتر,asan daftar,aasan daftar,easy daftar,ملازم حذف,delete employee,مٹانا", "ملازم کو حذف کیسے کروں؟", "How do I delete an employee?", "قطار کے آخر میں 🗑 دبائیں۔ اگر اس کا کوئی کیس کھلا ہو تو پہلے وہ کیس حذف کرنا ہوگا۔ کام پورا ہو چکا ہو تو حذف کرنے کی ضرورت نہیں، رہنے دیں۔", "Press the bin at the end of the row. If it has a case, delete that first. If work is finished you can simply leave the record."], ["d14", "آسان دفتر,asan daftar,aasan daftar,easy daftar,عمر,age,تاریخ پیدائش,dob", "عمر کیوں ضروری ہے؟", "Why is age important?", "ناقابلِ واپسی ایڈوانس صرف ایک خاص عمر کے بعد ملتا ہے۔ اس لیے تاریخِ پیدائش لکھیں۔ سوفٹ ویئر عمر خود نکال لیتا ہے۔", "A non-refundable advance is only allowed after a certain age, so write the date of birth. The software works out the age itself."], ["d15", "آسان دفتر,asan daftar,aasan daftar,easy daftar,پہلے ایڈوانس,advances taken,ناقابلِ واپسی تعداد", "\"پہلے لیے گئے ایڈوانس\" کا خانہ کیا ہے؟", "What is the “advances already taken” box?", "اس میں لکھیں کہ ملازم پہلے کتنے ناقابلِ واپسی ایڈوانس لے چکا ہے۔ اگر کبھی نہیں لیا تو صفر لکھیں۔", "Write how many non-refundable advances he already took. Write 0 if none."], ["d20", "آسان دفتر,asan daftar,aasan daftar,easy daftar,نیا کیس,new case,کیس کھولنا", "نیا کیس کیسے کھولوں؟", "How do I open a new case?", "\"ہوم\" پر \"نیا کیس\" دبائیں۔ ملازم چنیں۔ کام کی قسم چنیں، جیسے ایڈوانس یا پنشن۔ پھر \"کیس کھولیں\" دبائیں۔", "On Home press New case, pick the employee and the work (advance, pension…), then press Open case."], ["d21", "آسان دفتر,asan daftar,aasan daftar,easy daftar,کیس کیا ہے,what is a case,کیس", "\"کیس\" کا کیا مطلب ہے؟", "What does “case” mean?", "ایک ملازم کا ایک کام۔ مثلاً اسلم کا ایڈوانس ایک کیس ہے اور اس کی پنشن دوسرا کیس۔ ہر کیس میں اس کے کاغذات کی فہرست ہوتی ہے۔", "One job for one employee. For example Aslam’s advance is one case and his pension another. Each case has its own list of papers."], ["d22", "آسان دفتر,asan daftar,aasan daftar,easy daftar,چیک لسٹ,checklist,ٹک,کاغذ تیار", "چیک لسٹ کیسے استعمال کروں؟", "How do I use the checklist?", "جو کاغذ آ جائے اس کے آگے ٹک لگائیں۔ اوپر کی پٹی بتاتی ہے کہ کتنا کام ہو گیا۔ جو ٹک نہیں لگا وہ ابھی باقی ہے۔", "Tick each paper as it arrives. The bar above shows how much is done. Untick means still pending."], ["d23", "آسان دفتر,asan daftar,aasan daftar,easy daftar,کیس کی حالت,status,جمع کروایا,مکمل", "کیس کی حالت کیسے بدلوں؟", "How do I change the case status?", "کیس کھول کر اوپر تین بٹن ہیں: جاری، جمع کروایا، مکمل۔ جو حالت ہو وہ دبا دیں۔", "Open the case; three buttons on top: Open, Submitted, Finished. Press the right one."], ["d24", "آسان دفتر,asan daftar,aasan daftar,easy daftar,نوٹ,note,یاد داشت", "کیس میں اپنا نوٹ کیسے لکھوں؟", "How do I write my own note in a case?", "کیس کے نیچے \"نوٹ\" کا خانہ ہے۔ اس میں جو چاہیں لکھیں، خود محفوظ ہو جاتا ہے۔", "At the bottom of the case there is a Note box. Write anything; it saves by itself."], ["d25", "آسان دفتر,asan daftar,aasan daftar,easy daftar,کیس تلاش,search case", "پرانا کیس کیسے ڈھونڈوں؟", "How do I find an old case?", "\"کیس اور رہنمائی\" میں اوپر تلاش کے خانے میں ملازم کا نام یا کام کا نام لکھیں۔", "In Cases & Guidance type the employee name or the work name in the search box."], ["d30", "آسان دفتر,asan daftar,aasan daftar,easy daftar,جی پی فنڈ ایڈوانس,gpf advance,ایڈوانس,advance", "جی پی فنڈ ایڈوانس کیا ہوتا ہے؟", "What is a GPF advance?", "ملازم کے اپنے جی پی فنڈ کے پیسوں میں سے پیسے پہلے نکلوانا۔ دو قسمیں ہیں: ایک وہ جو واپس تنخواہ سے کٹتا ہے، دوسرا وہ جو واپس نہیں کٹتا۔", "Taking money early from the employee’s own GPF savings. Two kinds: one is repaid from salary, the other is not repaid."], ["d31", "آسان دفتر,asan daftar,aasan daftar,easy daftar,قابل واپسی,refundable,واپس کٹتا", "قابلِ واپسی ایڈوانس کیا ہے؟", "What is a refundable advance?", "یہ وقتی قرض ہے جو تنخواہ سے ماہانہ قسطوں میں کٹتا ہے۔ وفاقی رولز میں یہ بیماری، بچوں کی تعلیم یا علاج کے لیے بیرونِ ملک سفر، جنازے، مذہبی کام اور شادی کے ضروری خرچ کے لیے ہے۔", "A short loan repaid from salary in monthly instalments. Under federal rules it is for illness, travel abroad for health or education, funeral, religious and marriage expenses."], ["d32", "آسان دفتر,asan daftar,aasan daftar,easy daftar,جی پی فنڈ ایڈوانس کتنا,ایڈوانس کتنا مل سکتا,ایڈوانس کتنا ملے گا,کتنا مل سکتا ہے,کتنا ایڈوانس,حد,limit,how much", "قابلِ واپسی ایڈوانس کتنا مل سکتا ہے؟", "How much refundable advance can be taken?", "وفاقی رول: تین مہینے کی تنخواہ یا بیلنس کا آدھا، جو کم ہو۔ ملازم کا ریکارڈ بھرا ہو تو سوفٹ ویئر خود رقم بتا دیتا ہے۔ اگر آپ کا محکمہ مختلف حد رکھتا ہے تو \"قواعد اور حدیں\" میں بدل لیں۔", "Federal rule: the smaller of 3 months’ pay or half the balance. With the record filled the software shows the amount. If your department differs, change it in Rules & Limits."], ["d33", "آسان دفتر,asan daftar,aasan daftar,easy daftar,قسطیں,installments,کتنی قسطیں,واپسی", "ایڈوانس کتنی قسطوں میں کٹتا ہے؟", "In how many instalments is it cut?", "وفاقی رول میں عام طور پر 12 سے 48 برابر ماہانہ قسطیں۔ کیس کے صفحے پر ماہانہ کٹوتی کا اندازہ بھی لکھا ہوتا ہے۔", "Federal rule: normally 12 to 48 equal monthly instalments. The case page shows the monthly amount estimate."], ["d34", "آسان دفتر,asan daftar,aasan daftar,easy daftar,ناقابل واپسی,non refundable,45 سال", "ناقابلِ واپسی ایڈوانس کب ملتا ہے؟", "When is a non-refundable advance allowed?", "وفاقی رولز میں 45 سال کی عمر کے بعد۔ پوری نوکری میں صرف تین بار: 45، 50 اور 55 کے بعد ایک ایک۔ یہ رقم واپس نہیں کٹتی، آخر میں جی پی فنڈ کی ادائیگی سے کم ہو جاتی ہے۔", "Under federal rules after age 45, only three times in a whole service: once after 45, 50 and 55. It is not repaid; it is deducted from the final GPF payment."], ["d35", "آسان دفتر,asan daftar,aasan daftar,easy daftar,ناقابل واپسی مقصد,purpose,مکان,زمین,قرض", "ناقابلِ واپسی ایڈوانس کس کام کے لیے ملتا ہے؟", "What is a non-refundable advance given for?", "وفاقی رول میں 45 سے 50 کے درمیان: اپنی زمین پر گھر بنانا، گھر کی مرمت، گھر خریدنا، زرعی زمین خریدنا، یا بینک وغیرہ کا قرض اتارنا۔ 50 کے بعد وجہ بتانا ضروری نہیں۔", "Federal rule, ages 45–50: build a house on own land, repair a house, buy a house or farm land, or repay a bank loan. After 50 no reason is needed."], ["d36", "آسان دفتر,asan daftar,aasan daftar,easy daftar,ایڈوانس کاغذات,ایڈوانس کے کاغذات,جی پی فنڈ ایڈوانس کے کاغذات,ایڈوانس کے لیے کاغذات,papers,requirements,رکوائرمنٹ", "ایڈوانس کے لیے کون سے کاغذ چاہییں؟", "Which papers are needed for an advance?", "دفتر کا کورنگ لیٹر، ملازم کی درخواست، شناختی کارڈ کی کاپی، جی پی فنڈ فارم اور ٹی آر 58-اے بل، جی ایف آر-3، 17 نکاتی سرٹیفکیٹ، واپسی کا انڈرٹیکنگ، تازہ پے سلپ اور پچھلے ایڈوانس کا بقایا۔ پوری فہرست کیس میں ہے۔", "Covering letter, application, CNIC copy, GPF form with TR-58A bill, GFR-3, 17-point certificate, undertaking, latest pay slip and balance of the previous advance. The full list is in the case."], ["d37", "آسان دفتر,asan daftar,aasan daftar,easy daftar,17 نکاتی,سترہ نکاتی,17 point,certificate", "17 نکاتی سرٹیفکیٹ کیا ہے؟", "What is the 17-point certificate?", "ایک فارم جس میں ملازم کی 17 باتیں لکھتے ہیں: نام، شناختی کارڈ، تاریخِ پیدائش، تقرری، عہدہ، گریڈ، جی پی فنڈ نمبر، بیلنس، پچھلے ایڈوانس اور باقی۔ زیادہ تر خانے سوفٹ ویئر ملازم کے ریکارڈ سے خود بھر دیتا ہے۔", "A form with 17 facts about the employee: name, CNIC, date of birth, appointment, post, grade, GPF number, balance, earlier advances and more. The software fills most boxes from the record."], ["d38", "آسان دفتر,asan daftar,aasan daftar,easy daftar,اہل نہیں,eligible,اہلیت,نہیں مل سکتا", "سوفٹ ویئر کہتا ہے \"اہل نہیں\" تو کیا کروں؟", "The software says “not eligible” — what now?", "پہلے ملازم کی تاریخِ پیدائش اور پہلے لیے گئے ایڈوانس کی تعداد دیکھ لیں۔ اگر وہ صحیح ہیں تو ملازم کو بتا دیں کہ ابھی باری نہیں۔ اپنے محکمے کے قواعد بھی ایک بار دفتر سے پوچھ لیں۔", "Check the date of birth and the number of advances already taken. If correct, tell the employee it is not his turn yet. Also confirm your department’s rules with the office."], ["d40", "آسان دفتر,asan daftar,aasan daftar,easy daftar,ریٹائرمنٹ پر جی پی فنڈ,ریٹائرمنٹ کے بعد جی پی فنڈ,ریٹائرمنٹ پر جی پی,فائنل ادائیگی,final payment,ریٹائرمنٹ جی پی فنڈ", "جی پی فنڈ فائنل ادائیگی کیا ہے؟", "What is the GPF final payment?", "ریٹائرمنٹ، استعفے یا نوکری ختم ہونے پر پورا جی پی فنڈ نکلوانا۔ اس کے لیے اکاؤنٹنٹ جنرل کو درخواست، 17 نکاتی پروفارما، فائنل سیٹلمنٹ فارم اور زکوٰۃ کا اعلان لگتا ہے۔", "Taking out the whole GPF when retiring, resigning or leaving service. It needs an application to the Accountant General, the 17-point proforma, the final settlement form and the Zakat declaration."], ["d41", "آسان دفتر,asan daftar,aasan daftar,easy daftar,زکوٰۃ,zakat,حلف نامہ,affidavit", "زکوٰۃ کا اعلان کیا ہے؟", "What is the Zakat declaration?", "ایک حلف نامہ کہ جی پی فنڈ کی رقم پر زکوٰۃ نہیں کٹے گی۔ اس پر اوتھ کمشنر یا نوٹری کی تصدیق اور دو گواہ لگتے ہیں۔", "An affidavit that Zakat will not be cut from the GPF money. It needs an oath commissioner or notary and two witnesses."], ["d42", "آسان دفتر,asan daftar,aasan daftar,easy daftar,فوت شدہ,وفات,deceased,death,وارث", "فوت ہو جانے والے ملازم کا جی پی فنڈ کون لیتا ہے؟", "Who receives the GPF of a deceased employee?", "اس کا قانونی وارث۔ وارث درخواست دیتا ہے اور فارم کا پہلا حصہ بھرتا ہے۔ دوسرا حصہ محکمہ خود بھرتا ہے۔ اگر نامزدگی نہ ہو تو خاندان کی فہرست اور بعض صورتوں میں عدالت کا سرٹیفکیٹ لگتا ہے۔", "His legal heir. The heir applies and fills Part I; the department fills Part II. If there is no nomination, a family list and sometimes a court certificate are needed."], ["d43", "آسان دفتر,asan daftar,aasan daftar,easy daftar,پنشن,pension,نیا پنشن,ریٹائرمنٹ,پنشن کے کاغذات,پنشن کے لیے کاغذات,نئی پنشن", "نئی پنشن کے لیے کون سے کاغذ چاہییں؟", "Which papers are needed for a new pension?", "کل 20 چیزیں ہیں: پنشن درخواست CSR-25، تصاویر، شناختی کارڈ کاپی، تین اعلان، سیاست کا انڈرٹیکنگ، دستخط اور انگوٹھوں کے نشان، بینک تفصیل، خاندان کی فہرست، سروس بک، آخری تنخواہ کا سرٹیفکیٹ، این او سی، آفس آرڈر وغیرہ۔ پوری فہرست کیس \"پنشن — نیا کیس\" میں ہے۔", "There are 20 items: pension application CSR-25, photos, CNIC copy, three declarations, politics undertaking, signatures and thumb prints, bank details, family list, service book, last pay certificate, NOCs, office order etc. Full list is in the pension case."], ["d44", "آسان دفتر,asan daftar,aasan daftar,easy daftar,قبل از وقت,premature,انویلڈ,invalid,ایل پی آر,lpr", "وقت سے پہلے ریٹائرمنٹ یا انویلڈ پنشن میں زیادہ کیا لگتا ہے؟", "What extra is needed in early retirement or invalid pension?", "درخواست، 25 یا 31 سال سروس کا پروفارما، کوئی سزا نہ ہونے کا سرٹیفکیٹ، چھٹی کا سرٹیفکیٹ، اور انویلڈ میں اصل میڈیکل سرٹیفکیٹ۔", "An application, the 25/31-year service proforma, a no-disciplinary-action certificate, a leave certificate, and for invalid cases the original medical certificate."], ["d45", "آسان دفتر,asan daftar,aasan daftar,easy daftar,فیملی پنشن,family pension,بیوہ,widow", "فیملی پنشن کے کاغذات کون سے ہیں؟", "What papers are needed for family pension?", "پنشن والی ہی فہرست اور ساتھ ڈیتھ سرٹیفکیٹ، اور ضرورت ہو تو دوبارہ شادی نہ کرنے کا سرٹیفکیٹ۔ کل 22 چیزیں ہیں۔", "The same list as pension plus a death certificate and, if required, a non-remarriage certificate. 22 items in all."], ["d46", "آسان دفتر,asan daftar,aasan daftar,easy daftar,مدت,کب تک,time,کتنے دن", "کام کتنے دن میں ہوتا ہے؟", "How many days does it take?", "یہ سوفٹ ویئر اس کا وقت نہیں بتاتا کیونکہ یہ متعلقہ دفتر پر ہے۔ آپ کیس کی حالت \"جمع کروایا\" کر کے نوٹ میں تاریخ لکھ لیں، اور دفتر سے پیروی کرتے رہیں۔", "The software cannot tell because it depends on the office. Set the case to Submitted, note the date and keep following up with the office."], ["d50", "آسان دفتر,asan daftar,aasan daftar,easy daftar,رہنمائی,ہدایت,guide,instructions,کسٹمر ہدایت", "کسٹمر کے لیے ہدایت کیسے دوں؟", "How do I give the customer a guide?", "کیس کھول کر \"کسٹمر کے لیے رہنمائی\" دبائیں۔ اس میں ملازم کا نام، حد، کاغذات کی فہرست اور مراحل لکھے ہوتے ہیں۔ پھر \"واٹس ایپ\" دبائیں یا \"پرنٹ / پی ڈی ایف\" دبائیں۔", "Open the case and press Customer guide. It has the employee’s name, limit, paper list and steps. Then press WhatsApp or Print / PDF."], ["d51", "آسان دفتر,asan daftar,aasan daftar,easy daftar,نوری,نستعلیق,font,فونٹ,اردو لکھائی", "کسٹمر کی ہدایت کس لکھائی میں آتی ہے؟", "In which writing does the customer guide come?", "کسٹمر کی ہدایت ہمیشہ اردو میں اور نوری نستعلیق لکھائی میں چھپتی ہے، چاہے سوفٹ ویئر انگلش میں چل رہا ہو۔", "The customer guide always prints in Urdu in Noori Nastaleeq, even if the software is set to English."], ["d52", "آسان دفتر,asan daftar,aasan daftar,easy daftar,اونر ہدایت,owner notes,اونر کے لیے", "\"اونر کے لیے ہدایات\" کا بٹن کیا دکھاتا ہے؟", "What does the Owner notes button show?", "یہ صرف آپ کے لیے ہے۔ اس میں لکھا ہے کہ فارم کیسے بھرنا ہے، عام غلطیاں کیا ہیں، کس کے دستخط چاہییں اور حد کی جانچ۔ یہ کسٹمر کو نہ بھیجیں۔", "Only for you: how to fill the form, common mistakes, whose signature is needed, and the limit check. Do not send it to the customer."], ["d53", "آسان دفتر,asan daftar,aasan daftar,easy daftar,واٹس ایپ,whatsapp,بھیجنا,بھیجوں,بھیجیں,ہدایات بھیجنا,send", "واٹس ایپ پر کیسے بھیجوں؟", "How do I send on WhatsApp?", "کسٹمر کی رہنمائی میں \"WhatsApp\" دبائیں۔ ملازم کا فون نمبر ریکارڈ میں ہو تو واٹس ایپ اسی نمبر پر کھلتا ہے۔ پیغام میں فہرست لکھی ہوئی جاتی ہے۔ پوری پی ڈی ایف فائل کے لیے \"پرنٹ / پی ڈی ایف\" سے فائل محفوظ کر کے بھیجیں۔", "Press WhatsApp in the customer guide; it opens on the employee’s number. The message carries the list as text. For a full PDF file save it from Print / PDF and send it."], ["d54", "آسان دفتر,asan daftar,aasan daftar,easy daftar,پی ڈی ایف,pdf,پرنٹ,print,save pdf", "پی ڈی ایف کیسے بناؤں؟", "How do I make a PDF?", "\"پرنٹ / پی ڈی ایف\" دبائیں۔ پرنٹ کی کھڑکی میں پرنٹر کی جگہ \"PDF کے طور پر محفوظ کریں\" چنیں۔ فائل بن جائے گی، پھر واٹس ایپ پر بھیج دیں۔", "Press Print / PDF. In the print window choose Save as PDF instead of a printer. Then send the file on WhatsApp."], ["d60", "آسان دفتر,asan daftar,aasan daftar,easy daftar,فارم,forms,لائبریری,library", "فارم کا صفحہ کیا ہے؟", "What is the Forms page?", "یہاں سرکاری فارموں کی فہرست ہے، جیسے جی پی فنڈ، پنشن، بل اور قرض۔ ہر فارم کے ساتھ سرکاری لنک اور دو ہدایتی بٹن ہیں۔ آپ اپنے فارم بھی شامل کر سکتے ہیں۔", "It lists official forms: GPF, pension, bills and loans. Each has the official link and two guide buttons. You can add your own forms too."], ["d61", "آسان دفتر,asan daftar,aasan daftar,easy daftar,سرکاری فارم,official,ڈاؤن لوڈ,download", "سرکاری فارم کہاں سے ملے گا؟", "Where do I get the official form?", "فارم کے ساتھ \"سرکاری\" بٹن دبائیں۔ یہ اکاؤنٹنٹ جنرل کے دفتر کی اپنی ویب سائٹ پر لے جاتا ہے۔ وہاں سے فارم ڈاؤن لوڈ کریں۔", "Press Official next to the form. It opens the Accountant General office’s own site. Download it there."], ["d62", "آسان دفتر,asan daftar,aasan daftar,easy daftar,میری کاپی,my copy,تصویر,اپ لوڈ,upload,اسکین", "فارم کی تصویر کیسے شامل کروں؟", "How do I add a form from a photo?", "\"میری کاپی\" یا \"اپنا فارم شامل کریں\" دبائیں۔ خالی فارم کی تصویر، اسکین یا پی ڈی ایف چنیں۔ سوفٹ ویئر تصویر کو صاف کر دیتا ہے۔ پھر \"محفوظ کریں اور خانے بنائیں\" دبائیں۔", "Press My copy or Add my form. Choose a photo, scan or PDF of the blank form. The software cleans the picture. Then press Save & draw boxes."], ["d63", "آسان دفتر,asan daftar,aasan daftar,easy daftar,تصویر صاف,سایہ,اندھیرا,ڈارک,روشنی,shadow,dark", "اگر تصویر اندھیری یا سائے والی ہو تو؟", "If the photo is dark or has shadows?", "سوفٹ ویئر خود سایہ ہٹاتا اور روشنی ٹھیک کرتا ہے۔ اوپر \"سایہ ہٹائیں\"، \"روشنی\" اور \"کنٹراسٹ\" کی پٹیاں ہیں، انہیں ہلا کر دیکھ لیں۔ بہت خراب ہو تو دوبارہ سیدھی تصویر لیں۔", "The software removes shadows and fixes brightness itself. Sliders for Shadow, Brightness and Contrast are there to adjust. If it is very bad, take the photo again straight on."], ["d64", "آسان دفتر,asan daftar,aasan daftar,easy daftar,خانے,خانہ,boxes,draw,کھینچنا", "فارم میں بھرنے کے خانے کیسے بناؤں؟", "How do I make the fill-in boxes?", "فارم محفوظ ہونے کے بعد خالی جگہ پر انگلی یا ماؤس سے کھینچیں۔ ایک ڈبہ بن جائے گا۔ اس کا نام لکھیں، جیسے \"نام\"۔ یہ کام صرف ایک بار کرنا ہے۔", "After saving, drag a finger or the mouse over a blank place. A box appears. Name it, for example Name. This is done only once."], ["d65", "آسان دفتر,asan daftar,aasan daftar,easy daftar,ہلکی ہدایت,hint,خانے کے اندر,placeholder", "خانے کے اندر ہلکی ہدایت کیسے آتی ہے؟", "How does the light hint inside a box work?", "خانہ بناتے وقت \"خانے کے اندر ہلکی ہدایت\" میں لکھ دیں، جیسے \"شناختی کارڈ کے مطابق نام\"۔ بھرتے وقت وہ ہلکے رنگ میں نظر آتی ہے اور لکھتے ہی غائب ہو جاتی ہے۔ پرنٹ میں نہیں آتی۔", "While making a box write the hint, e.g. “name as on CNIC”. When filling it shows lightly and disappears when you type. It does not print."], ["d66", "آسان دفتر,asan daftar,aasan daftar,easy daftar,خود بھرنا,auto fill,ملازم سے بھرنا", "فارم میں ملازم کی باتیں خود کیسے بھریں؟", "How do the employee’s details fill by themselves?", "خانہ بناتے وقت \"ملازم کے ریکارڈ سے خود بھریں\" میں چنیں کہ یہ نام ہے یا شناختی کارڈ وغیرہ۔ پھر فارم بھرتے وقت اوپر ملازم چنیں، سب خود بھر جائے گا۔ غلطی ہو تو خود ٹھیک کر لیں۔", "While making a box pick which detail it is (name, CNIC…). Then choose the employee on top when filling and it fills itself. Correct anything by hand."], ["d67", "آسان دفتر,asan daftar,aasan daftar,easy daftar,فارم بھرنا,fill,بھریں,print form", "بھرا ہوا فارم کیسے پرنٹ کروں؟", "How do I print a filled form?", "فارم کے ساتھ \"بھریں\" دبائیں۔ ملازم چنیں، باقی لکھیں، \"محفوظ\" دبائیں، پھر \"پرنٹ\" دبائیں۔ فارم اصل شکل میں چھپتا ہے اور آپ کی لکھائی نیلی ہوتی ہے۔", "Press Fill next to the form, choose the employee, write the rest, press Save then Print. The form prints in its original look with your text in blue."], ["d68", "آسان دفتر,asan daftar,aasan daftar,easy daftar,رنگین کاغذ,نیلا,پیلا,پس منظر,colour paper,background", "رنگین فارم کا پرنٹ کیسا آئے گا؟", "How does a coloured form print?", "دیکھنے میں فارم اپنے اصل رنگ میں نظر آتا ہے تاکہ پتا چلے کون سا کاغذ ڈالنا ہے۔ پرنٹ میں پس منظر سفید رہتا ہے۔ آپ پرنٹر میں اسی رنگ کا کاغذ ڈالیں۔ رنگ سمیت چاہیے تو \"رنگ سمیت پرنٹ\" دبائیں۔", "You see the original colour so you know which paper to load. The print leaves the background white; put paper of that colour in the printer. For colour on white press Print with colour."], ["d69", "آسان دفتر,asan daftar,aasan daftar,easy daftar,کاغذ کا سائز,paper size,a4,legal,لیگل,فولیو", "کاغذ کا سائز کیسے پتا چلتا ہے؟", "How is the paper size found?", "پی ڈی ایف سے سائز بالکل صحیح ملتا ہے۔ تصویر سے اندازہ لگتا ہے، جیسے A4، لیگل، لیٹر یا فولیو۔ آپ بدل بھی سکتے ہیں اور آڑا (لینڈ اسکیپ) بھی کر سکتے ہیں۔", "From a PDF the size is exact. From a photo it is a good guess: A4, Legal, Letter or Folio. You can change it and make it landscape."], ["d70", "آسان دفتر,asan daftar,aasan daftar,easy daftar,فارم میں غلطی,خانہ بدلنا,box edit,delete box", "خانہ غلط بن گیا تو؟", "If a box is wrong?", "\"خانے\" دبا کر خانے پر دبائیں۔ نام بدل سکتے ہیں یا \"یہ خانہ حذف کریں\" دبا دیں۔ پھر نیا بنا لیں۔", "Open the boxes view and tap the box. Change its name or press Delete this box, then draw a new one."], ["d71", "آسان دفتر,asan daftar,aasan daftar,easy daftar,فارم اپڈیٹ,نیا ورژن,updated form,old form", "محکمہ فارم بدل دے تو؟", "If the department changes the form?", "سوفٹ ویئر خود نہیں جان سکتا۔ نیا فارم ڈاؤن لوڈ کریں، نئی کاپی شامل کریں، خانے بنائیں، اور پرانی کاپی حذف کر دیں۔ \"فارم آخری جانچ\" کی تاریخ بھی بدل دیں۔", "The software cannot know by itself. Download the new form, add the new copy, draw the boxes and delete the old copy. Update the form last-checked date."], ["d72", "آسان دفتر,asan daftar,aasan daftar,easy daftar,دو ہدایت,customer owner,کسٹمر ہدایت اونر ہدایت,بٹن", "ہر فارم کے دو ہدایتی بٹن کون سے ہیں؟", "What are the two guide buttons on each form?", "\"کسٹمر\": ملازم کے لیے سادہ ہدایت کہ کیسے بھرنا ہے اور کیا ساتھ لگانا ہے۔ \"اونر\": آپ کے لیے کہ خانہ بہ خانہ کیا لکھنا ہے اور احتیاط کیا ہے۔ آپ اپنی ہدایات بھی فارم کے خانے والے صفحے پر لکھ سکتے ہیں۔", "Customer: simple instructions for the employee on filling and what to attach. Owner: box-by-box notes and cautions for you. You can write your own on the form’s boxes page."], ["d73", "آسان دفتر,asan daftar,aasan daftar,easy daftar,پی ڈی ایف اپ لوڈ,pdf upload,پی ڈی ایف نہیں کھلتی", "پی ڈی ایف فائل نہ کھلے تو؟", "If a PDF file does not open?", "پہلی بار پی ڈی ایف کے لیے انٹرنیٹ چاہیے۔ نیٹ نہ ہو تو فارم کی تصویر یا اسکین (جے پی جی) اپ لوڈ کریں۔", "The first time a PDF needs internet. Without it, upload a photo or scan (JPG) instead."], ["d80", "آسان دفتر,asan daftar,aasan daftar,easy daftar,قواعد,حدیں,rules,limits,تبدیل", "\"قواعد اور حدیں\" کیا ہے؟", "What is Rules & Limits?", "یہاں ایڈوانس کی حدیں لکھی ہیں، جیسے کتنے مہینے کی تنخواہ اور کتنے فیصد بیلنس۔ شروع میں وفاقی قواعد ہیں۔ آپ کا محکمہ مختلف ہو تو یہاں بدل دیں، سوفٹ ویئر آپ کے لکھے ہوئے سے حساب کرے گا۔", "It holds the advance limits such as months of pay and percent of balance. At first they are the federal rules. If your department differs, change them here and the software will calculate from yours."], ["d81", "آسان دفتر,asan daftar,aasan daftar,easy daftar,وفاقی,بلوچستان,فرق,federal,different rules,محکمہ", "سب محکموں کے قواعد ایک جیسے ہیں؟", "Are the rules the same in all departments?", "نہیں۔ وفاقی حکومت، صوبے اور ادارے مختلف حدیں رکھ سکتے ہیں۔ اس لیے سوفٹ ویئر کی دی ہوئی حد کو اپنے دفتر سے ایک بار ضرور پوچھ لیں۔", "No. Federal, provincial and other bodies can have different limits. Always confirm the shown limit once with your own office."], ["d82", "آسان دفتر,asan daftar,aasan daftar,easy daftar,آخری جانچ,last checked,تاریخ,پرانی معلومات", "\"آخری جانچ\" کی تاریخ کیوں لکھی ہوتی ہے؟", "Why is a last-checked date written?", "قواعد اور فارم بدلتے رہتے ہیں۔ تاریخ سے پتا چلتا ہے کہ معلومات کب دیکھی گئی تھیں۔ بہت پرانی تاریخ ہو تو دفتر سے دوبارہ پوچھ لیں۔", "Rules and forms change. The date shows when the information was checked. If it is old, ask the office again."], ["d83", "آسان دفتر,asan daftar,aasan daftar,easy daftar,سوال جواب,faq,تلاش,سوال", "سوال و جواب کا صفحہ کیسے استعمال کروں؟", "How do I use the Questions page?", "اوپر خانے میں اپنا سوال لکھیں، جیسے \"ایڈوانس\" یا \"زکوٰۃ\"۔ نیچے جواب آ جاتے ہیں۔ جواب پر دبائیں تو کھل جاتا ہے۔ نیچے ذریعہ اور تاریخ بھی لکھی ہوتی ہے۔", "Type your question in the box, like “advance” or “zakat”. Answers appear below; tap one to open. The source and date are written under it."], ["d84", "آسان دفتر,asan daftar,aasan daftar,easy daftar,غلط معلومات,ذمہ داری,final,حتمی,دفتر کی منظوری", "کیا سوفٹ ویئر کی بات حتمی ہے؟", "Is the software’s word final?", "نہیں۔ یہ صرف رہنمائی ہے۔ حتمی فیصلہ اور اصل قواعد متعلقہ دفتر (اکاؤنٹنٹ جنرل، خزانہ وغیرہ) کے ہیں۔ ہر رہنمائی پر یہی لکھا ہوتا ہے۔", "No. It is guidance only. The final decision and exact rules belong to the concerned office (Accountant General, treasury, etc.). Every guide says so."], ["d85", "آسان دفتر,asan daftar,aasan daftar,easy daftar,بل,ٹھیکیدار,لیجر,contractor,bill,ledger", "کیا ٹھیکیدار کے بل اور لیجر بھی ہیں؟", "Are contractor bills and ledger included?", "ابھی نہیں۔ پہلے ورژن میں ملازمین، کیس، رہنمائی اور فارم ہیں۔ بل اور لیجر کا حصہ سرکاری فارم دیکھ کر اگلے مرحلے میں بنے گا۔", "Not yet. Version one has employees, cases, guidance and forms. Bills and ledger come in the next stage after checking the official forms."], ["d86", "آسان دفتر,asan daftar,aasan daftar,easy daftar,چوکیدار,چپراسی,سادہ,آسان,کم پڑھا لکھا", "کم پڑھا لکھا آدمی اسے کیسے استعمال کرے؟", "How can a person with little schooling use it?", "بس چار بڑے بٹن ہیں: نیا کیس، ملازمین، فارم، سوال و جواب۔ ہر صفحے پر ℹ️ ہدایات کا بٹن ہے۔ سوال و جواب میں ایک لفظ لکھیں، جواب سادہ اردو میں مل جاتا ہے۔", "Just four big buttons: New case, Employees, Forms, Questions. Every page has an info button. Type one word in Questions and get a simple Urdu answer."], ["d90", "آسان دفتر,asan daftar,aasan daftar,easy daftar,گریڈ,grade,bps,گریڈ وائز,گریڈ وار", "گریڈ وائز رہنمائی کیا ہے؟", "What is grade-wise guidance?", "سرکاری فارم گریڈ کے حساب سے کچھ فرق رکھتے ہیں۔ مثلاً بل کا فارم اور سرٹیفکیٹ پر دستخط کرنے والا۔ \"گریڈ وائز رہنمائی\" میں تین گروپ ہیں: گریڈ 1 تا 5، گریڈ 6 تا 15، اور گریڈ 16 اور اوپر۔ ہر گروپ کی کسٹمر والی شیٹ پرنٹ، JPG یا PDF ہو سکتی ہے۔", "Official forms differ a little by grade, for example the bill form and who signs a certificate. Grade-wise guidance has three groups: Grade 1–5, 6–15 and 16 and above. Each customer sheet can be printed, saved as JPG or PDF."], ["d91", "آسان دفتر,asan daftar,aasan daftar,easy daftar,گریڈ 1,گریڈ 5,چہارم درجہ,کلاس فور,class iv,چپراسی,چوکیدار,نائب قاصد", "کلاس فور (چپراسی، چوکیدار) کے لیے کیا الگ ہے؟", "What is different for Class IV (peon, watchman)?", "جی پی فنڈ ایڈوانس کا کلاس فور والا الگ فارم موجود ہے۔ فائنل ادائیگی میں \"کوئی ایڈوانس نہیں لیا\" کے سرٹیفکیٹ پر دفتر کا سربراہ دستخط کرتا ہے (فارم میں گریڈ 1 تا 5 لکھا ہے)۔ بل نان گزیٹڈ فارم پر بنتے ہیں۔ فارم دفتر کے کلرک سے بھروائیں، آپ صرف دستخط کریں۔", "There is a separate GPF advance form for Class IV. In final payment the head of office signs the “no advance” certificate (form names Grade 1–5). Bills are on non-gazetted forms. Let the clerk fill; you only sign."], ["d92", "آسان دفتر,asan daftar,aasan daftar,easy daftar,گریڈ 6,گریڈ 15,نان گزیٹڈ,non gazetted,کلرک,نان گزیٹڈ بل", "گریڈ 6 سے 15 والوں کے لیے کیا ہے؟", "What applies to Grade 6 to 15?", "عام جی پی فنڈ ایڈوانس فارم چلتا ہے۔ پے بل ٹی آر 22 اور ٹی اے بل ٹی آر 25 (نان گزیٹڈ) پر بنتے ہیں۔ فائنل ادائیگی کے فارم میں اس گریڈ کے دستخط کنندہ کا ذکر نہیں پڑھا، اس لیے دفتر سے پوچھ لیں۔", "The normal GPF advance form is used. Pay bill TR-22 and TA bill TR-25 (non-gazetted). The final-payment form does not name the signer for this grade, so ask the office."], ["d93", "آسان دفتر,asan daftar,aasan daftar,easy daftar,گریڈ 16,گزیٹڈ,gazetted,افسر,officer,ٹی آر 17,ٹی آر 20", "گریڈ 16 اور اوپر (گزیٹڈ افسر) کے لیے کیا الگ ہے؟", "What is different for Grade 16 and above?", "بل گزیٹڈ فارم ٹی آر 17 (پے) اور ٹی آر 20 (ٹی اے) پر بنتے ہیں۔ \"کوئی ایڈوانس نہیں لیا\" کے سرٹیفکیٹ پر افسر خود دستخط کر سکتا ہے۔ پنشن میں گزیٹڈ مدت کی سروس اسٹیٹمنٹ بھی لگتی ہے۔", "Bills are on gazetted forms TR-17 (pay) and TR-20 (TA). The officer may sign the “no advance” certificate himself. In pension a gazetted-period service statement is also needed."], ["d94", "آسان دفتر,asan daftar,aasan daftar,easy daftar,گزیٹڈ نان گزیٹڈ فرق,gazetted difference,بل فارم فرق", "گزیٹڈ اور نان گزیٹڈ بل میں کیا فرق ہے؟", "What is the difference between gazetted and non-gazetted bills?", "دونوں کے فارم الگ ہیں۔ گزیٹڈ: پے بل ٹی آر 17، ٹی اے بل ٹی آر 20۔ نان گزیٹڈ: پے بل ٹی آر 22، ٹی اے بل ٹی آر 25۔ عام طور پر گزیٹڈ گریڈ 16 اور اوپر ہوتے ہیں، اپنے محکمے سے تصدیق کر لیں۔", "Their forms differ. Gazetted: pay TR-17, TA TR-20. Non-gazetted: pay TR-22, TA TR-25. Gazetted is generally Grade 16 and above; confirm with your department."], ["d95", "آسان دفتر,asan daftar,aasan daftar,easy daftar,حد گریڈ سے,ایڈوانس حد گریڈ,limit grade,تنخواہ سے حد", "کیا ایڈوانس کی حد گریڈ سے طے ہوتی ہے؟", "Is the advance limit set by grade?", "نہیں۔ وفاقی رول میں حد بنیادی تنخواہ اور جی پی فنڈ بیلنس سے نکلتی ہے، گریڈ سے نہیں۔ اس لیے ملازم کے ریکارڈ میں تنخواہ اور بیلنس لکھیں۔", "No. Under the federal rule the limit comes from basic pay and GPF balance, not from the grade. So write pay and balance in the employee record."], ["d96", "آسان دفتر,asan daftar,aasan daftar,easy daftar,گریڈ لکھنا,گریڈ کہاں,grade where", "گریڈ کہاں لکھوں؟", "Where do I write the grade?", "\"ملازمین\" میں ملازم کا ریکارڈ کھولیں، \"گریڈ\" کے خانے میں نمبر لکھیں۔ پھر اس کے ہر کیس میں اس کے گریڈ کی ہدایت خود آ جاتی ہے۔", "Open the employee record in Employees and write the number in the Grade box. Then every case shows that grade’s guidance by itself."], ["d100", "آسان دفتر,asan daftar,aasan daftar,easy daftar,محکمہ,department,محکمہ وار,محکمے کے قوانین,departmental rules", "محکمہ وار قواعد کیا ہیں؟", "What are department-wise rules?", "ہر محکمے کے کچھ اپنے قواعد اور اضافی کاغذات ہو سکتے ہیں۔ \"محکمہ وار قواعد\" کے صفحے میں آپ ہر محکمے کے قواعد لکھتے ہیں۔ پھر اس محکمے کے ملازم کی ہر رہنمائی اور چیک لسٹ میں وہ خود شامل ہو جاتے ہیں۔", "Each department can have its own rules and extra papers. In the Department Rules page you type them. They then join every guide and checklist of that department’s employees by themselves."], ["d101", "آسان دفتر,asan daftar,aasan daftar,easy daftar,صحت,ہیلتھ,health,نرس,ڈاکٹر,ہسپتال", "محکمہ صحت کے ملازمین کے لیے کیا ہے؟", "What is there for Health Department employees?", "سوفٹ ویئر میں محکمہ صحت کا خانہ موجود ہے، مگر اس کے اپنے خاص قواعد میں نے ابھی کسی سرکاری ذریعے سے نہیں دیکھے۔ محکمہ صحت کا تازہ نوٹیفکیشن لے کر \"محکمہ وار قواعد\" میں لکھ دیں۔ پھر ملازم کے محکمے میں \"صحت\" لکھا ہو تو وہ قواعد خود آ جائیں گے۔", "A Health Department entry exists, but its own special rules have not been checked from an official source yet. Type them from the latest notification in Department Rules. When the employee’s department says “Health” they appear by themselves."], ["d102", "آسان دفتر,asan daftar,aasan daftar,easy daftar,تعلیم,ایجوکیشن,education,استاد,teacher,اساتذہ", "محکمہ تعلیم کے اساتذہ کے لیے کیا ہے؟", "What is there for Education Department teachers?", "محکمہ تعلیم کا خانہ موجود ہے، مگر اس کے اپنے خاص قواعد (جیسے اساتذہ کی ریٹائرمنٹ کا طریقہ) میں نے ابھی کسی سرکاری ذریعے سے نہیں دیکھے۔ تازہ نوٹیفکیشن لے کر \"محکمہ وار قواعد\" میں لکھیں۔", "An Education Department entry exists, but its own special rules (like the teachers’ retirement procedure) have not been checked from an official source yet. Type them from the latest notification."], ["d103", "آسان دفتر,asan daftar,aasan daftar,easy daftar,دوسرے محکمے,other department,نیا محکمہ,محکمہ شامل", "دوسرا محکمہ کیسے شامل کروں؟", "How do I add another department?", "\"محکمہ وار قواعد\" کھولیں، \"محکمہ شامل کریں\" دبائیں۔ نام، ملانے والے الفاظ، قواعد اور اضافی کاغذات لکھ کر محفوظ کریں۔ ملازم کے ریکارڈ کے \"محکمہ\" میں وہی لفظ لکھیں۔", "Open Department Rules, press Add department. Write the name, matching words, rules and extra papers and save. Write the same word in the employee’s Department box."], ["d104", "آسان دفتر,asan daftar,aasan daftar,easy daftar,اضافی کاغذات,extra papers,محکمے کے کاغذ", "محکمے کے اضافی کاغذات چیک لسٹ میں کیسے آتے ہیں؟", "How do the department’s extra papers get in the checklist?", "محکمے کے صفحے پر \"اضافی کاغذات\" میں ایک ایک سطر میں لکھیں۔ اس محکمے کے ملازم کے ہر کیس کی چیک لسٹ کے آخر میں وہ خود شامل ہو جاتے ہیں۔", "Write them one per line under Extra papers on the department page. They are added at the end of every checklist for that department’s employees."], ["d105", "آسان دفتر,asan daftar,aasan daftar,easy daftar,خودمختار,authority,اتھارٹی,پنشن رولز الگ,GIEDA", "خودمختار اداروں کے ملازمین کی پنشن کیسے ہوتی ہے؟", "How is pension for employees of autonomous bodies?", "ایسے اداروں کے پنشن کے اپنے الگ رولز ہو سکتے ہیں۔ مثال: بلوچستان حکومت کی سائٹ پر GIEDA اور پسنی فشریز ہاربر اتھارٹی کے الگ پنشن رولز ہیں۔ اپنے ادارے کے رولز کے مطابق چلیں۔", "Such bodies can have their own pension rules. Example: the Balochistan Government site has separate pension rules for GIEDA and the Pasni Fisheries Harbour Authority. Follow your own body’s rules."], ["d106", "آسان دفتر,asan daftar,aasan daftar,easy daftar,نجی,پرائیویٹ,private,کمپنی,نجی ملازم,جی پی فنڈ نجی", "نجی ادارے کے ملازم کے لیے جی پی فنڈ فارم چلتے ہیں؟", "Do GPF forms work for a private employee?", "نہیں۔ جی پی فنڈ اور پنشن کے سرکاری فارم سرکاری ملازمین کے لیے ہیں۔ نجی ادارے میں ادارے کی اپنی پالیسی چلتی ہے۔ یہ بات میں نے ابھی کسی سرکاری ذریعے سے نہیں پرکھی، اس لیے اپنے آجر سے پوچھ لیں۔", "No. The government GPF and pension forms are for government employees. A private organisation follows its own policy. I have not checked this against an official source, so ask the employer."], ["d107", "آسان دفتر,asan daftar,aasan daftar,easy daftar,محکمے کا نوٹیفکیشن,notification,کہاں سے,ڈی ڈی او", "محکمے کا نوٹیفکیشن کہاں سے ملے گا؟", "Where do I get the department’s notification?", "اپنے ڈی ڈی او (دفتر کے سربراہ) یا محکمے کے متعلقہ سیکشن سے۔ بلوچستان حکومت کی ویب سائٹ اور محکمہ خزانہ کی سائٹ پر بھی رولز اور نوٹیفکیشن رکھے جاتے ہیں۔ نمبر اور تاریخ سوفٹ ویئر میں \"ذریعہ\" میں لکھ لیں۔", "From your DDO (head of office) or the department’s section. The Balochistan Government and Finance Department sites also carry rules and notifications. Write the number and date under Source in the software."], ["d110", "آسان دفتر,asan daftar,aasan daftar,easy daftar,نوٹیفکیشن رجسٹر,notification register,نوٹیفکیشن شامل,واٹس ایپ نوٹیفکیشن", "نوٹیفکیشن کا صفحہ کیا ہے؟", "What is the Notifications page?", "یہاں دو چیزیں ہیں: ایک وہ قوانین اور نوٹیفکیشن جو سرکاری ذرائع پر ملے (لنک کے ساتھ)، اور دوسرا آپ کا اپنا رجسٹر جس میں آپ کو واٹس ایپ یا دفتر سے ملنے والے نوٹیفکیشن نمبر، تاریخ، ذریعہ اور تصویر کے ساتھ رکھتے ہیں۔", "Two things: laws and notifications found on official sources (with links), and your own register where you keep notifications you receive from WhatsApp or the office with number, date, source and photo."], ["d111", "آسان دفتر,asan daftar,aasan daftar,easy daftar,واٹس ایپ فیس بک نوٹیفکیشن اصل,fake notification,جعلی,تصدیق", "واٹس ایپ پر آنے والا نوٹیفکیشن اصل ہے یا نہیں کیسے پتا چلے؟", "How do I know whether a WhatsApp notification is genuine?", "ہر نوٹیفکیشن اصل نہیں ہوتا۔ اس پر نمبر، تاریخ اور جاری کرنے والے دفتر کا نام دیکھیں۔ پھر محکمے کی سرکاری سائٹ یا دفتر سے تصدیق کریں۔ رجسٹر میں ذریعہ ضرور لکھیں۔", "Not every notification is genuine. Check the number, date and issuing office, then confirm on the department’s official site or at the office. Always write the source in the register."], ["d112", "آسان دفتر,asan daftar,aasan daftar,easy daftar,بلوچستان پنشن قانون,سیکشن 19,ایکٹ 2025,section 19,balochistan pension act", "بلوچستان کا نیا پنشن قانون کیا کہتا ہے؟", "What does the new Balochistan pension law say?", "بلوچستان سول سرونٹس (ترمیمی) ایکٹ 2025 کی دفعہ 19: پہلے سے مستقل ملازمین کی پنشن 1989 کے پنشن رولز کے تحت رہے گی۔ بعد میں تعینات ہونے والوں کے لیے کنٹری بیوٹری پنشن اسکیم ہے۔ یہ ایکٹ 1 جولائی 2024 سے مؤثر سمجھا جاتا ہے۔ کون سا آپ پر لاگو ہے، اے جی آفس سے تصدیق کریں۔", "Section 19 of the Balochistan Civil Servants (Amendment) Act 2025: those already regular keep pension under the 1989 Pension Rules; those appointed later come under the Contributory Pension Scheme. The Act is deemed effective from 1 July 2024. Confirm with the AG office which applies to you."], ["d113", "آسان دفتر,asan daftar,aasan daftar,easy daftar,کنٹری بیوٹری,contributory,نئی پنشن اسکیم,پنشن فنڈ", "کنٹری بیوٹری پنشن اسکیم کیا ہے؟", "What is the Contributory Pension Scheme?", "یہ ایسا نظام ہے جس میں پنشن کا پیسہ پہلے سے جمع ہوتا رہتا ہے اور لائسنس یافتہ ادارے اسے سنبھالتے ہیں۔ خبروں کے مطابق بلوچستان اس پر آ گیا ہے اور ایس ای سی پی نے سات پنشن فنڈ منظور کیے ہیں۔ بالکل کون آتا ہے، یہ خبر میں نہیں لکھا — اصل نوٹیفکیشن دیکھیں۔", "A system where pension money is built up in advance and managed by licensed fund managers. News reports say Balochistan has moved to it and the SECP approved seven pension funds. Who exactly is covered is not in the report — read the notification."], ["d114", "آسان دفتر,asan daftar,aasan daftar,easy daftar,اینٹی سپیٹری,عبوری پنشن,anticipatory,provisional pension,پنشن دیر", "پنشن میں دیر ہو تو عبوری ادائیگی ملتی ہے؟", "If pension is delayed, is a provisional payment possible?", "دفعہ 19(5) کے مطابق اگر ریٹائرمنٹ یا وفات کے ایک مہینے بعد بھی پنشن طے نہ ہو تو مقررہ طریقے سے عبوری (اینٹی سپیٹری) ادائیگی ہو سکتی ہے، اور زائد ادائیگی بعد میں منہا ہوتی ہے۔ طریقہ اے جی آفس سے پوچھیں۔", "Under Section 19(5), if the pension is not fixed a month after retirement or death, a provisional (anticipatory) payment can be made as prescribed; any excess is adjusted later. Ask the AG office for the procedure."], ["d115", "آسان دفتر,asan daftar,aasan daftar,easy daftar,65 فیصد,اینٹی سپیٹری 2021,ڈان,متوقع پنشن,ایڈوانس پنشن,پنشن کا ایڈوانس,ایڈوانس پنشن کا طریقہ,اینٹی سپیٹری", "ایڈوانس (متوقع) پنشن 65 فیصد والی بات کیا ہے؟", "What is the 65% expected pension news?", "ڈان کی 17 اپریل 2021 کی خبر کے مطابق محکمہ خزانہ بلوچستان نے متوقع پنشن بنیادی تنخواہ کے 65 فیصد کے حساب سے فوراً دینے کی منظوری دی، شرائط کے ساتھ، اگلے احکامات تک۔ یہ پرانی خبر ہے، آج بھی یہی ہے یا نہیں، اے جی آفس سے پوچھیں۔", "Per Dawn of 17 April 2021, the Balochistan Finance Department approved immediate payment of an expected pension at 65% of basic salary, with conditions, until further orders. It is an old report — ask the AG office whether it still holds."], ["d116", "آسان دفتر,asan daftar,aasan daftar,easy daftar,نوٹیفکیشن کہاں ملیں,بلوچستان نوٹیفکیشن,notifications website,finance.gob.pk,pabalochistan", "بلوچستان کے نوٹیفکیشن کہاں ملتے ہیں؟", "Where are Balochistan notifications found?", "محکمہ خزانہ کی سائٹ (finance.gob.pk)، صوبائی اسمبلی کی سائٹ (pabalochistan.gov.pk) پر قوانین، اور اے جی بلوچستان کی سائٹ (agb.gov.pk) پر پنشن اور جی پی فنڈ کے فارم اور صفحات۔ اپنے محکمے کی سائٹ بھی دیکھیں۔", "The Finance Department site (finance.gob.pk), laws on the Provincial Assembly site (pabalochistan.gov.pk), and pension / GPF forms and pages on the AG Balochistan site (agb.gov.pk). Also check your own department’s site."], ["d117", "آسان دفتر,asan daftar,aasan daftar,easy daftar,نوٹیفکیشن شامل,نوٹیفکیشن کیسے,add notification,رجسٹر میں", "اپنا نوٹیفکیشن رجسٹر میں کیسے لکھوں؟", "How do I add my own notification to the register?", "\"نوٹیفکیشن\" کھولیں، \"نوٹیفکیشن شامل کریں\" دبائیں۔ عنوان، نمبر، تاریخ، جاری کرنے والا، ذریعہ اور سادہ الفاظ میں نکتے لکھیں۔ چاہیں تو تصویر بھی لگائیں۔ محفوظ کریں۔", "Open Notifications, press Add a notification. Write the title, number, date, issuing office, source and the points in simple words. Add a photo if you like. Save."], ["d118", "آسان دفتر,asan daftar,aasan daftar,easy daftar,ہدایات کی لائبریری,الگ ہدایات,گائیڈ,guides library", "ہدایات کی لائبریری کیا ہے؟", "What is the Guides Library?", "\"ہدایات کی لائبریری\" میں تین الگ حصے ہیں: جی پی فنڈ کی ہدایات، ریٹائرمنٹ اور پنشن کی ہدایات، اور دوسری ہدایات۔ کسی پر دبائیں، پھر کسٹمر یا اونر والی ہدایت کھولیں۔ پرنٹ، جے پی جی، پی ڈی ایف اور واٹس ایپ کے بٹن وہیں ہیں۔ ملازم چننے کی ضرورت نہیں۔", "The Guides Library has three separate parts: GPF guides, Retirement and pension guides, and Other guides. Open one, then the customer or owner version. Print, JPG, PDF and WhatsApp buttons are there. No employee needed."], ["d119", "آسان دفتر,asan daftar,aasan daftar,easy daftar,ریٹائرمنٹ کی ہدایات,ریٹائرمنٹ مکمل,retirement plan,ریٹائرمنٹ پر کیا کرنا", "ریٹائرمنٹ کی مکمل رہنمائی میں کیا ہے؟", "What is in the complete retirement guide?", "ریٹائرمنٹ پر تین کام الگ ہوتے ہیں: جی پی فنڈ کی آخری ادائیگی، پنشن، اور بینوولنٹ فنڈ۔ \"ریٹائرمنٹ — مکمل رہنمائی\" تینوں کو ترتیب سے دکھاتی ہے اور ہر کام کا الگ کیس کھولنے کو کہتی ہے۔", "At retirement three things happen separately: final GPF payment, pension and benevolent fund. \"Retirement — complete plan\" shows all three in order and tells you to open a separate case for each."], ["d120", "آسان دفتر,asan daftar,aasan daftar,easy daftar,جی پی فنڈ کی ہدایات,gpf guides,جی پی کی ہدایات", "جی پی فنڈ کی ہدایات کہاں ہیں؟", "Where are the GPF guides?", "\"ہدایات کی لائبریری\" میں \"جی پی فنڈ کی ہدایات\" کے نیچے چار ہدایات ہیں: قابلِ واپسی ایڈوانس، ناقابلِ واپسی ایڈوانس، فائنل ادائیگی، اور فوت شدہ ملازم کا جی پی فنڈ۔", "In the Guides Library under \"GPF guides\" there are four: refundable advance, non-refundable advance, final payment and GPF of a deceased employee."], ["d121", "آسان دفتر,asan daftar,aasan daftar,easy daftar,دوسری ہدایات,لون,قرض,میڈیکل,چھٹی,نئی بھرتی,پے بل,ٹی اے بل", "دوسرے کاموں کی ہدایات کون سی ہیں؟", "Which other guides are there?", "\"دوسری ہدایات\" میں لانگ ٹرم ایڈوانس یا قرض، میڈیکل ری ایمبرسمنٹ، چھٹی کی درخواست، نئی تقرری کی تنخواہ، اور پے بل / ٹی اے بل ہیں۔ ان کے کاغذات کی اصل فہرست سرکاری فارم پر ہوتی ہے، لنک ساتھ ہے۔", "\"Other guides\" has long-term advance or loan, medical reimbursement, leave application, new-appointment pay and pay / TA bills. The exact papers are printed on the official form; its link is given."]]);
/* ===== FAQ batch 6: Easy Daftar answers generated from the software data + house plans ===== */
FAQ_DEF.push(...[["d201", "آسان دفتر,asan daftar,easy daftar,قابل واپسی,قابلِ واپسی,واپس کٹنے والا,ریفنڈ ایبل,جی پی فنڈ ایڈوانس,جی پی فنڈ سے پیسے,جی پی فنڈ قرض,ایڈوانس,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "جی پی فنڈ ایڈوانس — قابلِ واپسی کیا ہے؟", "What is: GPF advance — refundable?", "اپنے ہی جی پی فنڈ بیلنس سے وقتی قرض۔ یہ تنخواہ سے ماہانہ قسطوں میں واپس کٹتا ہے۔", "A temporary loan from your own GPF balance. It is recovered back in monthly instalments from salary.", ["d202", "d203", "d204"]], ["d202", "آسان دفتر,asan daftar,easy daftar,قابل واپسی,قابلِ واپسی,واپس کٹنے والا,ریفنڈ ایبل,جی پی فنڈ ایڈوانس,جی پی فنڈ سے پیسے,جی پی فنڈ قرض,ایڈوانس,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "جی پی فنڈ ایڈوانس — قابلِ واپسی کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: GPF advance — refundable?", "کاغذات: 1) دفتر کا کورنگ لیٹر؛ 2) ملازم کی درخواست (مقصد اور رقم)؛ 3) شناختی کارڈ کی کاپی؛ 4) جی پی فنڈ فارم-II اور فارم-I / ٹی آر 58-اے بل؛ 5) جی ایف آر-3 درجہ بندی پروفارما (ٹوکن نمبر، ہیڈ آف اکاؤنٹ، ڈی ڈی او کوڈ)؛ 6) 17 نکاتی جی پی فنڈ سرٹیفکیٹ (بیلنس، پچھلے ایڈوانس، سروس میں وقفہ نہیں)؛ 7) واپسی / زائد ادائیگی کی وصولی کا انڈرٹیکنگ؛ 8) تازہ پے سلپ؛ 9) پچھلے ایڈوانس کا بقایا، اگر ہو؛ 10) بینک ڈپازٹ سلپ، اگر لاگو ہو۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Covering letter from the office; 2) Employee application (purpose and amount); 3) CNIC copy; 4) GPF Form-II and Form-I / TR-58A bill; 5) GFR-3 classification proforma (token no., head of account, DDO code); 6) 17-point GPF certificate (balance, previous advances, no gap in service); 7) Undertaking for repayment / recovery of over-payment; 8) Latest pay slip; 9) Balance of previous advance, if any; 10) Bank deposit slip, if applicable. Tick each paper in the case checklist.", ["d203", "d204", "d201"]], ["d203", "آسان دفتر,asan daftar,easy daftar,قابل واپسی,قابلِ واپسی,واپس کٹنے والا,ریفنڈ ایبل,جی پی فنڈ ایڈوانس,جی پی فنڈ سے پیسے,جی پی فنڈ قرض,ایڈوانس,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "جی پی فنڈ ایڈوانس — قابلِ واپسی کا طریقہ کیا ہے؟", "What are the steps for: GPF advance — refundable?", "مراحل: 1) مقصد اور رقم طے کریں؛ اس صفحے پر حد دیکھ لیں۔ 2) چیک لسٹ کے کاغذات جمع کریں۔ 3) سروس ریکارڈ سے 17 نکاتی سرٹیفکیٹ اور بل بھریں۔ 4) دفتر کا سربراہ / ڈی ڈی او دستخط اور مہر لگاتا ہے؛ ٹوکن نمبر لیا جاتا ہے۔ 5) اکاؤنٹس / خزانہ دفتر میں جمع کروائیں اور پیروی کریں۔", "Steps: 1) Decide the purpose and amount; check the limit on this page. 2) Collect the papers in the checklist. 3) Fill the 17-point certificate and the bill from the service record. 4) Head of office / DDO signs and stamps; token number is taken. 5) Submit to the Accounts / Treasury office and follow up.", ["d204", "d201", "d202"]], ["d204", "آسان دفتر,asan daftar,easy daftar,قابل واپسی,قابلِ واپسی,واپس کٹنے والا,ریفنڈ ایبل,جی پی فنڈ ایڈوانس,جی پی فنڈ سے پیسے,جی پی فنڈ قرض,ایڈوانس,فارم,form,کون سا فارم,کون سے فارم", "جی پی فنڈ ایڈوانس — قابلِ واپسی کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: GPF advance — refundable?", "فارم: جی پی فنڈ ایڈوانس (اے جی بلوچستان)، فارم ٹی آر 58-اے (جی پی فنڈ ایڈوانس بل)، جی ایف آر-3 (درجہ بندی)۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: GPF advance (AG Balochistan), Form T.R.58-A (GPF advance bill), GFR-3 (classification). The Forms page has the official link of each form.", ["d201", "d202", "d203"]], ["d211", "آسان دفتر,asan daftar,easy daftar,ناقابل واپسی,ناقابلِ واپسی,نان ریفنڈ ایبل,45 سال کے بعد ایڈوانس,جی پی فنڈ ایڈوانس,ایڈوانس,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "جی پی فنڈ ایڈوانس — ناقابلِ واپسی کیا ہے؟", "What is: GPF advance — non-refundable?", "45 سال کی عمر کے بعد ایسا ایڈوانس جو واپس نہیں کٹتا؛ آخری ادائیگی سے منہا ہوتا ہے۔ پوری ملازمت میں صرف تین (وفاقی رولز میں 45، 50، 55 کی عمر کے بعد ایک ایک)۔", "An advance after age 45 that is not repaid; it is adjusted against the final GPF payment. Only three in a whole service (one after each of ages 45, 50, 55 in the federal rules).", ["d212", "d213", "d214"]], ["d212", "آسان دفتر,asan daftar,easy daftar,ناقابل واپسی,ناقابلِ واپسی,نان ریفنڈ ایبل,45 سال کے بعد ایڈوانس,جی پی فنڈ ایڈوانس,ایڈوانس,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "جی پی فنڈ ایڈوانس — ناقابلِ واپسی کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: GPF advance — non-refundable?", "کاغذات: 1) دفتر کا کورنگ لیٹر؛ 2) مقصد بتانے والی ملازم کی درخواست؛ 3) شناختی کارڈ کی کاپی؛ 4) جی پی فنڈ فارم-II اور فارم-I / ٹی آر 58-اے بل؛ 5) جی ایف آر-3 درجہ بندی پروفارما؛ 6) 17 نکاتی جی پی فنڈ سرٹیفکیٹ (پچھلے ایڈوانس کی تعداد)؛ 7) مقصد کا ثبوت (زمین / مکان کے کاغذات یا قرض کا اسٹیٹمنٹ)؛ 8) مقررہ فارم پر معاہدہ (پہلی قسط لینے سے پہلے)؛ 9) تازہ پے سلپ؛ 10) زکوٰۃ سے استثنا کا فارم CZ-50 (لازمی نہیں)۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Covering letter from the office; 2) Employee application stating the purpose; 3) CNIC copy; 4) GPF Form-II and Form-I / TR-58A bill; 5) GFR-3 classification proforma; 6) 17-point GPF certificate (number of earlier advances); 7) Proof of purpose (land / house papers, or loan statement); 8) Agreement in the prescribed form (before the first instalment is drawn); 9) Latest pay slip; 10) CZ-50 for Zakat exemption (not compulsory). Tick each paper in the case checklist.", ["d213", "d214", "d211"]], ["d213", "آسان دفتر,asan daftar,easy daftar,ناقابل واپسی,ناقابلِ واپسی,نان ریفنڈ ایبل,45 سال کے بعد ایڈوانس,جی پی فنڈ ایڈوانس,ایڈوانس,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "جی پی فنڈ ایڈوانس — ناقابلِ واپسی کا طریقہ کیا ہے؟", "What are the steps for: GPF advance — non-refundable?", "مراحل: 1) عمر اور پہلے لیے گئے ناقابلِ واپسی ایڈوانس کی تعداد دیکھیں۔ 2) مقصد کا ثبوت اور چیک لسٹ کے کاغذات جمع کریں۔ 3) معاہدہ دستخط کریں؛ ڈی ڈی او بل پر دستخط اور مہر لگائے۔ 4) اکاؤنٹس آفس میں جمع کروائیں؛ رقم مقررہ وقت میں استعمال کریں (وفاقی رول: تین مہینے) اور ثبوت دیں۔", "Steps: 1) Check age and how many non-refundable advances were already taken. 2) Collect proof of purpose and the papers in the checklist. 3) Sign the agreement; DDO signs and stamps the bill. 4) Submit to the Accounts office; use the money within the time allowed (federal rule: three months) and show proof.", ["d214", "d211", "d212"]], ["d214", "آسان دفتر,asan daftar,easy daftar,ناقابل واپسی,ناقابلِ واپسی,نان ریفنڈ ایبل,45 سال کے بعد ایڈوانس,جی پی فنڈ ایڈوانس,ایڈوانس,فارم,form,کون سا فارم,کون سے فارم", "جی پی فنڈ ایڈوانس — ناقابلِ واپسی کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: GPF advance — non-refundable?", "فارم: جی پی فنڈ ایڈوانس (اے جی بلوچستان)، فارم ٹی آر 58-اے (جی پی فنڈ ایڈوانس بل)، جی ایف آر-3 (درجہ بندی)۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: GPF advance (AG Balochistan), Form T.R.58-A (GPF advance bill), GFR-3 (classification). The Forms page has the official link of each form.", ["d211", "d212", "d213"]], ["d221", "آسان دفتر,asan daftar,easy daftar,جی پی فنڈ فائنل,فائنل ادائیگی,جی پی فنڈ کی ادائیگی,ریٹائرمنٹ جی پی فنڈ,جی پی فنڈ نکلوانا,جی پی فنڈ ختم,جی پی فنڈ,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "جی پی فنڈ فائنل ادائیگی (ریٹائرمنٹ) کیا ہے؟", "What is: GPF final payment (retirement)?", "ریٹائر ہونے والے / ہو چکے ملازم کا پورا جی پی فنڈ نکلوانا (ریٹائرمنٹ، استعفیٰ، برخاستگی)۔", "Final withdrawal of the whole GPF accumulation by a retiring / retired employee (retirement, resignation, discharge).", ["d222", "d223", "d224"]], ["d222", "آسان دفتر,asan daftar,easy daftar,جی پی فنڈ فائنل,فائنل ادائیگی,جی پی فنڈ کی ادائیگی,ریٹائرمنٹ جی پی فنڈ,جی پی فنڈ نکلوانا,جی پی فنڈ ختم,جی پی فنڈ,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "جی پی فنڈ فائنل ادائیگی (ریٹائرمنٹ) کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: GPF final payment (retirement)?", "کاغذات: 1) اکاؤنٹنٹ جنرل کو درخواست (نام، ولدیت، جی پی فنڈ اکاؤنٹ نمبر)؛ 2) جہاں ملازمت کی ان آڈٹ و اکاؤنٹس دفاتر کی فہرست، اکاؤنٹ نمبروں سمیت؛ 3) آخری کٹوتی کی رقم اور مہینہ؛ 4) جہاں ادائیگی چاہیے وہ دفتر (اے جی، ڈی اے او، خزانہ یا این بی پی برانچ)؛ 5) دستخط کے نمونے تین کاپیوں میں اور شناختی کارڈ نمبر؛ 6) جی پی فنڈ سے چلنے والی انشورنس پالیسی، اگر ہو؛ 7) پچھلے 12 مہینوں کے ایڈوانس، یا \"کوئی ایڈوانس نہیں\" کا سرٹیفکیٹ؛ 8) 17 نکاتی پروفارما؛ 9) جی پی فنڈ فائنل سیٹلمنٹ فارم؛ 10) زکوٰۃ کا اعلان (حلف نامہ) — اوتھ کمشنر / نوٹری اور دو گواہوں کے ساتھ؛ 11) دفتر کے سربراہ کی طرف سے اے جی کو ارسال۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Application to the Accountant General (name, father's name, GPF account number); 2) Audit and accounts offices where served, with account numbers; 3) Amount and month of the last fund deduction; 4) Office where payment is wanted (AG, DAO, Treasury or NBP branch); 5) Specimen signature in triplicate and CNIC number; 6) Insurance policy financed from GPF, if any; 7) Advances in the last 12 months, or certificate of no advance; 8) 17-point proforma; 9) GPF Final Settlement form; 10) Zakat declaration (affidavit) with oath commissioner / notary and two witnesses; 11) Forwarding by the head of office to the AG. Tick each paper in the case checklist.", ["d223", "d224", "d221"]], ["d223", "آسان دفتر,asan daftar,easy daftar,جی پی فنڈ فائنل,فائنل ادائیگی,جی پی فنڈ کی ادائیگی,ریٹائرمنٹ جی پی فنڈ,جی پی فنڈ نکلوانا,جی پی فنڈ ختم,جی پی فنڈ,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "جی پی فنڈ فائنل ادائیگی (ریٹائرمنٹ) کا طریقہ کیا ہے؟", "What are the steps for: GPF final payment (retirement)?", "مراحل: 1) درخواست اور 17 نکاتی پروفارما بھریں۔ 2) زکوٰۃ کا اعلان تصدیق کروائیں۔ 3) دفتر کا سربراہ کیس اے جی کو بھیجے۔ 4) منتخب دفتر میں ادائیگی کی پیروی کریں۔", "Steps: 1) Fill the application and the 17-point proforma. 2) Get the Zakat declaration attested. 3) Head of office forwards the case to the AG. 4) Follow up on the payment at the chosen office.", ["d224", "d221", "d222"]], ["d224", "آسان دفتر,asan daftar,easy daftar,جی پی فنڈ فائنل,فائنل ادائیگی,جی پی فنڈ کی ادائیگی,ریٹائرمنٹ جی پی فنڈ,جی پی فنڈ نکلوانا,جی پی فنڈ ختم,جی پی فنڈ,فارم,form,کون سا فارم,کون سے فارم", "جی پی فنڈ فائنل ادائیگی (ریٹائرمنٹ) کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: GPF final payment (retirement)?", "فارم: جی پی فنڈ فائنل ادائیگی (اے جی بلوچستان)، جی پی فنڈ فائنل ادائیگی (اے جی پی آر)، فارم ٹی آر 58-اے (جی پی فنڈ ایڈوانس بل)۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: GPF final payment (AG Balochistan), GPF final payment (AGPR), Form T.R.58-A (GPF advance bill). The Forms page has the official link of each form.", ["d221", "d222", "d223"]], ["d231", "آسان دفتر,asan daftar,easy daftar,فوت شدہ ملازم کا جی پی فنڈ,وفات جی پی فنڈ,ڈیتھ کیس جی پی فنڈ,وارث جی پی فنڈ,فوت ملازم,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "فوت شدہ ملازم کا جی پی فنڈ کیا ہے؟", "What is: GPF of a deceased employee?", "ملازمت میں فوت ہونے والے ملازم کے جی پی فنڈ کی رقم کے لیے وارث کی درخواست۔", "The legal heir asks for the GPF dues of an employee who died in service.", ["d232", "d233", "d234"]], ["d232", "آسان دفتر,asan daftar,easy daftar,فوت شدہ ملازم کا جی پی فنڈ,وفات جی پی فنڈ,ڈیتھ کیس جی پی فنڈ,وارث جی پی فنڈ,فوت ملازم,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "فوت شدہ ملازم کا جی پی فنڈ کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: GPF of a deceased employee?", "کاغذات: 1) وارث کی درخواست (مرحوم سے رشتہ)؛ 2) ملازم کا نام، ولدیت، عہدہ، اکاؤنٹ نمبر؛ 3) جہاں ادائیگی چاہیے وہ دفتر؛ 4) دستخط کے نمونے تین کاپیوں میں، شناختی کارڈ نمبر؛ 5) اگر نامزدگی نہیں: خاندان کی فہرست (ازدواجی حیثیت، عمر، رشتہ)؛ 6) سول کورٹ سے سرپرستی / وراثت کا سرٹیفکیٹ، یا اگر نابالغ وارث کا حصہ فارم میں لکھی حد سے زیادہ ہو تو انڈیمنٹی بانڈ؛ 7) حصہ اول — درخواست دہندہ کی طرف سے بھرا ہوا؛ 8) 17 نکاتی پروفارما (تاریخِ وفات کے ساتھ)؛ 9) دفتر کا سربراہ اے جی کو بھیجے؛ 10) ڈیتھ سرٹیفکیٹ۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Heir's application (relationship to the deceased); 2) Subscriber's name, father's name, designation, account number; 3) Office where payment is wanted (AG / DAO / Treasury); 4) Specimen signatures in triplicate, CNIC number; 5) If no nomination: list of family members (marital status, ages, relationship); 6) Guardianship / succession certificate from a civil court, or indemnity bond when a minor heir's share is above the limit stated on the form; 7) Part I application filled by the applicant; 8) 17-point proforma (date of death entered); 9) Head of office forwards to the AG; 10) Death certificate. Tick each paper in the case checklist.", ["d233", "d234", "d231"]], ["d233", "آسان دفتر,asan daftar,easy daftar,فوت شدہ ملازم کا جی پی فنڈ,وفات جی پی فنڈ,ڈیتھ کیس جی پی فنڈ,وارث جی پی فنڈ,فوت ملازم,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "فوت شدہ ملازم کا جی پی فنڈ کا طریقہ کیا ہے؟", "What are the steps for: GPF of a deceased employee?", "مراحل: 1) تمام قانونی ورثا کی فہرست بنائیں اور نامزدگی دیکھیں۔ 2) نابالغ وارث ہوں تو عدالت کا سرٹیفکیٹ یا انڈیمنٹی بانڈ تیار کریں۔ 3) درخواست اور حصہ اول بھریں۔ 4) دفتر ارسال کرے؛ پیروی کریں۔", "Steps: 1) List all legal heirs and check for a nomination. 2) If minors are heirs, arrange the court certificate or indemnity bond. 3) Fill the application and Part I. 4) Office forwards it; follow up.", ["d234", "d231", "d232"]], ["d234", "آسان دفتر,asan daftar,easy daftar,فوت شدہ ملازم کا جی پی فنڈ,وفات جی پی فنڈ,ڈیتھ کیس جی پی فنڈ,وارث جی پی فنڈ,فوت ملازم,فارم,form,کون سا فارم,کون سے فارم", "فوت شدہ ملازم کا جی پی فنڈ کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: GPF of a deceased employee?", "فارم: فوت شدہ ملازم کا جی پی فنڈ، فارم ٹی آر 58-اے (جی پی فنڈ ایڈوانس بل)، خاندان کے افراد کی فہرست۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: GPF of deceased employee, Form T.R.58-A (GPF advance bill), List of family members. The Forms page has the official link of each form.", ["d231", "d232", "d233"]], ["d241", "آسان دفتر,asan daftar,easy daftar,ریٹائرمنٹ,ریٹائر ہو رہا,ریٹائرمنٹ پر,ریٹائرمنٹ کی تیاری,ریٹائر ہونے,ریٹائرڈ,ریٹائر,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "ریٹائرمنٹ — مکمل رہنمائی کیا ہے؟", "What is: Retirement — complete plan?", "ریٹائرمنٹ پر تین الگ کام ہوتے ہیں: (1) جی پی فنڈ کی آخری ادائیگی، (2) پنشن، (3) بینوولنٹ فنڈ۔ ہر ایک کے کاغذات الگ ہیں؛ یہ رہنمائی سب کو ترتیب سے دکھاتی ہے۔", "Three separate things happen at retirement: (1) final payment of your GPF, (2) your pension, (3) benevolent fund. Each has its own papers; this plan shows all of them in order.", ["d242", "d243", "d244"]], ["d242", "آسان دفتر,asan daftar,easy daftar,ریٹائرمنٹ,ریٹائر ہو رہا,ریٹائرمنٹ پر,ریٹائرمنٹ کی تیاری,ریٹائر ہونے,ریٹائرڈ,ریٹائر,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "ریٹائرمنٹ — مکمل رہنمائی کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: Retirement — complete plan?", "کاغذات: 1) سروس ریکارڈ مکمل اور دستخط شدہ (سروس کی تاریخ)؛ 2) جی پی فنڈ فائنل ادائیگی: الگ \"جی پی فنڈ فائنل ادائیگی\" کیس کھول کر اس کی چیک لسٹ مکمل کریں؛ 3) پنشن: الگ \"پنشن — ریٹائرمنٹ\" کیس کھولیں (20 کاغذات کی فہرست)؛ 4) بینوولنٹ فنڈ فارم؛ 5) نامزدگی کا فارم؛ 6) خاندان کے افراد کی فہرست؛ 7) زندہ ہونے کا سرٹیفکیٹ (جب مانگا جائے)؛ 8) شناختی کارڈ کی کاپیاں اور تصاویر۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Service record is complete and signed (history of services); 2) GPF final payment: open the separate \"GPF final payment\" case and finish its checklist; 3) Pension: open the separate \"Pension — retirement\" case (the 20-paper list); 4) Benevolent fund form; 5) Nomination form; 6) List of family members; 7) Life certificate (when asked); 8) CNIC copies and photographs. Tick each paper in the case checklist.", ["d243", "d244", "d241"]], ["d243", "آسان دفتر,asan daftar,easy daftar,ریٹائرمنٹ,ریٹائر ہو رہا,ریٹائرمنٹ پر,ریٹائرمنٹ کی تیاری,ریٹائر ہونے,ریٹائرڈ,ریٹائر,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "ریٹائرمنٹ — مکمل رہنمائی کا طریقہ کیا ہے؟", "What are the steps for: Retirement — complete plan?", "مراحل: 1) ریٹائرمنٹ کی تاریخ سے کافی پہلے شروع کریں؛ آخری ہفتے کا انتظار نہ کریں۔ 2) سروس ریکارڈ مکمل کریں اور نام، تاریخِ پیدائش یا سروس کی تاریخوں کی غلطی ٹھیک کروائیں۔ 3) تین الگ کیس کھولیں: جی پی فنڈ فائنل ادائیگی، پنشن، اور بینوولنٹ فنڈ کا فارم بھریں۔ 4) اپنے محکمے سے آفس آرڈر اور این او سی لیں۔ 5) ہر فائل الگ کورنگ لیٹر کے ساتھ اے جی آفس میں جمع کروائیں اور ڈائری نمبر رکھیں۔", "Steps: 1) Start well before the retirement date; do not wait for the last week. 2) Complete the service record and correct any mistake in name, date of birth or service dates. 3) Open the three separate cases: GPF final payment, Pension, and fill the benevolent fund form. 4) Get the office order and the NOCs from your department. 5) Submit each file to the AG office with its own covering letter and keep the diary numbers.", ["d244", "d241", "d242"]], ["d244", "آسان دفتر,asan daftar,easy daftar,ریٹائرمنٹ,ریٹائر ہو رہا,ریٹائرمنٹ پر,ریٹائرمنٹ کی تیاری,ریٹائر ہونے,ریٹائرڈ,ریٹائر,فارم,form,کون سا فارم,کون سے فارم", "ریٹائرمنٹ — مکمل رہنمائی کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: Retirement — complete plan?", "فارم: جی پی فنڈ فائنل ادائیگی (اے جی بلوچستان)، پنشن درخواست CSR-25 (ترمیم شدہ 2019)، خاندان کے افراد کی فہرست، سروس کی تاریخ، نامزدگی کا فارم، زندہ ہونے کا سرٹیفکیٹ، بینوولنٹ فنڈ، پنشن پیپرز، پنشن کے کاغذات۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: GPF final payment (AG Balochistan), Pension application CSR-25 (Revised 2019), List of family members, History of services, Nomination form, Life certificate, Benevolent fund, Pension papers, Pension documents. The Forms page has the official link of each form.", ["d241", "d242", "d243"]], ["d251", "آسان دفتر,asan daftar,easy daftar,پنشن,نئی پنشن,پنشن کیس,پنشن بنوانا,پنشن شروع,پنشن لگوانا,نیا پنشن کیس,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "پنشن — ریٹائرمنٹ (نیا کیس) کیا ہے؟", "What is: Pension — retirement (fresh case)?", "نئے ریٹائر ہونے والے ملازم کی پنشن شروع کروانے کے کاغذات۔", "Papers needed to start a pension for a newly retired employee.", ["d252", "d253", "d254"]], ["d252", "آسان دفتر,asan daftar,easy daftar,پنشن,نئی پنشن,پنشن کیس,پنشن بنوانا,پنشن شروع,پنشن لگوانا,نیا پنشن کیس,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "پنشن — ریٹائرمنٹ (نیا کیس) کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: Pension — retirement (fresh case)?", "کاغذات: 1) پنشن درخواست CSR-25 (ترمیم شدہ)؛ 2) تصاویر؛ 3) شناختی کارڈ کی کاپیاں؛ 4) سی ایس آر آرٹیکل 922(اے) کے تحت اعلان؛ 5) سی ایس آر آرٹیکل 920(1) کے تحت اعلان؛ 6) سی ایس آر آرٹیکل 911 کے تحت اعلان؛ 7) انڈرٹیکنگ: سیاست میں حصہ نہیں لوں گا؛ 8) سرکاری واجبات کی وصولی کی رضامندی؛ 9) دستخط کے نمونے (دو سیٹ)؛ 10) بینک، برانچ اور اکاؤنٹ نمبر؛ 11) انگوٹھے اور انگلیوں کے نشان (دو سیٹ)؛ 12) خاندان کے افراد کی فہرست؛ 13) سروس بک اور اہل سروس کا سرٹیفکیٹ (نان گزیٹڈ / گزیٹڈ)؛ 14) گزیٹڈ مدت کی تاریخ (سروس اسٹیٹمنٹ)؛ 15) آخری تنخواہ کا سرٹیفکیٹ؛ 16) ایسٹیٹ آفس کا این او سی؛ 17) انتظامی محکمے کا این او سی (کوئٹہ سے باہر)؛ 18) انتظامی محکمے کا ریٹائرمنٹ آفس آرڈر؛ 19) ڈسکرپٹو رول (شناختی نشان وغیرہ)؛ 20) 50 فیصد کمیوٹیشن کا آپشن۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Pension application CSR-25 (Revised); 2) Photographs; 3) Copies of CNIC; 4) Declaration under Article 922(a) CSR; 5) Declaration under Article 920(1) CSR; 6) Declaration under Article 911 CSR; 7) Undertaking: not taking part in politics; 8) Consent for recovery of government dues; 9) Specimen signature (two sets); 10) Bank, branch and account number; 11) Thumb and finger impressions (two sets); 12) List of family members; 13) Service book with qualifying service certificate (non-gazetted / gazetted); 14) History of gazetted period (service statement); 15) Last Pay Certificate; 16) NOC from Estate Office; 17) NOC from Administrative Department (outside Quetta); 18) Office order for retirement from administrative department; 19) Descriptive roll (identification marks etc.); 20) Option for 50% commutation. Tick each paper in the case checklist.", ["d253", "d254", "d251"]], ["d253", "آسان دفتر,asan daftar,easy daftar,پنشن,نئی پنشن,پنشن کیس,پنشن بنوانا,پنشن شروع,پنشن لگوانا,نیا پنشن کیس,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "پنشن — ریٹائرمنٹ (نیا کیس) کا طریقہ کیا ہے؟", "What are the steps for: Pension — retirement (fresh case)?", "مراحل: 1) 20 کاغذات جمع کریں۔ 2) محکمے سے این او سی اور ریٹائرمنٹ آفس آرڈر لیں۔ 3) CSR-25 اور خاندان کی فہرست بھریں۔ 4) اے جی آفس میں جمع کروائیں۔", "Steps: 1) Collect the 20 papers. 2) Get the NOCs and the retirement office order from the department. 3) Fill CSR-25 and the family list. 4) Submit to the AG office.", ["d254", "d251", "d252"]], ["d254", "آسان دفتر,asan daftar,easy daftar,پنشن,نئی پنشن,پنشن کیس,پنشن بنوانا,پنشن شروع,پنشن لگوانا,نیا پنشن کیس,فارم,form,کون سا فارم,کون سے فارم", "پنشن — ریٹائرمنٹ (نیا کیس) کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: Pension — retirement (fresh case)?", "فارم: پنشن درخواست CSR-25 (ترمیم شدہ 2019)، خاندان کے افراد کی فہرست، سروس کی تاریخ، پنشن پیپرز، پنشن کے کاغذات۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: Pension application CSR-25 (Revised 2019), List of family members, History of services, Pension papers, Pension documents. The Forms page has the official link of each form.", ["d251", "d252", "d253"]], ["d261", "آسان دفتر,asan daftar,easy daftar,قبل از وقت ریٹائرمنٹ,وقت سے پہلے ریٹائرمنٹ,ایل پی آر,lpr,انویلڈ پنشن,انویلڈ,قبل از وقت پنشن,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "پنشن — قبل از وقت / ایل پی آر / انویلڈ کیا ہے؟", "What is: Pension — premature / LPR / invalid?", "قبل از وقت ریٹائرمنٹ، ایل پی آر کیش منٹ اور انویلڈ پنشن کے کاغذات۔", "Papers for premature retirement, LPR encashment and invalid pension cases.", ["d262", "d263", "d264"]], ["d262", "آسان دفتر,asan daftar,easy daftar,قبل از وقت ریٹائرمنٹ,وقت سے پہلے ریٹائرمنٹ,ایل پی آر,lpr,انویلڈ پنشن,انویلڈ,قبل از وقت پنشن,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "پنشن — قبل از وقت / ایل پی آر / انویلڈ کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: Pension — premature / LPR / invalid?", "کاغذات: 1) پنشن درخواست CSR-25 (ترمیم شدہ)؛ 2) تصاویر؛ 3) شناختی کارڈ کی کاپیاں؛ 4) سی ایس آر آرٹیکل 922(اے) کے تحت اعلان؛ 5) سی ایس آر آرٹیکل 920(1) کے تحت اعلان؛ 6) سی ایس آر آرٹیکل 911 کے تحت اعلان؛ 7) انڈرٹیکنگ: سیاست میں حصہ نہیں لوں گا؛ 8) سرکاری واجبات کی وصولی کی رضامندی؛ 9) دستخط کے نمونے (دو سیٹ)؛ 10) بینک، برانچ اور اکاؤنٹ نمبر؛ 11) انگوٹھے اور انگلیوں کے نشان (دو سیٹ)؛ 12) خاندان کے افراد کی فہرست؛ 13) سروس بک اور اہل سروس کا سرٹیفکیٹ (نان گزیٹڈ / گزیٹڈ)؛ 14) گزیٹڈ مدت کی تاریخ (سروس اسٹیٹمنٹ)؛ 15) آخری تنخواہ کا سرٹیفکیٹ؛ 16) ایسٹیٹ آفس کا این او سی؛ 17) انتظامی محکمے کا این او سی (کوئٹہ سے باہر)؛ 18) انتظامی محکمے کا ریٹائرمنٹ آفس آرڈر؛ 19) ڈسکرپٹو رول (شناختی نشان وغیرہ)؛ 20) 50 فیصد کمیوٹیشن کا آپشن؛ 21) درخواست؛ 22) پروفارما: 25 / 31 سال اہل سروس؛ 23) سرٹیفکیٹ: کوئی انضباطی کارروائی نہیں؛ 24) پے آڈٹ آفس سے چھٹی کی اہلیت کا سرٹیفکیٹ؛ 25) اصل میڈیکل سرٹیفکیٹ (صرف انویلڈ پنشن میں)۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Pension application CSR-25 (Revised); 2) Photographs; 3) Copies of CNIC; 4) Declaration under Article 922(a) CSR; 5) Declaration under Article 920(1) CSR; 6) Declaration under Article 911 CSR; 7) Undertaking: not taking part in politics; 8) Consent for recovery of government dues; 9) Specimen signature (two sets); 10) Bank, branch and account number; 11) Thumb and finger impressions (two sets); 12) List of family members; 13) Service book with qualifying service certificate (non-gazetted / gazetted); 14) History of gazetted period (service statement); 15) Last Pay Certificate; 16) NOC from Estate Office; 17) NOC from Administrative Department (outside Quetta); 18) Office order for retirement from administrative department; 19) Descriptive roll (identification marks etc.); 20) Option for 50% commutation; 21) Application; 22) Proforma: 25 / 31 years qualifying service; 23) Certificate: no disciplinary action; 24) Leave admissibility certificate from Pay Audit Office; 25) Original medical certificate (invalid pension only). Tick each paper in the case checklist.", ["d263", "d264", "d261"]], ["d263", "آسان دفتر,asan daftar,easy daftar,قبل از وقت ریٹائرمنٹ,وقت سے پہلے ریٹائرمنٹ,ایل پی آر,lpr,انویلڈ پنشن,انویلڈ,قبل از وقت پنشن,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "پنشن — قبل از وقت / ایل پی آر / انویلڈ کا طریقہ کیا ہے؟", "What are the steps for: Pension — premature / LPR / invalid?", "مراحل: 1) 25 کاغذات جمع کریں (میڈیکل سرٹیفکیٹ صرف انویلڈ کیس میں)۔ 2) اہل سروس کا پروفارما اور چھٹی کا سرٹیفکیٹ لیں۔ 3) اے جی آفس میں جمع کروائیں۔", "Steps: 1) Collect the 25 papers (the medical certificate is only for invalid cases). 2) Get the service-qualification proforma and the leave certificate. 3) Submit to the AG office.", ["d264", "d261", "d262"]], ["d264", "آسان دفتر,asan daftar,easy daftar,قبل از وقت ریٹائرمنٹ,وقت سے پہلے ریٹائرمنٹ,ایل پی آر,lpr,انویلڈ پنشن,انویلڈ,قبل از وقت پنشن,فارم,form,کون سا فارم,کون سے فارم", "پنشن — قبل از وقت / ایل پی آر / انویلڈ کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: Pension — premature / LPR / invalid?", "فارم: پنشن درخواست CSR-25 (ترمیم شدہ 2019)، خاندان کے افراد کی فہرست، سروس کی تاریخ، پنشن پیپرز۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: Pension application CSR-25 (Revised 2019), List of family members, History of services, Pension papers. The Forms page has the official link of each form.", ["d261", "d262", "d263"]], ["d271", "آسان دفتر,asan daftar,easy daftar,فیملی پنشن,دوران ملازمت وفات,بیوہ پنشن,وارثوں کی پنشن,فوت ملازم کی پنشن,فوتگی پنشن,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "فیملی پنشن (دورانِ ملازمت وفات) کیا ہے؟", "What is: Family pension (death in service)?", "دورانِ ملازمت فوت ہونے والے ملازم یا پنشنر کے خاندان کے کاغذات۔", "Papers for the family of an employee who died in service or a pensioner.", ["d272", "d273", "d274"]], ["d272", "آسان دفتر,asan daftar,easy daftar,فیملی پنشن,دوران ملازمت وفات,بیوہ پنشن,وارثوں کی پنشن,فوت ملازم کی پنشن,فوتگی پنشن,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "فیملی پنشن (دورانِ ملازمت وفات) کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: Family pension (death in service)?", "کاغذات: 1) پنشن درخواست CSR-25 (ترمیم شدہ)؛ 2) تصاویر؛ 3) شناختی کارڈ کی کاپیاں؛ 4) سی ایس آر آرٹیکل 922(اے) کے تحت اعلان؛ 5) سی ایس آر آرٹیکل 920(1) کے تحت اعلان؛ 6) سی ایس آر آرٹیکل 911 کے تحت اعلان؛ 7) انڈرٹیکنگ: سیاست میں حصہ نہیں لوں گا؛ 8) سرکاری واجبات کی وصولی کی رضامندی؛ 9) دستخط کے نمونے (دو سیٹ)؛ 10) بینک، برانچ اور اکاؤنٹ نمبر؛ 11) انگوٹھے اور انگلیوں کے نشان (دو سیٹ)؛ 12) خاندان کے افراد کی فہرست؛ 13) سروس بک اور اہل سروس کا سرٹیفکیٹ (نان گزیٹڈ / گزیٹڈ)؛ 14) گزیٹڈ مدت کی تاریخ (سروس اسٹیٹمنٹ)؛ 15) آخری تنخواہ کا سرٹیفکیٹ؛ 16) ایسٹیٹ آفس کا این او سی؛ 17) انتظامی محکمے کا این او سی (کوئٹہ سے باہر)؛ 18) انتظامی محکمے کا ریٹائرمنٹ آفس آرڈر؛ 19) ڈسکرپٹو رول (شناختی نشان وغیرہ)؛ 20) 50 فیصد کمیوٹیشن کا آپشن؛ 21) ڈیتھ سرٹیفکیٹ (اگر درکار ہو)؛ 22) دوبارہ شادی نہ کرنے کا سرٹیفکیٹ (اگر درکار ہو)۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Pension application CSR-25 (Revised); 2) Photographs; 3) Copies of CNIC; 4) Declaration under Article 922(a) CSR; 5) Declaration under Article 920(1) CSR; 6) Declaration under Article 911 CSR; 7) Undertaking: not taking part in politics; 8) Consent for recovery of government dues; 9) Specimen signature (two sets); 10) Bank, branch and account number; 11) Thumb and finger impressions (two sets); 12) List of family members; 13) Service book with qualifying service certificate (non-gazetted / gazetted); 14) History of gazetted period (service statement); 15) Last Pay Certificate; 16) NOC from Estate Office; 17) NOC from Administrative Department (outside Quetta); 18) Office order for retirement from administrative department; 19) Descriptive roll (identification marks etc.); 20) Option for 50% commutation; 21) Death certificate (if required); 22) Non-remarriage certificate (if required). Tick each paper in the case checklist.", ["d273", "d274", "d271"]], ["d273", "آسان دفتر,asan daftar,easy daftar,فیملی پنشن,دوران ملازمت وفات,بیوہ پنشن,وارثوں کی پنشن,فوت ملازم کی پنشن,فوتگی پنشن,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "فیملی پنشن (دورانِ ملازمت وفات) کا طریقہ کیا ہے؟", "What are the steps for: Family pension (death in service)?", "مراحل: 1) ڈیتھ سرٹیفکیٹ سمیت 22 کاغذات جمع کریں۔ 2) بیوہ: ضرورت ہو تو دوبارہ شادی نہ کرنے کا سرٹیفکیٹ۔ 3) اے جی آفس میں جمع کروائیں۔", "Steps: 1) Collect the 22 papers, including the death certificate. 2) Widow: non-remarriage certificate when required. 3) Submit to the AG office.", ["d274", "d271", "d272"]], ["d274", "آسان دفتر,asan daftar,easy daftar,فیملی پنشن,دوران ملازمت وفات,بیوہ پنشن,وارثوں کی پنشن,فوت ملازم کی پنشن,فوتگی پنشن,فارم,form,کون سا فارم,کون سے فارم", "فیملی پنشن (دورانِ ملازمت وفات) کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: Family pension (death in service)?", "فارم: پنشن درخواست CSR-25 (ترمیم شدہ 2019)، خاندان کے افراد کی فہرست، نامزدگی کا فارم، زندہ ہونے کا سرٹیفکیٹ۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: Pension application CSR-25 (Revised 2019), List of family members, Nomination form, Life certificate. The Forms page has the official link of each form.", ["d271", "d272", "d273"]], ["d281", "آسان دفتر,asan daftar,easy daftar,لانگ ٹرم ایڈوانس,قرض,لون,سرکاری قرض,ضمانتی بانڈ,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "لانگ ٹرم ایڈوانس / قرض کیا ہے؟", "What is: Long-term advance / loan?", "سرکاری لانگ ٹرم ایڈوانس یا قرض کے کاغذات، ضمانت کے ساتھ۔", "Papers for a long-term advance or loan from the government, with a surety.", ["d282", "d283", "d284"]], ["d282", "آسان دفتر,asan daftar,easy daftar,لانگ ٹرم ایڈوانس,قرض,لون,سرکاری قرض,ضمانتی بانڈ,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "لانگ ٹرم ایڈوانس / قرض کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: Long-term advance / loan?", "کاغذات: 1) دفتر کا کورنگ لیٹر؛ 2) ملازم کی درخواست؛ 3) شناختی کارڈ کی کاپی؛ 4) تازہ پے سلپ۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Covering letter from the office; 2) Employee application; 3) CNIC copy; 4) Latest pay slip. Tick each paper in the case checklist.", ["d283", "d284", "d281"]], ["d283", "آسان دفتر,asan daftar,easy daftar,لانگ ٹرم ایڈوانس,قرض,لون,سرکاری قرض,ضمانتی بانڈ,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "لانگ ٹرم ایڈوانس / قرض کا طریقہ کیا ہے؟", "What are the steps for: Long-term advance / loan?", "مراحل: 1) لون اور ایڈوانس کا فارم پڑھ کر دیکھیں کہ کون اہل ہے۔ 2) پروفارما اور ضمانتی بانڈ بھریں۔ 3) دفتر دستخط اور مہر لگائے، پھر اکاؤنٹس آفس میں جمع کروائیں۔", "Steps: 1) Read the loans-and-advances form and check who is eligible. 2) Fill the proforma and the surety bond. 3) Office signs and stamps, then submit to the accounts office.", ["d284", "d281", "d282"]], ["d284", "آسان دفتر,asan daftar,easy daftar,لانگ ٹرم ایڈوانس,قرض,لون,سرکاری قرض,ضمانتی بانڈ,فارم,form,کون سا فارم,کون سے فارم", "لانگ ٹرم ایڈوانس / قرض کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: Long-term advance / loan?", "فارم: لون اور ایڈوانس، لانگ ٹرم ایڈوانس پروفارما، ضمانتی بانڈ۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: Loans and advances, Long-term advance proforma, Surety bond. The Forms page has the official link of each form.", ["d281", "d282", "d283"]], ["d291", "آسان دفتر,asan daftar,easy daftar,میڈیکل ری ایمبرسمنٹ,علاج کے پیسے,علاج کا خرچ,میڈیکل بل,میڈیکل کلیم,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "میڈیکل ری ایمبرسمنٹ کیا ہے؟", "What is: Medical reimbursement?", "علاج پر خرچ ہونے والی رقم کی واپسی کا دعویٰ۔", "Claim back the money spent on treatment.", ["d292", "d293", "d294"]], ["d292", "آسان دفتر,asan daftar,easy daftar,میڈیکل ری ایمبرسمنٹ,علاج کے پیسے,علاج کا خرچ,میڈیکل بل,میڈیکل کلیم,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "میڈیکل ری ایمبرسمنٹ کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: Medical reimbursement?", "کاغذات: 1) دفتر کا کورنگ لیٹر؛ 2) ملازم کی درخواست؛ 3) شناختی کارڈ کی کاپی؛ 4) تازہ پے سلپ۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Covering letter from the office; 2) Employee application; 3) CNIC copy; 4) Latest pay slip. Tick each paper in the case checklist.", ["d293", "d294", "d291"]], ["d293", "آسان دفتر,asan daftar,easy daftar,میڈیکل ری ایمبرسمنٹ,علاج کے پیسے,علاج کا خرچ,میڈیکل بل,میڈیکل کلیم,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "میڈیکل ری ایمبرسمنٹ کا طریقہ کیا ہے؟", "What are the steps for: Medical reimbursement?", "مراحل: 1) اصل بل، نسخے اور رپورٹیں سنبھال کر رکھیں۔ 2) میڈیکل ری ایمبرسمنٹ فارم بھریں۔ 3) دفتر سے دستخط کروا کر بلوں کے ساتھ جمع کروائیں۔", "Steps: 1) Keep the original bills, prescriptions and reports. 2) Fill the medical reimbursement form. 3) Get it signed by the office and submit with the bills.", ["d294", "d291", "d292"]], ["d294", "آسان دفتر,asan daftar,easy daftar,میڈیکل ری ایمبرسمنٹ,علاج کے پیسے,علاج کا خرچ,میڈیکل بل,میڈیکل کلیم,فارم,form,کون سا فارم,کون سے فارم", "میڈیکل ری ایمبرسمنٹ کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: Medical reimbursement?", "فارم: میڈیکل ری ایمبرسمنٹ۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: Medical reimbursement. The Forms page has the official link of each form.", ["d291", "d292", "d293"]], ["d301", "آسان دفتر,asan daftar,easy daftar,چھٹی,چھٹی کی درخواست,رخصت,لیو,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "چھٹی کی درخواست کیا ہے؟", "What is: Leave application?", "چھٹی کی درخواست۔", "Application for leave.", ["d302", "d303", "d304"]], ["d302", "آسان دفتر,asan daftar,easy daftar,چھٹی,چھٹی کی درخواست,رخصت,لیو,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "چھٹی کی درخواست کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: Leave application?", "کاغذات: 1) دفتر کا کورنگ لیٹر؛ 2) ملازم کی درخواست؛ 3) شناختی کارڈ کی کاپی؛ 4) تازہ پے سلپ۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Covering letter from the office; 2) Employee application; 3) CNIC copy; 4) Latest pay slip. Tick each paper in the case checklist.", ["d303", "d304", "d301"]], ["d303", "آسان دفتر,asan daftar,easy daftar,چھٹی,چھٹی کی درخواست,رخصت,لیو,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "چھٹی کی درخواست کا طریقہ کیا ہے؟", "What are the steps for: Leave application?", "مراحل: 1) فارم پر چھٹی کی قسم اور تاریخیں لکھیں۔ 2) دفتر کے سربراہ سے سفارش کروائیں۔ 3) منظوری کے حکم کی کاپی رکھیں۔", "Steps: 1) Write the type and dates of leave on the form. 2) Get it recommended by the head of office. 3) Keep a copy of the sanction order.", ["d304", "d301", "d302"]], ["d304", "آسان دفتر,asan daftar,easy daftar,چھٹی,چھٹی کی درخواست,رخصت,لیو,فارم,form,کون سا فارم,کون سے فارم", "چھٹی کی درخواست کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: Leave application?", "فارم: چھٹی کی درخواست۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: Leave application. The Forms page has the official link of each form.", ["d301", "d302", "d303"]], ["d311", "آسان دفتر,asan daftar,easy daftar,نئی تقرری,نئی بھرتی,نوکری لگنے,تنخواہ شروع,پہلی تنخواہ,جوائننگ,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "نئی تقرری — تنخواہ کا تعین کیا ہے؟", "What is: New appointment — pay fixation?", "نئے بھرتی ہونے والے ملازم کی تنخواہ شروع کروانے کے کاغذات۔", "Papers to start the salary of a newly appointed employee.", ["d312", "d313", "d314"]], ["d312", "آسان دفتر,asan daftar,easy daftar,نئی تقرری,نئی بھرتی,نوکری لگنے,تنخواہ شروع,پہلی تنخواہ,جوائننگ,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "نئی تقرری — تنخواہ کا تعین کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: New appointment — pay fixation?", "کاغذات: 1) دفتر کا کورنگ لیٹر؛ 2) ملازم کی درخواست؛ 3) شناختی کارڈ کی کاپی؛ 4) تازہ پے سلپ۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Covering letter from the office; 2) Employee application; 3) CNIC copy; 4) Latest pay slip. Tick each paper in the case checklist.", ["d313", "d314", "d311"]], ["d313", "آسان دفتر,asan daftar,easy daftar,نئی تقرری,نئی بھرتی,نوکری لگنے,تنخواہ شروع,پہلی تنخواہ,جوائننگ,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "نئی تقرری — تنخواہ کا تعین کا طریقہ کیا ہے؟", "What are the steps for: New appointment — pay fixation?", "مراحل: 1) تقرری کا آرڈر اور جوائننگ رپورٹ لیں۔ 2) نئی تقرری کا پے فارم اور جی ایف آر-3 بھریں۔ 3) اکاؤنٹس آفس میں جمع کروائیں۔", "Steps: 1) Collect the appointment order and joining report. 2) Fill the new-appointment pay form and GFR-3. 3) Submit to the accounts office.", ["d314", "d311", "d312"]], ["d314", "آسان دفتر,asan daftar,easy daftar,نئی تقرری,نئی بھرتی,نوکری لگنے,تنخواہ شروع,پہلی تنخواہ,جوائننگ,فارم,form,کون سا فارم,کون سے فارم", "نئی تقرری — تنخواہ کا تعین کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: New appointment — pay fixation?", "فارم: نئی بھرتی کا پے فارم، جی ایف آر-3 (درجہ بندی)۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: New appointment pay form, GFR-3 (classification). The Forms page has the official link of each form.", ["d311", "d312", "d313"]], ["d321", "آسان دفتر,asan daftar,easy daftar,پے بل,ٹی اے بل,سفر خرچ,تنخواہ کا بل,ٹی اے ڈی اے,کیا ہے,کیا ہوتا ہے,مطلب,تعارف", "پے بل / ٹی اے بل کیا ہے؟", "What is: Pay bill / TA bill?", "ماہانہ پے بل یا سفر خرچ کا بل (گزیٹڈ اور نان گزیٹڈ فارم)۔", "Monthly pay bill or travelling allowance bill (gazetted and non-gazetted forms).", ["d322", "d323", "d324"]], ["d322", "آسان دفتر,asan daftar,easy daftar,پے بل,ٹی اے بل,سفر خرچ,تنخواہ کا بل,ٹی اے ڈی اے,کاغذات,کاغذ,دستاویزات,ڈاکومنٹ,documents,چیک لسٹ,کیا لگتا ہے,کیا چاہییں,کیا لانا ہے", "پے بل / ٹی اے بل کے لیے کون سے کاغذات چاہییں؟", "Which papers are needed for: Pay bill / TA bill?", "کاغذات: 1) دفتر کا کورنگ لیٹر؛ 2) ملازم کی درخواست؛ 3) شناختی کارڈ کی کاپی؛ 4) تازہ پے سلپ۔ ہر کاغذ آنے پر کیس کی چیک لسٹ میں ٹک لگائیں۔", "Papers: 1) Covering letter from the office; 2) Employee application; 3) CNIC copy; 4) Latest pay slip. Tick each paper in the case checklist.", ["d323", "d324", "d321"]], ["d323", "آسان دفتر,asan daftar,easy daftar,پے بل,ٹی اے بل,سفر خرچ,تنخواہ کا بل,ٹی اے ڈی اے,طریقہ,طریقہ کار,مراحل,کیسے کریں,کیسے ہوگا,کیا کرنا ہے,steps,process,کیسے لیں,کیسے بنتی,کیسے بنتا,کیسے ملتا,کیسے ملتی,کیسے ملے گا,کیسے ملے گی,کیسے شروع", "پے بل / ٹی اے بل کا طریقہ کیا ہے؟", "What are the steps for: Pay bill / TA bill?", "مراحل: 1) فارم چنیں: گزیٹڈ کے لیے TR-17 / TR-20، نان گزیٹڈ کے لیے TR-22 / TR-25۔ 2) بل اور درجہ بندی کا فارم بھریں۔ 3) دفتر کا سربراہ دستخط کرے؛ خزانہ / اکاؤنٹس آفس میں جمع کروائیں۔", "Steps: 1) Choose the form: TR-17 / TR-20 for gazetted, TR-22 / TR-25 for non-gazetted. 2) Fill the bill and the classification form. 3) Head of office signs; submit to the treasury / accounts office.", ["d324", "d321", "d322"]], ["d324", "آسان دفتر,asan daftar,easy daftar,پے بل,ٹی اے بل,سفر خرچ,تنخواہ کا بل,ٹی اے ڈی اے,فارم,form,کون سا فارم,کون سے فارم", "پے بل / ٹی اے بل کے لیے کون سے فارم لگتے ہیں؟", "Which forms are needed for: Pay bill / TA bill?", "فارم: پے بل — گزیٹڈ (ٹی آر 17)، پے بل — نان گزیٹڈ (ٹی آر 22)، ٹی اے بل — گزیٹڈ (ٹی آر 20)، ٹی اے بل — نان گزیٹڈ (ٹی آر 25)، جی ایف آر-3 (درجہ بندی)۔ \"فارم\" صفحے میں ہر فارم کا سرکاری لنک موجود ہے۔", "Forms: Pay bill — Gazetted (TR-17), Pay bill — Non-gazetted (TR-22), TA bill — Gazetted (TR-20), TA bill — Non-gazetted (TR-25), GFR-3 (classification). The Forms page has the official link of each form.", ["d321", "d322", "d323"]], ["d400", "آسان دفتر,asan daftar,easy daftar,gpf advance (ag balochistan)", "جی پی فنڈ ایڈوانس (اے جی بلوچستان) کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: GPF advance (AG Balochistan)?", "جی پی فنڈ ایڈوانس (اے جی بلوچستان) کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/GPF-advance.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: جی پی فنڈ ایڈوانس — قابلِ واپسی، جی پی فنڈ ایڈوانس — ناقابلِ واپسی۔", "Form: GPF advance (AG Balochistan) — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/GPF-advance.pdf. In the software open the Forms page and press \"Official\". Used in: GPF advance — refundable, GPF advance — non-refundable.", ["d202", "d212", "d505"]], ["d401", "آسان دفتر,asan daftar,easy daftar,gpf advance — class iv", "جی پی فنڈ ایڈوانس — کلاس فور کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: GPF advance — Class IV?", "جی پی فنڈ ایڈوانس — کلاس فور کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/GPF-class-IV.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔", "Form: GPF advance — Class IV — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/GPF-class-IV.pdf. In the software open the Forms page and press \"Official\".", ["d505", "d500", "d243"]], ["d402", "آسان دفتر,asan daftar,easy daftar,gpf final payment (ag balochistan)", "جی پی فنڈ فائنل ادائیگی (اے جی بلوچستان) کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: GPF final payment (AG Balochistan)?", "جی پی فنڈ فائنل ادائیگی (اے جی بلوچستان) کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/GPF-Final-Payment.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: جی پی فنڈ فائنل ادائیگی (ریٹائرمنٹ)، ریٹائرمنٹ — مکمل رہنمائی۔", "Form: GPF final payment (AG Balochistan) — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/GPF-Final-Payment.pdf. In the software open the Forms page and press \"Official\". Used in: GPF final payment (retirement), Retirement — complete plan.", ["d222", "d242", "d505"]], ["d403", "آسان دفتر,asan daftar,easy daftar,gpf of deceased employee", "فوت شدہ ملازم کا جی پی فنڈ کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: GPF of deceased employee?", "فوت شدہ ملازم کا جی پی فنڈ کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/GPF-for-deceased.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: فوت شدہ ملازم کا جی پی فنڈ۔", "Form: GPF of deceased employee — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/GPF-for-deceased.pdf. In the software open the Forms page and press \"Official\". Used in: GPF of a deceased employee.", ["d232", "d505", "d500"]], ["d404", "آسان دفتر,asan daftar,easy daftar,gpf final payment (agpr)", "جی پی فنڈ فائنل ادائیگی (اے جی پی آر) کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: GPF final payment (AGPR)?", "جی پی فنڈ فائنل ادائیگی (اے جی پی آر) کا فارم AGPR کی سائٹ پر ہے۔ لنک: https://agpr.gov.pk/SiteImage/Misc/files/gpfinalpmt(1).pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: جی پی فنڈ فائنل ادائیگی (ریٹائرمنٹ)۔", "Form: GPF final payment (AGPR) — official source AGPR. Link: https://agpr.gov.pk/SiteImage/Misc/files/gpfinalpmt(1).pdf. In the software open the Forms page and press \"Official\". Used in: GPF final payment (retirement).", ["d222", "d505", "d500"]], ["d405", "آسان دفتر,asan daftar,easy daftar,form t.r.58-a (gpf advance bill)", "فارم ٹی آر 58-اے (جی پی فنڈ ایڈوانس بل) کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Form T.R.58-A (GPF advance bill)?", "فارم ٹی آر 58-اے (جی پی فنڈ ایڈوانس بل) کا فارم AGPR کی سائٹ پر ہے۔ لنک: https://agpr.gov.pk/SiteImage/Misc/files/TR-58(1).pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: جی پی فنڈ ایڈوانس — قابلِ واپسی، جی پی فنڈ ایڈوانس — ناقابلِ واپسی، جی پی فنڈ فائنل ادائیگی (ریٹائرمنٹ)، فوت شدہ ملازم کا جی پی فنڈ۔", "Form: Form T.R.58-A (GPF advance bill) — official source AGPR. Link: https://agpr.gov.pk/SiteImage/Misc/files/TR-58(1).pdf. In the software open the Forms page and press \"Official\". Used in: GPF advance — refundable, GPF advance — non-refundable, GPF final payment (retirement), GPF of a deceased employee.", ["d202", "d212", "d222"]], ["d406", "آسان دفتر,asan daftar,easy daftar,pension documents", "پنشن کے کاغذات کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Pension documents?", "پنشن کے کاغذات کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/PENSION-Documents.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: ریٹائرمنٹ — مکمل رہنمائی، پنشن — ریٹائرمنٹ (نیا کیس)۔", "Form: Pension documents — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/PENSION-Documents.pdf. In the software open the Forms page and press \"Official\". Used in: Retirement — complete plan, Pension — retirement (fresh case).", ["d242", "d252", "d505"]], ["d407", "آسان دفتر,asan daftar,easy daftar,pension papers", "پنشن پیپرز کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Pension papers?", "پنشن پیپرز کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/PENSION-PAPERS.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: ریٹائرمنٹ — مکمل رہنمائی، پنشن — ریٹائرمنٹ (نیا کیس)، پنشن — قبل از وقت / ایل پی آر / انویلڈ۔", "Form: Pension papers — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/PENSION-PAPERS.pdf. In the software open the Forms page and press \"Official\". Used in: Retirement — complete plan, Pension — retirement (fresh case), Pension — premature / LPR / invalid.", ["d242", "d252", "d262"]], ["d408", "آسان دفتر,asan daftar,easy daftar,pension application csr-25 (revised 2019),csr-25,revised 2019,csr 25,revised 2019,csr 25,revised 2019", "پنشن درخواست CSR-25 (ترمیم شدہ 2019) کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Pension application CSR-25 (Revised 2019)?", "پنشن درخواست CSR-25 (ترمیم شدہ 2019) کا فارم AGPR کی سائٹ پر ہے۔ لنک: https://agpr.gov.pk/SiteImage/Misc/files/CSR-25(Revised 2019).pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: ریٹائرمنٹ — مکمل رہنمائی، پنشن — ریٹائرمنٹ (نیا کیس)، پنشن — قبل از وقت / ایل پی آر / انویلڈ، فیملی پنشن (دورانِ ملازمت وفات)۔", "Form: Pension application CSR-25 (Revised 2019) — official source AGPR. Link: https://agpr.gov.pk/SiteImage/Misc/files/CSR-25(Revised 2019).pdf. In the software open the Forms page and press \"Official\". Used in: Retirement — complete plan, Pension — retirement (fresh case), Pension — premature / LPR / invalid, Family pension (death in service).", ["d242", "d252", "d262"]], ["d409", "آسان دفتر,asan daftar,easy daftar,list of family members", "خاندان کے افراد کی فہرست کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: List of family members?", "خاندان کے افراد کی فہرست کا فارم AGPR کی سائٹ پر ہے۔ لنک: https://agpr.gov.pk/SiteImage/Misc/files/pension.doc ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: فوت شدہ ملازم کا جی پی فنڈ، ریٹائرمنٹ — مکمل رہنمائی، پنشن — ریٹائرمنٹ (نیا کیس)، پنشن — قبل از وقت / ایل پی آر / انویلڈ، فیملی پنشن (دورانِ ملازمت وفات)۔", "Form: List of family members — official source AGPR. Link: https://agpr.gov.pk/SiteImage/Misc/files/pension.doc. In the software open the Forms page and press \"Official\". Used in: GPF of a deceased employee, Retirement — complete plan, Pension — retirement (fresh case), Pension — premature / LPR / invalid, Family pension (death in service).", ["d232", "d242", "d252"]], ["d410", "آسان دفتر,asan daftar,easy daftar,life certificate", "زندہ ہونے کا سرٹیفکیٹ کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Life certificate?", "زندہ ہونے کا سرٹیفکیٹ کا فارم AGPR کی سائٹ پر ہے۔ لنک: https://agpr.gov.pk/SiteImage/Misc/files/life.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: ریٹائرمنٹ — مکمل رہنمائی، فیملی پنشن (دورانِ ملازمت وفات)۔", "Form: Life certificate — official source AGPR. Link: https://agpr.gov.pk/SiteImage/Misc/files/life.pdf. In the software open the Forms page and press \"Official\". Used in: Retirement — complete plan, Family pension (death in service).", ["d242", "d272", "d505"]], ["d411", "آسان دفتر,asan daftar,easy daftar,nomination form", "نامزدگی کا فارم کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Nomination form?", "نامزدگی کا فارم کا فارم AGPR کی سائٹ پر ہے۔ لنک: https://agpr.gov.pk/SiteImage/Misc/files/nomination.doc ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: ریٹائرمنٹ — مکمل رہنمائی، فیملی پنشن (دورانِ ملازمت وفات)۔", "Form: Nomination form — official source AGPR. Link: https://agpr.gov.pk/SiteImage/Misc/files/nomination.doc. In the software open the Forms page and press \"Official\". Used in: Retirement — complete plan, Family pension (death in service).", ["d242", "d272", "d505"]], ["d412", "آسان دفتر,asan daftar,easy daftar,history of services", "سروس کی تاریخ کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: History of services?", "سروس کی تاریخ کا فارم AGPR کی سائٹ پر ہے۔ لنک: https://agpr.gov.pk/SiteImage/Misc/files/hos(2).doc ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: ریٹائرمنٹ — مکمل رہنمائی، پنشن — ریٹائرمنٹ (نیا کیس)، پنشن — قبل از وقت / ایل پی آر / انویلڈ۔", "Form: History of services — official source AGPR. Link: https://agpr.gov.pk/SiteImage/Misc/files/hos(2).doc. In the software open the Forms page and press \"Official\". Used in: Retirement — complete plan, Pension — retirement (fresh case), Pension — premature / LPR / invalid.", ["d242", "d252", "d262"]], ["d413", "آسان دفتر,asan daftar,easy daftar,benevolent fund", "بینوولنٹ فنڈ کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Benevolent fund?", "بینوولنٹ فنڈ کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/benevolent-fund.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: ریٹائرمنٹ — مکمل رہنمائی۔", "Form: Benevolent fund — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/benevolent-fund.pdf. In the software open the Forms page and press \"Official\". Used in: Retirement — complete plan.", ["d242", "d505", "d500"]], ["d414", "آسان دفتر,asan daftar,easy daftar,gfr-3 (classification),gfr-3,gfr 3,gfr 3", "جی ایف آر-3 (درجہ بندی) کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: GFR-3 (classification)?", "جی ایف آر-3 (درجہ بندی) کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/GFR3.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: جی پی فنڈ ایڈوانس — قابلِ واپسی، جی پی فنڈ ایڈوانس — ناقابلِ واپسی، نئی تقرری — تنخواہ کا تعین، پے بل / ٹی اے بل۔", "Form: GFR-3 (classification) — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/GFR3.pdf. In the software open the Forms page and press \"Official\". Used in: GPF advance — refundable, GPF advance — non-refundable, New appointment — pay fixation, Pay bill / TA bill.", ["d202", "d212", "d312"]], ["d415", "آسان دفتر,asan daftar,easy daftar,pay bill — gazetted (tr-17),tr-17,tr 17,tr 17", "پے بل — گزیٹڈ (ٹی آر 17) کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Pay bill — Gazetted (TR-17)?", "پے بل — گزیٹڈ (ٹی آر 17) کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/Form-TR-17-gaz-paybill.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: پے بل / ٹی اے بل۔", "Form: Pay bill — Gazetted (TR-17) — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/Form-TR-17-gaz-paybill.pdf. In the software open the Forms page and press \"Official\". Used in: Pay bill / TA bill.", ["d322", "d505", "d500"]], ["d416", "آسان دفتر,asan daftar,easy daftar,ta bill — gazetted (tr-20),tr-20,tr 20,tr 20", "ٹی اے بل — گزیٹڈ (ٹی آر 20) کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: TA bill — Gazetted (TR-20)?", "ٹی اے بل — گزیٹڈ (ٹی آر 20) کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/Form-TR-20-gaz-TAbill.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: پے بل / ٹی اے بل۔", "Form: TA bill — Gazetted (TR-20) — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/Form-TR-20-gaz-TAbill.pdf. In the software open the Forms page and press \"Official\". Used in: Pay bill / TA bill.", ["d322", "d505", "d500"]], ["d417", "آسان دفتر,asan daftar,easy daftar,pay bill — non-gazetted (tr-22),tr-22,tr 22,tr 22", "پے بل — نان گزیٹڈ (ٹی آر 22) کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Pay bill — Non-gazetted (TR-22)?", "پے بل — نان گزیٹڈ (ٹی آر 22) کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/FORM-TR22-NG-paybill.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: پے بل / ٹی اے بل۔", "Form: Pay bill — Non-gazetted (TR-22) — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/FORM-TR22-NG-paybill.pdf. In the software open the Forms page and press \"Official\". Used in: Pay bill / TA bill.", ["d322", "d505", "d500"]], ["d418", "آسان دفتر,asan daftar,easy daftar,ta bill — non-gazetted (tr-25),tr-25,tr 25,tr 25", "ٹی اے بل — نان گزیٹڈ (ٹی آر 25) کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: TA bill — Non-gazetted (TR-25)?", "ٹی اے بل — نان گزیٹڈ (ٹی آر 25) کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/FORM-TR-25-NG-TA.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: پے بل / ٹی اے بل۔", "Form: TA bill — Non-gazetted (TR-25) — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/FORM-TR-25-NG-TA.pdf. In the software open the Forms page and press \"Official\". Used in: Pay bill / TA bill.", ["d322", "d505", "d500"]], ["d419", "آسان دفتر,asan daftar,easy daftar,new appointment pay form", "نئی بھرتی کا پے فارم کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: New appointment pay form?", "نئی بھرتی کا پے فارم کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/Pay-form-01-hiring.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: نئی تقرری — تنخواہ کا تعین۔", "Form: New appointment pay form — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/Pay-form-01-hiring.pdf. In the software open the Forms page and press \"Official\". Used in: New appointment — pay fixation.", ["d312", "d505", "d500"]], ["d420", "آسان دفتر,asan daftar,easy daftar,commitment advice", "کمٹمنٹ ایڈوائس کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Commitment advice?", "کمٹمنٹ ایڈوائس کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/commitment-advice.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔", "Form: Commitment advice — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/commitment-advice.pdf. In the software open the Forms page and press \"Official\".", ["d505", "d500", "d243"]], ["d421", "آسان دفتر,asan daftar,easy daftar,leave application", "چھٹی کی درخواست کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Leave application?", "چھٹی کی درخواست کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/leave-application.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: چھٹی کی درخواست۔", "Form: Leave application — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/leave-application.pdf. In the software open the Forms page and press \"Official\". Used in: Leave application.", ["d302", "d505", "d500"]], ["d422", "آسان دفتر,asan daftar,easy daftar,loans and advances", "لون اور ایڈوانس کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Loans and advances?", "لون اور ایڈوانس کا فارم AG Balochistan کی سائٹ پر ہے۔ لنک: https://agb.gov.pk/wp-content/uploads/2018/04/Loansadvances.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: لانگ ٹرم ایڈوانس / قرض۔", "Form: Loans and advances — official source AG Balochistan. Link: https://agb.gov.pk/wp-content/uploads/2018/04/Loansadvances.pdf. In the software open the Forms page and press \"Official\". Used in: Long-term advance / loan.", ["d282", "d505", "d500"]], ["d423", "آسان دفتر,asan daftar,easy daftar,long-term advance proforma", "لانگ ٹرم ایڈوانس پروفارما کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Long-term advance proforma?", "لانگ ٹرم ایڈوانس پروفارما کا فارم AGPR کی سائٹ پر ہے۔ لنک: https://agpr.gov.pk/SiteImage/Misc/files/loanform.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: لانگ ٹرم ایڈوانس / قرض۔", "Form: Long-term advance proforma — official source AGPR. Link: https://agpr.gov.pk/SiteImage/Misc/files/loanform.pdf. In the software open the Forms page and press \"Official\". Used in: Long-term advance / loan.", ["d282", "d505", "d500"]], ["d424", "آسان دفتر,asan daftar,easy daftar,surety bond", "ضمانتی بانڈ کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Surety bond?", "ضمانتی بانڈ کا فارم AGPR کی سائٹ پر ہے۔ لنک: https://agpr.gov.pk/SiteImage/Misc/files/suretybond.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: لانگ ٹرم ایڈوانس / قرض۔", "Form: Surety bond — official source AGPR. Link: https://agpr.gov.pk/SiteImage/Misc/files/suretybond.pdf. In the software open the Forms page and press \"Official\". Used in: Long-term advance / loan.", ["d282", "d505", "d500"]], ["d425", "آسان دفتر,asan daftar,easy daftar,medical reimbursement", "میڈیکل ری ایمبرسمنٹ کہاں سے ملے گا اور کب لگتا ہے؟", "Where do I get the form: Medical reimbursement?", "میڈیکل ری ایمبرسمنٹ کا فارم AGPR کی سائٹ پر ہے۔ لنک: https://agpr.gov.pk/SiteImage/Misc/files/medreimb.pdf ۔ سوفٹ ویئر میں \"فارم\" صفحہ کھولیں اور \"سرکاری\" بٹن دبائیں۔ یہ فارم ان کاموں میں لگتا ہے: میڈیکل ری ایمبرسمنٹ۔", "Form: Medical reimbursement — official source AGPR. Link: https://agpr.gov.pk/SiteImage/Misc/files/medreimb.pdf. In the software open the Forms page and press \"Official\". Used in: Medical reimbursement.", ["d292", "d505", "d500"]], ["d500", "آسان دفتر,asan daftar,easy daftar,پنشن کتنی ملے گی,پنشن کی رقم,پنشن کا حساب,پنشن کتنی بنتی ہے,پنشن کتنی", "پنشن کتنی ملے گی؟", "How much pension will I get?", "سوفٹ ویئر پنشن کی رقم کا حساب نہیں لگاتا۔ رقم سروس کے سالوں اور آخری تنخواہ پر ہوتی ہے اور قواعد بدلتے رہتے ہیں۔ اپنے محکمے کے اکاؤنٹس آفس یا اے جی آفس سے پوچھ لیں۔", "The software does not calculate the pension amount. It depends on years of service and last pay and the rules keep changing. Ask your department accounts office or the AG office.", ["d252", "d253", "d243"]], ["d501", "آسان دفتر,asan daftar,easy daftar,جی پی فنڈ میں کتنے پیسے ہیں,جی پی فنڈ بیلنس,بیلنس کتنا ہے,جی پی فنڈ کا بیلنس کیسے پتا کریں", "میرے جی پی فنڈ میں کتنے پیسے ہیں؟", "How do I know my GPF balance?", "بیلنس آپ کے جی پی فنڈ کی سالانہ سلپ یا دفتر کے اکاؤنٹس سے پتا چلتا ہے۔ سوفٹ ویئر میں ملازم کے ریکارڈ میں بیلنس لکھ دیں تاکہ ایڈوانس کی حد کی جانچ ہو سکے۔", "Your balance is on your yearly GPF slip or with the office accounts. Write it in the employee record so the advance limit can be checked.", ["d202", "d201", "d212"]], ["d502", "آسان دفتر,asan daftar,easy daftar,جی پی فنڈ کیا ہوتا ہے,جی پی فنڈ کیا ہے,provident fund,جنرل پروویڈنٹ فنڈ", "جی پی فنڈ کیا ہوتا ہے؟", "What is GPF?", "جی پی فنڈ (جنرل پروویڈنٹ فنڈ) ملازم کی تنخواہ سے ہر ماہ کٹ کر جمع ہونے والی اس کی اپنی بچت ہے۔ اس میں سے ضرورت پر ایڈوانس مل سکتا ہے اور ریٹائرمنٹ پر باقی رقم ملتی ہے۔", "GPF (General Provident Fund) is the employee's own savings, deducted from salary every month. An advance can be taken from it when needed and the balance is paid at retirement.", ["d201", "d211", "d221"]], ["d503", "آسان دفتر,asan daftar,easy daftar,پنشن اور جی پی فنڈ میں فرق,پنشن جی پی فنڈ فرق,فرق", "پنشن اور جی پی فنڈ میں کیا فرق ہے؟", "What is the difference between pension and GPF?", "جی پی فنڈ آپ کی اپنی جمع شدہ رقم ہے جو ریٹائرمنٹ پر ایک بار ملتی ہے۔ پنشن ریٹائرمنٹ کے بعد ہر ماہ ملنے والی رقم ہے۔ دونوں کے کاغذات الگ الگ ہوتے ہیں۔", "GPF is your own saved money paid once at retirement. Pension is the amount paid every month after retirement. Their papers are separate.", ["d502", "d500", "d501"]], ["d504", "آسان دفتر,asan daftar,easy daftar,کاغذات کہاں جمع کروں,کہاں جمع کروائیں,کس دفتر میں,اے جی آفس,جمع کروانا", "کاغذات کہاں جمع کروانے ہیں؟", "Where do I submit the papers?", "عام طور پر کاغذات پہلے آپ کے اپنے دفتر سے تصدیق ہوتے ہیں، پھر اکاؤنٹس / خزانہ دفتر یا اے جی آفس میں جمع ہوتے ہیں۔ آپ کے محکمے میں جگہ الگ ہو سکتی ہے، اس لیے اپنے دفتر کے اکاؤنٹس سیکشن سے پوچھ لیں۔", "Usually papers are first verified by your own office and then submitted to the accounts / treasury office or the AG office. Your department may differ, so ask your office accounts section.", ["d505", "d242", "d202"]], ["d505", "آسان دفتر,asan daftar,easy daftar,کون سی چیز پہلے کروں,شروع کہاں سے کروں,پہلا کام,کہاں سے شروع", "مجھے کام کہاں سے شروع کرنا ہے؟", "Where do I start?", "پہلے \"ہدایات کی لائبریری\" کھولیں اور اپنے کام کی ہدایت دیکھیں: جی پی فنڈ، ریٹائرمنٹ یا دوسرے کام۔ پھر کاغذات کی چیک لسٹ بنائیں۔", "First open the Guides Library and read the guide for your work: GPF, retirement or other. Then follow its checklist.", ["d243", "d203", "d253"]], ["np01", "نقشہ,نقشے,مکان کا نقشہ,دکان کا نقشہ,فلیٹ,اپارٹمنٹ,ہاؤس پلان,house plan,naqsha,naqsha banwana,نقشہ بنوانا,نقشہ بنانا", "کیا آپ مکان، دکان اور فلیٹ کے نقشے بناتے ہیں؟", "Do you make plans for houses, shops and flats?", "جی ہاں۔ دکان، مکان، فلیٹ اور اپارٹمنٹ کے نقشے خصوصی رعایتی قیمت پر بنائے جاتے ہیں۔ تفصیل اور قیمت کے لیے واٹس ایپ پر رابطہ کریں۔", "Yes. Plans for shops, houses, flats and apartments are made at a special discount price. Contact us on WhatsApp for details and price.", ["np02", "np03", "d01"]], ["np02", "نقشے کی قیمت,نقشہ کتنے کا,نقشے کا ریٹ,نقشہ فیس,نقشے کی فیس,رعایتی قیمت", "نقشے کی قیمت کتنی ہے؟", "How much does a plan cost?", "قیمت اور رعایت کی تفصیل مالک خود بتائیں گے۔ واٹس ایپ پر اپنے پلاٹ کا سائز اور ضرورت لکھ بھیجیں۔", "The owner will tell you the price and the discount. Send your plot size and need on WhatsApp.", ["np01", "np03", "d01"]], ["np03", "نقشہ بنوانے کے لیے کیا دینا ہوگا,نقشے کے لیے معلومات,پلاٹ کا سائز,نقشہ بنوانے کا طریقہ", "نقشہ بنوانے کے لیے کیا معلومات دینی ہوں گی؟", "What information is needed for a plan?", "عام طور پر پلاٹ کی لمبائی چوڑائی، کتنی منزلیں، کتنے کمرے اور ضرورت کی باتیں بتانی ہوتی ہیں۔ یہ سب واٹس ایپ پر لکھ کر بھیج دیں۔", "Usually you tell the plot length and width, number of floors, number of rooms and your needs. Send these on WhatsApp.", ["np01", "np02", "d01"]]]);
const FAQ_NX={"d30": ["d31", "d34", "d36"], "d31": ["d32", "d33", "d36"], "d32": ["d33", "d36", "d37"], "d33": ["d36", "d32", "d38"], "d34": ["d35", "d36", "d37"], "d35": ["d36", "d34", "d37"], "d36": ["d37", "d204", "d38"], "d37": ["d36", "d38", "d203"], "d38": ["d32", "d33", "d36"], "d40": ["d222", "d223", "d243"], "d41": ["d40", "d36", "d37"], "d42": ["d233", "d234", "d45"], "d43": ["d252", "d253", "d254"], "d44": ["d262", "d263", "d253"], "d45": ["d272", "d273", "d42"], "d46": ["d243", "d253", "d223"]};
/* ===== Chat-bot: auto-replies from the live software/function/plan data (no private info) ===== */
const BOT_AL={
lab:['lab','laboratory','لیب','لیبارٹری','ٹیسٹ','test','pathology','patient','مریض','رپورٹ'],
pharmacy:['pharmacy','pharma','medical','medicine','clinic','دوا','فارمیسی','میڈیکل','کلینک','دکان دوا','prescription','پرچی','raqeeb','الرقیب'],
merchant:['merchant','grain','mandi','arhat','farmer','wheat','maund','اناج','آڑھت','آڑھتی','گندم','کسان','من','منڈی','جنس','اجناس','godown','گودام'],
kiryana:['kiryana','kirana','grocery','udhaar','udhar','کریانہ','ادھار','راشن'],
store:['general store','store','shop','جنرل اسٹور','اسٹور','دکان'],
school:['school','academy','student','fee','سکول','اسکول','طلبہ','فیس','حاضری','attendance','college','کالج'],
office:['office','quotation','quote','invoice','آفس','دفتر','کوٹیشن','job','project'],
daftar:['daftar','دفتر','آسان دفتر','gpf','جی پی فنڈ','pension','پنشن','ریٹائرمنٹ','رٹائرمنٹ','ریٹائر','رٹائر','سروس','ملازم','retirement','advance','ایڈوانس','employee forms','سرکاری فارم','govt office','سرکاری دفتر'],
hotel:['hotel','restaurant','room','booking','check-in','checkout','menu','table','kitchen','ہوٹل','ریسٹورنٹ','کمرہ','بکنگ','چیک ان','چیک آؤٹ','مینو','میز','کچن','کھانا']};
const BOT_IN={
greet:['salam','assalam','aoa','hello','hi','hey','سلام','السلام','ہیلو','ہائے'],
thanks:['thanks','thank','shukria','shukriya','jazak','شکریہ','مہربانی','جزاک'],
price:['price','prices','cost','charges','rupees','rs','kitna','kitni','kitne','qeemat','keemat','rate','قیمت','کتنا','کتنی','کتنے','ریٹ','پیسے','روپے','خرچ','پلان','plan','package','پیکج','monthly','yearly','ماہانہ','سالانہ'],
trial:['trial','free','demo','try','test drive','مفت','ٹرائل','آزما','ڈیمو','فری','azmaish','azmana'],
buy:['buy','purchase','order','lena','lene','khareed','خرید','لینا','لینے','چاہیے','چاہئے','chahiye','chahye','activate','payment','pay','ادائیگی','jazzcash','easypaisa','ایزی پیسہ','جاز کیش'],
offline:['offline','online','internet','net','آف لائن','آن لائن','انٹرنیٹ','نیٹ','wifi','بغیر نیٹ'],
device:['mobile','phone','pc','computer','laptop','android','iphone','window','windows','موبائل','کمپیوٹر','لیپ ٹاپ','فون','ونڈوز','اینڈرائیڈ'],
safe:['data','safe','security','backup','secure','hack','محفوظ','ڈیٹا','بیک اپ','سیکیورٹی','ریکارڈ','record','lost','ضائع'],
cashier:['cashier','staff','employee','permission','permissions','user','users','کیشئر','عملہ','اجازت','ملازم','یوزر','اسٹاف'],
support:['support','help','problem','guidance','guide','training','مدد','رہنمائی','سپورٹ','مسئلہ','تربیت','سکھا','سیکھ'],
update:['update','updates','version','upgrade','اپ ڈیٹ','اپڈیٹ','ورژن'],
contact:['contact','whatsapp','number','call','phone number','address','رابطہ','نمبر','واٹس ایپ','کال','پتہ'],
del:['delete','remove','حذف','ڈیلیٹ','مٹا'],
list:['software','softwares','list','features','feature','functions','function','options','سوفٹ ویئر','سوفٹویئر','فنکشن','سہولت','سہولیات','فیچر','اقسام','available'],
lang:['language','urdu','english','زبان','اردو','انگلش'],
multi:['branch','branches','shop','multiple','شاخ','برانچ','کئی دکانیں'],
print:['print','printer','receipt','slip','barcode','پرنٹ','پرنٹر','رسید','پرچی','بار کوڈ'],
arch:['architect','architecture','plan drawing','map','naqsha','نقشہ','آرکیٹیکٹ','3d','elevation']};
const BOT_PRIV=['password','پاس ورڈ','پاسورڈ','otp','income','آمدن','آمدنی','profit of owner','other customer','دوسرے کسٹمر','کسٹمر لسٹ','customer list','owner home','گھر کا پتہ','cnic','شناختی','bank account','اکاؤنٹ نمبر','account number','salary','تنخواہ owner','private','ذاتی'];
const BOT_STOP=new Set('the and for with have has can you your are this that what how much does will from any all not but get use using want need please about software ہے ہیں کیا کے کی کا کو میں سے اور پر بھی یہ وہ آپ ہم مجھے چاہیے kya hai hain aap mujhe ko ka ki ke main mein se aur par bhi'.split(' '));
const botNorm=s=>(s||'').toLowerCase().replace(/[ً-ٰٟ]/g,'').replace(/[يي]/g,'ی').replace(/ك/g,'ک').replace(/رٹائر/g,'ریٹائر').replace(/[ۃة]/g,'ہ').replace(/[^\p{L}\p{N} ]+/gu,' ');
const botHas=(n,w)=>{const x=botNorm(w).trim();if(!x)return false;return /^[a-z0-9 ]+$/.test(x)?new RegExp('(^| )'+x+'( |$)').test(n)||(x.length>4&&n.includes(x)):(x.length<=3?(' '+n+' ').includes(' '+x+' '):n.includes(x))};
function botLang(txt){const ar=(txt.match(/[-ۿ]/g)||[]).length,la=(txt.match(/[a-z]/gi)||[]).length;if(ar>la)return 'ur';
const n=botNorm(txt);const rom='kharidun chalega chalta hisab bhool kaise kya hai hain mujhe chahiye chahye kitna kitni kitne qeemat keemat aap mera meri lena lene khareed salam assalam shukria kaise karna karen karein kaam nahi nahin hamara hamare ka ki ke mein main zaroor bata batao batain'.split(' ');return rom.filter(w=>botHas(n,w)).length>=2?'ur':'en'}
const BL=(en,ur,lg)=>lg==='ur'?ur:en;
const BT=(s,lg)=>{const p=(s||'').split('|');return lg==='ur'?(p[1]||p[0]):p[0]};
const botMoney=n=>'Rs '+Number(n).toLocaleString('en-US');
function botSW(n){let best=null,sc=0;for(const k of Object.keys(BUS)){let c=0;(BOT_AL[k]||[]).forEach(w=>{if(botHas(n,w))c+=w.length>3?2:1});const nm=botNorm(BUS[k].en||BUS[k].n||'');if(nm&&n.includes(nm))c+=3;if(c>sc){sc=c;best=k}}return best}
function botSwName(k,lg){return BUS[k]?(lg==='ur'?BUS[k].ur:BUS[k].en):k}
function botSwDesc(k,lg){const d=BUSD[k];return d?(lg==='ur'?d[1]:d[0].replace(/\|$/,'')):''}
function botFuncs(k,lg){return funcsOf(k).map(g=>`${BT(g.g,lg)}: ${g.items.map(i=>BT(i.t,lg)).join('، ')}`.replace(/، /g,lg==='ur'?'، ':', '))}
function botPlans(lg){return cfgPlans().map(p=>{const nm=lg==='ur'?p.ur:p.en;const bits=[];if(p.buy)bits.push(BL('one-time ','ایک بار قیمت ',lg)+botMoney(p.buy));if(p.month)bits.push(BL('monthly ','ماہانہ ',lg)+botMoney(p.month));if(p.year)bits.push(BL('yearly (advance) ','پورے سال کا (پیشگی) ',lg)+botMoney(p.year));return `• ${nm}\n ${bits.join(' · ')}`}).join('\n')}
function botCustomFaq(n){const f=(ACC&&ACC.owner&&ACC.owner.faq)||(PUB&&PUB.faq)||[];let best=null,sc=0;f.forEach(q=>{const ks=(q.k||'').split(/[,،\n]/).map(s=>s.trim()).filter(Boolean);const c=ks.filter(k=>botHas(n,k)).length;if(c>sc){sc=c;best=q}});return best}
function faqFx(){return (ACC&&ACC.owner&&ACC.owner.fx)||(PUB&&PUB.fx)||{}}
function faqAll(){return FAQ_DEF.concat(faqFnRows())}
function faqEff(){const fx=faqFx();return faqAll().map(r=>{const o=fx[r[0]]||{};return {nx:r[6]||(typeof FAQ_NX!=='undefined'&&FAQ_NX[r[0]])||null,id:r[0],k:o.k!==undefined?o.k:r[1],qu:r[2],qe:r[3],u:o.u!==undefined?o.u:r[4],e:o.e!==undefined?o.e:r[5],off:!!o.off,edited:o.k!==undefined||o.u!==undefined||o.e!==undefined}})}
const FAQ_STOP=new Set('بتائیں بتاؤ بتایں بتادیں کہاں ملے ملتا ملتی کرنا کرنے کرتا کرتی کریں کیسے کیا کون کب the and for with have has can you your are this that what how much does will from any all not but get use using want need please about is do i my me we it to of in on a an be or if so as at by کیا ہے ہیں میں سے کو کی کے کا اور تو بھی یہ وہ کر سکتا سکتے سکتی ہو جائے ہوتا ہوتی ہوتے مجھے آپ ہم میرا میری میرے لیے لئے پر نے ہوں ہوگا ہوگی گا گی گے تھا تھی kya hai hain aap mujhe ko ka ki ke main mein se aur par bhi mera meri'.split(' '));
const faqToks=s=>botNorm(s).split(' ').filter(w=>w.length>=2&&!FAQ_STOP.has(w));
let _fqIdx=null,_fqKey='';
function faqIndex(){const eff=faqEff(),key=JSON.stringify(eff.map(f=>[f.k,f.off]));if(_fqIdx&&_fqKey===key)return _fqIdx;
const rows=eff.map(f=>({f,qu:new Set(faqToks(f.qu)),qe:new Set(faqToks(f.qe)),nu:botNorm(f.qu).trim(),ne:botNorm(f.qe).trim(),tok:new Set(faqToks(f.qu+' '+f.qe+' '+f.k)),ph:(f.k||'').split(/[,،\n]/).map(x=>x.trim()).filter(Boolean)}));
const df={};rows.forEach(r=>r.tok.forEach(w=>df[w]=(df[w]||0)+1));const N=rows.length;_fqIdx={rows,idf:w=>Math.log((N+1)/((df[w]||0)+0.5))};_fqKey=key;return _fqIdx}
function faqScore(r,q,ix,n){let s=0;q.forEach(w=>{if(r.tok.has(w))s+=ix.idf(w)});
const cov=T=>{if(!T.size)return 0;let m=0;q.forEach(w=>{if(T.has(w))m++});return (m/T.size)*(m/q.size)};
s+=5*Math.max(cov(r.qu),cov(r.qe));const nn=n.trim();if(nn&&(nn===r.nu||nn===r.ne))s+=30;return s}
function botFaqMatch(n,swc){const ix=faqIndex(),q=new Set(faqToks(n));if(!q.size)return null;const L=[];
ix.rows.forEach(r=>{if(r.f.off)return;let s=faqScore(r,q,ix,n);r.ph.forEach(k=>{const kk=botNorm(k).trim();if(kk.includes(' ')&&botHas(n,k))s+=2+kk.split(' ').length});
if(swc&&s>0&&r.f.id.startsWith('f_'+swc+'_'))s+=2.5;if(s>0)L.push([s,r])});
if(!L.length)return null;L.sort((a,b)=>b[0]-a[0]);const best=L[0][1],sc=L[0][0],gb=faqGroup(best.f.id);const o=L.find(x=>faqGroup(x[1].f.id)!==gb);const sc2=o?o[0]:0;
let m=0;q.forEach(w=>{if(best.tok.has(w))m++});if(m/q.size<0.5&&sc<30)return null;
const inSw=swc&&(best.f.id.startsWith('f_'+swc+'_')||(swc==='daftar'&&/^[dp]\d/.test(best.f.id)));return ((sc>=6||(q.size<=2&&sc>=3.8))&&sc>=sc2*1.15)||(inSw&&sc>=3.5)?best.f:null}
function botTop(n,swc,N){const ix=faqIndex(),q=new Set(faqToks(n));const sc=[];ix.rows.forEach(r=>{if(r.f.off)return;let s=faqScore(r,q,ix,n);if(swc&&r.f.id.startsWith('f_'+swc+'_'))s+=1.5;if(swc==='daftar'&&/^d\d/.test(r.f.id))s+=1.5;if(s>0)sc.push([s,r.f])});sc.sort((a,b)=>b[0]-a[0]);return sc.slice(0,N||3).map(x=>x[1])}
function botSugg(n,swc,lg){const t3=botTop(n,swc,3);if(!t3.length)return {txt:'',chips:[]};return {txt:'\n\n'+BL('Maybe you want to ask:','شاید آپ یہ پوچھنا چاہتے ہیں:',lg)+'\n'+t3.map(f=>'• '+(lg==='ur'?f.qu:f.qe)).join('\n'),chips:t3.map(f=>'f:'+f.id)}}
function faqGroup(id){let m=/^d(\d+)$/.exec(id);if(m)return 'd'+Math.floor(+m[1]/10);if(id.startsWith('f_'))return id.split('_').slice(0,2).join('_');return id.replace(/\d+$/,'')}
function faqRelated(id){const rows=faqEff().filter(f=>!f.off),me=rows.find(f=>f.id===id);if(!me)return [];
if(me.nx){const o=me.nx.filter(x=>rows.some(f=>f.id===x));if(o.length)return o.slice(0,3)}
const g=faqGroup(id),i=rows.indexOf(me),sib=rows.filter(f=>f.id!==id&&faqGroup(f.id)===g);const out=sib.filter(f=>rows.indexOf(f)>i).concat(sib.filter(f=>rows.indexOf(f)f.id);
if(out.length<3)botTop(botNorm(me.qu+' '+me.k),/^[dp]\d/.test(id)?'daftar':null,8).forEach(f=>{if(f.id!==id&&!out.includes(f.id)&&out.length<3)out.push(f.id)});return out}
function botTail(lg,sw){const w=ownerWA();return '\n\n'+BL('Ask me anything else, or tap a button below.','کچھ اور پوچھنا ہو تو لکھیں یا نیچے کا بٹن دبائیں۔',lg)}
function botReply(text,ctx){ctx=ctx||{};if(ctx.sw==='news')return newsBotReply(text,ctx);const lg=ctx.lg||botLang(text);const n=botNorm(text);const out=(a,extra)=>({text:a,lang:lg,sw:ctx.sw,...(extra||{})});
const cf=botCustomFaq(n);if(cf)return out(cf.a);
const df=botFaqMatch(n,botSW(n)||ctx.sw);if(df)return out((lg==='ur'?df.u:df.e)+(/^d\d/.test(df.id)?'\n\n'+BL('⚠ General guidance only; it may have mistakes and rules change often. Confirm with the concerned office.','⚠ یہ صرف عمومی رہنمائی ہے؛ اس میں کمی کوتاہی ہو سکتی ہے اور قواعد بدلتے رہتے ہیں۔ عمل سے پہلے متعلقہ دفتر سے تصدیق کر لیں۔',lg):'')+botTail(lg),{chips:faqRelated(df.id).map(x=>'f:'+x)});
if(BOT_PRIV.some(w=>botHas(n,w)))return out(BL('Sorry, I can only share information about the software, prices and the free trial. Personal, account or other customers\' details are private. For anything else the owner will reply to you.','معاف کیجیے، میں صرف سوفٹ ویئر، قیمت اور مفت ٹرائل کے بارے میں بتا سکتا ہوں۔ کسی کی ذاتی یا اکاؤنٹ کی معلومات نہیں دی جاتیں۔ باقی بات کا جواب مالک خود دیں گے۔',lg),{fallback:true});
const found={};for(const k in BOT_IN){let c=0;BOT_IN[k].forEach(w=>{if(botHas(n,w))c++});if(c)found[k]=c}
let sw=botSW(n);if(sw)ctx.sw=sw;else sw=ctx.sw;const swNow=botSW(n);
const fnHits=[];const toks=n.split(' ').filter(w=>w.length>=3&&!BOT_STOP.has(w));
if(toks.length){const scope=swNow?[swNow]:Object.keys(BUS);scope.forEach(k=>funcsOf(k).forEach(g=>g.items.forEach(i=>{const tt=botNorm(i.t);if(toks.some(w=>tt.includes(w)))fnHits.push({k,i})})))}
const has=k=>!!found[k];const tail=botTail(lg);
if(has('arch')&&!swNow)return out(BL('📐 We make plans for shops, houses, flats and apartments at a special discount price. Message the owner on WhatsApp with your plot size and need.','📐 دکان، مکان، فلیٹ اور اپارٹمنٹ کے نقشے خصوصی رعایتی قیمت پر بنائے جاتے ہیں۔ پلاٹ کا سائز اور ضرورت واٹس ایپ پر لکھ بھیجیں۔',lg)+tail);
if(has('price')||(has('buy')&&!has('trial')&&false))return out(BL('💰 Our plans:\n','💰 ہماری قیمتیں:\n',lg)+botPlans(lg)+'\n\n'+BL(`🎁 You can try any software FREE for ${TRIAL_DAYS} days first — no payment needed.`,`🎁 پہلے ${TRIAL_DAYS} دن مفت آزمائیں۔ کوئی پیسہ نہیں لگے گا۔`,lg)+tail,{chips:['trial','buy']});
if(has('trial')){const k=sw;return out(BL(`🎁 Yes! ${TRIAL_DAYS}-day FREE trial. All functions are open, works on mobile and PC with one link. No card or payment.\n`,`🎁 جی ہاں! ${TRIAL_DAYS} دن کا مفت ٹرائل ملتا ہے۔ سب سہولتیں کھلی ہوتی ہیں۔ موبائل اور کمپیوٹر دونوں پر چلتا ہے۔ کوئی پیسہ نہیں لگتا۔\nطریقہ: لنک کھولیں، اپنا واٹس ایپ نمبر اور پاس ورڈ لکھیں، پھر اپنا سوفٹ ویئر چنیں۔\n`,lg)+(k?`\n${botSwName(k,lg)}: ${trialUrl(k)}`:'\n'+BL('Tell me which software you want (e.g. Lab, Pharmacy, Grain, Kiryana, School…) or tap one below.','بتائیں آپ کو کون سا سوفٹ ویئر چاہیے (جیسے لیب، فارمیسی، اناج، کریانہ، اسکول) یا نیچے سے چنیں۔',lg))+tail,{chips:k?['buy','price']:['sw']})}
if(has('buy')&&!swNow)return out(BL('🛒 To buy: 1) start the free trial and check everything, 2) choose a plan (see prices), 3) message the owner on WhatsApp'+(ownerWA()?' '+ownerWA():'')+' for payment and activation. Guidance is given at every step and support is for life.','🛒 خریدنے کا طریقہ: 1) پہلے مفت ٹرائل شروع کر کے دیکھ لیں۔ 2) اپنی پسند کی قیمت والا پلان چنیں۔ 3) پیسے بھیجنے اور سوفٹ ویئر چالو کروانے کے لیے ہمیں واٹس ایپ کریں'+(ownerWA()?' '+ownerWA():'')+'۔ ہر قدم پر ہم آپ کی رہنمائی کریں گے اور ہمیشہ مدد ملے گی۔',lg)+tail,{chips:['price','trial']});
if(has('offline'))return out(BL('🌐 Works both ways: OFFLINE on your PC (no internet needed, Rs 10,000 plan) or ONLINE on PC + mobile with the web link. Records can also be saved online with the Online-Records add-on so you can run the business from anywhere. See prices for details.','🌐 دو طرح چلتا ہے: کمپیوٹر پر بغیر انٹرنیٹ کے، یا انٹرنیٹ کے ساتھ موبائل اور کمپیوٹر پر ایک ہی لنک سے۔ ریکارڈ آن لائن بھی محفوظ ہو سکتا ہے، تو آپ کہیں سے بھی اپنا حساب دیکھ سکتے ہیں۔ قیمتیں دیکھنے کے لیے "قیمتیں" دبائیں۔',lg)+tail,{chips:['price']});
if(has('device'))return out(BL('📱💻 One link opens on mobile (Android/iPhone) and on PC (Windows). You can also install it like an app from the browser.','📱💻 ایک ہی لنک موبائل (اینڈرائیڈ اور آئی فون) اور کمپیوٹر (ونڈوز) دونوں پر کھلتا ہے۔ آپ اسے موبائل میں ایپ کی طرح بھی رکھ سکتے ہیں۔',lg)+tail);
if(has('safe'))return out(BL('🔒 Every customer\'s records are completely separate from others. Data is saved on your device and you can download a backup with one click; online record saving is available as an add-on.','🔒 ہر کسٹمر کا ریکارڈ دوسروں سے بالکل الگ رہتا ہے، کوئی دوسرا اسے نہیں دیکھ سکتا۔ ڈیٹا آپ کے فون یا کمپیوٹر میں محفوظ رہتا ہے، اور ایک بٹن سے اس کی کاپی (بیک اپ) بھی نکال سکتے ہیں۔ چاہیں تو ریکارڈ آن لائن بھی محفوظ ہو سکتا ہے۔',lg)+tail);
if(has('cashier'))return out(BL('👥 The admin can create cashiers/staff and tick, function by function (A to Z), what each person is allowed to see or do. Delete is allowed only to the owner unless the owner grants it; staff can send a delete request.','👥 آپ اپنے کیشئر اور عملے کے الگ آئی ڈی بنا سکتے ہیں۔ ہر کام کے سامنے ٹک لگا کر بتا سکتے ہیں کہ کون کیا دیکھ سکتا ہے اور کیا کر سکتا ہے۔ ریکارڈ مٹانے کا اختیار صرف مالک کے پاس ہوتا ہے۔ عملہ اس کے لیے درخواست بھیج سکتا ہے۔',lg)+tail);
if(has('del'))return out(BL('🗑 For safety, delete is owner-only by default. Staff can send a delete request and the owner approves it; cash totals then adjust automatically.','🗑 حفاظت کے لیے ریکارڈ صرف مالک مٹا سکتا ہے۔ عملہ مٹانے کی درخواست بھیجتا ہے، مالک منظور کرے تو مٹتا ہے اور کیش کا حساب خود ٹھیک ہو جاتا ہے۔',lg)+tail);
if(has('support'))return out(BL('🤝 Guidance at every step and lifetime support. Report any problem with the 🆘 button inside the software or on WhatsApp'+(ownerWA()?' '+ownerWA():'')+'.','🤝 ہر قدم پر رہنمائی اور ہمیشہ مدد ملتی ہے۔ کوئی بھی مسئلہ ہو تو سوفٹ ویئر کے اندر 🆘 بٹن دبائیں یا واٹس ایپ'+(ownerWA()?' '+ownerWA():'')+' پر بتائیں۔',lg)+tail);
if(has('update'))return out(BL('🔄 New versions are sent by the owner; you get an alert inside the software and update with one click. Your data stays safe.','🔄 نیا ورژن آنے پر سوفٹ ویئر کے اندر خبر آتی ہے۔ ایک بٹن دبانے سے اپ ڈیٹ ہو جاتا ہے۔ آپ کا ریکارڈ محفوظ رہتا ہے۔',lg)+tail);
if(has('lang'))return out(BL('🌍 Every screen works in Urdu and English — switch with one click.','🌍 پورا سوفٹ ویئر اردو اور انگلش دونوں میں چلتا ہے۔ ایک بٹن سے زبان بدل لیں۔',lg)+tail);
if(has('contact'))return out(ownerWA()?BL('📲 WhatsApp: '+ownerWA(),'📲 واٹس ایپ: '+ownerWA(),lg)+tail:BL('The owner will contact you here shortly.','ہم جلد آپ سے یہیں رابطہ کریں گے۔',lg),{chips:[]});
const swCue=/سوفٹ ?ویئر|سافٹ ?ویئر|سوفٹویئر|software|سہولت|فنکشن|function|feature/i.test(text)||(swNow&&n.includes(botNorm(BUS[swNow].en||BUS[swNow].n||'')))||has('list');
if(swNow&&swCue&&!(fnHits.length&&!has('list'))){const k=swNow;return out(`${BUS[k].i} ${botSwName(k,lg)}\n${botSwDesc(k,lg)}\n\n`+BL('Functions:\n','سہولتیں:\n',lg)+botFuncs(k,lg).map(x=>'• '+x).join('\n')+'\n\n'+BL(`🎁 Free ${TRIAL_DAYS}-day trial: `,`🎁 ${TRIAL_DAYS} دن مفت ٹرائل: `,lg)+trialUrl(k)+botSugg(n,k,lg).txt+tail,{chips:botSugg(n,k,lg).chips})}
if(fnHits.length){const seen=new Set(),rows=[];fnHits.forEach(h=>{const key=h.k+h.i.id;if(!seen.has(key)&&rows.length<8){seen.add(key);rows.push(`• ${BUS[h.k].i} ${botSwName(h.k,lg)} → ${h.i.i||''} ${BT(h.i.t,lg)}`)}});return out(BL('✅ Yes, we have it:\n','✅ جی ہاں، یہ سہولت موجود ہے:\n',lg)+rows.join('\n')+'\n\n'+BL(`Try it free for ${TRIAL_DAYS} days.`,`${TRIAL_DAYS} دن مفت آزما کر دیکھیں۔`,lg)+tail,{chips:['trial','price']})}
if(has('list')||has('greet')){const list=Object.keys(BUS).map(k=>`${BUS[k].i} ${botSwName(k,lg)} — ${botSwDesc(k,lg)}`).join('\n');return out((has('greet')?BL('Assalam o Alaikum! 🌸 ','السلام علیکم! 🌸 ',lg):'')+BL('Naveed Business Softwares has:\n','نوید بزنس سافٹ ویئرز میں یہ سوفٹ ویئر ہیں:\n',lg)+list+'\n\n'+BL('Write the name of your business or software, ask about prices, or tap a button.','اپنے کاروبار کا نام لکھیں، قیمت پوچھیں یا نیچے کا کوئی بٹن دبائیں۔',lg),{chips:['sw','price','trial']})}
if(has('thanks'))return out(BL('You are welcome! 🌸 We are always here to help.','شکریہ! 🌸 ہم آپ کی خدمت کے لیے حاضر ہیں۔',lg));
const sg=botSugg(n,ctx.sw,lg);return out(BL('Thank you for your message. I did not fully understand, so I have passed it to the owner who will reply to you personally. Meanwhile you can ask about software, prices, free trial or how to buy.','آپ کے پیغام کا شکریہ۔ مجھے یہ بات پوری سمجھ نہیں آئی، اس لیے آپ کا پیغام مالک کو بھیج دیا ہے۔ وہ خود آپ کو جواب دیں گے۔ اتنی دیر میں آپ سوفٹ ویئر، قیمت، مفت ٹرائل یا خریدنے کا طریقہ پوچھ سکتے ہیں۔',lg)+sg.txt,{fallback:true,chips:sg.chips})}
const BOT_CHIPS={sw:['Which software do I need?|مجھے کون سا سوفٹ ویئر چاہیے؟','which software do you have'],price:['What are the prices?|قیمتیں کیا ہیں؟','prices قیمت'],trial:['Start a free trial|مفت ٹرائل شروع کریں','free trial مفت ٹرائل'],buy:['How do I buy?|کیسے خریدیں؟','how to buy کیسے خریدیں'],support:['Help & support|مدد اور سپورٹ','support سپورٹ'],offline:['Does it work offline?|کیا آف لائن چلتا ہے؟','does it work offline آف لائن'],safe:['Is my data safe?|کیا ڈیٹا محفوظ ہے؟','is my data safe ڈیٹا محفوظ'],cashier:['Can I add cashiers?|کیا کیشئر بنا سکتے ہیں؟','cashier کیشئر']};
const chipOk=c=>BOT_CHIPS[c]||(c.startsWith('f:')&&faqAll().some(r=>r[0]===c.slice(2)));
const chips3=ids=>{const out=[];(ids||[]).forEach(c=>{if(chipOk(c)&&!out.includes(c))out.push(c)});['sw','f:d30','f:np01','price','trial','buy'].forEach(c=>{if(out.length<3&&!out.includes(c)&&chipOk(c))out.push(c)});return out.slice(0,3)};
const chipTxt=(c,lg)=>{if(c.startsWith('f:')){const r=faqAll().find(r=>r[0]===c.slice(2));return lg==='ur'?r[2]:r[3]}return BT(BOT_CHIPS[c][0],lg)};
const chipRow=(fn,ids)=>`
${chips3(ids).map(c=>``).join('')}
`;
/* ---------- public chat (new customers, from ad links ?chat or ?chat=lab) ---------- */
const visitorId=()=>{try{let v=localStorage.getItem('shp_vid');if(!v){v='v'+uid();localStorage.setItem('shp_vid',v)}return v}catch(e){return 'v_tmp'}};
async function pchatAll(){return (await KV.get('pchat'))||{}}
async function pchatPush(vid,from,text,extra){const all=await pchatAll();const th=all[vid]=all[vid]||{vid,name:'',phone:'',sw:'',msgs:[],created:Date.now()};const m={id:'p'+uid(),from,text,ts:Date.now(),...(extra||{})};th.msgs.push(m);th.last=m.ts;if(from==='visitor')th.unread=true;await KV.set('pchat',all);await outbox('pchat',{vid,msg:m,name:th.name,phone:th.phone,sw:th.sw});return th}
async function pchatSend(txt,lgx){const el=$('#pc_t');const x=(txt||(el&&el.value)||'').trim();if(!x)return;if(el)el.value='';const vid=visitorId();const all=await pchatAll();const th=all[vid]||{};
await pchatPush(vid,'visitor',chipLabel(x));
const first=!(th.msgs||[]).some(m=>m.from==='bot');const ctx={sw:th.sw||PCHAT_SW,lg:(txt&&lgx)||''};const r=botReply(x,ctx);
const a2=await pchatAll();const t2=a2[vid];if(ctx.sw)t2.sw=ctx.sw;if(ctx.fb)t2.fb=true;await KV.set('pchat',a2);
await pchatPush(vid,'bot',(first&&ctx.sw!=='news'?welcomeMsg(null)+'\n\n':'')+r.text,{auto:1,chips:r.chips,fallback:r.fallback});pchatDraw()}
let PCHAT_SW='';
async function pchatPoll(){if(!$('#pc_box')||!online())return;const vid=visitorId();const d=await fsGet('pchat/'+vid,false);if(!d||!d.j)return;let j;try{j=JSON.parse(d.j)}catch(e){return}const all=await pchatAll();const th=all[vid];if(!th)return;const ids=new Set(th.msgs.map(x=>x.id));let n=0;(j.msgs||[]).forEach(x=>{if(!ids.has(x.id)&&x.from==='owner'){th.msgs.push(x);n++}});if(n){th.msgs.sort((a,b)=>a.ts-b.ts);await KV.set('pchat',all);pchatDraw()}}
async function pchatDraw(){const box=$('#pc_box');if(!box)return;const all=await pchatAll();const th=all[visitorId()];const ms=(th&&th.msgs)||[];const lastBot=[...ms].reverse().find(m=>m.from!=='visitor');
box.innerHTML=(ms.length?ms.map(c=>`
${t('Ask anything about our software, prices or the free trial — you get an instant reply.|ہمارے سوفٹ ویئر، قیمتوں یا مفت ٹرائل کے بارے میں کچھ بھی پوچھیں — فوری جواب ملے گا۔')}
`})});
rows.sort((a,b)=>b.ts-a.ts);
hm({title:'💬 '+t('Chats & leads|چیٹس اور لیڈز'),wide:true,body:(rows.length?rows.map(r=>r.html).join(''):`
${t('No chats yet. Put the chat links in your ads — visitors get instant auto replies and you see everything here.|ابھی کوئی چیٹ نہیں۔ اپنے ایڈ میں چیٹ لنک لگائیں — وزیٹر کو فوری آٹو جواب ملے گا اور سب کچھ آپ یہاں دیکھیں گے۔')}
`)+`${t('Ad / bio links (open the auto-reply chat)|ایڈ / بائیو لنکس (آٹو ریپلائی چیٹ کھولتے ہیں)')}`+['',...Object.keys(BUS)].map(k=>{const u=baseUrl()+'?chat'+(k?'='+k:'')+(ownerWA()?'&w='+normWA(ownerWA()):'');return `
${t('The bot answers from your live software list, functions and prices automatically — change a price or a plan and the replies change. It never shares passwords, accounts or customer data.|بوٹ آپ کے سوفٹ ویئر، فنکشنز اور قیمتوں سے خود جواب بناتا ہے — قیمت یا پلان بدلیں تو جواب بھی بدل جاتے ہیں۔ یہ پاس ورڈ، اکاؤنٹ یا کسٹمرز کا ڈیٹا کبھی نہیں بتاتا۔')}
💬 ${t('Ready-made questions & answers|تیار شدہ سوال و جواب')} (${faqList().length})
${t('The bot answers these automatically. Search, press ✏ to edit the keywords or the Urdu / English answer, or switch one off. Changes save online by themselves.|بوٹ یہ جواب خود دیتا ہے۔ تلاش کریں، ✏ دبا کر کلیدی الفاظ یا اردو / انگلش جواب بدلیں، یا کسی کو بند کریں۔ تبدیلی خود آن لائن محفوظ ہو جاتی ہے۔')}
${faqRows()}
🧪 ${t('Test the bot|بوٹ کو آزمائیں')}${t('Your own questions & answers|آپ کے اپنے سوال و جواب')}${f}
`})}
async function faqAdd(){const k=$('#bs_k').value.trim(),a=$('#bs_a').value.trim();if(!k||!a)return;ACC.owner.faq=(ACC.owner.faq||[]);ACC.owner.faq.push({k,a});await accSave();botSettings()}
async function faqDel(i){ACC.owner.faq.splice(i,1);await accSave();botSettings()}
/* ---------- welcome bubble: opens by itself when a visitor opens the link ---------- */
function welcomeBubble(){if(SCR!=='login'||$('#wbub')||$('.modal,#hmodal'))return;try{const l=+localStorage.getItem('shp_wb')||0;if(Date.now()-l<6*3600*1000)return}catch(e){}
const d=document.createElement('div');d.id='wbub';
d.innerHTML=`
${t('Naveed Business Softwares|نوید بزنس سافٹ ویئرز')}
${t('Assalam o Alaikum! 🌸 Welcome. What do you need?|السلام علیکم! 🌸 خوش آمدید۔ آپ کو کیا چاہیے؟')}
`;
document.body.appendChild(d)}
function wbubClose(){const e=$('#wbub');if(e)e.remove();try{localStorage.setItem('shp_wb',Date.now())}catch(x){}}
function wbubGo(q){wbubClose();pubChat();setTimeout(()=>pchatSend(q,LANG==='ur'?'ur':'en'),900)}
function cmpFix(){document.querySelectorAll('.cmp textarea').forEach(x=>{if(!x.value)x.style.height=''})}
setInterval(cmpFix,700);
function chipLabel(x){const c=Object.values(BOT_CHIPS).find(v=>v[1]===x);return c?t(c[0]):x}
/* ---------- ready-made Q&A: list, search, edit (saved online with the owner account) ---------- */
let FAQ_Q='';
function faqList(){const q=botNorm(FAQ_Q).trim();return faqEff().filter(f=>!q||botNorm(f.qu+' '+f.qe+' '+f.k+' '+f.u+' '+f.e).includes(q))}
function faqRows(){return faqList().map(f=>`
'}
function faqSearch(v){FAQ_Q=v;$('#fq_list').innerHTML=faqRows();$('#fq_n').textContent=faqList().length}
function faqTry(){const x=($('#fq_t').value||'').trim();if(!x)return;$('#fq_r').textContent=botReply(x,{}).text}
function faqEdit(id){const f=faqEff().find(x=>x.id===id);if(!f)return;
hm({title:'✏ '+esc(LANG==='ur'?f.qu:f.qe),body:`
${esc(f.qu)} ${esc(f.qe)}
`,
foot:``})}
async function faqSave(id){const r=faqAll().find(x=>x[0]===id),o={};const k=$('#fe_k').value.trim(),u=$('#fe_u').value.trim(),e=$('#fe_e').value.trim();if(k!==r[1])o.k=k;if(u!==r[4])o.u=u;if(e!==r[5])o.e=e;if(!$('#fe_on').checked)o.off=1;
ACC.owner.fx=ACC.owner.fx||{};if(Object.keys(o).length)ACC.owner.fx[id]=o;else delete ACC.owner.fx[id];await accSave();closeAll();botSettings();toast('✓','ok')}
async function faqReset(id){if(ACC.owner.fx)delete ACC.owner.fx[id];await accSave();closeAll();botSettings()}
/* ===== Firebase cloud layer (plain REST — no SDK, works inside the single file) ===== */
const FBCFG={apiKey:'AIzaSyA7NYsiJdNeIaG8ZpgnN4RPGthsy5YaAUw',projectId:'software-hub-pakistan'};
const FB_OWNER_EMAIL='owner@shp-hub.app',FB_DOM='@shp-hub.app';
const CL={o:null,u:null,syncing:{},inboxTs:0,pchatTs:0,last:0,err:'',kick:null,ft:null};
const FSB=()=>`https://firestore.googleapis.com/v1/projects/${FBCFG.projectId}/databases/(default)/documents`;
const hs=s=>{let h=5381;for(let i=0;ik.replace(/\//g,'%2F'),unesc2=k=>k.replace(/%2F/g,'/');
async function fj(url,opt){const c=new AbortController();const to=setTimeout(()=>c.abort(),15000);try{const r=await fetch(url,Object.assign({signal:c.signal},opt));let j=null;try{j=await r.json()}catch(e){}return {ok:r.ok,status:r.status,j}}catch(e){return {ok:false,status:0,j:null,net:true}}finally{clearTimeout(to)}}
const emailOf=(id,ev)=>id+(ev>0?'+'+ev:'')+FB_DOM;
async function authCall(ep,body){return fj('https://identitytoolkit.googleapis.com/v1/accounts:'+ep+'?key='+FBCFG.apiKey,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(body)})}
function mkTok(email,j){return {email,uid:j.localId,idToken:j.idToken,refresh:j.refreshToken,exp:Date.now()+(Math.max(60,+j.expiresIn||3600)-60)*1000}}
async function clSignIn(email,pw){const r=await authCall('signInWithPassword',{email,password:pw,returnSecureToken:true});if(!r.ok)return {err:r.net?'net':((r.j&&r.j.error&&r.j.error.message)||'fail')};return {u:mkTok(email,r.j)}}
async function clSignUp(email,pw){const r=await authCall('signUp',{email,password:pw,returnSecureToken:true});if(!r.ok)return {err:r.net?'net':((r.j&&r.j.error&&r.j.error.message)||'fail')};return {u:mkTok(email,r.j)}}
async function clSave(){try{await KV.set('cloud',{o:CL.o,u:CL.u,inboxTs:CL.inboxTs,pchatTs:CL.pchatTs})}catch(e){}}
async function clLoad(){try{const s=await KV.get('cloud');if(s){CL.o=s.o||null;CL.u=s.u||null;CL.inboxTs=s.inboxTs||0;CL.pchatTs=s.pchatTs||0}}catch(e){}}
async function tokOf(slot){const u=CL[slot];if(!u)return null;if(Date.now()w||((CL.u&&SESS&&SESS.k==='user')?'u':(CL.o?'o':(CL.u?'u':null)));
const online=()=>navigator.onLine!==false;
/* ---- Firestore value codec (we only use strings, ints, bools) ---- */
const enc=o=>{const f={};for(const k in o){const v=o[k];f[k]=typeof v==='number'?{integerValue:String(Math.round(v))}:typeof v==='boolean'?{booleanValue:v}:{stringValue:String(v)}}return f};
const dec=d=>{const o={};const f=(d&&d.fields)||{};for(const k in f){const v=f[k];o[k]=v.stringValue!==undefined?v.stringValue:v.integerValue!==undefined?+v.integerValue:v.booleanValue}return o};
async function fsq(method,path,body,slot,qs){const h={'Content-Type':'application/json'};const s=slot===false?null:pickSlot(slot);if(s){const tk=await tokOf(s);if(tk)h.Authorization='Bearer '+tk}return fj(FSB()+path+(qs||''),{method,headers:h,body:body?JSON.stringify(body):undefined})}
async function fsGet(path,slot){const r=await fsq('GET','/'+path,null,slot);if(r.status===404)return null;return r.ok?dec(r.j):undefined}
async function fsSet(path,obj,o){o=o||{};const r=await fsq('PATCH','/'+path,{fields:enc(obj)},o.slot,o.create?'?currentDocument.exists=false':'');return r.ok?true:(r.status===409||(r.j&&r.j.error&&r.j.error.status==='ALREADY_EXISTS')||r.status===400&&o.create?'exists':false)}
async function fsDel(path,slot){const r=await fsq('DELETE','/'+path,null,slot);return r.ok||r.status===404}
async function fsQuery(parent,coll,after,limit,slot,eq){const where=eq?{fieldFilter:{field:{fieldPath:eq[0]},op:'EQUAL',value:{stringValue:eq[1]}}}:{fieldFilter:{field:{fieldPath:'ts'},op:'GREATER_THAN',value:{integerValue:String(after||0)}}};
const sq={from:[{collectionId:coll}],where};if(!eq){sq.orderBy=[{field:{fieldPath:'ts'},direction:'ASCENDING'}];sq.limit=limit||300}
const r=await fsq('POST',(parent?'/'+parent:'')+':runQuery',{structuredQuery:sq},slot);if(!r.ok||!Array.isArray(r.j))return undefined;
return r.j.filter(x=>x.document).map(x=>Object.assign({id:x.document.name.split('/').pop()},dec(x.document)))}
async function fsCommit(writes,slot){const base=`projects/${FBCFG.projectId}/databases/(default)/documents/`;
for(let i=0;iw.del?{delete:base+w.path}:{update:{name:base+w.path,fields:enc(w.f)}});const r=await fsq('POST',':commit',{writes:part},slot);if(!r.ok)return false}return true}
/* ---------- tenant data sync: every record is its own document ---------- */
const cloudStore=m=>!!(m&&m.type!=='pharmacy'&&m.mode&&(m.mode.store==='online'||m.mode.store==='both'));
function flatten(db){const o={};const c=db.c||{};for(const k in c)for(const r of (c[k]||[]))if(r&&r.id!==undefined)o['c~'+k+'~'+r.id]=JSON.stringify(r);for(const k in (db.cfg||{}))o['g~'+k]=JSON.stringify(db.cfg[k]);for(const k in (db.seq||{}))o['q~'+k]=JSON.stringify(db.seq[k]);return o}
function applyRemote(db,key,j,del){db.c=db.c||{};db.cfg=db.cfg||{};db.seq=db.seq||{};const a=key.indexOf('~'),b=key.indexOf('~',a+1);const ty=key[0];
if(ty==='c'){const c=key.slice(a+1,b),id=key.slice(b+1);const arr=db.c[c]||(db.c[c]=[]);const i=arr.findIndex(x=>String(x.id)===id);if(del){if(i>=0)arr.splice(i,1)}else{const r=JSON.parse(j);if(i>=0)arr[i]=r;else arr.push(r)}}
else if(ty==='g'){const k=key.slice(a+1);if(del)delete db.cfg[k];else db.cfg[k]=JSON.parse(j)}
else if(ty==='q'){const k=key.slice(a+1);if(!del)db.seq[k]=Math.max(+db.seq[k]||0,+JSON.parse(j)||0)}}
function tsync(tid,liveDb){if(CL.syncing[tid])return CL.syncing[tid];const p=_tsync(tid,liveDb).catch(e=>({err:String(e)})).finally(()=>{delete CL.syncing[tid]});CL.syncing[tid]=p;return p}
async function _tsync(tid,liveDb){const m=ACC&&ACC.tenants[tid];const slot=pickSlot();if(!cloudStore(m)||!slot||!online())return {skip:1};
let db=liveDb||(await KV.get('t_'+tid));const had=!!db;if(!db)db={c:{},cfg:{},seq:{}};
const S=(await KV.get('sync_'+tid))||{pulled:0,h:{},ts:{}};let cur=flatten(db),pulled=0,pushed=0,maxTs=S.pulled;
let after=Math.max(0,S.pulled-120000),guard=0;
for(;guard<60;guard++){const r=await fsQuery('tenants/'+tid,'rec',after,300,slot);if(r===undefined){CL.err='pull';return {err:'pull'}}
for(const d of r){const key=unesc2(d.id),ts=d.ts||0;if(ts>maxTs)maxTs=ts;if(key[0]==='@')continue;if(S.ts[key]&&S.ts[key]>=ts)continue;S.ts[key]=ts;
const here=cur[key]!==undefined,dirty=here&&hs(cur[key])!==S.h[key],delLocal=!here&&S.h[key]!==undefined;
if(dirty||delLocal)continue;
applyRemote(db,key,d.j,!!d.del);pulled++;if(d.del){delete S.h[key];delete cur[key]}else{cur[key]=d.j;S.h[key]=hs(d.j)}}
if(r.length<300)break;after=r[r.length-1].ts}
S.pulled=maxTs;cur=flatten(db);const writes=[],marks=[];const base=Date.now();let n=0;
for(const key in cur){if(hs(cur[key])!==S.h[key]&&cur[key].length<900000){const ts=base+(n++);writes.push({path:`tenants/${tid}/rec/${esc2(key)}`,f:{j:cur[key],ts,del:false}});marks.push([key,hs(cur[key]),ts])}}
for(const key in S.h)if(cur[key]===undefined){const ts=base+(n++);writes.push({path:`tenants/${tid}/rec/${esc2(key)}`,f:{j:'',ts,del:true}});marks.push([key,null,ts])}
if(writes.length){const ok=await fsCommit(writes,slot);if(!ok){CL.err='push';await KV.set('sync_'+tid,S);return {err:'push',pulled}}
marks.forEach(([k,h,ts])=>{if(h===null)delete S.h[k];else S.h[k]=h;S.ts[k]=ts});pushed=writes.length}
if(pulled&&(!liveDb||true))await KV.set('t_'+tid,db);else if(!had&&pushed)await KV.set('t_'+tid,db);
await KV.set('sync_'+tid,S);CL.last=Date.now();CL.err='';cloudPill();return {pulled,pushed}}
function cloudPill(){const e=$('#savePill');const m=HUB.ctx&&HUB.ctx.meta;if(!e||!m||!cloudStore(m))return;
e.textContent=CL.err?'☁ '+t('Waiting — will sync|انتظار — خود سنک ہوگا'):CL.last?'☁ '+t('Saved online|آن لائن محفوظ')+' '+new Date(CL.last).toLocaleTimeString([], {hour:'2-digit',minute:'2-digit'}):'☁ '+t('Connecting…|جڑ رہا ہے…')}
let _flT=null;function cloudAfterFlush(){const c=HUB.ctx;if(!c||!cloudStore(c.meta))return;clearTimeout(_flT);_flT=setTimeout(()=>{const c2=HUB.ctx;if(c2&&HUB.tdb)tsync(c2.tid,HUB.tdb)},5000)}
async function cloudBeforeMount(tid){const m=ACC.tenants[tid];if(!m||!CL.u&&!CL.o)return;await cloudRefreshMeta(tid);if(cloudStore(m)&&online())await Promise.race([tsync(tid,null),new Promise(r=>setTimeout(r,9000))])}
/* ---------- customer: keep tenant details / staff in step with the owner ---------- */
async function cloudRefreshMeta(tid){const slot=pickSlot();if(!slot||!online()||!ACC)return false;const d=await fsGet('tenants/'+tid,slot);if(!d||!d.j)return false;let meta;try{meta=JSON.parse(d.j)}catch(e){return false}
const old=ACC.tenants[tid]||{};const keep={own:old.own,trial:old.trial};const chg=['status','expiry','plan','ver','offer','mode','delOK','features'].some(k=>JSON.stringify(old[k])!==JSON.stringify(meta[k]));
ACC.tenants[tid]=Object.assign(old,meta,keep.own?{own:true}:{});await accSave();
const me=SESS&&SESS.uid&&ACC.users[SESS.uid];if(me&&me.role==='admin'){const us=await fsQuery('','users',0,0,slot,['tid',tid]);if(us){for(const x of us){let j;try{j=JSON.parse(x.j)}catch(e){continue}const o=ACC.users[j.uid];if(o)Object.assign(o,j,{salt:o.salt,hash:o.hash,fuid:x.id});else ACC.users[j.uid]=Object.assign(j,{salt:'x',hash:'',fuid:x.id})}await accSave()}}
return chg}
/* ---------- accounts: Firebase user per hub user (email = id@shp-hub.app) ---------- */
const userDoc=u=>({j:JSON.stringify({uid:u.uid,id:u.id,name:u.name,tid:u.tid,role:u.role,perms:u.perms||{},status:u.status,created:u.created,ev:u.ev||0}),tid:u.tid,role:u.role,ts:Date.now()});
async function cloudMkUser(u,pw,reset){const slot=pickSlot();if(!slot||!online())return {err:'net'};let ev=reset?(u.ev||0)+1:(u.ev||0),r=null,tries=0;
do{r=await clSignUp(emailOf(u.id,ev),pw);if(r.u)break;if(r.err==='EMAIL_EXISTS'){ev++;tries++}else return {err:r.err}}while(tries<6);if(!r||!r.u)return {err:'EMAIL_EXISTS'};
const idd={ev,tid:u.tid,ts:Date.now()};let ok=await fsSet('ids/'+u.id,idd,{create:!reset&&!u.fuid,slot});if(ok==='exists')return {err:'ID_TAKEN'};if(!ok)return {err:'ids'};
const old=u.fuid;u.fuid=r.u.uid;u.ev=ev;ok=await fsSet('users/'+u.fuid,userDoc(u),{slot});if(!ok){u.fuid=old;return {err:'users'}}
if(old&&old!==u.fuid)await fsDel('users/'+old,slot);return {ok:1}}
async function cloudNewUser(u,pw,reset){if(!CL.o&&!CL.u)return true;const r=await cloudMkUser(u,pw,reset);if(r.err){if(r.err==='ID_TAKEN')toast(t('This ID is already taken online — choose another|یہ آئی ڈی آن لائن پہلے سے لی ہوئی ہے — دوسری چنیں'),'err');else toast(t('Saved on this device only — online account will be created when internet is available|صرف اس ڈیوائس پر محفوظ — انٹرنیٹ ملنے پر آن لائن اکاؤنٹ بنے گا'),'err');u.pend=1;return false}delete u.pend;return true}
async function cloudChangePw(id,ev,oldPw,newPw,owner){if(!online())return false;const s=await clSignIn(owner?FB_OWNER_EMAIL:emailOf(id,ev||0),oldPw);if(!s.u)return false;const r=await authCall('update',{idToken:s.u.idToken,password:newPw,returnSecureToken:true});return r.ok}
async function cloudLogin(id,pw){if(!online()||!ACC&&false)return null;const idd=await fsGet('ids/'+id,false);if(!idd)return null;
const r=await clSignIn(emailOf(id,idd.ev||0),pw);if(!r.u)return r.err==='net'?null:{err:t('Wrong ID or password|آئی ڈی یا پاس ورڈ غلط ہے')};
CL.u=r.u;await clSave();const ud=await fsGet('users/'+r.u.uid,'u');if(!ud||!ud.j)return {err:t('Account not found|اکاؤنٹ نہیں ملا')};let uj;try{uj=JSON.parse(ud.j)}catch(e){return null}
const md=await fsGet('tenants/'+ud.tid,'u');if(!md||!md.j)return {err:t('Customer record not found|کسٹمر ریکارڈ نہیں ملا')};const meta=JSON.parse(md.j);
if(!ACC)ACC={v:1,owner:{id:'',name:(PUB&&PUB.name)||'Naveed Business Softwares',phone:(PUB&&PUB.wa)||'',salt:'',hash:''},tenants:{},users:{},logs:[],leads:[]};
if(!ACC.owner)ACC.owner={id:'',name:(PUB&&PUB.name)||'Naveed Business Softwares',phone:(PUB&&PUB.wa)||'',salt:'',hash:''};Object.values(ACC.users).forEach(x=>{if(x.id===uj.id&&x.uid!==uj.uid)delete ACC.users[x.uid]});
ACC.tenants[meta.tid]=Object.assign(ACC.tenants[meta.tid]||{},meta);const salt=newSalt();ACC.users[uj.uid]=Object.assign(ACC.users[uj.uid]||{},uj,{salt,hash:await hashPw(pw,salt),fuid:r.u.uid,ev:idd.ev||0});await accSave();return {user:ACC.users[uj.uid]}}
async function cloudSilent(id,pw,owner){if(!online())return;const r=await clSignIn(owner?FB_OWNER_EMAIL:emailOf(id,((ACC.users&&Object.values(ACC.users).find(x=>x.id===id))||{}).ev||0),pw);if(!r.u)return false;if(owner)CL.o=r.u;else CL.u=r.u;await clSave();return true}
/* ---------- owner: push everything to the cloud (tenants, users, settings, public config) ---------- */
let _apT=null;function cloudAccKick(){clearTimeout(_apT);if(!CL.o||!ACC||!ACC.owner||!ACC.owner.id)return;_apT=setTimeout(()=>accPush().catch(()=>{}),3000)}
async function accPush(){if(!CL.o||!online()||!ACC||!ACC.owner||!ACC.owner.id)return false;const S=(await KV.get('sync_acc'))||{h:{}};const now=Date.now();let n=0;const docs={};
const slim=m=>{const x=JSON.parse(JSON.stringify(m));if(JSON.stringify(x).length>900000)delete x.logo;return x};
for(const tid in ACC.tenants){docs['tenants/'+tid]={j:JSON.stringify(slim(ACC.tenants[tid])),tid,ts:now+(n++)}}
for(const u of Object.values(ACC.users))if(u.fuid){docs['users/'+u.fuid]=userDoc(u);docs['users/'+u.fuid].ts=now+(n++)}
docs['acc/main']={j:JSON.stringify({owner:ACC.owner,plans:ACC.plans||null,pay:ACC.pay||null,leads:ACC.leads||[],payments:ACC.payments||[],logs:(ACC.logs||[]).slice(0,100),faq:ACC.owner.faq||[]}),ts:now+(n++)};
docs['cfg/pub']={j:JSON.stringify({name:ownerName(),wa:ownerWA(),plans:allPlans(),pay:cfgPay(),pk:(ACC.owner.keys&&ACC.owner.keys.pub)||null,faq:ACC.owner.faq||[],fx:ACC.owner.fx||{},welcome:ACC.owner.welcome||'',ann:ACC.owner.ann||'',v:now}),ts:now+(n++)};
const writes=[],marks=[];for(const p in docs){const f=docs[p];const h=hs(f.j);if(S.h[p]!==h){writes.push({path:p,f});marks.push([p,h])}}
for(const p in S.h){if(!docs[p]&&(p.startsWith('tenants/')||p.startsWith('users/'))){writes.push({path:p,del:true});marks.push([p,null])}}
if(writes.length){if(!await fsCommit(writes,'o')){CL.err='acc';return false}marks.forEach(([p,h])=>{if(h===null)delete S.h[p];else S.h[p]=h})}
await KV.set('sync_acc',S);return writes.length}
/* ---------- outbox -> cloud (leads, chat, delete requests, public chat) ---------- */
function cloudKick(){clearTimeout(CL.kick);CL.kick=setTimeout(()=>outFlush().catch(()=>{}),1500)}
async function outFlush(){if(!online())return;const q=(await KV.get('outbox'))||[];if(!q.length)return;let left=[];
for(const it of q.slice(0,40)){let ok=false;try{const d=it.data||{};
if(it.type==='payment')ok=true;
else if(it.type==='pchat'){const cur=await fsGet('pchat/'+d.vid,false);if(cur===undefined)ok=false;else{const all=(await KV.get('pchat'))||{};const th=all[d.vid];let thr={vid:d.vid,msgs:[]};if(cur&&cur.j){try{thr=JSON.parse(cur.j)}catch(e){}}
if(th){const ids=new Set((thr.msgs||[]).map(x=>x.id));(th.msgs||[]).forEach(x=>{if(!ids.has(x.id))thr.msgs.push(x)});thr.msgs.sort((a,b)=>a.ts-b.ts);thr.name=th.name||thr.name;thr.phone=th.phone||thr.phone;thr.sw=th.sw||thr.sw}
ok=await fsSet('pchat/'+d.vid,{j:JSON.stringify(thr),ts:Date.now(),vid:d.vid},{slot:false})}}
else if(it.type==='chat'&&d.from==='owner'){ok=await fsSet(`tenants/${d.tid}/chat/${d.id}`,{j:JSON.stringify(d),ts:d.ts||Date.now()},{slot:CL.o?'o':'u'})}
else ok=await fsSet('inbox/'+it.id,{t:it.type,j:JSON.stringify(d),ts:it.ts||Date.now(),tid:(d&&d.tid)||'',from:(SESS&&SESS.uid)||''},{slot:false});
}catch(e){ok=false}if(!ok)left.push(it)}
left=left.concat(q.slice(40));await KV.set('outbox',left);OUTN=left.length;if(left.length&&left.lengthCL.inboxTs)CL.inboxTs=d.ts;
if(d.t==='lead'){const ex=ACC.leads.find(x=>x.id===j.id);if(!ex){ACC.leads.push(j);a++}else if(ex.tid!==j.tid||ex.type!==j.type||ex.status!==j.status){Object.assign(ex,{type:j.type,tid:j.tid,status:j.status});a++}}
else if(d.t==='chat'&&j.tid){const th=chat[j.tid]=chat[j.tid]||[];if(!th.some(x=>x.id===j.id)){th.push(j);c++}}
else if(d.t==='delreq'&&!reqs.some(x=>x.id===j.id)){reqs.push(j);r++}
else if(d.t==='pchat-contact'&&j.vid){const th=pch[j.vid]=pch[j.vid]||{vid:j.vid,msgs:[],created:Date.now()};th.name=j.name||th.name;th.phone=j.phone||th.phone;p++}}
if(a)await accSave();if(c)await KV.set('chat',chat);if(r)await KV.set('reqs',reqs);if(p)await KV.set('pchat',pch);n+=a+c+r;
await fsCommit(ib.map(d=>({path:'inbox/'+d.id,del:true})),'o')}
const pc=await fsQuery('','pchat',CL.pchatTs,200,'o');
if(pc&&pc.length){const pch=await pchatAll();for(const d of pc){let j;try{j=JSON.parse(d.j)}catch(e){continue}if(d.ts>CL.pchatTs)CL.pchatTs=d.ts;const th=pch[d.id]=pch[d.id]||{vid:d.id,msgs:[],created:Date.now()};const ids=new Set(th.msgs.map(x=>x.id));let nw=0;(j.msgs||[]).forEach(x=>{if(!ids.has(x.id)){th.msgs.push(x);if(x.from==='visitor')nw++}});th.msgs.sort((a,b)=>a.ts-b.ts);th.name=j.name||th.name;th.phone=j.phone||th.phone;th.sw=j.sw||th.sw;th.last=th.msgs.length?th.msgs[th.msgs.length-1].ts:th.last;if(nw){th.unread=true;n+=nw}}await KV.set('pchat',pch)}
await clSave();return n}
/* owner reply on a public chat must reach the visitor: push the thread */
async function pchatPushOwner(vid){const all=await pchatAll();const th=all[vid];if(th&&CL.o)await fsSet('pchat/'+vid,{j:JSON.stringify(th),ts:Date.now(),vid},{slot:'o'})}
/* customer: read owner replies */
async function chatPullCust(tid){const slot=pickSlot();if(!slot||!online())return 0;const cur=(await KV.get('chatts_'+tid))||0;const r=await fsQuery('tenants/'+tid,'chat',cur,100,slot);if(!r||!r.length)return 0;
const chat=await chatAll();const th=chat[tid]=chat[tid]||[];let n=0,mx=cur;for(const d of r){let j;try{j=JSON.parse(d.j)}catch(e){continue}if(d.ts>mx)mx=d.ts;if(!th.some(x=>x.id===j.id)){th.push(j);n++}}th.sort((a,b)=>a.ts-b.ts);await KV.set('chat',chat);await KV.set('chatts_'+tid,mx);return n}
/* ---------- online lab reports across devices ---------- */
async function cloudPubRep(rid,R){const slot=pickSlot();if(!slot||!online())return false;return fsSet('reps/'+rid,{j:JSON.stringify(R),ts:Date.now(),tid:String(R.tid||(HUB.ctx&&HUB.ctx.tid)||'')},{slot})}
async function cloudDelRep(rid){const slot=pickSlot();if(!slot||!online())return false;return fsDel('reps/'+rid,slot)}
async function cloudGetRep(rid){if(!online())return null;const d=await fsGet('reps/'+rid,false);if(!d||!d.j)return null;try{return JSON.parse(d.j)}catch(e){return null}}
/* ---------- public config for visitors (prices, owner WhatsApp, FAQ) ---------- */
async function cloudPubCfg(){if(!online())return;const last=await KV.get('pubcfg_ts');if(last&&Date.now()-last<10*60*1000&&PUB)return;const d=await fsGet('cfg/pub',false);if(d&&d.j){try{const j=JSON.parse(d.j);PUB=Object.assign({},PUB||{},j);await KV.set('pubcfg',PUB);await KV.set('pubcfg_ts',Date.now())}catch(e){}}}
/* ---------- owner connect / restore ---------- */
async function ownerConnect(pw){const r=await clSignIn(FB_OWNER_EMAIL,pw);if(!r.u)return {err:r.err};CL.o=r.u;await clSave();
const own=Object.values(ACC.tenants).filter(m=>m.own);own.forEach(m=>{m.mode=m.mode||{run:'both',store:'device'};if(m.type!=='pharmacy')m.mode.store='online'});await accSave();await accPush();return {ok:1}}
async function ownerRestore(pw){const r=await clSignIn(FB_OWNER_EMAIL,pw);if(!r.u)return {err:r.err==='net'?t('No internet|انٹرنیٹ نہیں'):t('Wrong password|پاس ورڈ غلط ہے')};CL.o=r.u;
const a=await fsGet('acc/main','o');if(!a||!a.j)return {err:t('No cloud backup found — connect the cloud from your first device first|کلاؤڈ بیک اپ نہیں ملا — پہلے اپنی پہلی ڈیوائس سے کلاؤڈ جوڑیں')};const A=JSON.parse(a.j);
const salt=newSalt();A.owner.salt=salt;A.owner.hash=await hashPw(pw,salt);
ACC={v:1,owner:A.owner,tenants:{},users:{},logs:A.logs||[],leads:A.leads||[],plans:A.plans||undefined,pay:A.pay||undefined,payments:A.payments||[]};if(!ACC.plans)delete ACC.plans;if(!ACC.pay)delete ACC.pay;
const tn=await fsQuery('','tenants',0,500,'o')||[];tn.forEach(d=>{try{const m=JSON.parse(d.j);ACC.tenants[m.tid]=m}catch(e){}});
const us=await fsQuery('','users',0,500,'o')||[];us.forEach(d=>{try{const j=JSON.parse(d.j);ACC.users[j.uid]=Object.assign(j,{salt:'x',hash:'',fuid:d.id})}catch(e){}});
await accSave();await clSave();return {ok:1,tenants:tn.length,users:us.length}}
/* generate fresh cloud passwords for users that have no online account yet */
async function cloudFixUsers(){if(!CL.o)return [];const out=[];for(const u of Object.values(ACC.users)){if(u.fuid&&!u.pend)continue;const pw=genPw();const ok=await cloudNewUser(u,pw,!!u.fuid);if(ok){u.salt=newSalt();u.hash=await hashPw(pw,u.salt);out.push({id:u.id,pw,tid:u.tid,name:(ACC.tenants[u.tid]||{}).name||''})}}await accSave();await accPush();return out}
/* ---------- background loop ---------- */
async function cloudTick(){if(document.hidden||!online())return;try{
if(CL.o&&SESS&&SESS.k==='owner'){await ownerPull();if(SCR==='owner')renderDash();await accPush()}
const c=HUB.ctx;if(c&&cloudStore(c.meta)){await cloudRefreshMeta(c.tid);await tsync(c.tid,HUB.tdb);if(SESS&&SESS.k==='user')await chatPullCust(c.tid)}
await outFlush()}catch(e){}}
async function cloudInit(){await clLoad();setInterval(cloudTick,60000);let cnt=0;setInterval(()=>{if(HUB.ctx&&cnt++%3===0)cloudTick()},60000);window.addEventListener('online',()=>{cloudKick();cloudTick()});cloudKick();if(!ACC||!ACC.owner||!ACC.owner.id||(SESS&&SESS.k!=='owner'))cloudPubCfg().catch(()=>{})}
/* ---------- owner Cloud panel ---------- */
const FB_RULES=`rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
function isOwner() { return request.auth != null && request.auth.token.email == '${FB_OWNER_EMAIL}'; }
function hasMe() { return request.auth != null && exists(/databases/$(database)/documents/users/$(request.auth.uid)); }
function me() { return get(/databases/$(database)/documents/users/$(request.auth.uid)).data; }
function mine(tid) { return hasMe() && me().tid == tid; }
function isAdminOf(tid) { return mine(tid) && me().role == 'admin'; }
match /users/{u} {
allow get: if isOwner() || (request.auth != null && request.auth.uid == u);
allow list: if isOwner() || (hasMe() && me().role == 'admin' && resource.data.tid == me().tid);
allow create: if isOwner() || (isAdminOf(request.resource.data.tid) && request.resource.data.role == 'staff');
allow update: if isOwner() || (isAdminOf(resource.data.tid) && resource.data.role == 'staff' && request.resource.data.role == 'staff' && request.resource.data.tid == resource.data.tid);
allow delete: if isOwner() || (isAdminOf(resource.data.tid) && resource.data.role == 'staff');
}
match /ids/{i} {
allow get: if true;
allow create: if isOwner() || (hasMe() && me().role == 'admin' && request.resource.data.tid == me().tid);
allow update: if isOwner() || (hasMe() && me().role == 'admin' && resource.data.tid == me().tid && request.resource.data.tid == me().tid);
allow delete: if isOwner();
}
match /tenants/{t} {
allow get: if isOwner() || mine(t);
allow list: if isOwner();
allow write: if isOwner();
match /rec/{r} { allow read, write: if isOwner() || mine(t); }
match /chat/{m} { allow read, create: if isOwner() || mine(t); allow update, delete: if isOwner(); }
}
match /inbox/{i} {
allow create: if request.resource.data.keys().hasOnly(['t','j','ts','tid','from'])
&& request.resource.data.t is string && request.resource.data.t.size() < 40
&& request.resource.data.j is string && request.resource.data.j.size() < 100000
&& request.resource.data.ts is number
&& (!('tid' in request.resource.data) || request.resource.data.tid is string)
&& (!('from' in request.resource.data) || request.resource.data.from is string);
allow read, update, delete: if isOwner();
}
match /pchat/{v} {
allow get: if true;
allow create, update: if request.resource.data.keys().hasOnly(['j','ts','vid'])
&& request.resource.data.vid == v
&& request.resource.data.j is string && request.resource.data.j.size() < 200000
&& request.resource.data.ts is number;
allow list, delete: if isOwner();
}
match /reps/{r} {
allow get: if true;
allow create: if isOwner() || (hasMe() && request.resource.data.tid == me().tid && request.resource.data.j.size() < 300000);
allow update: if isOwner() || (hasMe() && resource.data.tid == me().tid && request.resource.data.tid == me().tid && request.resource.data.j.size() < 300000);
allow delete: if isOwner() || (hasMe() && resource.data.tid == me().tid);
}
match /acc/{d} { allow read, write: if isOwner(); }
match /cfg/{d} { allow get: if true; allow write: if isOwner(); }
}
}
`;
const tenantBytes=async tid=>{try{const d=await KV.get('t_'+tid);return d?JSON.stringify(d).length:0}catch(e){return 0}};
async function cloudPanel(){const miss=Object.values(ACC.users).filter(u=>!u.fuid||u.pend).length;const q=(await KV.get('outbox'))||[];
const rows=[];let tot=0;for(const m of Object.values(ACC.tenants)){if(!cloudStore(m))continue;const b=await tenantBytes(m.tid);tot+=b;rows.push(`
${CL.o?'':`${t('Connect to the cloud|کلاؤڈ سے جوڑیں')}`}
${rows.length?''+rows.join(''):''}
${t('Firestore security rules (paste in Firebase > Firestore > Rules > Publish)|سیکیورٹی رولز (Firebase ← Firestore ← "رولز" میں پیسٹ کر کے "شائع کریں")')}`,
foot:`${CL.o?``:''}`})}
async function cloudDoConnect(){const e=$('#cl_e');e.textContent='…';const r=await ownerConnect($('#cl_pw').value);if(r.err){e.textContent=r.err==='net'?t('No internet|انٹرنیٹ نہیں'):t('Could not sign in — check the password you set for owner@shp-hub.app in Firebase|لاگ اِن نہیں ہوا — Firebase میں owner@shp-hub.app کا پاس ورڈ چیک کریں')+' ('+r.err+')';return}closeAll();toast(t('Cloud connected ✅|کلاؤڈ جڑ گیا ✅'),'ok');cloudPanel()}
async function cloudSyncNow(){toast(t('Syncing…|سنک ہو رہا ہے…'),'ok');await ownerPull();await accPush();for(const m of Object.values(ACC.tenants))if(cloudStore(m)&&m.own)await tsync(m.tid,HUB.ctx&&HUB.ctx.tid===m.tid?HUB.tdb:null);await outFlush();toast(t('Done ✅|ہو گیا ✅'),'ok');closeAll();cloudPanel()}
async function cloudFixUi(){const out=await cloudFixUsers();closeAll();hm({title:'🔑 '+t('New online passwords — send to customers|نئے آن لائن پاس ورڈ — کسٹمرز کو بھیجیں'),wide:true,body:out.length?out.map(o=>`
${esc(o.name)}
${esc(o.id)} / ${esc(o.pw)}
`).join(''):`
${t('Nothing to do|کچھ کرنا نہیں')}
`})}
async function exportOwnerBackup(){const bk={kind:'shp-owner-backup',v:1,ts:Date.now(),acc:ACC};dl('SoftwareHub-owner-backup-'+new Date().toISOString().slice(0,10)+'.json',bk);await KV.set('lastBackup',Date.now())}
function ownerRestoreUi(){hm({title:'👑 '+t('Owner login from the cloud|کلاؤڈ سے اونر لاگ اِن'),body:`
${t('For a new phone or PC: enter your cloud owner password to bring back your whole account.|نئے فون یا پی سی کے لیے: کلاؤڈ اونر پاس ورڈ لکھیں، آپ کا پورا اکاؤنٹ واپس آ جائے گا۔')}
`,foot:``})}
async function ownerRestoreGo(){const e=$('#or_e');e.textContent='…';const r=await ownerRestore($('#or_pw').value);if(r.err){e.textContent=r.err;return}closeAll();SESS={k:'owner'};saveSess();goOwner();toast(t('Account restored ✅|اکاؤنٹ بحال ✅'),'ok')}
async function cloudIdTaken(id){try{if(!online())return false;return !!(await fsGet('ids/'+id,false))}catch(e){return false}}
/* ===== Full backup & restore of EVERY customer (owner only) =====
One file = owner accounts + every customer's records (own ID each) + pharmacy databases.
Last 3 copies are kept inside this browser too; an older one is deleted only after the new one is verified. */
const BK_KEEP=3;
function idbDump(name){return new Promise(res=>{try{const r=indexedDB.open(name);r.onerror=()=>res(null);r.onupgradeneeded=()=>{r.transaction.abort();res(null)};
r.onsuccess=()=>{const d=r.result;const names=[...d.objectStoreNames];if(!names.length){d.close();return res(null)}const out={};let left=names.length;
const tx=d.transaction(names);names.forEach(n=>{const q=tx.objectStore(n).getAll();q.onsuccess=()=>{out[n]=q.result;if(--left===0){d.close();res(out)}};q.onerror=()=>{if(--left===0){d.close();res(out)}}})}}catch(e){res(null)}})}
function idbPut(name,dump){return new Promise(res=>{try{const r=indexedDB.open(name,1);r.onupgradeneeded=()=>{const d=r.result;Object.keys(dump).forEach(n=>{if(!d.objectStoreNames.contains(n))d.createObjectStore(n,{keyPath:(n==='meta'||n==='outbox'||n==='tomb')?'k':'id'})})};
r.onerror=()=>res(false);r.onsuccess=()=>{const d=r.result;const names=Object.keys(dump).filter(n=>d.objectStoreNames.contains(n));if(!names.length){d.close();return res(true)}
const tx=d.transaction(names,'readwrite');names.forEach(n=>{const s=tx.objectStore(n);s.clear();(dump[n]||[]).forEach(x=>{try{s.put(x)}catch(e){}})});tx.oncomplete=()=>{d.close();res(true)};tx.onerror=()=>{d.close();res(false)}}}catch(e){res(false)}})}
async function buildFullBackup(){const bk={kind:'shp-full-backup',v:1,ts:Date.now(),build:HUBBUILD,acc:ACC,tenants:{}};
for(const m of Object.values(ACC.tenants)){const e={type:m.type,name:m.name};const d=await KV.get('t_'+m.tid);if(d)e.data=d;const at=await KV.get('a_'+m.tid);if(at)e.att=at;if(m.type==='pharmacy'){const p=await idbDump('shp_pharm_'+m.tid);if(p)e.pharm=p}bk.tenants[m.tid]=e}
return bk}
const bkCount=b=>Object.values(b.tenants).reduce((n,e)=>n+(e.data?1:0)+(e.pharm?1:0)+(e.att?1:0),0);
async function bkList(){return (await KV.get('bk_list'))||[]}
async function runFullBackup(dlFile){
toast(t('Making backup…|بیک اپ بن رہا ہے…'),'ok');
const bk=await buildFullBackup();const txt=JSON.stringify(bk);
/* verify: file must parse back and hold every customer */
let ok=false;try{const c=JSON.parse(txt);ok=c.kind==='shp-full-backup'&&Object.keys(c.tenants).length===Object.keys(ACC.tenants).length&&bkCount(c)===bkCount(bk)}catch(e){}
if(!ok){toast(t('Backup could not be verified — old copies kept|بیک اپ کی جانچ نہیں ہوئی — پرانی کاپیاں محفوظ ہیں'),'err');return false}
let L=await bkList();L.unshift({ts:bk.ts,n:Object.keys(bk.tenants).length,kb:Math.round(txt.length/1024),txt});
await KV.set('bk_list',L.slice(0,BK_KEEP)); /* older than 3 are dropped only now, after the new one is verified and saved */
await KV.set('lastBackup',bk.ts);
if(dlFile!==false)dl('SoftwareHub-FULL-backup-'+new Date(bk.ts).toISOString().slice(0,10)+'.json',txt);
toast(t('Backup ready ✅|بیک اپ تیار ✅')+' · '+Object.keys(bk.tenants).length+' '+t('customers|کسٹمرز'),'ok');return true}
function bkDue(){return KV.get('lastBackup').then(x=>!x||Date.now()-x>7*864e5)}
async function bkBanner(){try{if(!(await bkDue()))return;const e=document.getElementById('bkBan');if(e)return;const d=document.createElement('div');d.id='bkBan';d.style.cssText='background:#fef3c7;border:1px solid #f59e0b;color:#78350f;padding:8px 12px;margin:8px;border-radius:10px;display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;font-weight:700';
d.innerHTML=`⏰ ${t('Weekly backup is due — keep every customer\'s data safe.|ہفتہ وار بیک اپ کا وقت ہے — سب کسٹمرز کا ڈیٹا محفوظ رکھیں۔')}`;
const host=document.querySelector('#scr-owner')||document.body;host.insertBefore(d,host.firstChild)}catch(e){}}
async function bkModal(auto){const L=await bkList();const last=await KV.get('lastBackup');
hm({title:'💾 '+t('Backup & Restore (all customers)|بیک اپ اور بحالی (تمام کسٹمرز)'),wide:true,body:`
${t('One click makes ONE file with every customer\'s records. Do it once a week and keep the file on a USB or Google Drive. If anything is ever lost or hacked, restore from it — each customer\'s records go back into their own ID.|ایک کلک سے ایک فائل بنتی ہے جس میں ہر کسٹمر کا ریکارڈ ہے۔ ہفتے میں ایک بار بنائیں اور فائل USB یا گوگل ڈرائیو میں رکھیں۔ کچھ ضائع یا ہیک ہو جائے تو اسی سے بحال کریں — ہر کسٹمر کا ریکارڈ اس کی اپنی آئی ڈی میں واپس جاتا ہے۔')}
${t('Copies kept inside the app|ایپ میں محفوظ کاپیاں')}${L.length} / ${BK_KEEP}
${t('The app keeps the last 3 copies; the oldest is removed only after the new one is checked. Files you download are yours — delete old ones from Downloads yourself.|ایپ آخری 3 کاپیاں رکھتی ہے؛ پرانی تب ہٹتی ہے جب نئی کی جانچ ہو جائے۔ ڈاؤن لوڈ ہونے والی فائلیں آپ کی ہیں — پرانی فائلیں ڈاؤن لوڈز سے خود ہٹائیں۔')}
`}
${t('Restore from a file|فائل سے بحالی')}`})}
async function bkSave(i){const L=await bkList();const x=L[i];if(x)dl('SoftwareHub-FULL-backup-'+new Date(x.ts).toISOString().slice(0,10)+'.json',x.txt)}
function bkFilePick(){const i=document.createElement('input');i.type='file';i.accept='.json';i.onchange=async()=>{const f=i.files[0];if(!f)return;try{const j=JSON.parse(await f.text());if(j.kind!=='shp-full-backup'||!j.tenants||typeof j.tenants!=='object'||Array.isArray(j.tenants)||!Object.keys(j.tenants).length)throw 0;bkRestoreUi(j)}catch(e){toast(t('This is not a Naveed Business Softwares full backup file|یہ نوید بزنس سافٹ ویئرز کی مکمل بیک اپ فائل نہیں'),'err')}};i.click()}
async function bkRestorePick(i){const L=await bkList();if(L[i])bkRestoreUi(JSON.parse(L[i].txt))}
function bkRestoreUi(j){window._bkR=j;const ids=Object.keys(j.tenants);
hm({title:'♻ '+t('Restore|بحالی')+' — '+fdt(j.ts),wide:true,body:`
${t('Choose which customers to bring back. Each customer\'s records are put back into their own ID. A safety copy of the current data is made first.|جن کسٹمرز کو واپس لانا ہے چنیں۔ ہر کسٹمر کا ریکارڈ اس کی اپنی آئی ڈی میں واپس جائے گا۔ پہلے موجودہ ڈیٹا کی حفاظتی کاپی بن جاتی ہے۔')}
${ids.map(id=>{const e=j.tenants[id];const m=(j.acc.tenants||{})[id]||{};return ``}).join('')}
`,
foot:``})}
async function bkRestoreGo(){const j=window._bkR;if(!j)return;const sel=[...document.querySelectorAll('.bkc:checked')].map(c=>c.value);if(!sel.length){toast(t('Choose at least one customer|کم از کم ایک کسٹمر چنیں'),'err');return}
for(const id of sel){const e=j.tenants[id];if(!e||typeof e!=='object'||(e.data&&typeof e.data!=='object')||(e.pharm&&typeof e.pharm!=='object')||(e.att&&typeof e.att!=='object')){toast(t('Backup file looks damaged — nothing was changed|بیک اپ فائل خراب لگتی ہے — کچھ نہیں بدلا'),'err');return}}
if(!confirm(t('Replace current records of the chosen customers with the backup?|منتخب کسٹمرز کا موجودہ ریکارڈ بیک اپ سے بدل دیں؟')))return;
await runFullBackup(false); /* safety copy of the current state first */
const withAcc=document.getElementById('bkAcc').checked;
for(const id of sel){const e=j.tenants[id];if(withAcc&&j.acc){const m=j.acc.tenants[id];if(m)ACC.tenants[id]=m;Object.values(j.acc.users||{}).forEach(u=>{if(u.tid===id)ACC.users[u.uid]=u})}
if(e.data)await KV.set('t_'+id,e.data);if(e.att)await KV.set('a_'+id,e.att);if(e.pharm)await idbPut('shp_pharm_'+id,e.pharm)}
await accSave();closeAll();toast(t('Restored ✅ — reloading|بحال ہو گیا ✅ — دوبارہ کھل رہا ہے'),'ok');setTimeout(()=>location.reload(),1200)}
/* ===== STAFF ATTENDANCE — one system in the hub, for EVERY software =====
Own store per customer: KV 'a_'+tid { c:{att,leave,bio}, cfg:{att:{…}}, seq }. Synced online like other data (keys prefixed '@'). */
const AT={db:null,tid:null,face:0,tab:'today',ym:null};
const atCloudOK=m=>!!(m&&m.mode&&(m.mode.store==='online'||m.mode.store==='both'));
async function atLoad(tid){if(AT.tid===tid&&AT.db)return;AT.tid=tid;AT.db=(await KV.get('a_'+tid))||{c:{att:[],leave:[],bio:[]},cfg:{},seq:{}};AT.db.c=AT.db.c||{};['att','leave','bio'].forEach(k=>AT.db.c[k]=AT.db.c[k]||[]);AT.db.cfg=AT.db.cfg||{}}
const atAll=c=>AT.db.c[c]||(AT.db.c[c]=[]);
const atGet=(c,id)=>atAll(c).find(x=>x.id===id);
function atPut(c,r){const a=atAll(c),i=a.findIndex(x=>x.id===r.id);if(i<0)a.push(r);else a[i]=r;return r}
async function atSave(){await KV.set('a_'+AT.tid,AT.db);atSyncSoon()}
const atCfg=()=>Object.assign({on:false,lat:null,lng:null,r:150,inT:'09:00',outT:'17:00',grace:10,off:[0],hol:[],needFace:true},AT.db.cfg.att||{});
const pad2=n=>String(n).padStart(2,'0');
const ymd=d=>{d=new Date(d);return d.getFullYear()+'-'+pad2(d.getMonth()+1)+'-'+pad2(d.getDate())};
const hhmm=ts=>{const d=new Date(ts);return pad2(d.getHours())+':'+pad2(d.getMinutes())};
const mins=s=>{const [h,m]=String(s||'0:0').split(':');return (+h||0)*60+(+m||0)};
const tmin=ts=>{const d=new Date(ts);return d.getHours()*60+d.getMinutes()};
function atMe(){const imp=SESS&&SESS.imp;const u=imp?null:ACC.users[SESS.uid];return {imp,u,admin:imp||(u&&u.role==='admin')}}
const atCan=k=>{const m=atMe();if(m.admin)return true;const p=(m.u&&m.u.perms)||{};if(k==='s')return p._ats!==false;return !!p['_at'+k]};
function atStaff(){return tenantUsers(AT.tid).filter(u=>u.status!=='off'&&(u.role==='staff'||u.role==='admin'))}
/* ---------- sync (same cloud tenant, record keys start with '@') ---------- */
let _atT=null;function atSyncSoon(){clearTimeout(_atT);_atT=setTimeout(()=>atSync().catch(()=>{}),2500)}
async function atSync(){const m=ACC&&ACC.tenants[AT.tid];const slot=pickSlot();if(!atCloudOK(m)||!slot||!online()||!AT.db)return {skip:1};const tid=AT.tid,db=AT.db;
const S=(await KV.get('async_'+tid))||{pulled:0,h:{},ts:{}};let cur=flatten(db),maxTs=S.pulled,after=Math.max(0,S.pulled-120000);
for(let g=0;g<60;g++){const r=await fsQuery('tenants/'+tid,'rec',after,300,slot);if(r===undefined)return {err:'pull'};
for(const d of r){const full=unesc2(d.id),ts=d.ts||0;if(ts>maxTs)maxTs=ts;if(full[0]!=='@')continue;const key=full.slice(1);if(S.ts[key]&&S.ts[key]>=ts)continue;S.ts[key]=ts;
const here=cur[key]!==undefined,dirty=here&&hs(cur[key])!==S.h[key];if(dirty)continue;applyRemote(db,key,d.j,!!d.del);if(d.del){delete S.h[key];delete cur[key]}else{cur[key]=d.j;S.h[key]=hs(d.j)}}
if(r.length<300)break;after=r[r.length-1].ts}
S.pulled=maxTs;cur=flatten(db);const writes=[],marks=[];const base=Date.now();let n=0;
for(const key in cur){if(hs(cur[key])!==S.h[key]&&cur[key].length<900000){const ts=base+(n++);writes.push({path:`tenants/${tid}/rec/${esc2('@'+key)}`,f:{j:cur[key],ts,del:false}});marks.push([key,hs(cur[key]),ts])}}
if(writes.length){if(!(await fsCommit(writes,slot)))return {err:'push'};marks.forEach(([k,h,ts])=>{S.h[k]=h;S.ts[k]=ts})}
await KV.set('async_'+tid,S);await KV.set('a_'+tid,db);return {ok:1}}
/* ---------- geo ---------- */
function atGeo(){return new Promise((res,rej)=>{if(!navigator.geolocation)return rej('nogeo');navigator.geolocation.getCurrentPosition(p=>res({lat:p.coords.latitude,lng:p.coords.longitude,acc:p.coords.accuracy}),e=>rej(e.code===1?'denied':'fail'),{enableHighAccuracy:true,timeout:20000,maximumAge:0})})}
function atDist(a,b,c,d){const R=6371000,rad=x=>x*Math.PI/180,dl=rad(c-a),dn=rad(d-b);const h=Math.sin(dl/2)**2+Math.cos(rad(a))*Math.cos(rad(c))*Math.sin(dn/2)**2;return 2*R*Math.asin(Math.sqrt(h))}
/* ---------- camera + face ---------- */
const FACE_JS='https://cdn.jsdelivr.net/npm/@vladmandic/face-api@1.7.12/dist/face-api.js',FACE_MODELS='https://cdn.jsdelivr.net/npm/@vladmandic/face-api@1.7.12/model';
async function faceLib(){if(AT.face===1)return true;if(AT.face===-1&&Date.now()-(AT.faceT||0)<60000)return false;
try{if(!window.faceapi)await new Promise((ok,no)=>{const s=document.createElement('script');s.src=FACE_JS;s.onload=ok;s.onerror=no;document.head.appendChild(s);setTimeout(no,25000)});
await faceapi.nets.tinyFaceDetector.loadFromUri(FACE_MODELS);await faceapi.nets.faceLandmark68Net.loadFromUri(FACE_MODELS);await faceapi.nets.faceRecognitionNet.loadFromUri(FACE_MODELS);AT.face=1;return true}catch(e){AT.face=-1;AT.faceT=Date.now();return false}}
async function faceDesc(el){const r=await faceapi.detectSingleFace(el,new faceapi.TinyFaceDetectorOptions({inputSize:320,scoreThreshold:0.5})).withFaceLandmarks().withFaceDescriptor();return r?Array.from(r.descriptor):null}
const fdist=(a,b)=>{let s=0;for(let i=0;i{let stream=null;const ov=document.createElement('div');ov.className='hov';ov.style.zIndex=300;
ov.innerHTML=`
${title}
${t('Look straight at the camera|سیدھا کیمرے کی طرف دیکھیں')}
`;
document.body.appendChild(ov);const stop=v=>{try{stream&&stream.getTracks().forEach(x=>x.stop())}catch(e){}ov.remove();res(v)};
$('#camX',ov).onclick=()=>stop(null);
try{stream=await navigator.mediaDevices.getUserMedia({video:{facingMode:'user',width:{ideal:640},height:{ideal:480}},audio:false});const v=$('#camV',ov);v.srcObject=stream;await v.play().catch(()=>{})}catch(e){$('#camM',ov).textContent=t('Camera not allowed — allow the camera in the browser and try again|کیمرہ اجازت نہیں — براؤزر میں کیمرے کی اجازت دے کر دوبارہ کوشش کریں');$('#camOk',ov).disabled=true;return}
$('#camOk',ov).onclick=()=>{const v=$('#camV',ov);if(!v.videoWidth)return;const c=document.createElement('canvas');c.width=v.videoWidth;c.height=v.videoHeight;c.getContext('2d').drawImage(v,0,0);stop(c)}})}
/* ---------- the day calculation ---------- */
function atLeaveOn(uid,day){return atAll('leave').find(l=>l.uid===uid&&l.status==='ok'&&l.kind==='leave'&&l.from<=day&&l.to>=day)}
function atShortOn(uid,day){return atAll('leave').filter(l=>l.uid===uid&&l.status==='ok'&&l.kind==='short'&&l.from===day)}
function atDay(uid,day){const c=atCfg(),rec=atAll('att').find(r=>r.uid===uid&&r.day===day),today=ymd(Date.now());const dow=new Date(day+'T12:00:00').getDay();
const o={day,rec,st:'',late:0,early:0,note:''};
if(day>today){o.st='future';return o}
const lv=atLeaveOn(uid,day);if(lv){o.st='leave';o.note=lv.text||'';return o}
if(!rec&&(c.off.includes(dow)||(c.hol||[]).includes(day))){o.st='off';o.note=(c.hol||[]).includes(day)?t('Holiday|چھٹی'):'';return o}
const sh=atShortOn(uid,day);const inM=mins(c.inT)+num2(c.grace),outM=mins(c.outT);
const cover=(a,b)=>sh.some(s=>mins(s.t1)<=a&&mins(s.t2)>=b);
if(!rec||!rec.inTs){o.st=(day===today&&tmin(Date.now())0?'late':'present';return o}
const num2=v=>parseFloat(v)||0;
const AT_COL={present:'#16a34a',late:'#f59e0b',noout:'#7c3aed',absent:'#dc2626',leave:'#2563eb',short:'#0891b2',off:'#94a3b8',pending:'#cbd5e1',running:'#22c55e',future:'#e2e8f0'};
const AT_LAB={present:'Present|حاضر',late:'Late|لیٹ',noout:'OUT not marked|آؤٹ نہیں لگا',absent:'Absent|غیر حاضر',leave:'Leave|چھٹی',off:'Off day|چھٹی کا دن',pending:'Not yet|ابھی نہیں',running:'On duty|ڈیوٹی پر',future:'—'};
function atMonth(uid,ym){const [y,m]=ym.split('-').map(Number),n=new Date(y,m,0).getDate();const days=[];const S={present:0,late:0,noout:0,absent:0,leave:0,off:0,lateMin:0,earlyMin:0,short:0};
for(let d=1;d<=n;d++){const k=ym+'-'+pad2(d),x=atDay(uid,k);days.push(x);if(S[x.st]!==undefined)S[x.st]++;S.lateMin+=x.late;S.earlyMin+=x.early;S.short+=atShortOn(uid,k).length?1:0}
S.worked=S.present+S.late;S.absTotal=S.absent+S.noout;return {days,S}}
/* ---------- screens ---------- */
function atOpen(){const meta=ACC.tenants[SESS.tid];atLoad(meta.tid).then(()=>{AT.ym=ymd(Date.now()).slice(0,7);AT.tab=atMe().u?'me':(atCan('v')||atCan('m')?'today':'me');
const ov=document.createElement('div');ov.className='hov';ov.id='atOv';ov.innerHTML=`
🕘 ${t('Staff Attendance|اسٹاف حاضری')}
`;document.body.appendChild(ov);atRender();atSync().then(r=>{if(r&&r.ok)atRender()}).catch(()=>{})})}
function atClose(){const o=$('#atOv');if(o)o.remove()}
function atTabs(){const T=[['me',t('My attendance|میری حاضری'),atCan('s')]];if(atCan('v')||atCan('m'))T.unshift(['today',t('Today|آج'),1],['month',t('Month sheet|ماہانہ شیٹ'),1]);T.push(['leave',t('Leaves|چھٹیاں'),1]);if(atCan('m'))T.push(['bio',t('Staff bio-data|اسٹاف بائیو ڈیٹا'),1],['set',t('Settings|سیٹنگز'),1]);
return `
${T.filter(x=>x[2]).map(x=>``).join('')}
`}
function atRender(){const b=$('#atBody');if(!b)return;const c=atCfg();let h=atTabs();
if(!c.on&&AT.tab!=='set'&&AT.tab!=='bio'&&AT.tab!=='leave'&&!(AT.tab==='me'&&atCan('m')))h+=`
⚠ ${atCan('m')?t('Attendance is not switched on yet. Open Settings: set the shop location and times, then switch it on.|حاضری ابھی چالو نہیں۔ سیٹنگز میں دکان کی لوکیشن اور اوقات لکھ کر چالو کریں۔'):t('Attendance is not switched on yet — ask your admin.|حاضری ابھی چالو نہیں — اپنے ایڈمن سے کہیں۔')}
${t('Owner view — attendance is marked by staff on their own phones.|اونر ویو — حاضری عملہ اپنے موبائل سے لگاتا ہے۔')}
`;
const uid=m.u.uid,day=ymd(Date.now()),x=atDay(uid,day),r=x.rec||{},bio=atGet('bio',uid);const c=atCfg();
const btnIn=!r.inTs,btnOut=r.inTs&&!r.outTs;
let h=`
${t('Today|آج')}${chip(x.st)}
${t('IN|اِن')}${r.inTs?hhmm(r.inTs):'—'}
${t('OUT|آؤٹ')}${r.outTs?hhmm(r.outTs):'—'}
${t('Duty time|ڈیوٹی کا وقت')}${c.inT} – ${c.outT}
`;
if(bio&&bio.active===false)h+=`
${t('Your attendance is not active. Ask your admin to activate you.|آپ کی حاضری فعال نہیں۔ ایڈمن سے فعال کروائیں۔')}
`;else if(!bio)h+=`
${t('Your bio-data is not entered yet. Ask your admin to enter it and register your face first.|آپ کا بائیو ڈیٹا ابھی درج نہیں ہوا۔ ایڈمن سے کہیں پہلے بائیو ڈیٹا اور چہرہ درج کرے۔')}
`;
else h+=`
${btnIn?``:''}${btnOut?``:''}${!btnIn&&!btnOut?`
${t('Today is complete ✅|آج کی حاضری مکمل ✅')}
`:''}
${t('IN and OUT are both required, otherwise the day counts as absent.|اِن اور آؤٹ دونوں ضروری ہیں، ورنہ دن غیر حاضر شمار ہوگا۔')}
`;
return h+atMonthTbl(uid,AT.ym,true)}
async function atMark(kind){const m=atMe(),uid=m.u.uid,c=atCfg(),day=ymd(Date.now());if(!c.on){toast(t('Attendance is off|حاضری بند ہے'),'err');return}{const bb=atGet('bio',uid);if(!bb||bb.active===false){toast(t('Not activated yet — ask your admin|ابھی فعال نہیں — ایڈمن سے کہیں'),'err');return}}
if(c.lat===null&&!atExempt()){toast(t('Admin has not saved the shop location yet|ایڈمن نے ابھی دکان کی لوکیشن محفوظ نہیں کی'),'err');return}
toast(t('Finding your location…|آپ کی لوکیشن ڈھونڈ رہے ہیں…'),'ok');let g;try{g=await atGeo()}catch(e){toast(e==='denied'?t('Location not allowed — allow location in the browser|لوکیشن کی اجازت نہیں — براؤزر میں اجازت دیں'):t('Could not get location — go outside/near a window and try again|لوکیشن نہیں ملی — کھلی جگہ یا کھڑکی کے پاس جا کر دوبارہ کوشش کریں'),'err');return}
const d=(c.lat===null)?0:atDist(c.lat,c.lng,g.lat,g.lng);if(!atExempt()&&d>c.r+Math.min(g.acc||0,50)){hm({title:'📍',body:`
${t('You are outside the allowed place. Attendance cannot be marked from here.|آپ مقررہ جگہ سے باہر ہیں۔ یہاں سے حاضری نہیں لگ سکتی۔')}
${t('Distance from shop|دکان سے فاصلہ')}: ${Math.round(d)} m · ${t('Allowed|اجازت')}: ${c.r} m
`});return}
const cv=await atCamera(kind==='in'?t('IN — selfie|اِن — سیلفی'):t('OUT — selfie|آؤٹ — سیلفی'),t('Take photo|تصویر لیں'));if(!cv)return;
let face='skip',dist=null;const bio=atGet('bio',uid);
if(bio&&bio.desc&&bio.desc.length&&c.needFace){toast(t('Checking face…|چہرہ جانچ رہے ہیں…'),'ok');if(await faceLib()){const ds=await faceDesc(cv).catch(()=>null);if(!ds){toast(t('Face not seen clearly — take the photo again|چہرہ صاف نظر نہیں آیا — دوبارہ تصویر لیں'),'err');return}
dist=Math.min(...bio.desc.map(x=>fdist(x,ds)));if(dist>0.55){face='bad';hm({title:'🙂',body:`
${t('Face does not match. Attendance not marked.|چہرہ نہیں ملتا۔ حاضری نہیں لگی۔')}
`});
const rj=atPut('att',{id:uid+'_bad_'+Date.now(),uid,day,bad:1,kind,ts:Date.now(),ph:thumb(cv,140,.5),fd:Math.round(dist*100)/100});await atSave();return}face='ok'}else face='unver'}
const now=Date.now();let rec=atAll('att').find(r=>r.uid===uid&&r.day===day&&!r.bad);
if(kind==='in'){if(rec&&rec.inTs){toast(t('IN already marked|اِن پہلے لگ چکا'),'err');return}rec=rec||{id:uid+'_'+day,uid,day};rec.inTs=now;rec.inLoc=[g.lat,g.lng,Math.round(d)];rec.inPh=thumb(cv,140,.5);rec.inFace=face;rec.inFd=dist===null?null:Math.round(dist*100)/100}
else{if(!rec||!rec.inTs){toast(t('Mark IN first|پہلے اِن لگائیں'),'err');return}if(rec.outTs){toast(t('OUT already marked|آؤٹ پہلے لگ چکا'),'err');return}rec.outTs=now;rec.outLoc=[g.lat,g.lng,Math.round(d)];rec.outPh=thumb(cv,140,.5);rec.outFace=face;rec.outFd=dist===null?null:Math.round(dist*100)/100}
rec.name=m.u.name;atPut('att',rec);await atSave();toast((kind==='in'?t('IN marked ✅|اِن لگ گیا ✅'):t('OUT marked ✅|آؤٹ لگ گیا ✅'))+' '+hhmm(now),'ok');atRender()}
function atCell(x){const col=AT_COL[x.st];return `
`}
function atMonthTbl(uid,ym,detail){const {days,S}=atMonth(uid,ym);
const nav=`
${rows}`}
function atShowImg(id){const l=atGet('leave',id);if(l&&l.ph)hm({title:'📄',body:``})}
function atLeaveForm(){const d=ymd(Date.now());hm({title:'✍ '+t('Leave application|چھٹی کی درخواست'),body:`
`,foot:``})}
function fileToThumb(f,w){return new Promise(res=>{if(!f)return res('');const im=new Image(),u=URL.createObjectURL(f);im.onload=()=>{const c=document.createElement('canvas');c.width=im.width;c.height=im.height;c.getContext('2d').drawImage(im,0,0);res(thumb(c,Math.min(w,im.width),.6));URL.revokeObjectURL(u)};im.onerror=()=>res('');im.src=u})}
async function atLeaveSend(){const m=atMe(),k=$('#lvK').value,text=$('#lvX').value.trim(),ph=await fileToThumb($('#lvP').files[0],900);if(!text&&!ph){toast(t('Write a reason or attach a photo|وجہ لکھیں یا تصویر لگائیں'),'err');return}
const l={id:'lv'+uid(),uid:m.u.uid,name:m.u.name,kind:k,text,ph,status:'wait',ts:Date.now()};if(k==='short'){l.from=$('#lvSd').value;l.t1=$('#lvT1').value;l.t2=$('#lvT2').value}else{l.from=$('#lvF').value;l.to=$('#lvT').value;if(l.tox.id!==id);await atSave();atRender()}
function atShortForm(){const d=ymd(Date.now());hm({title:'⏱ '+t('Short leave|مختصر چھٹی'),body:``,foot:``})}
async function atShortSave(){const u=ACC.users[$('#shU').value];atPut('leave',{id:'lv'+uid(),uid:u.uid,name:u.name,kind:'short',from:$('#shD').value,t1:$('#shA').value,t2:$('#shB').value,text:$('#shX').value.trim(),status:'ok',ts:Date.now(),by:'admin'});await atSave();closeAll();toast('✅','ok');atRender()}
/* ---------- bio-data ---------- */
function atBioHtml(){const rows=atStaff().map(u=>{const b=atGet('bio',u.uid);return `
${b&&b.photo?``:''}
${esc(u.name)} @${esc(u.id)}
${b?`${esc(b.desig||'')} ${b.phone?'· '+esc(b.phone):''} · ${b.desc&&b.desc.length?'✅ '+t('face registered|چہرہ درج'):'⚠ '+t('face not registered|چہرہ درج نہیں')}`:'⚠ '+t('bio-data not entered|بائیو ڈیٹا درج نہیں')}
${t('Step 1: enter each staff member\'s bio-data. Step 2: register the face (3 photos). Attendance works only after bio-data is entered.|پہلا قدم: ہر ملازم کا بائیو ڈیٹا درج کریں۔ دوسرا: چہرہ درج کریں (3 تصاویر)۔ بائیو ڈیٹا کے بعد ہی حاضری لگتی ہے۔')}
${rows||'
—
'}`}
function atBioForm(uidv){const u=ACC.users[uidv],b=atGet('bio',uidv)||{};window._bioDesc=(b.desc||[]).slice();window._bioPhoto=b.photo||'';window._bioLoc=null;
const f=(id,l,v,ty)=>``;
hm({title:'🪪 '+esc(u.name),wide:true,body:`
${f('father',t('Father name|والد کا نام'),b.father)}${f('cnic',t('CNIC|شناختی کارڈ'),b.cnic)}${f('phone',t('Phone|فون'),b.phone,'tel')}${f('desig',t('Designation|عہدہ'),b.desig)}${f('join',t('Joining date|تاریخ شمولیت'),b.join,'date')}${f('addr',t('Address|پتہ'),b.addr)}
${t('Take 3 photos: straight, slightly left, slightly right. Needs internet the first time.|3 تصاویر لیں: سیدھا، ذرا بائیں، ذرا دائیں۔ پہلی بار انٹرنیٹ چاہیے۔')}
${window._bioDesc.length?``:''}
`,foot:``})}
async function atFaceEnroll(){toast(t('Loading face tool…|چہرہ پہچاننے کا ٹول لوڈ ہو رہا ہے…'),'ok');if(!(await faceLib())){toast(t('Could not load the face tool — check internet and try again|ٹول لوڈ نہیں ہوا — انٹرنیٹ دیکھیں اور دوبارہ کوشش کریں'),'err');return}
const ds=[];for(let i=1;i<=3;i++){const cv=await atCamera(t('Face photo|چہرے کی تصویر')+' '+i+'/3',t('Take photo|تصویر لیں'));if(!cv)return;const d=await faceDesc(cv).catch(()=>null);if(!d){toast(t('Face not clear — try again|چہرہ صاف نہیں — دوبارہ|'),'err');i--;continue}ds.push(d);if(i===1)window._bioPhoto=thumb(cv,140,.6)}
window._bioDesc=ds;const e=$('#bioFc');if(e)e.textContent='✅ 3';toast(t('Face registered ✅|چہرہ درج ✅'),'ok')}
window._bioLoc=null;async function atBioLoc(){try{const g=await atGeo();window._bioLoc=[g.lat,g.lng];$('#bi_locT').textContent=g.lat.toFixed(5)+', '+g.lng.toFixed(5)}catch(e){toast(t('Could not get location|لوکیشن نہیں ملی'),'err')}}
async function atBioAct(uidv,on){const b=atGet('bio',uidv);if(!b)return;b.active=on;b.ts=Date.now();await atSave();atRender()}
async function atBioSave(uidv){const pf=$('#bi_ph')&&$('#bi_ph').files[0];if(pf){const th=await fileToThumb(pf,200);if(th)window._bioPhoto=th}const g=id=>($('#bi_'+id)||{}).value||'';const u=ACC.users[uidv];atPut('bio',{id:uidv,name:u.name,father:g('father'),cnic:g('cnic'),phone:g('phone'),desig:g('desig'),join:g('join'),addr:g('addr'),emg:g('emg'),note:g('note'),photo:window._bioPhoto||'',loc:window._bioLoc||(atGet('bio',uidv)||{}).loc||null,active:(atGet('bio',uidv)||{}).active===false?false:true,desc:window._bioDesc||[],ts:Date.now()});await atSave();closeAll();atRender();toast('✅','ok')}
/* ---------- one person detail ---------- */
function atOneHtml(){const u=ACC.users[AT.who];if(!u)return '';const b=atGet('bio',u.uid)||{};return `
${t('Who can do what (view all, approve leave, manage) is set per staff in “Staff & permissions”.|کون کیا کر سکتا ہے (سب کی حاضری دیکھنا، چھٹی منظور کرنا، انتظام) یہ "عملہ اور اجازتیں" میں ہر ملازم کے لیے طے ہوتا ہے۔')}
`}
async function atSetLoc(){toast(t('Finding location…|لوکیشن ڈھونڈ رہے ہیں…'),'ok');try{const g=await atGeo();AT.db.cfg.att=Object.assign(atCfg(),{lat:g.lat,lng:g.lng});await atSave();$('#asLoc').textContent=g.lat.toFixed(5)+', '+g.lng.toFixed(5);toast(t('Saved ✅ (accuracy ±|محفوظ ✅ (درستگی ±')+Math.round(g.acc)+' m)','ok')}catch(e){toast(t('Could not get location|لوکیشن نہیں ملی'),'err')}}
async function atSetSave(){const c=atCfg();AT.db.cfg.att=Object.assign(c,{on:$('#asOn').checked,r:Math.max(20,+$('#asR').value||150),inT:$('#asI').value||'09:00',outT:$('#asO').value||'17:00',grace:Math.max(0,+$('#asG').value||0),off:$$('.asD').filter(x=>x.checked).map(x=>+x.value),hol:$('#asH').value.split(/[\s,]+/).filter(x=>/^\d{4}-\d{2}-\d{2}$/.test(x)),needFace:$('#asF').checked});await atSave();toast('✅','ok');atRender()}
const _atR0=atRender;atRender=function(){if(AT.tab==='one'){const b=$('#atBody');if(b){b.innerHTML=atTabs()+atOneHtml();return}}_atR0()};
/* ---------- works offline: marks are saved on the phone and sent by themselves when the internet is back ---------- */
async function atPending(){if(!AT.db)return 0;const S=(await KV.get('async_'+AT.tid))||{h:{}};const cur=flatten(AT.db);let n=0;for(const k in cur)if(hs(cur[k])!==S.h[k])n++;return n}
async function atPendUi(){const n=await atPending();const e=$('#atPend');if(e)e.innerHTML=n?`⏳ ${t('Waiting to be sent (will go automatically when internet is back)|بھیجنا باقی (انٹرنیٹ آتے ہی خود چلا جائے گا)')}: ${n}`:`☁ ${t('All sent|سب بھیجا جا چکا')}`}
async function atBoot(){try{const m=ACC&&ACC.tenants[SESS.tid];if(!m)return;await atLoad(m.tid);if(!AT._on){AT._on=1;addEventListener('online',()=>{atSync().then(()=>{atPendUi();if($('#atBody'))atRender()}).catch(()=>{})});setInterval(()=>{if(navigator.onLine!==false)atSync().then(()=>atPendUi()).catch(()=>{})},120000)}
if(navigator.onLine!==false){atSync().catch(()=>{});if(atCfg().on&&AT.face!==1)setTimeout(()=>faceLib().catch(()=>{}),4000)}}catch(e){}}
const _atR1=atRender;atRender=function(){_atR1();atPendUi()};
/* ===== STAFF ATTENDANCE v2 (builds on hub-att.js; later declarations replace the older ones) =====
capture flow (location → camera → preview+submit → scan → congratulations), IN/OUT cards with photo+time,
offline/clock check, 40-day photo clean-up, owner reports (today / month / year / CV), salary rules, hotel shifts */
AT.skew=0;AT.skewT=0;AT._idx=null;
const hh12=ts=>{const d=new Date(ts);let h=d.getHours();const m=pad2(d.getMinutes()),ap=h>=12?'PM':'AM';h=h%12||12;return pad2(h)+':'+m+' '+ap};
const dmy=day=>{const p=String(day).split('-');return p.length===3?p[2]+'-'+p[1]+'-'+p[0]:day};
const DOW_L=['Sun|اتوار','Mon|پیر','Tue|منگل','Wed|بدھ','Thu|جمعرات','Fri|جمعہ','Sat|ہفتہ'];
const dowOf=day=>t(DOW_L[new Date(day+'T12:00:00').getDay()]);
const pctS=v=>(Math.round(v*10)/10)+'%';
const atIsHotel=()=>{const m=ACC&&ACC.tenants[AT.tid];return !!(m&&m.type==='hotel')};
function atIdx(){if(AT._idx)return AT._idx;const m=new Map();atAll('att').forEach(r=>{if(!r.bad)m.set(r.uid+'|'+r.day,r)});return AT._idx=m}
const atRecOf=(uid,day)=>atIdx().get(uid+'|'+day);
AT_COL.opt='#cbd5e1';AT_LAB.opt='Optional|اختیاری';AT_COL.pre='#f1f5f9';AT_LAB.pre='Before joining|شمولیت سے پہلے';
function atStart(uid){const b=atGet('bio',uid)||{},c=atCfg();const a=[b.join,b.act||(b.ts?ymd(b.ts):''),c.since].filter(x=>x&&/^\d{4}-\d{2}-\d{2}$/.test(x));return a.length?a.sort().slice(-1)[0]:''}
/* ---------- phone clock check (real time from the server when online) ---------- */
async function atSkew(){if(navigator.onLine===false||Date.now()-AT.skewT<600000)return AT.skew;AT.skewT=Date.now();
try{const t0=Date.now();const r=await fetch('sw.js?x='+t0,{method:'HEAD',cache:'no-store'});const d=r.headers.get('date');if(d){const t1=Date.now();const sk=Date.parse(d)-Math.round((t0+t1)/2);AT.skew=Math.abs(sk)>=90000?sk:0}}catch(e){}return AT.skew}
/* ---------- shifts (hotel / restaurant only) ---------- */
function atShiftOf(uid){const c=atCfg(),b=atGet('bio',uid);const sh=atIsHotel()?(c.shifts||[]).find(s=>s.id===(b&&b.shift)):null;return sh?{name:sh.name,inT:sh.inT,outT:sh.outT}:{name:'',inT:c.inT,outT:c.outT}}
function atWin(uid,day){const s=atShiftOf(uid),[y,m,d]=day.split('-').map(Number),base=new Date(y,m-1,d).getTime(),a=mins(s.inT),b=mins(s.outT);return {st:base+a*60000,en:base+(b<=a?b+1440:b)*60000,s}}
/* ---------- the day calculation (time based: night shifts work too) ---------- */
function atDay(uid,day){const c=atCfg(),rec=atRecOf(uid,day),today=ymd(Date.now()),nowT=Date.now();const dow=new Date(day+'T12:00:00').getDay();
const o={day,rec,st:'',late:0,early:0,note:''};const us=ACC.users[uid];const adm=!!(us&&us.role==='admin');
if(day>today){o.st='future';return o}
if(!rec){const s0=atStart(uid);if(s0&&daysh.some(s=>mins(s.t1)<=a&&mins(s.t2)>=b);
if(!rec||!rec.inTs){if(adm){o.st='opt';return o}o.st=(day===today&&nowT0?'late':'present';return o}
/* ---------- statistics for any range ---------- */
function atStats(uid,from,to){const today=ymd(Date.now());const S={present:0,late:0,noout:0,absent:0,leave:0,off:0,early:0,lateMin:0,earlyMin:0,days:[],workMin:0,workN:0,inSum:0,inN:0,outSum:0,outN:0,flag:0};
const end=new Date(Math.min(new Date(to+'T12:00:00').getTime(),new Date(today+'T12:00:00').getTime()));
for(const d=new Date(from+'T12:00:00');d<=end;d.setDate(d.getDate()+1)){const k=ymd(d),x=atDay(uid,k);S.days.push(x);
if(x.st==='running'){if(x.late>0)S.late++;else S.present++}else if(typeof S[x.st]==='number')S[x.st]++;
S.lateMin+=x.late;S.earlyMin+=x.early;if(x.early>0)S.early++;const r=x.rec;
if((r&&(r.inOff||r.inClk||r.inFace==='unver'||r.outOff||r.outClk||r.outFace==='unver'))||x.st==='noout')S.flag++;
if(r&&r.inTs){S.inSum+=tmin(r.inTs);S.inN++;if(r.outTs){S.outSum+=tmin(r.outTs);S.outN++;S.workMin+=Math.round((r.outTs-r.inTs)/60000);S.workN++}}}
S.worked=S.present+S.late+S.noout;S.sched=S.worked+S.absent;S.attPct=S.sched?Math.round(S.worked*1000/S.sched)/10:0;S.latePct=S.worked?Math.round(S.late*1000/S.worked)/10:0;S.absPct=S.sched?Math.round(S.absent*1000/S.sched)/10:0;return S}
const minToT=m=>{if(!m&&m!==0)return '—';m=Math.round(m);let h=Math.floor(m/60)%24;const mm=m%60,ap=h>=12?'PM':'AM';h=h%12||12;return pad2(h)+':'+pad2(mm)+' '+ap};
const hrsOf=min=>min?Math.floor(min/60)+'h '+pad2(min%60)+'m':'—';
/* ---------- salary: owner decides the relaxation ---------- */
HUB.attDed=function(uid,ym,salary){try{if(!AT.db||AT.tid!==(SESS&&SESS.tid))return null;const c=atCfg(),s=c.sal||{};if(!s.on)return null;
const [y,m]=ym.split('-').map(Number),last=new Date(y,m,0).getDate(),S=atStats(uid,ym+'-01',ym+'-'+pad2(last));
const lateDays=(+s.lateAbs>0)?Math.floor(Math.max(0,S.late-(+s.freeLate||0))/(+s.lateAbs)):0;
const days=Math.max(0,S.absent+(s.noOutAbs?S.noout:0)+lateDays-(+s.freeAbs||0));const div=+s.div||30;
return {days,absent:S.absent,late:S.late,noout:S.noout,leave:S.leave,lateDays,amount:Math.round((+salary||0)/div*days)}}catch(e){return null}};
HUB.staffList=function(){try{return tenantUsers(SESS.tid).filter(u=>u.status!=='off').map(u=>({uid:u.uid,name:u.name,id:u.id,role:u.role}))}catch(e){return []}};
/* ---------- photos are kept 40 days; times stay for ever ---------- */
function atPurge(){let ch=0;const cut=ymd(Date.now()-40*864e5);atAll('att').forEach(r=>{if(r.day{if(r[k]){delete r[k];ch++}})});
const n0=atAll('att').length;AT.db.c.att=atAll('att').filter(r=>!(r.bad&&r.day{if(l.ph&&(l.ts||0){})}catch(e){}}};
const _atSync0=atSync;atSync=async function(){const r=await _atSync0.apply(this,arguments);AT._idx=null;return r};
/* ---------- what can the person do right now ---------- */
function atCur(uid){const now=Date.now(),day=ymd(now),yd=ymd(now-864e5),A=atAll('att');let rec=A.find(r=>r.uid===uid&&r.day===day&&!r.bad);
if(!rec||rec.outTs){const y=A.find(r=>r.uid===uid&&r.day===yd&&!r.bad&&r.inTs&&!r.outTs);if(y){const w=atWin(uid,yd);if(w.en>new Date(day+'T00:00:00').getTime()&&nowx.stop())}catch(e){}_camStream=null}
function atCapOv(){let o=document.getElementById('capOv');if(!o){o=document.createElement('div');o.id='capOv';o.className='capov';document.body.appendChild(o)}return o}
function atCapClose(){atCamStop();const o=document.getElementById('capOv');if(o)o.remove();AT.capBusy=0;if(document.getElementById('atBody'))atRender()}
const capShell=(kind,inner)=>`
`;
function atExempt(){try{const m=atMe();return !!(m.imp||(m.u&&(m.u.ownerAtt||m.u.role==='admin')))}catch(e){return false}}
async function atCapture(kind){const m=atMe();if(!m.u){toast(t('Owner view — attendance is marked by staff on their own phones.|اونر ویو — حاضری عملہ اپنے موبائل سے لگاتا ہے۔'),'err');return}
if(AT.capBusy)return;const uid=m.u.uid,c=atCfg();
if(!c.on){toast(t('Attendance is off|حاضری بند ہے'),'err');return}
const bb=atGet('bio',uid);if(!bb||bb.active===false){toast(t('Not activated yet — ask your admin|ابھی فعال نہیں — ایڈمن سے کہیں'),'err');return}
if(c.lat===null&&!atExempt()){toast(t('Admin has not saved the shop location yet|ایڈمن نے ابھی دکان کی لوکیشن محفوظ نہیں کی'),'err');return}
const cur=atCur(uid);if(kind==='in'&&!cur.canIn){toast(t('IN already marked|اِن پہلے لگ چکا'),'err');return}if(kind==='out'&&!cur.canOut){toast(t('Mark IN first|پہلے اِن لگائیں'),'err');return}
AT.capBusy=1;atCapOv().innerHTML=capShell(kind,'');
const loc=await atLocStep(kind);if(!loc)return;atCamStep(kind,loc)}
async function atLocStep(kind){const c=atCfg(),B=document.getElementById('capB');if(!B)return null;
B.innerHTML=`
📍
${t('Checking your location…|آپ کی لوکیشن چیک ہو رہی ہے…')}
${t('You are outside the allowed place. Attendance cannot be marked from here.|آپ مقررہ جگہ سے باہر ہیں۔ یہاں سے حاضری نہیں لگ سکتی۔')}
${t('Distance from shop|دکان سے فاصلہ')}: ${Math.round(d)} m · ${t('allowed|اجازت')}: ${c.r} m
${c.noReq?'':``}
`;return null}
return {g,d}}
function atLocHelp(kind,e){const B=document.getElementById('capB');if(!B)return;
const steps=e==='denied'?[t('Tap the 🔒 lock icon next to the web address.|ایڈریس کے ساتھ 🔒 تالے کے نشان پر دبائیں۔'),t('Open “Permissions” → “Location” → choose “Allow”.|"اجازتیں" ← "لوکیشن" ← "اجازت دیں" چنیں۔'),t('Also make sure the phone Location (GPS) is ON.|فون کی لوکیشن (GPS) بھی آن ہونی چاہیے۔'),t('Press “Try again”.|"دوبارہ کوشش" دبائیں۔')]
:[t('Turn ON the phone Location (GPS): swipe down from the top and tap “Location”.|فون کی لوکیشن (GPS) آن کریں: اوپر سے نیچے کھینچ کر "لوکیشن" کا بٹن دبائیں۔'),t('Go near a window or outside for a better signal.|بہتر سگنل کے لیے کھڑکی کے پاس یا کھلی جگہ آئیں۔'),t('Press “Try again”.|"دوبارہ کوشش" دبائیں۔')];
B.innerHTML=`
📍
${e==='denied'?t('Location is blocked|لوکیشن بند ہے'):t('Location is OFF or not found|لوکیشن آن نہیں ہے یا نہیں مل رہی')}
${t('Attendance needs your location to check that you are at work. Please turn it on:|حاضری کے لیے آپ کی لوکیشن چاہیے تاکہ پتا چلے آپ کام کی جگہ پر ہیں۔ براہِ مہربانی اسے آن کریں:')}
${steps.map(x=>`
${x}
`).join('')}
`}
async function atCamStep(kind,loc){const B=document.getElementById('capB');if(!B)return;
B.innerHTML=`
${t('Look straight at the camera|سیدھا کیمرے کی طرف دیکھیں')}
`;
try{_camStream=await navigator.mediaDevices.getUserMedia({video:{facingMode:'user',width:{ideal:640},height:{ideal:480}},audio:false});const v=document.getElementById('capV');if(!v){atCamStop();return}v.srcObject=_camStream;await v.play().catch(()=>{})}
catch(e){const h=document.getElementById('capH');if(h)h.innerHTML=`${t('Camera not allowed — allow the camera in the browser and try again|کیمرہ اجازت نہیں — براؤزر میں کیمرے کی اجازت دے کر دوبارہ کوشش کریں')}`;const bt=document.querySelector('#capB .capbtns');if(bt)bt.innerHTML=``;return}
document.getElementById('capShot').onclick=()=>{const v=document.getElementById('capV');if(!v||!v.videoWidth)return;const cv=document.createElement('canvas');cv.width=v.videoWidth;cv.height=v.videoHeight;cv.getContext('2d').drawImage(v,0,0);atCamStop();atPrevStep(kind,loc,cv)}}
function atPrevStep(kind,loc,cv){const B=document.getElementById('capB');if(!B)return;window._capCv=cv;window._capLoc=loc;
B.innerHTML=`
${t('Check your photo, then press Submit|تصویر دیکھیں، پھر "جمع کریں" دبائیں')}
`;
document.getElementById('capSub').onclick=()=>atSubmit(kind);document.getElementById('capRe').onclick=()=>atCamStep(kind,loc)}
async function atSubmit(kind){const cv=window._capCv,loc=window._capLoc;if(!cv||!loc)return;const wrap=document.getElementById('capImg'),bt=document.getElementById('capBtns'),h=document.getElementById('capH');
if(wrap)wrap.classList.add('scanning');if(bt)bt.style.display='none';if(h)h.textContent=t('Recording your attendance…|آپ کی حاضری ریکارڈ ہو رہی ہے…');
const t0=Date.now();let res;try{res=await atRecord(kind,loc,cv)}catch(e){res={err:'fail'}}
const wait=Math.max(0,2200-(Date.now()-t0));if(wait)await new Promise(r=>setTimeout(r,wait));
if(res.err){if(wrap)wrap.classList.remove('scanning');const msg=res.err==='face'?t('Face does not match. Attendance not marked.|چہرہ نہیں ملتا۔ حاضری نہیں لگی۔'):res.err==='clear'?t('Face not seen clearly — take the photo again|چہرہ صاف نظر نہیں آیا — دوبارہ تصویر لیں'):res.err==='dup'?(kind==='in'?t('IN already marked|اِن پہلے لگ چکا'):t('OUT already marked|آؤٹ پہلے لگ چکا')):t('Could not record — try again|ریکارڈ نہیں ہوا — دوبارہ کوشش کریں');
if(h)h.innerHTML=`${msg}`;if(bt){bt.style.display='';bt.innerHTML=``}return}
atSuccess(kind,res.rec)}
/* writes the record (works offline: saved on the phone, sent by itself later) */
async function atRecord(kind,loc,cv){const m=atMe(),uid=m.u.uid,c=atCfg();const bio=atGet('bio',uid);let face='skip',dist=null;
if(bio&&bio.desc&&bio.desc.length&&c.needFace){if(await faceLib()){const ds=await faceDesc(cv).catch(()=>null);if(!ds)return {err:'clear'};dist=Math.min(...bio.desc.map(x=>fdist(x,ds)));
if(dist>0.55){atPut('att',{id:uid+'_bad_'+Date.now(),uid,day:ymd(Date.now()),bad:1,kind,ts:Date.now(),ph:thumb(cv,140,.5),fd:Math.round(dist*100)/100});AT._idx=null;await atSave();return {err:'face'}}face='ok'}else face='unver'}
const sk=await atSkew();const now=Date.now()+sk,off=navigator.onLine===false?1:0,clk=sk?Math.round(sk/1000):0;const cur=atCur(uid);const ph=thumb(cv,170,.55);
let rec=cur.rec;
if(kind==='in'){if(rec&&rec.inTs)return {err:'dup'};const day=ymd(now);rec=rec||{id:uid+'_'+day,uid,day};rec.inTs=now;rec.inLoc=[loc.g.lat,loc.g.lng,Math.round(loc.d)];rec.inPh=ph;rec.inFace=face;rec.inFd=dist===null?null:Math.round(dist*100)/100;if(off)rec.inOff=1;if(clk)rec.inClk=clk}
else{if(!rec||!rec.inTs)return {err:'dup'};if(rec.outTs)return {err:'dup'};rec.outTs=now;rec.outLoc=[loc.g.lat,loc.g.lng,Math.round(loc.d)];rec.outPh=ph;rec.outFace=face;rec.outFd=dist===null?null:Math.round(dist*100)/100;if(off)rec.outOff=1;if(clk)rec.outClk=clk}
rec.name=m.u.name;atPut('att',rec);AT._idx=null;await atSave();return {rec}}
function atSuccess(kind,rec){const ts=kind==='in'?rec.inTs:rec.outTs,ph=kind==='in'?rec.inPh:rec.outPh,off=kind==='in'?rec.inOff:rec.outOff;const o=atCapOv();o.classList.add('done');
o.insertAdjacentHTML('beforeend',`
🎉 ${t('Congratulations!|مبارک ہو!')}
${t('Your attendance has been recorded|آپ کی حاضری لگ گئی')}
${t('Attendance % = days worked ÷ working days (leave and off days are not counted). Late % = late days ÷ days worked.|حاضری فیصد = حاضر دن ÷ کام کے دن (چھٹی اور آف دن شمار نہیں)۔ لیٹ فیصد = لیٹ دن ÷ حاضر دن۔')}