سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 23:15 UTC
fix(B03-R3): isolate recovery rendering in js/phase5-enterprise.js
davoodmehraban89 committed
Nov 24, 2026 at 17:06 UTC
3a907ea9f7c0e08dbb3c3cca9393ae1d37d7ac36
1 file changed
+1
js/phase5-enterprise.js
+1
@@ -11,6 +11,7 @@ function p5Id(p){return p+'_'+Date.now().toString(36)+'_'+Math.random().toString
11
function p5Audit(action,entity,entityId,before,after){if(!currentUser)return;datastore.phase5Audit.push({id:p5Id('P5A'),ownerUserId:currentUser.id,companyId:afCompanyId(),action,entity,entityId,before:before||null,after:after||null,at:new Date().toISOString()})}
12
function p5Need(){if(!requireWrite())return'';const c=afCompanyId();if(!c)alert('ابتدا شرکت فعال را انتخاب کنید.');return c}
13
function p5EnsureSeed(){
14
+ if(typeof finoraIsReadOnlyRefresh==='function'&&finoraIsReadOnlyRefresh())return;
15
if(!currentUser||!afCompanyId())return;let ch=false,cid=afCompanyId();
16
if(!getMyWarehouses().length){datastore.warehouses.push({id:p5Id('WH'),ownerUserId:currentUser.id,companyId:cid,code:'MAIN',name:'انبار اصلی',active:true,createdAt:new Date().toISOString()});ch=true}
17
if(!getMyCurrencies().some(x=>x.code==='IRR')){datastore.currencies.push({id:p5Id('CUR'),ownerUserId:currentUser.id,companyId:cid,code:'IRR',title:'ریال ایران',symbol:'ریال',decimals:0,base:true,active:true});ch=true}