flexbiz-server 12.7.8 → 12.7.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1154) hide show
  1. package/package.json +6 -6
  2. package/server/agents/agents.js +1 -1
  3. package/server/agents/ai_memory_manager.js +1 -6
  4. package/server/agents/ceoAgent.js +1 -43
  5. package/server/agents/chatController.js +1 -6
  6. package/server/agents/cskhAgent.js +1 -43
  7. package/server/agents/departmentAgent.js +1 -0
  8. package/server/agents/departmentAgents.js +1 -0
  9. package/server/agents/flowAgent.js +1 -43
  10. package/server/agents/loadTenantModel.js +1 -0
  11. package/server/agents/prompts/ceo.js +1 -2
  12. package/server/agents/prompts/cskh.js +1 -0
  13. package/server/agents/prompts/flow.js +1 -2
  14. package/server/agents/prompts/staff.js +1 -0
  15. package/server/agents/routerAgent.js +1 -0
  16. package/server/agents/specialists.js +1 -0
  17. package/server/agents/staffAgent.js +1 -44
  18. package/server/agents/tools/financeTools.js +1 -57
  19. package/server/agents/tools/flowTools.js +1 -36
  20. package/server/agents/tools/kpiTools.js +1 -104
  21. package/server/agents/tools/masterDataTools.js +1 -74
  22. package/server/agents/tools/okrTools.js +1 -21
  23. package/server/agents/tools/ragTools.js +1 -21
  24. package/server/agents/tools/reportTools.js +1 -43
  25. package/server/agents/tools/staffTools.js +1 -13
  26. package/server/agents/tools/stockTools.js +1 -41
  27. package/server/agents/tools/systemTools.js +1 -52
  28. package/server/agents/tools/taskTools.js +1 -23
  29. package/server/agents/tools/utils.js +1 -57
  30. package/server/app.js +1 -23
  31. package/server/auths/authMiddleware.js +1 -3
  32. package/server/auths/bearer.js +1 -3
  33. package/server/auths/facebook.js +1 -12
  34. package/server/auths/google.js +1 -13
  35. package/server/auths/joinApp.js +1 -0
  36. package/server/auths/local.js +1 -67
  37. package/server/auths/oauthCommon.js +1 -0
  38. package/server/auths/rateLimiterMiddleware.js +1 -11
  39. package/server/cluster.js +1 -1
  40. package/server/controllers/controller.js +1 -129
  41. package/server/controllers/controllerRPT.js +1 -38
  42. package/server/controllers/controllerUtils.js +1 -72
  43. package/server/controllers/createHandler.js +1 -35
  44. package/server/controllers/createRouteHandler.js +1 -4
  45. package/server/controllers/deleteHandler.js +1 -11
  46. package/server/controllers/deleteManyHandler.js +1 -2
  47. package/server/controllers/exportHandler.js +1 -19
  48. package/server/controllers/findHandler.js +1 -80
  49. package/server/controllers/handlers.js +1 -3
  50. package/server/controllers/historyHandler.js +1 -8
  51. package/server/controllers/importFromExcelHandler.js +1 -17
  52. package/server/controllers/importFromGsHandler.js +1 -10
  53. package/server/controllers/importFromJsonHandler.js +1 -6
  54. package/server/controllers/importHandler.js +1 -26
  55. package/server/controllers/logHandler.js +1 -5
  56. package/server/controllers/rptCreateRouteHandler.js +1 -4
  57. package/server/controllers/rptExcelHandler.js +1 -45
  58. package/server/controllers/rptHandler.js +1 -16
  59. package/server/controllers/updateBookHandler.js +1 -11
  60. package/server/controllers/updateFieldHandler.js +1 -12
  61. package/server/controllers/updateHandler.js +1 -38
  62. package/server/controllers/updateKeyHandler.js +1 -14
  63. package/server/controllers/viewHandler.js +1 -13
  64. package/server/data/sys/listinfo.js +93 -93
  65. package/server/data/sys/menuinfo.js +1 -24
  66. package/server/data/sys/moduleinfo.js +520 -9000
  67. package/server/data/sys/reportinfo.js +10 -10
  68. package/server/flow/FlowCluster.js +1 -0
  69. package/server/flow/FlowEngine.js +1 -68
  70. package/server/flow/WebhookManager.js +1 -26
  71. package/server/flow/handlers.js +1 -3
  72. package/server/flow/nodes/aiAnalysis.js +1 -9
  73. package/server/flow/nodes/checkAction.js +1 -7
  74. package/server/flow/nodes/customer.js +1 -15
  75. package/server/flow/nodes/data.js +1 -17
  76. package/server/flow/nodes/debug.js +1 -2
  77. package/server/flow/nodes/delay.js +1 -3
  78. package/server/flow/nodes/email.js +1 -8
  79. package/server/flow/nodes/event.js +1 -12
  80. package/server/flow/nodes/facebook.js +1 -3
  81. package/server/flow/nodes/facebookConversations.js +1 -5
  82. package/server/flow/nodes/facebookCreatePost.js +1 -10
  83. package/server/flow/nodes/facebookSendMessage.js +1 -12
  84. package/server/flow/nodes/forEachItem.js +1 -8
  85. package/server/flow/nodes/function.js +1 -4
  86. package/server/flow/nodes/httprequest.js +1 -7
  87. package/server/flow/nodes/inject.js +1 -14
  88. package/server/flow/nodes/pushNotification.js +1 -5
  89. package/server/flow/nodes/report.js +1 -6
  90. package/server/flow/nodes/saveData.js +1 -2
  91. package/server/flow/nodes/switch.js +1 -20
  92. package/server/flow/nodes/userform.js +1 -28
  93. package/server/flow/nodes/webhook.js +1 -1
  94. package/server/flow/nodes/zaloSendMessage.js +1 -4
  95. package/server/flow/utils.js +1 -67
  96. package/server/global.js +1 -18
  97. package/server/libs/WorkerPool.js +1 -4
  98. package/server/libs/WorkerStaticPool.js +1 -20
  99. package/server/libs/assbonus.js +1 -7
  100. package/server/libs/asyncCompat.js +1 -10
  101. package/server/libs/backup.js +1 -2
  102. package/server/libs/blockchainconnect.js +1 -12
  103. package/server/libs/cdpsdiem.js +1 -5
  104. package/server/libs/cdpsdt.js +1 -7
  105. package/server/libs/cdpskh.js +1 -15
  106. package/server/libs/cdpsnphep.js +1 -6
  107. package/server/libs/cdpstk.js +1 -11
  108. package/server/libs/ckcn.js +1 -14
  109. package/server/libs/ckdiem.js +1 -5
  110. package/server/libs/ckdt.js +1 -6
  111. package/server/libs/cknphep.js +1 -6
  112. package/server/libs/cktk.js +1 -4
  113. package/server/libs/cktt.js +1 -10
  114. package/server/libs/ckvt.js +1 -14
  115. package/server/libs/ckvtcapphat.js +1 -6
  116. package/server/libs/ckvtnpp.js +1 -9
  117. package/server/libs/ckvttt.js +1 -12
  118. package/server/libs/createSocaitheongay.js +1 -9
  119. package/server/libs/ctdiem.js +1 -5
  120. package/server/libs/ctvt.js +1 -8
  121. package/server/libs/ctvtnpp.js +1 -8
  122. package/server/libs/ctvttt.js +1 -7
  123. package/server/libs/databanle.js +1 -17
  124. package/server/libs/databanlenpp.js +1 -8
  125. package/server/libs/databanletheongay.js +1 -25
  126. package/server/libs/dkcn.js +1 -14
  127. package/server/libs/dkdiem.js +1 -5
  128. package/server/libs/dkdt.js +1 -6
  129. package/server/libs/dknphep.js +1 -7
  130. package/server/libs/dktk.js +1 -5
  131. package/server/libs/dktt.js +1 -10
  132. package/server/libs/dkvt.js +1 -12
  133. package/server/libs/dkvtnpp.js +1 -8
  134. package/server/libs/dkvttt.js +1 -8
  135. package/server/libs/dncn.js +1 -6
  136. package/server/libs/dntk.js +1 -4
  137. package/server/libs/dntt.js +1 -6
  138. package/server/libs/docs.js +1 -672
  139. package/server/libs/dstkcn.js +1 -1
  140. package/server/libs/dstktt.js +1 -1
  141. package/server/libs/dtbanletheonpp.js +1 -17
  142. package/server/libs/dtbanletheosp.js +1 -16
  143. package/server/libs/dtbanletheospnpp.js +1 -15
  144. package/server/libs/email.js +1 -3
  145. package/server/libs/excel.js +1 -3
  146. package/server/libs/excelHelper.js +1 -10
  147. package/server/libs/executiveDashboard.js +1 -8
  148. package/server/libs/fifo_dk.js +1 -8
  149. package/server/libs/fifo_group.js +1 -4
  150. package/server/libs/fifo_trace_query.js +1 -12
  151. package/server/libs/getGiaban.js +1 -59
  152. package/server/libs/getGiabanAsync.js +1 -1
  153. package/server/libs/getNotifies.js +1 -1
  154. package/server/libs/htmlReport.js +1 -9
  155. package/server/libs/initDatabase.js +1 -9
  156. package/server/libs/invoiceEasy.js +1 -108
  157. package/server/libs/invoiceViettel.js +1 -25
  158. package/server/libs/invoiceVnpt.js +1 -22
  159. package/server/libs/joinData.js +1 -44
  160. package/server/libs/kpistatus.js +1 -47
  161. package/server/libs/kqchamcong.js +1 -12
  162. package/server/libs/kqhdkd.js +1 -8
  163. package/server/libs/load-template.js +1 -3
  164. package/server/libs/logger.js +1 -3
  165. package/server/libs/mailmanagement.js +1 -13
  166. package/server/libs/mongooseDeletePost.js +1 -6
  167. package/server/libs/mongooseLeanId.js +1 -1
  168. package/server/libs/mongoosePatch.js +1 -14
  169. package/server/libs/mongooseSecurityPlugin.js +1 -16
  170. package/server/libs/onepay-payment.js +1 -4
  171. package/server/libs/optimizeBookkeeping.js +1 -22
  172. package/server/libs/parse-template.js +1 -5
  173. package/server/libs/permission.js +1 -58
  174. package/server/libs/phanbokh.js +1 -3
  175. package/server/libs/post-book.js +1 -22
  176. package/server/libs/post-socai.js +1 -25
  177. package/server/libs/post-sokho.js +1 -26
  178. package/server/libs/prototypes.js +1 -24
  179. package/server/libs/psdt.js +1 -1
  180. package/server/libs/pskh.js +1 -1
  181. package/server/libs/pstk.js +1 -1
  182. package/server/libs/queryBuilding.js +1 -15
  183. package/server/libs/redis-cache.js +1 -34
  184. package/server/libs/restore.js +1 -1
  185. package/server/libs/sctcnkh.js +1 -20
  186. package/server/libs/sessionContext.js +2 -14
  187. package/server/libs/socaitk.js +1 -9
  188. package/server/libs/textReport.js +1 -5
  189. package/server/libs/thnxt.js +1 -17
  190. package/server/libs/thnxtnpp.js +1 -9
  191. package/server/libs/thnxttt.js +1 -9
  192. package/server/libs/tinhGt.js +1 -10
  193. package/server/libs/tinhGtCapnhatPNK.js +1 -7
  194. package/server/libs/tinhGtPhanboHeSo.js +1 -12
  195. package/server/libs/tinhGtPhanboSltp.js +1 -10
  196. package/server/libs/tinhGtPhanboYtcp.js +1 -11
  197. package/server/libs/tinhGtSltk.js +1 -9
  198. package/server/libs/tinhGtThcppstk.js +1 -10
  199. package/server/libs/tinhGtTrucTiep.js +1 -7
  200. package/server/libs/tinhGtXoa.js +1 -3
  201. package/server/libs/tinhgia1vt_fifo.js +1 -22
  202. package/server/libs/tinhgiafifo.js +1 -28
  203. package/server/libs/tinhgiatb.js +1 -30
  204. package/server/libs/tinhgiatb1vt.js +1 -7
  205. package/server/libs/tinhhoahong.js +1 -64
  206. package/server/libs/tinhhoahongnpp.js +1 -46
  207. package/server/libs/tinhkhauhao1ts.js +1 -12
  208. package/server/libs/tinhkhauhaots.js +1 -8
  209. package/server/libs/tuoinophaithu.js +1 -11
  210. package/server/libs/tuoinophaitra.js +1 -12
  211. package/server/libs/utils.js +1 -121
  212. package/server/libs/validate.js +1 -4
  213. package/server/libs/validator-acc-cust.js +1 -1
  214. package/server/libs/validator-account.js +1 -4
  215. package/server/libs/validator-vt.js +1 -2
  216. package/server/libs/validator.js +1 -11
  217. package/server/libs/vectorService.js +1 -16
  218. package/server/libs/viCollation.js +1 -4
  219. package/server/libs/vsocai.js +1 -11
  220. package/server/maps-demo/participant.js +18 -0
  221. package/server/models/account.js +1 -7
  222. package/server/models/actionLog.js +1 -2
  223. package/server/models/afflink.js +1 -2
  224. package/server/models/aimemory.js +1 -1
  225. package/server/models/app.js +1 -16
  226. package/server/models/approve.js +1 -95
  227. package/server/models/assabcihandler.js +1 -35
  228. package/server/models/assbank.js +1 -19
  229. package/server/models/assbooking.js +1 -4
  230. package/server/models/assbuy.js +1 -3
  231. package/server/models/asscashwithdraw.js +1 -4
  232. package/server/models/assfindhash.js +1 -2
  233. package/server/models/assinvestment.js +1 -13
  234. package/server/models/assissue.js +1 -2
  235. package/server/models/asskey.js +1 -15
  236. package/server/models/assneedtobuy.js +1 -6
  237. package/server/models/assperiod.js +1 -7
  238. package/server/models/assproduct.js +1 -13
  239. package/server/models/assprofitsharing.js +1 -4
  240. package/server/models/assreceiver.js +1 -2
  241. package/server/models/assrequest.js +1 -10
  242. package/server/models/asssell.js +1 -7
  243. package/server/models/asstransaction.js +1 -3
  244. package/server/models/asstransfer.js +1 -4
  245. package/server/models/assuser_identity.js +1 -4
  246. package/server/models/asswithdraw.js +1 -4
  247. package/server/models/attend.js +1 -2
  248. package/server/models/banggiaban.js +1 -8
  249. package/server/models/bangtinhluong.js +1 -5
  250. package/server/models/base.js +1 -1
  251. package/server/models/bg1.js +1 -9
  252. package/server/models/bg2.js +1 -10
  253. package/server/models/cache.js +1 -3
  254. package/server/models/cacheDataReport.js +1 -2
  255. package/server/models/cacheSessionReport.js +1 -5
  256. package/server/models/calllog.js +1 -4
  257. package/server/models/cart.js +1 -5
  258. package/server/models/cddiem.js +1 -2
  259. package/server/models/cddt.js +1 -3
  260. package/server/models/cdkh.js +1 -5
  261. package/server/models/cdkhtheongay.js +1 -5
  262. package/server/models/cdnphep.js +1 -2
  263. package/server/models/cdtk.js +1 -3
  264. package/server/models/cdtktheongay.js +1 -3
  265. package/server/models/cdvt.js +1 -5
  266. package/server/models/cdvtnpp.js +1 -6
  267. package/server/models/cdvttheongay.js +1 -5
  268. package/server/models/chamcong.js +1 -7
  269. package/server/models/chat_message.js +1 -2
  270. package/server/models/chat_session.js +1 -2
  271. package/server/models/checkin.js +1 -4
  272. package/server/models/checkinactivity.js +1 -3
  273. package/server/models/checkinkpi.js +1 -4
  274. package/server/models/checkinlocation.js +1 -2
  275. package/server/models/chitietluongds.js +1 -12
  276. package/server/models/chitieukpi.js +1 -3
  277. package/server/models/chudethaoluan.js +1 -3
  278. package/server/models/ckgtluong.js +1 -2
  279. package/server/models/colleague.js +1 -2
  280. package/server/models/comment.js +1 -4
  281. package/server/models/congdoansx.js +1 -4
  282. package/server/models/congtacvien.js +1 -4
  283. package/server/models/congthuctinhgiaban.js +1 -8
  284. package/server/models/consultant.js +1 -4
  285. package/server/models/contract.js +1 -6
  286. package/server/models/counter.js +1 -2
  287. package/server/models/csluongtheods.js +1 -3
  288. package/server/models/csphucap.js +1 -2
  289. package/server/models/ctds.js +1 -5
  290. package/server/models/ctds2.js +1 -7
  291. package/server/models/currency.js +1 -3
  292. package/server/models/custom_report.js +1 -1
  293. package/server/models/customer.js +1 -31
  294. package/server/models/customer_care.js +1 -2
  295. package/server/models/data_list_config.js +1 -7
  296. package/server/models/databanle.js +1 -8
  297. package/server/models/datlich.js +1 -4
  298. package/server/models/deal.js +1 -2
  299. package/server/models/dh2.js +1 -20
  300. package/server/models/diagram.js +1 -2
  301. package/server/models/dinhmucsx.js +1 -8
  302. package/server/models/dkhoc.js +1 -6
  303. package/server/models/dknphep.js +1 -2
  304. package/server/models/dmban.js +1 -3
  305. package/server/models/dmbp.js +1 -12
  306. package/server/models/dmca.js +1 -2
  307. package/server/models/dmchietkhau.js +1 -8
  308. package/server/models/dmchietkhauhd.js +1 -19
  309. package/server/models/dmchinhanh.js +1 -2
  310. package/server/models/dmcpmh.js +1 -2
  311. package/server/models/dmdiemthuong.js +1 -3
  312. package/server/models/dmdoi.js +1 -4
  313. package/server/models/dmdoituongdanhgia.js +1 -2
  314. package/server/models/dmdt.js +1 -8
  315. package/server/models/dmdvt.js +1 -3
  316. package/server/models/dmgiaban.js +1 -9
  317. package/server/models/dmgiamua.js +1 -5
  318. package/server/models/dmgiathitruong.js +1 -5
  319. package/server/models/dmgiathitruong_ngay.js +1 -2
  320. package/server/models/dmgiathitruong_theodoi.js +1 -2
  321. package/server/models/dmhoahonghd.js +1 -8
  322. package/server/models/dmhoahongnpp.js +1 -8
  323. package/server/models/dmkc.js +1 -3
  324. package/server/models/dmkho.js +1 -7
  325. package/server/models/dmkhuyenmai.js +1 -9
  326. package/server/models/dmkhuyenmaihd.js +1 -11
  327. package/server/models/dmletet.js +1 -2
  328. package/server/models/dmlo.js +1 -4
  329. package/server/models/dmloaicong.js +1 -4
  330. package/server/models/dmloaitask.js +1 -2
  331. package/server/models/dmloaits.js +1 -2
  332. package/server/models/dmnckkm.js +1 -4
  333. package/server/models/dmnghiepvu.js +1 -4
  334. package/server/models/dmnguonvon.js +1 -2
  335. package/server/models/dmnhnv.js +1 -4
  336. package/server/models/dmnv.js +1 -17
  337. package/server/models/dmnvt.js +1 -10
  338. package/server/models/dmphi.js +1 -3
  339. package/server/models/dmqct.js +1 -3
  340. package/server/models/dmqddvt.js +1 -3
  341. package/server/models/dmtanggiamts.js +1 -3
  342. package/server/models/dmto.js +1 -4
  343. package/server/models/dmtt.js +1 -6
  344. package/server/models/dmvt.js +1 -17
  345. package/server/models/dmyt.js +1 -4
  346. package/server/models/dn0.js +1 -13
  347. package/server/models/dnm.js +1 -11
  348. package/server/models/dokho.js +1 -2
  349. package/server/models/domain.js +1 -2
  350. package/server/models/dvcs.js +1 -3
  351. package/server/models/ecomcategories.js +1 -3
  352. package/server/models/ecomcategories_cty.js +1 -3
  353. package/server/models/ecomproductlines.js +1 -2
  354. package/server/models/ecompromotion_flashsales.js +1 -2
  355. package/server/models/ecompromotion_freeships.js +1 -2
  356. package/server/models/email.js +1 -2
  357. package/server/models/endpoint.js +1 -1
  358. package/server/models/events.js +1 -3
  359. package/server/models/evoucher.js +1 -5
  360. package/server/models/experiencejourney.js +1 -2
  361. package/server/models/experiencejourneydata.js +1 -4
  362. package/server/models/experiencejourneypersona.js +1 -3
  363. package/server/models/experiencejourneystage.js +1 -2
  364. package/server/models/exportexceltemplate.js +1 -2
  365. package/server/models/fbconversation.js +1 -15
  366. package/server/models/fbmessage.js +1 -2
  367. package/server/models/fbpage.js +1 -2
  368. package/server/models/fbpost.js +1 -2
  369. package/server/models/fieldright.js +1 -2
  370. package/server/models/fifo_dk.js +1 -2
  371. package/server/models/fifo_lot.js +1 -3
  372. package/server/models/fifo_trace.js +1 -4
  373. package/server/models/file.js +1 -4
  374. package/server/models/filechunk.js +1 -2
  375. package/server/models/financialroadmap.js +1 -3
  376. package/server/models/flow.js +1 -2
  377. package/server/models/flowdata.js +1 -3
  378. package/server/models/flowpending.js +1 -2
  379. package/server/models/folder.js +1 -4
  380. package/server/models/follow.js +1 -2
  381. package/server/models/forminfo.js +1 -5
  382. package/server/models/giaoca.js +1 -3
  383. package/server/models/giatb.js +1 -3
  384. package/server/models/group.js +1 -9
  385. package/server/models/gt_ctgt.js +1 -4
  386. package/server/models/gt_hspb.js +1 -3
  387. package/server/models/gt_sltk.js +1 -3
  388. package/server/models/gt_thcppstk.js +1 -3
  389. package/server/models/hanmucton.js +1 -4
  390. package/server/models/hd1.js +1 -11
  391. package/server/models/hd2.js +1 -26
  392. package/server/models/hd3.js +1 -17
  393. package/server/models/hd4.js +1 -13
  394. package/server/models/hd7.js +1 -17
  395. package/server/models/hd8.js +1 -12
  396. package/server/models/hde.js +1 -11
  397. package/server/models/hmcn.js +1 -3
  398. package/server/models/hmcnct.js +1 -2
  399. package/server/models/hspbts.js +1 -4
  400. package/server/models/htl.js +1 -13
  401. package/server/models/importexceltemplate.js +1 -2
  402. package/server/models/introducebonus.js +1 -4
  403. package/server/models/introducecode.js +1 -3
  404. package/server/models/introducer.js +1 -4
  405. package/server/models/kbbtpb.js +1 -7
  406. package/server/models/kbmPttct.js +1 -4
  407. package/server/models/kbmTkgtgt.js +1 -5
  408. package/server/models/kbm_bcdkt_old.js +1 -4
  409. package/server/models/kbm_kqhdkd_old.js +1 -3
  410. package/server/models/kbm_lcttgt_old.js +1 -5
  411. package/server/models/kbm_lctttt_old.js +1 -4
  412. package/server/models/kbm_pttct_old.js +1 -4
  413. package/server/models/kbm_tkgtgt_old.js +1 -5
  414. package/server/models/kbmbcdkt.js +1 -4
  415. package/server/models/kbmbcqt.js +1 -4
  416. package/server/models/kbmkqhdkd.js +1 -3
  417. package/server/models/kbmlcttgt.js +1 -6
  418. package/server/models/kbmlctttt.js +1 -4
  419. package/server/models/kbmtmbctc.js +1 -4
  420. package/server/models/kehoachdtcp.js +1 -3
  421. package/server/models/kehoachmh.js +1 -8
  422. package/server/models/keyresult.js +1 -7
  423. package/server/models/khunghangthanhvien.js +1 -3
  424. package/server/models/label.js +1 -2
  425. package/server/models/labelinfo.js +1 -2
  426. package/server/models/lenhcapphat.js +1 -8
  427. package/server/models/lenhsx.js +1 -8
  428. package/server/models/lienhe.js +1 -4
  429. package/server/models/like_module.js +1 -2
  430. package/server/models/link.js +1 -2
  431. package/server/models/listinfo_old.js +1 -124
  432. package/server/models/loaidiem.js +1 -2
  433. package/server/models/lock.js +1 -2
  434. package/server/models/log.js +1 -8
  435. package/server/models/mailaccount.js +1 -3
  436. package/server/models/mailgroup.js +1 -3
  437. package/server/models/mailreceived.js +1 -2
  438. package/server/models/mailsent.js +1 -2
  439. package/server/models/mailtemplate.js +1 -2
  440. package/server/models/maudanhgia.js +1 -2
  441. package/server/models/menuinfo.js +1 -2
  442. package/server/models/message.js +1 -8
  443. package/server/models/message2.js +1 -4
  444. package/server/models/message2setting.js +1 -3
  445. package/server/models/moduleinfo.js +1 -4
  446. package/server/models/momo.js +1 -18
  447. package/server/models/news.js +1 -3
  448. package/server/models/newsfeed.js +1 -4
  449. package/server/models/note.js +1 -2
  450. package/server/models/notification.js +1 -8
  451. package/server/models/okr.js +1 -4
  452. package/server/models/okrdiagram.js +1 -3
  453. package/server/models/onepay.js +1 -24
  454. package/server/models/opportunity.js +1 -4
  455. package/server/models/options.js +1 -2
  456. package/server/models/originimportid.js +1 -1
  457. package/server/models/otp.js +1 -1
  458. package/server/models/parameter.js +1 -2
  459. package/server/models/participant.js +1 -21
  460. package/server/models/partner.js +1 -1
  461. package/server/models/payload.js +1 -1
  462. package/server/models/pbl.js +1 -16
  463. package/server/models/pc0.js +1 -13
  464. package/server/models/pc1.js +1 -14
  465. package/server/models/pc2.js +1 -13
  466. package/server/models/pc3.js +1 -13
  467. package/server/models/pc5.js +1 -8
  468. package/server/models/pc6.js +1 -14
  469. package/server/models/pcl.js +1 -6
  470. package/server/models/pdn.js +1 -9
  471. package/server/models/pdx.js +1 -9
  472. package/server/models/pgh.js +1 -5
  473. package/server/models/phieudanhgia.js +1 -3
  474. package/server/models/pht.js +1 -8
  475. package/server/models/phucap.js +1 -4
  476. package/server/models/pkc.js +1 -6
  477. package/server/models/pkh.js +1 -6
  478. package/server/models/pkk.js +1 -10
  479. package/server/models/pkt.js +1 -12
  480. package/server/models/pn1.js +1 -18
  481. package/server/models/pn2.js +1 -12
  482. package/server/models/pn3.js +1 -13
  483. package/server/models/pn5.js +1 -14
  484. package/server/models/pn6.js +1 -14
  485. package/server/models/pn9.js +1 -17
  486. package/server/models/pnc.js +1 -9
  487. package/server/models/pnh.js +1 -11
  488. package/server/models/pnk.js +1 -10
  489. package/server/models/po1.js +1 -19
  490. package/server/models/ppb.js +1 -6
  491. package/server/models/productcode.js +1 -2
  492. package/server/models/profile.js +1 -4
  493. package/server/models/pt1.js +1 -12
  494. package/server/models/pt5.js +1 -8
  495. package/server/models/ptl.js +1 -5
  496. package/server/models/ptthanhtoan.js +1 -6
  497. package/server/models/purchase_contract.js +1 -17
  498. package/server/models/pxc.js +1 -9
  499. package/server/models/pxh.js +1 -11
  500. package/server/models/pxk.js +1 -9
  501. package/server/models/qts.js +1 -14
  502. package/server/models/qts_dieuchinh.js +1 -3
  503. package/server/models/qts_dieuchuyen.js +1 -4
  504. package/server/models/quanhuyen.js +1 -2
  505. package/server/models/reason.js +1 -2
  506. package/server/models/receivedinvoice.js +1 -2
  507. package/server/models/reportinfo.js +1 -5
  508. package/server/models/right.js +1 -4
  509. package/server/models/rpt.js +1 -2
  510. package/server/models/rptform.js +1 -3
  511. package/server/models/rptobject.js +1 -2
  512. package/server/models/sale_contract.js +1 -9
  513. package/server/models/schedule.js +1 -18
  514. package/server/models/schedule_log.js +1 -2
  515. package/server/models/shipbook.js +1 -12
  516. package/server/models/shortcut.js +1 -2
  517. package/server/models/smsaccount.js +1 -10
  518. package/server/models/smssend.js +1 -2
  519. package/server/models/so1.js +1 -22
  520. package/server/models/so5.js +1 -15
  521. package/server/models/so9.js +1 -19
  522. package/server/models/socai.js +1 -28
  523. package/server/models/socainpp.js +1 -18
  524. package/server/models/socaitc.js +1 -6
  525. package/server/models/socaitmp.js +1 -16
  526. package/server/models/socaitt.js +1 -4
  527. package/server/models/sodiemthuong.js +1 -4
  528. package/server/models/sokho.js +1 -27
  529. package/server/models/sokhocapphat.js +1 -18
  530. package/server/models/sokhokhongton.js +1 -19
  531. package/server/models/sokhonpp.js +1 -19
  532. package/server/models/sokhotc.js +1 -8
  533. package/server/models/sokhott.js +1 -18
  534. package/server/models/sophanbokh.js +1 -3
  535. package/server/models/sosanxuat.js +1 -5
  536. package/server/models/sotinhkh.js +1 -2
  537. package/server/models/spdd_ck.js +1 -3
  538. package/server/models/spdd_dk.js +1 -3
  539. package/server/models/step.js +1 -2
  540. package/server/models/strategicdiagram.js +1 -3
  541. package/server/models/strategicgoal.js +1 -4
  542. package/server/models/strategickpi.js +1 -6
  543. package/server/models/strategicobjective.js +1 -5
  544. package/server/models/strategicplan.js +1 -5
  545. package/server/models/subscribe.js +1 -2
  546. package/server/models/support.js +1 -2
  547. package/server/models/synctime.js +1 -2
  548. package/server/models/sys_job_queue_book_keeping.js +1 -2
  549. package/server/models/sysconfig.js +1 -2
  550. package/server/models/sysgroup.js +1 -2
  551. package/server/models/tableinfo.js +1 -3
  552. package/server/models/task.js +1 -9
  553. package/server/models/tc.js +1 -2
  554. package/server/models/tdttco.js +1 -9
  555. package/server/models/tdttco_tt.js +1 -5
  556. package/server/models/tdttno.js +1 -9
  557. package/server/models/tdttno_tt.js +1 -5
  558. package/server/models/templaterpt.js +1 -2
  559. package/server/models/templatestore.js +1 -3
  560. package/server/models/templatevoucher.js +1 -3
  561. package/server/models/tinhthanh.js +1 -2
  562. package/server/models/tokens.js +1 -3
  563. package/server/models/tontucthoi.js +1 -9
  564. package/server/models/trangthai.js +1 -4
  565. package/server/models/trangthaiapp.js +1 -4
  566. package/server/models/transaction.js +1 -16
  567. package/server/models/trialinfo.js +1 -2
  568. package/server/models/user.js +1 -40
  569. package/server/models/usergroup.js +1 -7
  570. package/server/models/vanchuyen.js +1 -12
  571. package/server/models/vat.js +1 -3
  572. package/server/models/vatra.js +1 -6
  573. package/server/models/vatvao.js +1 -6
  574. package/server/models/versioninfo.js +1 -2
  575. package/server/models/vietqrbanks.js +1 -2
  576. package/server/models/vsocai.js +1 -6
  577. package/server/models/wallet.js +1 -8
  578. package/server/models/warranty.js +1 -3
  579. package/server/models/warrantyclaim.js +1 -2
  580. package/server/models/warrantypolicy.js +1 -1
  581. package/server/models/workflow.js +1 -4
  582. package/server/models/xaphuong.js +1 -2
  583. package/server/models/xhd.js +1 -10
  584. package/server/models/ytdd_ck.js +1 -4
  585. package/server/models/ytdd_dk.js +1 -4
  586. package/server/models/zalo.js +1 -17
  587. package/server/modules/bot/webhook.js +1 -0
  588. package/server/modules/lists/bg-cddiem.js +1 -6
  589. package/server/modules/lists/bg-cddt.js +1 -7
  590. package/server/modules/lists/bg-cdkh.js +1 -11
  591. package/server/modules/lists/bg-cdnphep.js +1 -6
  592. package/server/modules/lists/bg-cdtk.js +1 -9
  593. package/server/modules/lists/bg-cdvt.js +1 -8
  594. package/server/modules/lists/bg-cdvtnpp.js +1 -8
  595. package/server/modules/lists/bg-fifo_dk.js +1 -8
  596. package/server/modules/lists/ls-account.js +1 -4
  597. package/server/modules/lists/ls-afflink.js +1 -3
  598. package/server/modules/lists/ls-approve.js +1 -5
  599. package/server/modules/lists/ls-assbank.js +1 -3
  600. package/server/modules/lists/ls-asscashwithdraw.js +1 -8
  601. package/server/modules/lists/ls-assissue.js +1 -3
  602. package/server/modules/lists/ls-asskey.js +1 -41
  603. package/server/modules/lists/ls-assreceiver.js +1 -3
  604. package/server/modules/lists/ls-assrequest.js +1 -4
  605. package/server/modules/lists/ls-asstransaction.js +1 -3
  606. package/server/modules/lists/ls-asstransfer.js +1 -3
  607. package/server/modules/lists/ls-assuser_identity.js +1 -1
  608. package/server/modules/lists/ls-bangtinhluong.js +1 -2
  609. package/server/modules/lists/ls-calllog.js +1 -4
  610. package/server/modules/lists/ls-cart.js +1 -14
  611. package/server/modules/lists/ls-chamcong.js +1 -3
  612. package/server/modules/lists/ls-chat_session.js +1 -5
  613. package/server/modules/lists/ls-checkin.js +1 -24
  614. package/server/modules/lists/ls-checkinactivity.js +1 -8
  615. package/server/modules/lists/ls-checkinkpi.js +1 -3
  616. package/server/modules/lists/ls-checkinlocation.js +1 -1
  617. package/server/modules/lists/ls-chitietluongds.js +1 -4
  618. package/server/modules/lists/ls-chitieukpi.js +1 -1
  619. package/server/modules/lists/ls-chudethaoluan.js +1 -1
  620. package/server/modules/lists/ls-ckgtluong.js +1 -1
  621. package/server/modules/lists/ls-comment.js +1 -9
  622. package/server/modules/lists/ls-congdoansx.js +1 -3
  623. package/server/modules/lists/ls-congtacvien.js +1 -5
  624. package/server/modules/lists/ls-consultant.js +1 -2
  625. package/server/modules/lists/ls-contract.js +1 -7
  626. package/server/modules/lists/ls-csluongtheods.js +1 -1
  627. package/server/modules/lists/ls-csphucap.js +1 -1
  628. package/server/modules/lists/ls-ctds.js +1 -4
  629. package/server/modules/lists/ls-ctds2.js +1 -4
  630. package/server/modules/lists/ls-currency.js +1 -1
  631. package/server/modules/lists/ls-customer.js +1 -22
  632. package/server/modules/lists/ls-customer_care.js +1 -1
  633. package/server/modules/lists/ls-datlich.js +1 -9
  634. package/server/modules/lists/ls-dckhauhaots.js +1 -3
  635. package/server/modules/lists/ls-deal.js +1 -3
  636. package/server/modules/lists/ls-diagram.js +1 -1
  637. package/server/modules/lists/ls-dkhoc.js +1 -6
  638. package/server/modules/lists/ls-dknphep.js +1 -1
  639. package/server/modules/lists/ls-dmban.js +1 -4
  640. package/server/modules/lists/ls-dmbp.js +1 -7
  641. package/server/modules/lists/ls-dmca.js +1 -1
  642. package/server/modules/lists/ls-dmchietkhau.js +1 -19
  643. package/server/modules/lists/ls-dmchietkhauhd.js +1 -4
  644. package/server/modules/lists/ls-dmchinhanh.js +1 -1
  645. package/server/modules/lists/ls-dmchucvu.js +1 -2
  646. package/server/modules/lists/ls-dmcpmh.js +1 -1
  647. package/server/modules/lists/ls-dmdiemthuong.js +1 -4
  648. package/server/modules/lists/ls-dmdoi.js +1 -4
  649. package/server/modules/lists/ls-dmdoituongdanhgia.js +1 -1
  650. package/server/modules/lists/ls-dmdt.js +1 -11
  651. package/server/modules/lists/ls-dmdvt.js +1 -2
  652. package/server/modules/lists/ls-dmgiaban.js +1 -4
  653. package/server/modules/lists/ls-dmgiamua.js +1 -4
  654. package/server/modules/lists/ls-dmgiathitruong.js +1 -15
  655. package/server/modules/lists/ls-dmgiathitruong_ngay.js +1 -2
  656. package/server/modules/lists/ls-dmgiathitruong_theodoi.js +1 -1
  657. package/server/modules/lists/ls-dmhoahonghd.js +1 -1
  658. package/server/modules/lists/ls-dmhoahongnpp.js +1 -1
  659. package/server/modules/lists/ls-dmkc.js +1 -3
  660. package/server/modules/lists/ls-dmkho.js +1 -7
  661. package/server/modules/lists/ls-dmkhuyenmai.js +1 -5
  662. package/server/modules/lists/ls-dmkhuyenmaihd.js +1 -3
  663. package/server/modules/lists/ls-dmletet.js +1 -1
  664. package/server/modules/lists/ls-dmlo.js +1 -1
  665. package/server/modules/lists/ls-dmloaicong.js +1 -1
  666. package/server/modules/lists/ls-dmloaits.js +1 -1
  667. package/server/modules/lists/ls-dmnckkm.js +1 -7
  668. package/server/modules/lists/ls-dmnghiepvu.js +1 -1
  669. package/server/modules/lists/ls-dmnguonvon.js +1 -1
  670. package/server/modules/lists/ls-dmnhnv.js +1 -6
  671. package/server/modules/lists/ls-dmnhtask.js +1 -5
  672. package/server/modules/lists/ls-dmnkh.js +1 -6
  673. package/server/modules/lists/ls-dmntt.js +1 -6
  674. package/server/modules/lists/ls-dmnv.js +1 -14
  675. package/server/modules/lists/ls-dmnvt.js +1 -7
  676. package/server/modules/lists/ls-dmphi.js +1 -6
  677. package/server/modules/lists/ls-dmqct.js +1 -2
  678. package/server/modules/lists/ls-dmqddvt.js +1 -3
  679. package/server/modules/lists/ls-dmtanggiamts.js +1 -1
  680. package/server/modules/lists/ls-dmto.js +1 -5
  681. package/server/modules/lists/ls-dmtt.js +1 -7
  682. package/server/modules/lists/ls-dmvt.js +1 -52
  683. package/server/modules/lists/ls-dmyt.js +1 -1
  684. package/server/modules/lists/ls-dokho.js +1 -1
  685. package/server/modules/lists/ls-dvcs.js +1 -1
  686. package/server/modules/lists/ls-ecomcategories.js +1 -5
  687. package/server/modules/lists/ls-ecomcategories_cty.js +1 -5
  688. package/server/modules/lists/ls-email.js +1 -4
  689. package/server/modules/lists/ls-events.js +1 -3
  690. package/server/modules/lists/ls-evoucher.js +1 -3
  691. package/server/modules/lists/ls-experiencejourney.js +1 -1
  692. package/server/modules/lists/ls-experiencejourneydata.js +1 -3
  693. package/server/modules/lists/ls-experiencejourneypersona.js +1 -4
  694. package/server/modules/lists/ls-experiencejourneystage.js +1 -1
  695. package/server/modules/lists/ls-fbconversation.js +1 -2
  696. package/server/modules/lists/ls-fbmessage.js +1 -2
  697. package/server/modules/lists/ls-fbpage.js +1 -11
  698. package/server/modules/lists/ls-fbpost.js +1 -2
  699. package/server/modules/lists/ls-file.js +1 -38
  700. package/server/modules/lists/ls-financialroadmap.js +1 -3
  701. package/server/modules/lists/ls-flow.js +1 -6
  702. package/server/modules/lists/ls-flowdata.js +1 -1
  703. package/server/modules/lists/ls-flowpending.js +1 -3
  704. package/server/modules/lists/ls-folder.js +1 -1
  705. package/server/modules/lists/ls-forminfo.js +1 -1
  706. package/server/modules/lists/ls-giaoca.js +1 -5
  707. package/server/modules/lists/ls-group.js +1 -5
  708. package/server/modules/lists/ls-hmcn.js +1 -2
  709. package/server/modules/lists/ls-hspbts.js +1 -3
  710. package/server/modules/lists/ls-introducebonus.js +1 -4
  711. package/server/modules/lists/ls-introducecode.js +1 -10
  712. package/server/modules/lists/ls-introducer.js +1 -21
  713. package/server/modules/lists/ls-kbm-bcdkt.js +1 -1
  714. package/server/modules/lists/ls-kbm-bcqt.js +1 -5
  715. package/server/modules/lists/ls-kbm-kqhdkd.js +1 -1
  716. package/server/modules/lists/ls-kbm-lcttgt.js +1 -1
  717. package/server/modules/lists/ls-kbm-lctttt.js +1 -1
  718. package/server/modules/lists/ls-kbm-pttct.js +1 -3
  719. package/server/modules/lists/ls-kbm-tkgtgt.js +1 -3
  720. package/server/modules/lists/ls-kbm-tmbctc.js +1 -3
  721. package/server/modules/lists/ls-kehoachdtcp.js +1 -4
  722. package/server/modules/lists/ls-keyresult.js +1 -7
  723. package/server/modules/lists/ls-khunghangthanhvien.js +1 -1
  724. package/server/modules/lists/ls-label.js +1 -1
  725. package/server/modules/lists/ls-lienhe.js +1 -4
  726. package/server/modules/lists/ls-like-module.js +1 -1
  727. package/server/modules/lists/ls-link.js +1 -1
  728. package/server/modules/lists/ls-loaidiem.js +1 -1
  729. package/server/modules/lists/ls-lock.js +1 -1
  730. package/server/modules/lists/ls-log.js +1 -3
  731. package/server/modules/lists/ls-mailaccount.js +1 -5
  732. package/server/modules/lists/ls-mailreceived.js +1 -5
  733. package/server/modules/lists/ls-mailsent.js +1 -4
  734. package/server/modules/lists/ls-mailtemplate.js +1 -4
  735. package/server/modules/lists/ls-maudanhgia.js +1 -3
  736. package/server/modules/lists/ls-message2.js +1 -8
  737. package/server/modules/lists/ls-message2setting.js +1 -5
  738. package/server/modules/lists/ls-news.js +1 -7
  739. package/server/modules/lists/ls-newsfeed.js +1 -4
  740. package/server/modules/lists/ls-note.js +1 -6
  741. package/server/modules/lists/ls-okr.js +1 -5
  742. package/server/modules/lists/ls-okrdiagram.js +1 -1
  743. package/server/modules/lists/ls-opportunity.js +1 -5
  744. package/server/modules/lists/ls-options.js +1 -4
  745. package/server/modules/lists/ls-parameter.js +1 -3
  746. package/server/modules/lists/ls-participant.js +1 -12
  747. package/server/modules/lists/ls-phieudanhgia.js +1 -7
  748. package/server/modules/lists/ls-phucap.js +1 -2
  749. package/server/modules/lists/ls-productcode.js +1 -9
  750. package/server/modules/lists/ls-profile.js +1 -1
  751. package/server/modules/lists/ls-ptthanhtoan.js +1 -3
  752. package/server/modules/lists/ls-qts-dieuchinh.js +1 -2
  753. package/server/modules/lists/ls-qts-dieuchuyen.js +1 -8
  754. package/server/modules/lists/ls-reason.js +1 -1
  755. package/server/modules/lists/ls-rpt.js +1 -5
  756. package/server/modules/lists/ls-rptform.js +1 -3
  757. package/server/modules/lists/ls-shortcut.js +1 -1
  758. package/server/modules/lists/ls-smsaccount.js +1 -1
  759. package/server/modules/lists/ls-smssend.js +1 -3
  760. package/server/modules/lists/ls-sosanxuat.js +1 -4
  761. package/server/modules/lists/ls-step.js +1 -1
  762. package/server/modules/lists/ls-strategicdiagram.js +1 -1
  763. package/server/modules/lists/ls-strategicgoal.js +1 -3
  764. package/server/modules/lists/ls-strategickpi.js +1 -7
  765. package/server/modules/lists/ls-strategicobjective.js +1 -3
  766. package/server/modules/lists/ls-strategicplan.js +1 -6
  767. package/server/modules/lists/ls-support.js +1 -3
  768. package/server/modules/lists/ls-task.js +1 -28
  769. package/server/modules/lists/ls-tc.js +1 -1
  770. package/server/modules/lists/ls-templaterpt.js +1 -5
  771. package/server/modules/lists/ls-templatevoucher.js +1 -1
  772. package/server/modules/lists/ls-tontucthoi.js +1 -3
  773. package/server/modules/lists/ls-trangthaiapp.js +1 -3
  774. package/server/modules/lists/ls-transaction.js +1 -4
  775. package/server/modules/lists/ls-usergroup.js +1 -7
  776. package/server/modules/lists/ls-vat.js +1 -1
  777. package/server/modules/lists/ls-vatra.js +1 -5
  778. package/server/modules/lists/ls-vatvao.js +1 -6
  779. package/server/modules/lists/ls-warranty.js +1 -3
  780. package/server/modules/lists/ls-workflow.js +1 -1
  781. package/server/modules/lists/ls_hanmucton.js +1 -3
  782. package/server/modules/lists/ls_hspb.js +1 -4
  783. package/server/modules/lists/ls_spdd_ck.js +1 -3
  784. package/server/modules/lists/ls_spdd_dk.js +1 -3
  785. package/server/modules/lists/ls_ytdd_ck.js +1 -4
  786. package/server/modules/lists/ls_ytdd_dk.js +1 -4
  787. package/server/modules/lists/sys-attend.js +1 -4
  788. package/server/modules/lists/sys-follow.js +1 -4
  789. package/server/modules/lists/sys-right.js +1 -2
  790. package/server/modules/public/app.js +1 -4
  791. package/server/modules/public/approve.js +1 -37
  792. package/server/modules/public/callin.js +1 -7
  793. package/server/modules/public/comment.js +1 -5
  794. package/server/modules/public/dmnvt.js +1 -4
  795. package/server/modules/public/dmvt.js +1 -9
  796. package/server/modules/public/file.js +1 -11
  797. package/server/modules/public/forminfo.js +1 -1
  798. package/server/modules/public/group.js +1 -4
  799. package/server/modules/public/introducecode.js +1 -1
  800. package/server/modules/public/listinfo.js +1 -1
  801. package/server/modules/public/media-webhook.js +1 -1
  802. package/server/modules/public/partner.js +1 -1
  803. package/server/modules/public/paymentCallback.js +1 -32
  804. package/server/modules/public/province.js +1 -1
  805. package/server/modules/public/ptthanhtoan.js +1 -4
  806. package/server/modules/public/subscribe.js +1 -30
  807. package/server/modules/public/support.js +1 -3
  808. package/server/modules/public/tableinfo.js +1 -1
  809. package/server/modules/public/trialinfo.js +1 -4
  810. package/server/modules/public/versioninfo.js +1 -1
  811. package/server/modules/reports/calc-tinhgiafifo.js +1 -8
  812. package/server/modules/reports/calc-tinhgiatb.js +1 -7
  813. package/server/modules/reports/calc-tinhgiathanh.js +1 -7
  814. package/server/modules/reports/calc-tinhkhauhaots.js +1 -3
  815. package/server/modules/reports/calc-tinhluong.js +1 -68
  816. package/server/modules/reports/rp-assbonus.js +1 -4
  817. package/server/modules/reports/rp-asssupply.js +1 -1
  818. package/server/modules/reports/rp-asstransferlog.js +1 -10
  819. package/server/modules/reports/rp-backup.js +1 -4
  820. package/server/modules/reports/rp-banggiatb.js +1 -3
  821. package/server/modules/reports/rp-bangtinhkhauhao.js +1 -6
  822. package/server/modules/reports/rp-baoCaoFifoKy.js +1 -1
  823. package/server/modules/reports/rp-baocaokhachhang.js +1 -6
  824. package/server/modules/reports/rp-bcdkt.js +1 -11
  825. package/server/modules/reports/rp-bcintroducebonus.js +1 -4
  826. package/server/modules/reports/rp-bckhtiemnang.js +1 -3
  827. package/server/modules/reports/rp-bcqt.js +1 -85
  828. package/server/modules/reports/rp-bkchamcong.js +1 -5
  829. package/server/modules/reports/rp-bkct.js +1 -13
  830. package/server/modules/reports/rp-bkshipbook.js +1 -8
  831. package/server/modules/reports/rp-bkvanchuyen.js +1 -8
  832. package/server/modules/reports/rp-bkvatra.js +1 -7
  833. package/server/modules/reports/rp-bkvatvao.js +1 -7
  834. package/server/modules/reports/rp-capnhatsocaitc.js +1 -4
  835. package/server/modules/reports/rp-cdpsdiem.js +1 -4
  836. package/server/modules/reports/rp-cdpsdt.js +1 -5
  837. package/server/modules/reports/rp-cdpskh.js +1 -8
  838. package/server/modules/reports/rp-cdpsnphep.js +1 -3
  839. package/server/modules/reports/rp-cdpstk.js +1 -4
  840. package/server/modules/reports/rp-chitietchitientheohoadon.js +1 -12
  841. package/server/modules/reports/rp-chitiettaisan.js +1 -13
  842. package/server/modules/reports/rp-chitietthutientheohoadon.js +1 -13
  843. package/server/modules/reports/rp-ckcn.js +1 -3
  844. package/server/modules/reports/rp-ckdiem.js +1 -2
  845. package/server/modules/reports/rp-cktk.js +1 -3
  846. package/server/modules/reports/rp-ckvt.js +1 -10
  847. package/server/modules/reports/rp-ckvttheokho.js +1 -4
  848. package/server/modules/reports/rp-ckvttheotg.js +1 -4
  849. package/server/modules/reports/rp-ckvttt.js +1 -3
  850. package/server/modules/reports/rp-congnophaithutheotuoino.js +1 -3
  851. package/server/modules/reports/rp-congnophaitratheotuoino.js +1 -3
  852. package/server/modules/reports/rp-congnosapthu.js +1 -4
  853. package/server/modules/reports/rp-congnosaptra.js +1 -4
  854. package/server/modules/reports/rp-congviectheobp.js +1 -9
  855. package/server/modules/reports/rp-congviectheodt.js +1 -8
  856. package/server/modules/reports/rp-congviectheokh.js +1 -8
  857. package/server/modules/reports/rp-congviectheonv.js +1 -9
  858. package/server/modules/reports/rp-congviectheotimeline.js +1 -6
  859. package/server/modules/reports/rp-ctbanle.js +1 -15
  860. package/server/modules/reports/rp-ctbanle2.js +1 -20
  861. package/server/modules/reports/rp-ctbanlectv.js +1 -20
  862. package/server/modules/reports/rp-ctbanlenpp.js +1 -24
  863. package/server/modules/reports/rp-ctdanhgianhanvien.js +1 -8
  864. package/server/modules/reports/rp-cthangbanbitralai.js +1 -4
  865. package/server/modules/reports/rp-ctmuahang.js +1 -7
  866. package/server/modules/reports/rp-cttralaihang.js +1 -4
  867. package/server/modules/reports/rp-databanle.js +1 -10
  868. package/server/modules/reports/rp-diemthuong.js +1 -2
  869. package/server/modules/reports/rp-dkcn.js +1 -3
  870. package/server/modules/reports/rp-dktk.js +1 -2
  871. package/server/modules/reports/rp-dsnhanviencm.js +1 -9
  872. package/server/modules/reports/rp-dsnhanvientb.js +1 -9
  873. package/server/modules/reports/rp-dtbanlekempk.js +1 -12
  874. package/server/modules/reports/rp-dtbanletheoct.js +1 -22
  875. package/server/modules/reports/rp-dtbanletheoctkempk.js +1 -25
  876. package/server/modules/reports/rp-dtbanletheokh.js +1 -17
  877. package/server/modules/reports/rp-dtbanletheokhnpp.js +1 -19
  878. package/server/modules/reports/rp-dtbanletheokho.js +1 -15
  879. package/server/modules/reports/rp-dtbanletheonam.js +1 -3
  880. package/server/modules/reports/rp-dtbanletheongay.js +1 -1
  881. package/server/modules/reports/rp-dtbanletheonpp.js +1 -23
  882. package/server/modules/reports/rp-dtbanletheonv.js +1 -19
  883. package/server/modules/reports/rp-dtbanletheoquy.js +1 -3
  884. package/server/modules/reports/rp-dtbanletheosp.js +1 -9
  885. package/server/modules/reports/rp-dtbanletheospnpp.js +1 -6
  886. package/server/modules/reports/rp-dtbanletheothang.js +1 -3
  887. package/server/modules/reports/rp-dtbanletheothungan.js +1 -12
  888. package/server/modules/reports/rp-dtbanletheovt.js +1 -2
  889. package/server/modules/reports/rp-dtbanletheovtnpp.js +1 -2
  890. package/server/modules/reports/rp-dutoanthuchitheodt.js +1 -4
  891. package/server/modules/reports/rp-getPXC2PNC.js +1 -8
  892. package/server/modules/reports/rp-getariseofaccountsbymonth.js +1 -4
  893. package/server/modules/reports/rp-getbtpb.js +1 -6
  894. package/server/modules/reports/rp-getcashbycashier.js +1 -7
  895. package/server/modules/reports/rp-getcschietkhau.js +1 -5
  896. package/server/modules/reports/rp-getdinhmuc4lenhcp.js +1 -7
  897. package/server/modules/reports/rp-getdinhmuc4pxk.js +1 -9
  898. package/server/modules/reports/rp-getdk4pht.js +1 -8
  899. package/server/modules/reports/rp-getdk4pkc.js +1 -10
  900. package/server/modules/reports/rp-getdttheoca.js +1 -5
  901. package/server/modules/reports/rp-getinvoice2pay.js +1 -4
  902. package/server/modules/reports/rp-getinvoice2receive.js +1 -4
  903. package/server/modules/reports/rp-getinvoice2return.js +1 -5
  904. package/server/modules/reports/rp-getinvoice2return_bl.js +1 -6
  905. package/server/modules/reports/rp-getkehoachmh4lenhcp.js +1 -4
  906. package/server/modules/reports/rp-getkhauhao.js +1 -7
  907. package/server/modules/reports/rp-getluong.js +1 -8
  908. package/server/modules/reports/rp-getluongchuyen.js +1 -5
  909. package/server/modules/reports/rp-getpn2fee.js +1 -5
  910. package/server/modules/reports/rp-getpn2return.js +1 -5
  911. package/server/modules/reports/rp-getthanhpham4pnk.js +1 -7
  912. package/server/modules/reports/rp-getvc2xhd.js +1 -11
  913. package/server/modules/reports/rp-gt_cpnvltt.js +1 -6
  914. package/server/modules/reports/rp-hangbanbitralai.js +1 -5
  915. package/server/modules/reports/rp-hangthanhvien.js +1 -3
  916. package/server/modules/reports/rp-hoadonbanhangtheohantt.js +1 -5
  917. package/server/modules/reports/rp-hoadonmuahangtheohantt.js +1 -5
  918. package/server/modules/reports/rp-hoahong.js +1 -15
  919. package/server/modules/reports/rp-kcsns.js +1 -19
  920. package/server/modules/reports/rp-kgchamcong.js +1 -1
  921. package/server/modules/reports/rp-khoaso.js +1 -11
  922. package/server/modules/reports/rp-kiemtrasocaitcvssocai.js +1 -6
  923. package/server/modules/reports/rp-kqdanhgianhanvien.js +1 -5
  924. package/server/modules/reports/rp-kqhdkd.js +1 -1
  925. package/server/modules/reports/rp-lcttgt.js +1 -16
  926. package/server/modules/reports/rp-lctttt.js +1 -11
  927. package/server/modules/reports/rp-linkslist.js +1 -4
  928. package/server/modules/reports/rp-phanbochitienchohoadon.js +1 -11
  929. package/server/modules/reports/rp-phanbothutienchohoadon.js +1 -11
  930. package/server/modules/reports/rp-ptbitralai.js +1 -7
  931. package/server/modules/reports/rp-ptcttct.js +1 -24
  932. package/server/modules/reports/rp-ptdonhang.js +1 -8
  933. package/server/modules/reports/rp-pttct.js +1 -52
  934. package/server/modules/reports/rp-pttctkho.js +1 -32
  935. package/server/modules/reports/rp-pttctkho2.js +1 -29
  936. package/server/modules/reports/rp-referredusers.js +1 -5
  937. package/server/modules/reports/rp-sctbhxh.js +1 -4
  938. package/server/modules/reports/rp-sctcnkh.js +1 -11
  939. package/server/modules/reports/rp-sctdiem.js +1 -3
  940. package/server/modules/reports/rp-sctdt.js +1 -7
  941. package/server/modules/reports/rp-sctdtcp.js +1 -11
  942. package/server/modules/reports/rp-sctluong.js +1 -6
  943. package/server/modules/reports/rp-sctthuetncn.js +1 -4
  944. package/server/modules/reports/rp-scttk.js +1 -9
  945. package/server/modules/reports/rp-sctvt.js +1 -5
  946. package/server/modules/reports/rp-sctvt_sl.js +1 -5
  947. package/server/modules/reports/rp-sctvtnpp.js +1 -6
  948. package/server/modules/reports/rp-sctvttt.js +1 -5
  949. package/server/modules/reports/rp-search.js +1 -4
  950. package/server/modules/reports/rp-socai.js +1 -6
  951. package/server/modules/reports/rp-socaitk.js +1 -1
  952. package/server/modules/reports/rp-sochut.js +1 -7
  953. package/server/modules/reports/rp-sokho.js +1 -7
  954. package/server/modules/reports/rp-sokhott.js +1 -5
  955. package/server/modules/reports/rp-sonkbh.js +1 -5
  956. package/server/modules/reports/rp-sonkc.js +1 -6
  957. package/server/modules/reports/rp-sonkct.js +1 -5
  958. package/server/modules/reports/rp-sonkmh.js +1 -5
  959. package/server/modules/reports/rp-sonktt.js +1 -5
  960. package/server/modules/reports/rp-soquy.js +1 -11
  961. package/server/modules/reports/rp-sosanhkhvatt.js +1 -13
  962. package/server/modules/reports/rp-sosanhkhvatt2.js +1 -5
  963. package/server/modules/reports/rp-sotaisan.js +1 -13
  964. package/server/modules/reports/rp-sotiengui.js +1 -7
  965. package/server/modules/reports/rp-taodinhmuctudkhoc.js +1 -5
  966. package/server/modules/reports/rp-thbanhangkempk.js +1 -28
  967. package/server/modules/reports/rp-thdanhgianhanvien.js +1 -9
  968. package/server/modules/reports/rp-thgt.js +1 -6
  969. package/server/modules/reports/rp-thnxt.js +1 -11
  970. package/server/modules/reports/rp-thnxt_sl.js +1 -9
  971. package/server/modules/reports/rp-thnxtnpp.js +1 -10
  972. package/server/modules/reports/rp-thnxttt.js +1 -9
  973. package/server/modules/reports/rp-tkbanhangtheogioithieu.js +1 -9
  974. package/server/modules/reports/rp-tkgioithieukh.js +1 -4
  975. package/server/modules/reports/rp-tkgtgt.js +1 -76
  976. package/server/modules/reports/rp-tkgtgt_old.js +1 -7
  977. package/server/modules/reports/rp-tmbctc.js +1 -20
  978. package/server/modules/reports/rp-tonghopbanhang.js +1 -6
  979. package/server/modules/reports/rp-tonghopmuahang.js +1 -5
  980. package/server/modules/reports/rp-tonghoptralaihang.js +1 -5
  981. package/server/modules/reports/rp-tongquanbanle.js +1 -20
  982. package/server/modules/reports/rp-tongquanbds.js +1 -3
  983. package/server/modules/reports/rp-tongquancongty.js +1 -6
  984. package/server/modules/reports/rp-tongquanctvnpp.js +1 -12
  985. package/server/modules/reports/rp-tongquannvbh.js +1 -14
  986. package/server/modules/reports/rp-tongquannvnpp.js +1 -5
  987. package/server/modules/reports/rp-uoctinhnvl.js +1 -11
  988. package/server/modules/reports/rp-wallet.js +1 -3
  989. package/server/modules/reports/rpt-tkdiemtichluy.js +1 -9
  990. package/server/modules/systems/sys-app.js +1 -34
  991. package/server/modules/systems/sys-colleague.js +1 -11
  992. package/server/modules/systems/sys-data_list_config.js +1 -1
  993. package/server/modules/systems/sys-domain.js +1 -1
  994. package/server/modules/systems/sys-ecomproductlines.js +1 -1
  995. package/server/modules/systems/sys-exportexceltemplate.js +1 -1
  996. package/server/modules/systems/sys-fieldright.js +1 -1
  997. package/server/modules/systems/sys-importexceltemplate.js +1 -1
  998. package/server/modules/systems/sys-labelinfo.js +1 -3
  999. package/server/modules/systems/sys-listinfo.js +1 -10
  1000. package/server/modules/systems/sys-menuinfo.js +1 -1
  1001. package/server/modules/systems/sys-message.js +1 -14
  1002. package/server/modules/systems/sys-moduleinfo.js +1 -2
  1003. package/server/modules/systems/sys-notification.js +1 -8
  1004. package/server/modules/systems/sys-quanhuyen.js +1 -1
  1005. package/server/modules/systems/sys-reportinfo.js +1 -5
  1006. package/server/modules/systems/sys-rptobject.js +1 -1
  1007. package/server/modules/systems/sys-schedule.js +1 -10
  1008. package/server/modules/systems/sys-sysconfig.js +1 -1
  1009. package/server/modules/systems/sys-sysgroup.js +1 -1
  1010. package/server/modules/systems/sys-tableinfo.js +1 -1
  1011. package/server/modules/systems/sys-templatestore.js +1 -5
  1012. package/server/modules/systems/sys-tinhthanh.js +1 -1
  1013. package/server/modules/systems/sys-token.js +1 -3
  1014. package/server/modules/systems/sys-trangthai.js +1 -3
  1015. package/server/modules/systems/sys-trialinfo.js +1 -1
  1016. package/server/modules/systems/sys-user.js +1 -45
  1017. package/server/modules/systems/sys-users.js +1 -10
  1018. package/server/modules/systems/sys-versioninfo.js +1 -1
  1019. package/server/modules/systems/sys-vietqrbanks.js +1 -1
  1020. package/server/modules/systems/sys-xaphuong.js +1 -1
  1021. package/server/modules/vouchers/vo-banggiaban.js +1 -8
  1022. package/server/modules/vouchers/vo-bc1.js +1 -34
  1023. package/server/modules/vouchers/vo-bc5.js +1 -15
  1024. package/server/modules/vouchers/vo-bg1.js +1 -10
  1025. package/server/modules/vouchers/vo-bg2.js +1 -12
  1026. package/server/modules/vouchers/vo-bn1.js +1 -36
  1027. package/server/modules/vouchers/vo-bn5.js +1 -15
  1028. package/server/modules/vouchers/vo-dh2.js +1 -35
  1029. package/server/modules/vouchers/vo-dinhmucsx.js +1 -6
  1030. package/server/modules/vouchers/vo-dkb.js +1 -21
  1031. package/server/modules/vouchers/vo-dn0.js +1 -9
  1032. package/server/modules/vouchers/vo-dnm.js +1 -20
  1033. package/server/modules/vouchers/vo-hd1.js +1 -37
  1034. package/server/modules/vouchers/vo-hd2.js +1 -108
  1035. package/server/modules/vouchers/vo-hd3.js +1 -38
  1036. package/server/modules/vouchers/vo-hd4.js +1 -13
  1037. package/server/modules/vouchers/vo-hd7.js +1 -29
  1038. package/server/modules/vouchers/vo-hd8.js +1 -29
  1039. package/server/modules/vouchers/vo-hde.js +1 -39
  1040. package/server/modules/vouchers/vo-htl.js +1 -11
  1041. package/server/modules/vouchers/vo-kbbtpb.js +1 -6
  1042. package/server/modules/vouchers/vo-kehoachmh.js +1 -11
  1043. package/server/modules/vouchers/vo-lenhcapphat.js +1 -9
  1044. package/server/modules/vouchers/vo-lenhsx.js +1 -12
  1045. package/server/modules/vouchers/vo-pbl.js +1 -94
  1046. package/server/modules/vouchers/vo-pc0.js +1 -14
  1047. package/server/modules/vouchers/vo-pc1.js +1 -31
  1048. package/server/modules/vouchers/vo-pc2.js +1 -25
  1049. package/server/modules/vouchers/vo-pc3.js +1 -14
  1050. package/server/modules/vouchers/vo-pc5.js +1 -15
  1051. package/server/modules/vouchers/vo-pc6.js +1 -19
  1052. package/server/modules/vouchers/vo-pcl.js +1 -7
  1053. package/server/modules/vouchers/vo-pdn.js +1 -11
  1054. package/server/modules/vouchers/vo-pdx.js +1 -9
  1055. package/server/modules/vouchers/vo-pgh.js +1 -16
  1056. package/server/modules/vouchers/vo-pht.js +1 -6
  1057. package/server/modules/vouchers/vo-pkc.js +1 -5
  1058. package/server/modules/vouchers/vo-pkh.js +1 -9
  1059. package/server/modules/vouchers/vo-pkk.js +1 -12
  1060. package/server/modules/vouchers/vo-pkt.js +1 -12
  1061. package/server/modules/vouchers/vo-pn1.js +1 -30
  1062. package/server/modules/vouchers/vo-pn2.js +1 -17
  1063. package/server/modules/vouchers/vo-pn3.js +1 -18
  1064. package/server/modules/vouchers/vo-pn5.js +1 -18
  1065. package/server/modules/vouchers/vo-pn6.js +1 -18
  1066. package/server/modules/vouchers/vo-pn9.js +1 -23
  1067. package/server/modules/vouchers/vo-pnc.js +1 -19
  1068. package/server/modules/vouchers/vo-pnh.js +1 -17
  1069. package/server/modules/vouchers/vo-pnk.js +1 -14
  1070. package/server/modules/vouchers/vo-pnknpp.js +1 -12
  1071. package/server/modules/vouchers/vo-po1.js +1 -14
  1072. package/server/modules/vouchers/vo-ppb.js +1 -8
  1073. package/server/modules/vouchers/vo-pt1.js +1 -20
  1074. package/server/modules/vouchers/vo-pt5.js +1 -15
  1075. package/server/modules/vouchers/vo-ptl.js +1 -8
  1076. package/server/modules/vouchers/vo-purchase_contract.js +1 -9
  1077. package/server/modules/vouchers/vo-pxc.js +1 -24
  1078. package/server/modules/vouchers/vo-pxh.js +1 -18
  1079. package/server/modules/vouchers/vo-pxk.js +1 -15
  1080. package/server/modules/vouchers/vo-pxknpp.js +1 -14
  1081. package/server/modules/vouchers/vo-qts.js +1 -12
  1082. package/server/modules/vouchers/vo-sale_contract.js +1 -11
  1083. package/server/modules/vouchers/vo-shipbook.js +1 -17
  1084. package/server/modules/vouchers/vo-so1.js +1 -125
  1085. package/server/modules/vouchers/vo-so5.js +1 -57
  1086. package/server/modules/vouchers/vo-so7.js +1 -97
  1087. package/server/modules/vouchers/vo-so9.js +1 -119
  1088. package/server/modules/vouchers/vo-vanchuyen.js +1 -14
  1089. package/server/modules/vouchers/vo-xhd.js +1 -33
  1090. package/server/route.js +1 -54
  1091. package/server/services/invoiceFetcher.js +1 -12
  1092. package/server/sslConfig.js +1 -2
  1093. package/server/test/array.js +59 -0
  1094. package/server/test/utils.js +191 -0
  1095. package/server/tools/agent-benchmark.js +268 -0
  1096. package/server/tools/redis-smoke-test.js +195 -0
  1097. package/server/workers/backupApp.js +1 -10
  1098. package/server/workers/calcGrid.js +1 -9
  1099. package/server/workers/excelParser.js +1 -10
  1100. package/server/workers/inputWorker.js +1 -8
  1101. package/server/workers/pushNotify.js +1 -11
  1102. package/server/workers/reportWorker.js +1 -8
  1103. package/server/workers/restoreApp.js +1 -10
  1104. package/server/workers/runScript.js +1 -5
  1105. package/server/workers/sendEmail.js +1 -14
  1106. package/server/workers/webhook.js +1 -5
  1107. package/server/workers/worker-utils.js +1 -5
  1108. package/enable_mongo_replica.sh +0 -100
  1109. package/server/auths/local_old.js +0 -60
  1110. package/server/controllers/controllerUtils_v1.js +0 -72
  1111. package/server/controllers/controller_old.js +0 -129
  1112. package/server/controllers/createHandler_old.js +0 -35
  1113. package/server/controllers/deleteHandler_old.js +0 -12
  1114. package/server/controllers/exportHandler_old.js +0 -17
  1115. package/server/controllers/findHandler_old.js +0 -74
  1116. package/server/controllers/importFromJsonHandler_old.js +0 -6
  1117. package/server/controllers/importHandler_old.js +0 -41
  1118. package/server/controllers/updateFieldHandler_old.js +0 -13
  1119. package/server/controllers/updateHandler_old.js +0 -40
  1120. package/server/controllers/viewHandler_old.js +0 -14
  1121. package/server/libs/BlockchainTransactionPool.js +0 -3
  1122. package/server/libs/WorkerStaticPool_v1.js +0 -5
  1123. package/server/libs/WorkerStaticPool_v2.js +0 -16
  1124. package/server/libs/WorkerStaticPool_v3.js +0 -19
  1125. package/server/libs/cdpskh_old.js +0 -9
  1126. package/server/libs/ckcn_old.js +0 -11
  1127. package/server/libs/cktt_old.js +0 -9
  1128. package/server/libs/ckvt_old.js +0 -12
  1129. package/server/libs/databanle_old.js +0 -18
  1130. package/server/libs/dkcn_old.js +0 -10
  1131. package/server/libs/dktt_old.js +0 -8
  1132. package/server/libs/dkvt_old.js +0 -9
  1133. package/server/libs/getGiaban_old.js +0 -70
  1134. package/server/libs/joinData_bk.js +0 -44
  1135. package/server/libs/optimizeBookkeeping_bk.js +0 -14
  1136. package/server/libs/permission_old.js +0 -58
  1137. package/server/libs/thnxt_old.js +0 -9
  1138. package/server/libs/tinhgiatb1vt_old.js +0 -5
  1139. package/server/libs/tinhgiatb_old.js +0 -39
  1140. package/server/libs/vsocai_old.js +0 -7
  1141. package/server/modules/lists/ls-assabcihandler.js +0 -3
  1142. package/server/modules/lists/ls-assbooking.js +0 -20
  1143. package/server/modules/lists/ls-assbuy.js +0 -8
  1144. package/server/modules/lists/ls-assinvestment.js +0 -31
  1145. package/server/modules/lists/ls-assneedtobuy.js +0 -10
  1146. package/server/modules/lists/ls-assperiod.js +0 -19
  1147. package/server/modules/lists/ls-assproduct.js +0 -9
  1148. package/server/modules/lists/ls-assprofitsharing.js +0 -8
  1149. package/server/modules/lists/ls-asssell.js +0 -13
  1150. package/server/modules/lists/ls-asswithdraw.js +0 -12
  1151. package/server/modules/reports/rp-analyzedata.js +0 -6
  1152. package/server/modules/reports/rp-assinterest.js +0 -8
  1153. package/server/modules/reports/rp-assproductowners.js +0 -3
  1154. package/server/workers/restoreApp_bk.js +0 -23
@@ -1 +1 @@
1
- const Account=global.getModel("account");module.exports=function($id_app$$,$tk$$,$fn$$){Account.find({id_app:$id_app$$,tk_cn:!0,tk:$tk$$},{tk:1}).lean().then($accs_kqs$$=>{$accs_kqs$$=$accs_kqs$$.map($a$$=>$a$$.tk);$fn$$(null,$accs_kqs$$)})};
1
+ const _0x1b48b5=_0x1f46;(function(_0xba3dd,_0x3a239c){const _0x146d20=_0x1f46,_0x5a8c11=_0xba3dd();while(!![]){try{const _0x2a512f=-parseInt(_0x146d20(0x1f6))/0x1*(-parseInt(_0x146d20(0x200))/0x2)+parseInt(_0x146d20(0x1f7))/0x3+parseInt(_0x146d20(0x1fc))/0x4*(parseInt(_0x146d20(0x1ef))/0x5)+-parseInt(_0x146d20(0x1f3))/0x6+parseInt(_0x146d20(0x1ee))/0x7+-parseInt(_0x146d20(0x1ff))/0x8+-parseInt(_0x146d20(0x1f8))/0x9*(parseInt(_0x146d20(0x1f0))/0xa);if(_0x2a512f===_0x3a239c)break;else _0x5a8c11['push'](_0x5a8c11['shift']());}catch(_0x4f1edc){_0x5a8c11['push'](_0x5a8c11['shift']());}}}(_0x2887,0xdacb8));function _0x1f46(_0x7b8f,_0x3c9d7b){_0x7b8f=_0x7b8f-0x1ed;const _0x2887a6=_0x2887();let _0x1f4623=_0x2887a6[_0x7b8f];if(_0x1f46['YbKdIs']===undefined){var _0x3674e2=function(_0x4a60bc){const _0x5d422b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3694ed='',_0x631b98='';for(let _0x1097e9=0x0,_0x553ff6,_0x1a54f6,_0x256f32=0x0;_0x1a54f6=_0x4a60bc['charAt'](_0x256f32++);~_0x1a54f6&&(_0x553ff6=_0x1097e9%0x4?_0x553ff6*0x40+_0x1a54f6:_0x1a54f6,_0x1097e9++%0x4)?_0x3694ed+=String['fromCharCode'](0xff&_0x553ff6>>(-0x2*_0x1097e9&0x6)):0x0){_0x1a54f6=_0x5d422b['indexOf'](_0x1a54f6);}for(let _0x515fcb=0x0,_0x425d3e=_0x3694ed['length'];_0x515fcb<_0x425d3e;_0x515fcb++){_0x631b98+='%'+('00'+_0x3694ed['charCodeAt'](_0x515fcb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x631b98);};_0x1f46['rVmLQB']=_0x3674e2,_0x1f46['XiUgPw']={},_0x1f46['YbKdIs']=!![];}const _0x30be1e=_0x2887a6[0x0],_0x377e66=_0x7b8f+_0x30be1e,_0x44530c=_0x1f46['XiUgPw'][_0x377e66];return!_0x44530c?(_0x1f4623=_0x1f46['rVmLQB'](_0x1f4623),_0x1f46['XiUgPw'][_0x377e66]=_0x1f4623):_0x1f4623=_0x44530c,_0x1f4623;}const Account=global[_0x1b48b5(0x1fe)+_0x1b48b5(0x1f1)](_0x1b48b5(0x1f5)+'nt');function _0x2887(){const _0x4c4d3c=['zgvS','zxHWB3i','nZi2nZmWmNv1v2PSDW','BwfW','ywnJB3u','mti0mJy3muD0uxnKDa','nZe3mdmWzgLKqu9h','nJeXmxnlsuTfsa','DgTFy24','DgHLBG','BgvHBG','mti3nZy2mhn0wKLSza','zMLUza','z2v0tw8','oduZnJq4q3zsqK5e','mNHbtfHiAa','AwrFyxa','nZmZotC4yurQzvH1','mtvKEuvlwNe','ndG3mevXELPmDa'];_0x2887=function(){return _0x4c4d3c;};return _0x2887();}module[_0x1b48b5(0x1f2)+'ts']=function(_0x1097e9,_0x553ff6,_0x1a54f6){const _0x10adc0=_0x1b48b5,_0x256f32={};_0x256f32[_0x10adc0(0x1ed)+'p']=_0x1097e9,_0x256f32[_0x10adc0(0x1f9)]=!![],_0x256f32['tk']=_0x553ff6;let _0x515fcb=_0x256f32;const _0x425d3e={};_0x425d3e['tk']=0x1,Account[_0x10adc0(0x1fd)](_0x515fcb,_0x425d3e)[_0x10adc0(0x1fb)]()[_0x10adc0(0x1fa)](_0x8c0d8c=>{const _0x549fc8=_0x10adc0;let _0x4c5302=_0x8c0d8c[_0x549fc8(0x1f4)](_0x5cc583=>_0x5cc583['tk']);_0x1a54f6(null,_0x4c5302);});};
@@ -1 +1 @@
1
- const Account=global.getModel("account");module.exports=function($id_app$$,$tk$$,$fn$$){Account.find({id_app:$id_app$$,tk_cn:!1,tk:$tk$$},{tk:1}).lean().then(function($accs_kqs$$){$accs_kqs$$=$accs_kqs$$.map($a$$=>$a$$.tk);$fn$$(null,$accs_kqs$$)})};
1
+ function _0x1b58(){const _0x403749=['z2v0tw8','BwfW','BgvHBG','DgTFy24','ywnJB3u','zgvS','nZi3mtiXCuTMzwLv','mJq3muvJquDPwq','zxHWB3i','AwrFyxa','zMLUza','ntCXnZq2nMXgyvvvAa','mJCWnJqXnwPYwKT0Bq','mtuWodCXmgzuAgzSyq','mtu5ntjWDwjArMG','mtm3nJiYogH3BLH1CG','mtj3wNvPCwS','mJyXoty3mMv3tLjgBq'];_0x1b58=function(){return _0x403749;};return _0x1b58();}const _0x58a61a=_0x60ce;(function(_0x496cf1,_0x900785){const _0x30f7fa=_0x60ce,_0x285823=_0x496cf1();while(!![]){try{const _0x25c0c3=-parseInt(_0x30f7fa(0x1dd))/0x1+-parseInt(_0x30f7fa(0x1d2))/0x2+parseInt(_0x30f7fa(0x1d6))/0x3+parseInt(_0x30f7fa(0x1d4))/0x4+parseInt(_0x30f7fa(0x1d1))/0x5*(parseInt(_0x30f7fa(0x1d5))/0x6)+-parseInt(_0x30f7fa(0x1de))/0x7*(parseInt(_0x30f7fa(0x1d3))/0x8)+parseInt(_0x30f7fa(0x1d0))/0x9;if(_0x25c0c3===_0x900785)break;else _0x285823['push'](_0x285823['shift']());}catch(_0x187701){_0x285823['push'](_0x285823['shift']());}}}(_0x1b58,0xb70c3));function _0x60ce(_0x442282,_0x3f9add){_0x442282=_0x442282-0x1cf;const _0x1b5806=_0x1b58();let _0x60ce3b=_0x1b5806[_0x442282];if(_0x60ce['MsEgUD']===undefined){var _0x3c9394=function(_0x4a1750){const _0x4ec1cc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xb04635='',_0x24cb8d='';for(let _0x2e0d57=0x0,_0x58cadc,_0x2a921e,_0x7205ac=0x0;_0x2a921e=_0x4a1750['charAt'](_0x7205ac++);~_0x2a921e&&(_0x58cadc=_0x2e0d57%0x4?_0x58cadc*0x40+_0x2a921e:_0x2a921e,_0x2e0d57++%0x4)?_0xb04635+=String['fromCharCode'](0xff&_0x58cadc>>(-0x2*_0x2e0d57&0x6)):0x0){_0x2a921e=_0x4ec1cc['indexOf'](_0x2a921e);}for(let _0x24a84b=0x0,_0xb1d67d=_0xb04635['length'];_0x24a84b<_0xb1d67d;_0x24a84b++){_0x24cb8d+='%'+('00'+_0xb04635['charCodeAt'](_0x24a84b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x24cb8d);};_0x60ce['IHhYWz']=_0x3c9394,_0x60ce['CcGXKL']={},_0x60ce['MsEgUD']=!![];}const _0x27fa88=_0x1b5806[0x0],_0x25f203=_0x442282+_0x27fa88,_0x278ac5=_0x60ce['CcGXKL'][_0x25f203];return!_0x278ac5?(_0x60ce3b=_0x60ce['IHhYWz'](_0x60ce3b),_0x60ce['CcGXKL'][_0x25f203]=_0x60ce3b):_0x60ce3b=_0x278ac5,_0x60ce3b;}const Account=global[_0x58a61a(0x1d7)+_0x58a61a(0x1dc)](_0x58a61a(0x1db)+'nt');module[_0x58a61a(0x1df)+'ts']=function(_0x2e0d57,_0x58cadc,_0x2a921e){const _0x1c91f8=_0x58a61a,_0x7205ac={};_0x7205ac[_0x1c91f8(0x1e0)+'p']=_0x2e0d57,_0x7205ac[_0x1c91f8(0x1da)]=![],_0x7205ac['tk']=_0x58cadc;let _0x24a84b=_0x7205ac;const _0xb1d67d={};_0xb1d67d['tk']=0x1,Account[_0x1c91f8(0x1cf)](_0x24a84b,_0xb1d67d)[_0x1c91f8(0x1d9)]()['then'](function(_0xba0107){const _0x208087=_0x1c91f8;let _0x2394c2=_0xba0107[_0x208087(0x1d8)](_0x2be267=>_0x2be267['tk']);_0x2a921e(null,_0x2394c2);});};
@@ -1,17 +1 @@
1
- const databanle=require("./databanlenpp"),async=require("async");
2
- module.exports=async function($query_user$$,$condition$$,$callback$$){if(!$condition$$.tu_ngay||!$condition$$.den_ngay)return $callback$$("B\u00e1o c\u00e1o n\u00e0y y\u00eau c\u1ea7u c\u00e1c tham s\u1ed1:tu_ngay,den_ngay");$query_user$$={id_app:$condition$$.id_app};var $condition_kh_custs_ma_kho$$=$condition$$.ma_kho;$condition_kh_custs_ma_kho$$&&($query_user$$.$and||($query_user$$.$and=[]),$query_user$$.$and||($query_user$$.$and=[]),typeof $condition_kh_custs_ma_kho$$=="string"&&($condition_kh_custs_ma_kho$$=
3
- [$condition_kh_custs_ma_kho$$]),$query_user$$.$and.push({$or:[{ma_kho:{$in:$condition_kh_custs_ma_kho$$}},{"details.ma_kho":{$in:$condition_kh_custs_ma_kho$$}}]}));$query_user$$.ngay_ct={$gte:$condition$$.tu_ngay,$lte:$condition$$.den_ngay};$condition$$.ma_dvcs&&($query_user$$.ma_dvcs=$condition$$.ma_dvcs);$condition$$.user_nv&&($query_user$$.user_nv=$condition$$.user_nv);$condition$$.user_ctv&&($query_user$$.user_ctv=$condition$$.user_ctv);$condition$$.user&&($query_user$$.$or?($query_user$$.$and||
4
- ($query_user$$.$and=[]),$query_user$$.$and.push({$or:[{user_nv:$condition$$.user},{user_ctv:$condition$$.user}]})):$query_user$$.$or=[{user_nv:$condition$$.user},{user_ctv:$condition$$.user}]);$condition$$.tinh_thanh&&($query_user$$.tinh_thanh=$condition$$.tinh_thanh);if($condition$$.ma_kh)$query_user$$.ma_kh=$condition$$.ma_kh;else{$condition_kh_custs_ma_kho$$={};if($condition$$.nh_kh){var $nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$=await global.getModel("group").getAllChildrenGroup($condition$$.id_app,
5
- $condition$$.nh_kh,{status:!0});$condition_kh_custs_ma_kho$$.nh_kh={$in:$nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$}}$condition$$.nh_kh2&&($nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$=await global.getModel("group").getAllChildrenGroup($condition$$.id_app,$condition$$.nh_kh2,{status:!0}),$condition_kh_custs_ma_kho$$.nh_kh2={$in:$nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$});$condition$$.nh_kh3&&($nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$=await global.getModel("group").getAllChildrenGroup($condition$$.id_app,
6
- $condition$$.nh_kh3,{status:!0}),$condition_kh_custs_ma_kho$$.nh_kh3={$in:$nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$});$condition$$.nh_kh4&&($nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$=await global.getModel("group").getAllChildrenGroup($condition$$.id_app,$condition$$.nh_kh4,{status:!0}),$condition_kh_custs_ma_kho$$.nh_kh4={$in:$nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$});$condition$$.nh_kh5&&($nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$=await global.getModel("group").getAllChildrenGroup($condition$$.id_app,
7
- $condition$$.nh_kh5,{status:!0}),$condition_kh_custs_ma_kho$$.nh_kh5={$in:$nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$});Object.keys($condition_kh_custs_ma_kho$$).length>0&&($condition_kh_custs_ma_kho$$.id_app=$condition$$.id_app,$condition_kh_custs_ma_kho$$=await global.getModel("customer").find($condition_kh_custs_ma_kho$$,{ma_kh:1}).lean(),$query_user$$.ma_kh={$in:$condition_kh_custs_ma_kho$$.map($c$$=>$c$$.ma_kh)})}$condition$$.ma_ct&&($query_user$$.ma_ct=$condition$$.ma_ct);$condition$$.user_hoa_hong&&
8
- ($query_user$$.$or?($query_user$$.$and||($query_user$$.$and=[]),$query_user$$.$and.push({$or:[{user_nv:$condition$$.user_hoa_hong},{user_ctv:$condition$$.user_hoa_hong},{user_ctv2:$condition$$.user_hoa_hong},{user_kho:$condition$$.user_hoa_hong},{user_gt:$condition$$.user_hoa_hong},{user_ql:$condition$$.user_hoa_hong},{"details.user_nv":$condition$$.user_hoa_hong},{"details.user_ctv":$condition$$.user_hoa_hong},{"details.user_ctv2":$condition$$.user_hoa_hong},{"details.user_kho":$condition$$.user_hoa_hong},
9
- {"details.user_gt":$condition$$.user_hoa_hong},{"details.user_ql":$condition$$.user_hoa_hong}]})):$query_user$$.$or=[{user_nv:$condition$$.user_hoa_hong},{user_ctv:$condition$$.user_hoa_hong},{user_ctv2:$condition$$.user_hoa_hong},{user_kho:$condition$$.user_hoa_hong},{user_gt:$condition$$.user_hoa_hong},{user_ql:$condition$$.user_hoa_hong},{"details.user_nv":$condition$$.user_hoa_hong},{"details.user_ctv":$condition$$.user_hoa_hong},{"details.user_ctv2":$condition$$.user_hoa_hong},{"details.user_kho":$condition$$.user_hoa_hong},
10
- {"details.user_gt":$condition$$.user_hoa_hong},{"details.user_ql":$condition$$.user_hoa_hong}]);databanle($query_user$$,function($error$$,$rs$$,$ptthanhtoans$$){if($error$$)return $callback$$($error$$);const $thanh_toan$$=$ptthanhtoans$$.map($pt$$=>({name:$pt$$.ma,value:$pt$$.ma,ma:$pt$$.ma,ten:$pt$$.ten}));async.mapLimit($rs$$,100,function($r$$,$callback$$){$r$$.t_sl_xuat=$r$$.details.csum("sl_xuat");$r$$.t_tien_hang=$r$$.details.csum("tien_hang");$r$$.t_tien_hang_ct=$r$$.details.csum("tien_hang_ct");
11
- $r$$.t_thue=$r$$.details.csum("tien_thue");$r$$.t_tien_ck=$r$$.details.csum("tien_ck");$r$$.t_tien_cp=$r$$.details.csum("tien_cp");$r$$.t_tien=$r$$.details.csum("tien");$r$$.tien_ck_hd=$r$$.tien_ck_hd||0;$r$$.t_tien_xuat=$r$$.details.csum("tien_xuat");$r$$.t_tien_hoa_hong=$r$$.details.csum("tien_hoa_hong");$r$$.t_tien_hoa_hong_gt=$r$$.details.csum("tien_hoa_hong_gt");$r$$.t_tien_hoa_hong_ctv=$r$$.details.csum("tien_hoa_hong_ctv");$r$$.t_tien_hoa_hong_ql=$r$$.details.csum("tien_hoa_hong_ql");$r$$.tien_freeship=
12
- $r$$.tien_freeship||0;$r$$.tien_phi_vc=$r$$.tien_phi_vc||0;$r$$.details_tl?($r$$.t_tien_tl=$r$$.details_tl.csum("tien_hang_ct")-$r$$.details_tl.csum("tien_ck"),$r$$.t_tien_thue_tl=$r$$.details_tl.csum("tien_thue"),$r$$.t_tien_nhap=$r$$.details_tl.csum("tien_nhap"),$r$$.t_sl_nhap=$r$$.details_tl.csum("sl_nhap"),$r$$.t_tien_hoa_hong-=$r$$.details_tl.csum("tien_hoa_hong"),$r$$.t_tien_hoa_hong_gt-=$r$$.details_tl.csum("tien_hoa_hong_gt"),$r$$.t_tien_hoa_hong_ctv-=$r$$.details_tl.csum("tien_hoa_hong_ctv"),
13
- $r$$.t_tien_hoa_hong_ql-=$r$$.details_tl.csum("tien_hoa_hong_ql")):($r$$.t_tien_tl=0,$r$$.t_sl_nhap=0,$r$$.t_tien_nhap=0);$callback$$(null,$r$$)},function($error$$,$rs$$){if($error$$)return $callback$$($error$$);$error$$=$condition$$.groupby||$condition$$.group_by||["ma_kho"];typeof $error$$=="string"&&($error$$=[$error$$]);$rs$$.groupBy($error$$,[{name:"t_sl_xuat",value:"t_sl_xuat"},{name:"t_tien_hang",value:"t_tien_hang"},{name:"t_tien_hang_ct",value:"t_tien_hang_ct"},{name:"t_thue",value:"t_thue"},
14
- {name:"t_tien_cp",value:"t_tien_cp"},{name:"t_tien_ck",value:"t_tien_ck"},{name:"t_tien",value:"t_tien"},{name:"tien_ck_hd",value:"tien_ck_hd"},{name:"tien_freeship",value:"tien_freeship"},{name:"tien_phi_vc",value:"tien_phi_vc"},{name:"tien_evoucher",value:"tien_evoucher"},{name:"tien_thu",value:"tien_thu"},{name:"tien_thu2",value:"tien_thu2"},{name:"tien_paymentByPoints",value:"tien_paymentByPoints"},{name:"t_tien_xuat",value:"t_tien_xuat"},{name:"t_sl_nhap",value:"t_sl_nhap"},{name:"t_tien_tl",
15
- value:"t_tien_tl"},{name:"t_tien_thue_tl",value:"t_tien_thue_tl"},{name:"t_tien_nhap",value:"t_tien_nhap"},{name:"phai_tra",value:"phai_tra"},{name:"t_tien_hoa_hong",value:"t_tien_hoa_hong"},{name:"t_tien_hoa_hong_gt",value:"t_tien_hoa_hong_gt"},{name:"t_tien_hoa_hong_ctv",value:"t_tien_hoa_hong_ctv"},{name:"t_tien_hoa_hong_ql",value:"t_tien_hoa_hong_ql"},...$thanh_toan$$],async function($error$$,$report$$){if($error$$)return $callback$$($error$$);let $i$$=1;$report$$.forEach(function($r$$){$r$$.stt=
16
- $i$$;$r$$.bold=!1;$r$$.t_phai_thu=$r$$.t_tien_hang_ct-($r$$.t_tien_ck||0)+($r$$.t_thue||0)+($r$$.tien_phi_vc||0)-($r$$.tien_freeship||0)-($r$$.tien_ck_hd||0)-($r$$.tien_evoucher||0);$r$$.t_doanh_thu=$r$$.t_tien_hang_ct-($r$$.t_tien_ck||0)+($r$$.tien_phi_vc||0)-($r$$.tien_freeship||0)-($r$$.tien_ck_hd||0)-($r$$.tien_evoucher||0);$r$$.t_doanh_thu_thuan=$r$$.t_doanh_thu-$r$$.t_tien_tl;$r$$.t_lai=$r$$.t_doanh_thu-$r$$.t_tien_xuat-($r$$.t_tien_tl-$r$$.t_tien_nhap);$r$$.t_tien_thu=$thanh_toan$$.map($pt$$=>
17
- $r$$[$pt$$.ma]||0).reduce(($a$$,$b$$)=>$a$$+$b$$,0);$r$$.t_tien_paymentByPoints=$r$$.tien_paymentByPoints||0;$r$$.t_tien_phai_tl=$r$$.t_tien_tl+$r$$.t_tien_thue_tl;$i$$++});$report$$.forEach($r$$=>{$r$$.t_tien_phai_tl=$r$$.t_tien_tl+$r$$.t_tien_thue_tl});$callback$$(null,$report$$)})})})};
1
+ function _0x3f60(_0xf164ff,_0x401927){_0xf164ff=_0xf164ff-0x93;const _0x5b77dc=_0x5b77();let _0x3f601d=_0x5b77dc[_0xf164ff];if(_0x3f60['wHorZe']===undefined){var _0x4d469b=function(_0x4a425c){const _0x5b9826='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x89a4ae='',_0x4cd89e='';for(let _0x2822a6=0x0,_0xb9a24,_0x1c18a3,_0x5d671d=0x0;_0x1c18a3=_0x4a425c['charAt'](_0x5d671d++);~_0x1c18a3&&(_0xb9a24=_0x2822a6%0x4?_0xb9a24*0x40+_0x1c18a3:_0x1c18a3,_0x2822a6++%0x4)?_0x89a4ae+=String['fromCharCode'](0xff&_0xb9a24>>(-0x2*_0x2822a6&0x6)):0x0){_0x1c18a3=_0x5b9826['indexOf'](_0x1c18a3);}for(let _0xc31541=0x0,_0x46f3b4=_0x89a4ae['length'];_0xc31541<_0x46f3b4;_0xc31541++){_0x4cd89e+='%'+('00'+_0x89a4ae['charCodeAt'](_0xc31541)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4cd89e);};_0x3f60['xHdXUz']=_0x4d469b,_0x3f60['fzehSy']={},_0x3f60['wHorZe']=!![];}const _0x491bfd=_0x5b77dc[0x0],_0x5210e1=_0xf164ff+_0x491bfd,_0x56b83b=_0x3f60['fzehSy'][_0x5210e1];return!_0x56b83b?(_0x3f601d=_0x3f60['xHdXUz'](_0x3f601d),_0x3f60['fzehSy'][_0x5210e1]=_0x3f601d):_0x3f601d=_0x56b83b,_0x3f601d;}const _0x42f795=_0x3f60;(function(_0x161570,_0x43558d){const _0x256e04=_0x3f60,_0xeb2703=_0x161570();while(!![]){try{const _0x38e8f9=-parseInt(_0x256e04(0xdb))/0x1+parseInt(_0x256e04(0xa6))/0x2+-parseInt(_0x256e04(0xd7))/0x3*(parseInt(_0x256e04(0xb1))/0x4)+parseInt(_0x256e04(0xa7))/0x5+-parseInt(_0x256e04(0x103))/0x6*(-parseInt(_0x256e04(0xec))/0x7)+parseInt(_0x256e04(0xba))/0x8+-parseInt(_0x256e04(0xd4))/0x9*(parseInt(_0x256e04(0xf6))/0xa);if(_0x38e8f9===_0x43558d)break;else _0xeb2703['push'](_0xeb2703['shift']());}catch(_0x18dabc){_0xeb2703['push'](_0xeb2703['shift']());}}}(_0x5b77,0x5d9c4));const databanle=require('./dat'+_0x42f795(0xb6)+_0x42f795(0x9f)),async=require(_0x42f795(0xe9)+'bs/as'+_0x42f795(0xd8)+_0x42f795(0xc6));function _0x5b77(){const _0x318e9f=['Df90Ahu','nJaXndq4ofnVExfNBa','BMfTzq','EhvHDa','B2LUDhm','BwfFzhy','AgfTihm','igpHUQD1ia','qSoHBYbJ','BL9Oyw4','zv90Ba','DMfSDwu','DgLUAf8','BxbHDa','Df9WAge','BMDHEv8','BMHHCa','B25Nx2C','z2v0qwW','AgfUz18','BNrcEva','ChvZAa','DxnLCL8','BgvHBG','DgH1','BL9JAW','BL90Ahu','mti2odCYodjcruH0twO','yM9Sza','y3r2mG','mte1mtq2zxfVu0LO','Ew5Jq28','jg9Y','CM91Ca','ndq2otyZqMvbrwrJ','z19JDa','zhjLBKC','C2XFBMG','zgvS','BL9UAge','DhjH','DxnLCG','Df9SywK','BwfFy3q','y2TFAgq','zxjFz3q','zxjFy3q','y3vZDg8','lI4VBgK','A2HV','jgD0zq','nJGZouT4wKjVqG','z2f5','x2TOBW','BL9JCa','Df9KB2e','BwfWtgK','BgvUz3q','C3rHDhu','BhmUBwe','zxjFBNy','mtbuDujPr2O','DgHHBMG','EvbVAw4','BenOAwW','DgLLBL8','y3n1Bq','DgLLBG','y8oHyYb0','zgv0ywK','zM9Yrwe','BwL0','zxjFCwW','A2v5CW','ndiYnfH4ALLJuq','BhmUDxm','Dv90Ahu','AgvY','B25Nx3e','zNjLzxm','zxjFA2G','Cgf5Bwu','DhvFBMC','x2HVBMC','jgfUza','BL94Dwe','AwrFyxa','BhnFDgW','zxzVDwm','z3jVDxa','BwfFA2G','Df90Awu','B25N','y3r2','BMHFDgG','zxHWB3i','Av90Ba','zw5WCa','B25Nx2m','BwfW','jgLU','DgH1mG','zgvUx24','z2v0tw8','mteYmJq1mgDNB1HhCa','mtu4mda0nwXTBwTxBa','Av90Ahu','BL9OB2e','BL9WyxK','x3fS','CgHPx3y','C2XFEhu','BMHFA2G','x2n0DG','DgvU','ofjYD2rguW','C3rYAw4','x2D0','Ag9Hx2G','BL90Ba','ywjHBMW','AgLW','Df9ZBf8'];_0x5b77=function(){return _0x318e9f;};return _0x5b77();}module[_0x42f795(0x9d)+'ts']=async function(_0x317f8d,_0x585d8a,_0x5807ca){const _0x415698=_0x42f795;if(!_0x585d8a[_0x415698(0x10b)+'ay']||!_0x585d8a[_0x415698(0xa4)+_0x415698(0xed)])return _0x5807ca(_0x415698(0xc1)+'áo\x20nà'+'y\x20yêu'+_0x415698(0xc0)+_0x415698(0xfd)+_0x415698(0xbf)+'ố:tu_'+'ngay,'+_0x415698(0xa4)+_0x415698(0xed));const _0x24c07d={};_0x24c07d['id_ap'+'p']=_0x585d8a[_0x415698(0x94)+'p'];const _0x24ee54=_0x24c07d;let _0x5231d1=_0x585d8a[_0x415698(0x98)+'o'];if(_0x5231d1){if(!_0x24ee54[_0x415698(0x10d)])_0x24ee54[_0x415698(0x10d)]=[];if(!_0x24ee54['$and'])_0x24ee54[_0x415698(0x10d)]=[];typeof _0x5231d1==_0x415698(0xb2)+'g'&&(_0x5231d1=[_0x5231d1]);const _0x218da1={};_0x218da1[_0x415698(0xa2)]=_0x5231d1;const _0xbe1d00={};_0xbe1d00[_0x415698(0x98)+'o']=_0x218da1;const _0x31ed9d={};_0x31ed9d[_0x415698(0xa2)]=_0x5231d1;const _0x4a5c45={};_0x4a5c45[_0x415698(0xfe)+_0x415698(0xf4)+_0x415698(0xee)]=_0x31ed9d;const _0x5e095e={};_0x5e095e[_0x415698(0xd9)]=[_0xbe1d00,_0x4a5c45],_0x24ee54[_0x415698(0x10d)][_0x415698(0xce)](_0x5e095e);}const _0x50510a={};_0x50510a[_0x415698(0xeb)]=_0x585d8a[_0x415698(0x10b)+'ay'],_0x50510a['$lte']=_0x585d8a['den_n'+'gay'],_0x24ee54[_0x415698(0xc8)+'ct']=_0x50510a;_0x585d8a['ma_dv'+'cs']&&(_0x24ee54[_0x415698(0xbe)+'cs']=_0x585d8a[_0x415698(0xbe)+'cs']);_0x585d8a[_0x415698(0xcf)+'nv']&&(_0x24ee54[_0x415698(0xcf)+'nv']=_0x585d8a['user_'+'nv']);_0x585d8a[_0x415698(0xcf)+_0x415698(0x9b)]&&(_0x24ee54[_0x415698(0xcf)+_0x415698(0x9b)]=_0x585d8a[_0x415698(0xcf)+'ctv']);if(_0x585d8a[_0x415698(0xe2)]){if(!_0x24ee54['$or']){const _0xb3d157={};_0xb3d157[_0x415698(0xcf)+'nv']=_0x585d8a[_0x415698(0xe2)];const _0x4c1550={};_0x4c1550[_0x415698(0xcf)+_0x415698(0x9b)]=_0x585d8a[_0x415698(0xe2)],_0x24ee54[_0x415698(0xd9)]=[_0xb3d157,_0x4c1550];}else{if(!_0x24ee54['$and'])_0x24ee54[_0x415698(0x10d)]=[];const _0xa31187={};_0xa31187[_0x415698(0xcf)+'nv']=_0x585d8a[_0x415698(0xe2)];const _0x2d5ea3={};_0x2d5ea3[_0x415698(0xcf)+_0x415698(0x9b)]=_0x585d8a[_0x415698(0xe2)];const _0x19000a={};_0x19000a['$or']=[_0xa31187,_0x2d5ea3],_0x24ee54[_0x415698(0x10d)][_0x415698(0xce)](_0x19000a);}}_0x585d8a[_0x415698(0xc5)+_0x415698(0xf7)]&&(_0x24ee54['tinh_'+_0x415698(0xf7)]=_0x585d8a['tinh_'+_0x415698(0xf7)]);if(_0x585d8a[_0x415698(0x98)])_0x24ee54['ma_kh']=_0x585d8a[_0x415698(0x98)];else{let _0xa7f076,_0x4da845,_0x5e3b5e,_0x39a3ae,_0x4c7136,_0x2ec054={};if(_0x585d8a[_0x415698(0xae)]){const _0x3ba2f1={};_0x3ba2f1['statu'+'s']=!![],_0xa7f076=await global['getMo'+_0x415698(0xdf)]('group')[_0x415698(0xcb)+_0x415698(0xf9)+'drenG'+'roup'](_0x585d8a[_0x415698(0x94)+'p'],_0x585d8a[_0x415698(0xae)],_0x3ba2f1);const _0x4cde78={};_0x4cde78[_0x415698(0xa2)]=_0xa7f076,_0x2ec054[_0x415698(0xae)]=_0x4cde78;}if(_0x585d8a[_0x415698(0xae)+'2']){const _0x21b736={};_0x21b736[_0x415698(0xf3)+'s']=!![],_0x4da845=await global[_0x415698(0xa5)+'del'](_0x415698(0x97))[_0x415698(0xcb)+_0x415698(0xf9)+_0x415698(0xdd)+_0x415698(0xda)](_0x585d8a[_0x415698(0x94)+'p'],_0x585d8a[_0x415698(0xae)+'2'],_0x21b736);const _0x53b524={};_0x53b524[_0x415698(0xa2)]=_0x4da845,_0x2ec054[_0x415698(0xae)+'2']=_0x53b524;}if(_0x585d8a[_0x415698(0xae)+'3']){const _0x10257d={};_0x10257d[_0x415698(0xf3)+'s']=!![],_0x5e3b5e=await global[_0x415698(0xa5)+'del'](_0x415698(0x97))[_0x415698(0xcb)+_0x415698(0xf9)+'drenG'+'roup'](_0x585d8a[_0x415698(0x94)+'p'],_0x585d8a[_0x415698(0xae)+'3'],_0x10257d);const _0x4bc314={};_0x4bc314[_0x415698(0xa2)]=_0x5e3b5e,_0x2ec054[_0x415698(0xae)+'3']=_0x4bc314;}if(_0x585d8a[_0x415698(0xae)+'4']){const _0x57a724={};_0x57a724[_0x415698(0xf3)+'s']=!![],_0x39a3ae=await global[_0x415698(0xa5)+'del']('group')[_0x415698(0xcb)+_0x415698(0xf9)+_0x415698(0xdd)+_0x415698(0xda)](_0x585d8a[_0x415698(0x94)+'p'],_0x585d8a[_0x415698(0xae)+'4'],_0x57a724);const _0x10f00d={};_0x10f00d[_0x415698(0xa2)]=_0x39a3ae,_0x2ec054['nh_kh'+'4']=_0x10f00d;}if(_0x585d8a['nh_kh'+'5']){const _0x55a114={};_0x55a114[_0x415698(0xf3)+'s']=!![],_0x4c7136=await global[_0x415698(0xa5)+_0x415698(0xdf)](_0x415698(0x97))[_0x415698(0xcb)+_0x415698(0xf9)+_0x415698(0xdd)+'roup'](_0x585d8a[_0x415698(0x94)+'p'],_0x585d8a[_0x415698(0xae)+'5'],_0x55a114);const _0x2d19d7={};_0x2d19d7[_0x415698(0xa2)]=_0x4c7136,_0x2ec054[_0x415698(0xae)+'5']=_0x2d19d7;}if(Object[_0x415698(0x102)](_0x2ec054)[_0x415698(0xf2)+'h']>0x0){_0x2ec054[_0x415698(0x94)+'p']=_0x585d8a[_0x415698(0x94)+'p'];const _0x20972a={};_0x20972a[_0x415698(0x98)]=0x1;let _0x3f4120=await global[_0x415698(0xa5)+_0x415698(0xdf)](_0x415698(0xe8)+'mer')['find'](_0x2ec054,_0x20972a)[_0x415698(0xd0)]();_0x24ee54[_0x415698(0x98)]={'$in':_0x3f4120[_0x415698(0xa1)](_0x3e6288=>_0x3e6288['ma_kh'])};}}_0x585d8a['ma_ct']&&(_0x24ee54[_0x415698(0xe4)]=_0x585d8a[_0x415698(0xe4)]);if(_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)]){if(_0x24ee54[_0x415698(0xd9)]){if(!_0x24ee54['$and'])_0x24ee54[_0x415698(0x10d)]=[];const _0x3d99b9={};_0x3d99b9[_0x415698(0xcf)+'nv']=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x42baed={};_0x42baed[_0x415698(0xcf)+_0x415698(0x9b)]=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+'ong'];const _0x28f4f9={};_0x28f4f9[_0x415698(0xcf)+_0x415698(0xd6)]=_0x585d8a['user_'+_0x415698(0xb4)+_0x415698(0x9a)];const _0x5dd898={};_0x5dd898['user_'+_0x415698(0xea)]=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x351848={};_0x351848[_0x415698(0xcf)+'gt']=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+'ong'];const _0x3fc83b={};_0x3fc83b['user_'+'ql']=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x18b160={};_0x18b160[_0x415698(0xfe)+_0x415698(0x104)+_0x415698(0xf5)]=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x266243={};_0x266243[_0x415698(0xfe)+'ls.us'+_0x415698(0xe7)+'v']=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x407100={};_0x407100['detai'+_0x415698(0x104)+_0x415698(0xe7)+'v2']=_0x585d8a[_0x415698(0xcf)+'hoa_h'+_0x415698(0x9a)];const _0x44c913={};_0x44c913[_0x415698(0xfe)+_0x415698(0x104)+'er_kh'+'o']=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x523a94={};_0x523a94[_0x415698(0xfe)+_0x415698(0x104)+_0x415698(0xe6)]=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x461cce={};_0x461cce[_0x415698(0xfe)+'ls.us'+'er_ql']=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x428265={};_0x428265[_0x415698(0xd9)]=[_0x3d99b9,_0x42baed,_0x28f4f9,_0x5dd898,_0x351848,_0x3fc83b,_0x18b160,_0x266243,_0x407100,_0x44c913,_0x523a94,_0x461cce],_0x24ee54['$and']['push'](_0x428265);}else{const _0x2db6cf={};_0x2db6cf['user_'+'nv']=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+'ong'];const _0x170a7b={};_0x170a7b[_0x415698(0xcf)+_0x415698(0x9b)]=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0xece790={};_0xece790[_0x415698(0xcf)+_0x415698(0xd6)]=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x314608={};_0x314608[_0x415698(0xcf)+_0x415698(0xea)]=_0x585d8a[_0x415698(0xcf)+'hoa_h'+_0x415698(0x9a)];const _0x37030d={};_0x37030d[_0x415698(0xcf)+'gt']=_0x585d8a[_0x415698(0xcf)+'hoa_h'+_0x415698(0x9a)];const _0x8b34ae={};_0x8b34ae[_0x415698(0xcf)+'ql']=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x5bc2a8={};_0x5bc2a8[_0x415698(0xfe)+_0x415698(0x104)+_0x415698(0xf5)]=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+'ong'];const _0x283484={};_0x283484[_0x415698(0xfe)+'ls.us'+'er_ct'+'v']=_0x585d8a['user_'+'hoa_h'+'ong'];const _0x36524a={};_0x36524a[_0x415698(0xfe)+_0x415698(0x104)+'er_ct'+'v2']=_0x585d8a['user_'+'hoa_h'+_0x415698(0x9a)];const _0x3b49b0={};_0x3b49b0[_0x415698(0xfe)+_0x415698(0x104)+_0x415698(0x109)+'o']=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x14147b={};_0x14147b[_0x415698(0xfe)+_0x415698(0x104)+_0x415698(0xe6)]=_0x585d8a[_0x415698(0xcf)+_0x415698(0xb4)+_0x415698(0x9a)];const _0x4eb250={};_0x4eb250['detai'+_0x415698(0x104)+_0x415698(0x101)]=_0x585d8a[_0x415698(0xcf)+'hoa_h'+_0x415698(0x9a)],_0x24ee54[_0x415698(0xd9)]=[_0x2db6cf,_0x170a7b,_0xece790,_0x314608,_0x37030d,_0x8b34ae,_0x5bc2a8,_0x283484,_0x36524a,_0x3b49b0,_0x14147b,_0x4eb250];}}databanle(_0x24ee54,function(_0x33dde3,_0x11d967,_0x420d16){const _0x21e62a=_0x415698;if(_0x33dde3)return _0x5807ca(_0x33dde3);const _0x1f9b3c=_0x420d16['map'](_0x5724f5=>{const _0x5472a7=_0x3f60,_0x51a15e={};return _0x51a15e[_0x5472a7(0xbb)]=_0x5724f5['ma'],_0x51a15e[_0x5472a7(0xc4)]=_0x5724f5['ma'],_0x51a15e['ma']=_0x5724f5['ma'],_0x51a15e[_0x5472a7(0xb0)]=_0x5724f5[_0x5472a7(0xb0)],_0x51a15e;});async[_0x21e62a(0xf1)+_0x21e62a(0x100)](_0x11d967,0x64,function(_0x13c7d9,_0x2eda71){const _0x4e5366=_0x21e62a;_0x13c7d9['t_sl_'+_0x4e5366(0xbc)]=_0x13c7d9[_0x4e5366(0xfe)+'ls'][_0x4e5366(0xfb)](_0x4e5366(0xad)+'at'),_0x13c7d9['t_tie'+'n_han'+'g']=_0x13c7d9[_0x4e5366(0xfe)+'ls'][_0x4e5366(0xfb)]('tien_'+'hang'),_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xc2)+_0x4e5366(0xdc)]=_0x13c7d9[_0x4e5366(0xfe)+'ls'][_0x4e5366(0xfb)](_0x4e5366(0xfa)+_0x4e5366(0xcc)+'ct'),_0x13c7d9['t_thu'+'e']=_0x13c7d9[_0x4e5366(0xfe)+'ls'][_0x4e5366(0xfb)](_0x4e5366(0xfa)+'thue'),_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xd2)]=_0x13c7d9[_0x4e5366(0xfe)+'ls'][_0x4e5366(0xfb)](_0x4e5366(0xfa)+'ck'),_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xef)]=_0x13c7d9[_0x4e5366(0xfe)+'ls'][_0x4e5366(0xfb)](_0x4e5366(0xfa)+'cp'),_0x13c7d9[_0x4e5366(0x99)+'n']=_0x13c7d9[_0x4e5366(0xfe)+'ls'][_0x4e5366(0xfb)](_0x4e5366(0xfc)),_0x13c7d9[_0x4e5366(0xfa)+_0x4e5366(0xe5)]=_0x13c7d9[_0x4e5366(0xfa)+_0x4e5366(0xe5)]||0x0,_0x13c7d9[_0x4e5366(0x99)+'n_xua'+'t']=_0x13c7d9[_0x4e5366(0xfe)+'ls'][_0x4e5366(0xfb)](_0x4e5366(0xfa)+'xuat'),_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xa9)+_0x4e5366(0x10c)]=_0x13c7d9['detai'+'ls']['csum'](_0x4e5366(0xfa)+_0x4e5366(0xb4)+_0x4e5366(0x9a)),_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xa9)+_0x4e5366(0x10c)+'_gt']=_0x13c7d9[_0x4e5366(0xfe)+'ls'][_0x4e5366(0xfb)]('tien_'+_0x4e5366(0xb4)+'ong_g'+'t'),_0x13c7d9['t_tie'+_0x4e5366(0xa9)+_0x4e5366(0x10c)+_0x4e5366(0xaf)]=_0x13c7d9[_0x4e5366(0xfe)+'ls']['csum'](_0x4e5366(0xfa)+'hoa_h'+_0x4e5366(0xa0)+'tv'),_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xa9)+_0x4e5366(0x10c)+_0x4e5366(0xab)]=_0x13c7d9['detai'+'ls'][_0x4e5366(0xfb)](_0x4e5366(0xfa)+_0x4e5366(0xb4)+_0x4e5366(0x107)+'l'),_0x13c7d9['tien_'+_0x4e5366(0x108)+_0x4e5366(0xb7)]=_0x13c7d9[_0x4e5366(0xfa)+_0x4e5366(0x108)+_0x4e5366(0xb7)]||0x0,_0x13c7d9['tien_'+'phi_v'+'c']=_0x13c7d9[_0x4e5366(0xfa)+_0x4e5366(0xac)+'c']||0x0,_0x13c7d9[_0x4e5366(0xfe)+_0x4e5366(0x95)]?(_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xb5)]=_0x13c7d9[_0x4e5366(0xfe)+_0x4e5366(0x95)][_0x4e5366(0xfb)]('tien_'+_0x4e5366(0xcc)+'ct')-_0x13c7d9[_0x4e5366(0xfe)+_0x4e5366(0x95)]['csum'](_0x4e5366(0xfa)+'ck'),_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xd3)+_0x4e5366(0xc3)]=_0x13c7d9['detai'+_0x4e5366(0x95)][_0x4e5366(0xfb)](_0x4e5366(0xfa)+'thue'),_0x13c7d9['t_tie'+_0x4e5366(0xe0)+'p']=_0x13c7d9[_0x4e5366(0xfe)+_0x4e5366(0x95)]['csum'](_0x4e5366(0xfa)+'nhap'),_0x13c7d9['t_sl_'+'nhap']=_0x13c7d9['detai'+_0x4e5366(0x95)][_0x4e5366(0xfb)](_0x4e5366(0xde)+'ap'),_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xa9)+_0x4e5366(0x10c)]=_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xa9)+'_hong']-_0x13c7d9['detai'+_0x4e5366(0x95)][_0x4e5366(0xfb)]('tien_'+'hoa_h'+'ong'),_0x13c7d9[_0x4e5366(0x99)+'n_hoa'+_0x4e5366(0x10c)+_0x4e5366(0xb3)]=_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xa9)+'_hong'+_0x4e5366(0xb3)]-_0x13c7d9[_0x4e5366(0xfe)+_0x4e5366(0x95)][_0x4e5366(0xfb)]('tien_'+_0x4e5366(0xb4)+_0x4e5366(0xca)+'t'),_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xa9)+_0x4e5366(0x10c)+_0x4e5366(0xaf)]=_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xa9)+_0x4e5366(0x10c)+_0x4e5366(0xaf)]-_0x13c7d9[_0x4e5366(0xfe)+_0x4e5366(0x95)][_0x4e5366(0xfb)](_0x4e5366(0xfa)+'hoa_h'+'ong_c'+'tv'),_0x13c7d9[_0x4e5366(0x99)+_0x4e5366(0xa9)+'_hong'+_0x4e5366(0xab)]=_0x13c7d9['t_tie'+'n_hoa'+_0x4e5366(0x10c)+_0x4e5366(0xab)]-_0x13c7d9['detai'+_0x4e5366(0x95)]['csum']('tien_'+_0x4e5366(0xb4)+_0x4e5366(0x107)+'l')):(_0x13c7d9[_0x4e5366(0x99)+'n_tl']=0x0,_0x13c7d9[_0x4e5366(0xb8)+_0x4e5366(0xc9)]=0x0,_0x13c7d9['t_tie'+_0x4e5366(0xe0)+'p']=0x0),_0x2eda71(null,_0x13c7d9);},function(_0x7b2d83,_0x31f69a){const _0x4548d2=_0x21e62a;if(_0x7b2d83)return _0x5807ca(_0x7b2d83);let _0x286b24=_0x585d8a['group'+'by']||_0x585d8a[_0x4548d2(0x97)+'_by']||[_0x4548d2(0x98)+'o'];if(typeof _0x286b24==_0x4548d2(0xb2)+'g')_0x286b24=[_0x286b24];const _0x337b1a={};_0x337b1a[_0x4548d2(0xbb)]=_0x4548d2(0xb8)+_0x4548d2(0xbc),_0x337b1a[_0x4548d2(0xc4)]=_0x4548d2(0xb8)+_0x4548d2(0xbc);const _0x51d76d={};_0x51d76d[_0x4548d2(0xbb)]='t_tie'+_0x4548d2(0xc2)+'g',_0x51d76d['value']=_0x4548d2(0x99)+'n_han'+'g';const _0x2f9285={};_0x2f9285[_0x4548d2(0xbb)]='t_tie'+_0x4548d2(0xc2)+_0x4548d2(0xdc),_0x2f9285[_0x4548d2(0xc4)]=_0x4548d2(0x99)+'n_han'+_0x4548d2(0xdc);const _0x331e45={};_0x331e45['name']=_0x4548d2(0xb9)+'e',_0x331e45[_0x4548d2(0xc4)]='t_thu'+'e';const _0x20ede3={};_0x20ede3[_0x4548d2(0xbb)]=_0x4548d2(0x99)+_0x4548d2(0xef),_0x20ede3[_0x4548d2(0xc4)]='t_tie'+'n_cp';const _0x425e43={};_0x425e43[_0x4548d2(0xbb)]=_0x4548d2(0x99)+_0x4548d2(0xd2),_0x425e43[_0x4548d2(0xc4)]=_0x4548d2(0x99)+_0x4548d2(0xd2);const _0x505c00={};_0x505c00[_0x4548d2(0xbb)]=_0x4548d2(0x99)+'n',_0x505c00[_0x4548d2(0xc4)]='t_tie'+'n';const _0x5283c8={};_0x5283c8[_0x4548d2(0xbb)]=_0x4548d2(0xfa)+_0x4548d2(0xe5),_0x5283c8[_0x4548d2(0xc4)]=_0x4548d2(0xfa)+_0x4548d2(0xe5);const _0xf85187={};_0xf85187[_0x4548d2(0xbb)]=_0x4548d2(0xfa)+'frees'+_0x4548d2(0xb7),_0xf85187[_0x4548d2(0xc4)]=_0x4548d2(0xfa)+_0x4548d2(0x108)+'hip';const _0x3537ff={};_0x3537ff['name']=_0x4548d2(0xfa)+_0x4548d2(0xac)+'c',_0x3537ff[_0x4548d2(0xc4)]=_0x4548d2(0xfa)+_0x4548d2(0xac)+'c';const _0x53a60a={};_0x53a60a['name']=_0x4548d2(0xfa)+_0x4548d2(0x96)+'her',_0x53a60a[_0x4548d2(0xc4)]=_0x4548d2(0xfa)+_0x4548d2(0x96)+'her';const _0x53c7bd={};_0x53c7bd[_0x4548d2(0xbb)]=_0x4548d2(0xfa)+_0x4548d2(0xd1),_0x53c7bd[_0x4548d2(0xc4)]='tien_'+_0x4548d2(0xd1);const _0x38d52d={};_0x38d52d[_0x4548d2(0xbb)]=_0x4548d2(0xfa)+_0x4548d2(0xa3),_0x38d52d[_0x4548d2(0xc4)]=_0x4548d2(0xfa)+_0x4548d2(0xa3);const _0x25a6c8={};_0x25a6c8[_0x4548d2(0xbb)]='tien_'+_0x4548d2(0x10a)+_0x4548d2(0xcd)+_0x4548d2(0xbd),_0x25a6c8[_0x4548d2(0xc4)]='tien_'+'payme'+'ntByP'+'oints';const _0x4da6ba={};_0x4da6ba[_0x4548d2(0xbb)]='t_tie'+'n_xua'+'t',_0x4da6ba['value']=_0x4548d2(0x99)+_0x4548d2(0x93)+'t';const _0x27fc55={};_0x27fc55['name']=_0x4548d2(0xb8)+_0x4548d2(0xc9),_0x27fc55['value']=_0x4548d2(0xb8)+_0x4548d2(0xc9);const _0xc25afb={};_0xc25afb[_0x4548d2(0xbb)]=_0x4548d2(0x99)+_0x4548d2(0xb5),_0xc25afb[_0x4548d2(0xc4)]=_0x4548d2(0x99)+_0x4548d2(0xb5);const _0x237ec1={};_0x237ec1['name']=_0x4548d2(0x99)+'n_thu'+_0x4548d2(0xc3),_0x237ec1['value']=_0x4548d2(0x99)+_0x4548d2(0xd3)+_0x4548d2(0xc3);const _0x93b269={};_0x93b269[_0x4548d2(0xbb)]=_0x4548d2(0x99)+_0x4548d2(0xe0)+'p',_0x93b269['value']='t_tie'+'n_nha'+'p';const _0x329d5b={};_0x329d5b['name']='phai_'+_0x4548d2(0xe1),_0x329d5b[_0x4548d2(0xc4)]='phai_'+_0x4548d2(0xe1);const _0x25d6a9={};_0x25d6a9['name']=_0x4548d2(0x99)+_0x4548d2(0xa9)+_0x4548d2(0x10c),_0x25d6a9[_0x4548d2(0xc4)]=_0x4548d2(0x99)+_0x4548d2(0xa9)+_0x4548d2(0x10c);const _0x4c0011={};_0x4c0011[_0x4548d2(0xbb)]=_0x4548d2(0x99)+'n_hoa'+_0x4548d2(0x10c)+_0x4548d2(0xb3),_0x4c0011[_0x4548d2(0xc4)]=_0x4548d2(0x99)+_0x4548d2(0xa9)+_0x4548d2(0x10c)+_0x4548d2(0xb3);const _0x2e00c0={};_0x2e00c0['name']='t_tie'+'n_hoa'+_0x4548d2(0x10c)+_0x4548d2(0xaf),_0x2e00c0['value']=_0x4548d2(0x99)+'n_hoa'+_0x4548d2(0x10c)+'_ctv';const _0x4d97d5={};_0x4d97d5[_0x4548d2(0xbb)]=_0x4548d2(0x99)+_0x4548d2(0xa9)+_0x4548d2(0x10c)+'_ql',_0x4d97d5[_0x4548d2(0xc4)]=_0x4548d2(0x99)+_0x4548d2(0xa9)+_0x4548d2(0x10c)+_0x4548d2(0xab),_0x31f69a[_0x4548d2(0x97)+'By'](_0x286b24,[_0x337b1a,_0x51d76d,_0x2f9285,_0x331e45,_0x20ede3,_0x425e43,_0x505c00,_0x5283c8,_0xf85187,_0x3537ff,_0x53a60a,_0x53c7bd,_0x38d52d,_0x25a6c8,_0x4da6ba,_0x27fc55,_0xc25afb,_0x237ec1,_0x93b269,_0x329d5b,_0x25d6a9,_0x4c0011,_0x2e00c0,_0x4d97d5,..._0x1f9b3c],async function(_0x1ed4e3,_0x18bc02){const _0x599d0a=_0x4548d2;if(_0x1ed4e3)return _0x5807ca(_0x1ed4e3);let _0x43a01b=0x1;_0x18bc02[_0x599d0a(0xff)+'ch'](function(_0x3573a4){const _0x2e3ad9=_0x599d0a;_0x3573a4['stt']=_0x43a01b,_0x3573a4[_0x2e3ad9(0xd5)]=![],_0x3573a4[_0x2e3ad9(0xc7)+_0x2e3ad9(0xa8)]=_0x3573a4['t_tie'+_0x2e3ad9(0xc2)+_0x2e3ad9(0xdc)]-(_0x3573a4[_0x2e3ad9(0x99)+'n_ck']||0x0)+(_0x3573a4['t_thu'+'e']||0x0)+(_0x3573a4[_0x2e3ad9(0xfa)+'phi_v'+'c']||0x0)-(_0x3573a4[_0x2e3ad9(0xfa)+_0x2e3ad9(0x108)+'hip']||0x0)-(_0x3573a4['tien_'+_0x2e3ad9(0xe5)]||0x0)-(_0x3573a4['tien_'+_0x2e3ad9(0x96)+'her']||0x0),_0x3573a4[_0x2e3ad9(0xf0)+_0x2e3ad9(0x9c)+'u']=_0x3573a4[_0x2e3ad9(0x99)+'n_han'+'g_ct']-(_0x3573a4[_0x2e3ad9(0x99)+'n_ck']||0x0)+(_0x3573a4['tien_'+_0x2e3ad9(0xac)+'c']||0x0)-(_0x3573a4[_0x2e3ad9(0xfa)+_0x2e3ad9(0x108)+_0x2e3ad9(0xb7)]||0x0)-(_0x3573a4[_0x2e3ad9(0xfa)+'ck_hd']||0x0)-(_0x3573a4[_0x2e3ad9(0xfa)+_0x2e3ad9(0x96)+_0x2e3ad9(0x106)]||0x0),_0x3573a4['t_doa'+'nh_th'+_0x2e3ad9(0x105)+'an']=_0x3573a4[_0x2e3ad9(0xf0)+'nh_th'+'u']-_0x3573a4[_0x2e3ad9(0x99)+'n_tl'],_0x3573a4[_0x2e3ad9(0xe3)]=_0x3573a4[_0x2e3ad9(0xf0)+_0x2e3ad9(0x9c)+'u']-_0x3573a4[_0x2e3ad9(0x99)+_0x2e3ad9(0x93)+'t']-(_0x3573a4['t_tie'+_0x2e3ad9(0xb5)]-_0x3573a4['t_tie'+'n_nha'+'p']),_0x3573a4[_0x2e3ad9(0x99)+_0x2e3ad9(0xd3)]=_0x1f9b3c['map'](_0xe0bb3d=>_0x3573a4[_0xe0bb3d['ma']]||0x0)['reduc'+'e']((_0x3e99df,_0x3ddd71)=>_0x3e99df+_0x3ddd71,0x0),_0x3573a4[_0x2e3ad9(0x99)+_0x2e3ad9(0xaa)+'mentB'+_0x2e3ad9(0xf8)+'ts']=_0x3573a4['tien_'+_0x2e3ad9(0x10a)+_0x2e3ad9(0xcd)+_0x2e3ad9(0xbd)]||0x0,_0x3573a4[_0x2e3ad9(0x99)+'n_pha'+_0x2e3ad9(0x9e)]=_0x3573a4[_0x2e3ad9(0x99)+_0x2e3ad9(0xb5)]+_0x3573a4[_0x2e3ad9(0x99)+'n_thu'+_0x2e3ad9(0xc3)],_0x43a01b++;}),_0x18bc02[_0x599d0a(0xff)+'ch'](_0x54b397=>{const _0x2057d1=_0x599d0a;_0x54b397[_0x2057d1(0x99)+'n_pha'+_0x2057d1(0x9e)]=_0x54b397[_0x2057d1(0x99)+_0x2057d1(0xb5)]+_0x54b397['t_tie'+'n_thu'+'e_tl'];}),_0x5807ca(null,_0x18bc02);});});});};
@@ -1,16 +1 @@
1
- const databanle=require("./databanle"),FALLBACK_FIELDS=["ma_nv","ma_dt","ma_bp","ma_kh"],NEGATE_FIELDS="tien_hang_nt tien_hang tien_hang_ct_nt tien_hang_ct tien_ck tien_ck_nt tien_thue tien_thue_nt tien_hoa_hong tien_hoa_hong_gt tien_hoa_hong_ctv tien_hoa_hong_ql".split(" "),TOTAL_FIELDS="sl_xuat sl_nhap sl_xuat_qd_bc sl_nhap_qd_bc tien_hang tien_hang_ct tien_ck tien_thue tien_cp tien_xuat tien_xuat_tmp tt tien loi_nhuan loi_nhuan_tmp tien_hoa_hong tien_hoa_hong_gt tien_hoa_hong_ctv tien_hoa_hong_ql t_hoa_hong".split(" ");
2
- module.exports=async function($condition$$){if(!$condition$$.id_app)throw"B\u00e1o c\u00e1o n\u00e0y y\u00eau c\u1ea7u c\u00e1c tham s\u1ed1: id_app";$condition$$.den_ngay||($condition$$.den_ngay=new Date);const $query$$={id_app:$condition$$.id_app};$query$$.ngay_ct={$lte:$condition$$.den_ngay};$condition$$.tu_ngay&&($query$$.ngay_ct.$gte=$condition$$.tu_ngay);$condition$$.ma_dvcs&&($query$$.ma_dvcs=$condition$$.ma_dvcs);$condition$$.ma_nv&&($query$$.ma_nv=$condition$$.ma_nv);$condition$$.user_nv_giao_hang&&
3
- ($query$$.user_nv_giao_hang=$condition$$.user_nv_giao_hang);$condition$$.ma_kho&&($query$$.$or=[{ma_kho:$condition$$.ma_kho},{"details.ma_kho":$condition$$.ma_kho}]);$condition$$.ma_ct&&($query$$.ma_ct=$condition$$.ma_ct);$condition$$.id_cs&&($query$$["details.id_cs"]=$condition$$.id_cs);$condition$$.id_cs_ck&&($query$$["details.id_cs_ck"]=$condition$$.id_cs_ck);if($condition$$.ma_kh)$query$$.ma_kh=$condition$$.ma_kh;else{var $activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$=["nh_kh","nh_kh2","nh_kh3",
4
- "nh_kh4","nh_kh5"].filter($f$$=>$condition$$[$f$$]);if($activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.length>0){const $groupModel$$=global.getModel("group"),$nhResults$$=await Promise.all($activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.map($f$$=>$groupModel$$.getAllChildrenGroup($condition$$.id_app,$condition$$[$f$$],{status:!0}))),$condition_kh$$={id_app:$condition$$.id_app};$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.forEach(($f$$,$i$$)=>{$condition_kh$$[$f$$]={$in:$nhResults$$[$i$$]}});
5
- $activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$=await global.getModel("customer").find($condition_kh$$,{ma_kh:1}).lean();$query$$.ma_kh={$in:$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.map($c$$=>$c$$.ma_kh)}}}$condition$$.user_hoa_hong&&($activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$=$condition$$.user_hoa_hong,$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$=[{user_nv:$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$},{user_ctv:$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$},{user_gt:$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$},
6
- {user_ql:$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$},{"details.user_nv":$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$},{"details.user_ctv":$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$},{"details.user_gt":$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$},{"details.user_ql":$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$}],$query$$.$or?$query$$.$and=[{$or:$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$}]:$query$$.$or=$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$);let $ma_vts_set$$=
7
- null;if($condition$$.ma_vt)$query$$["details.ma_vt"]=$condition$$.ma_vt,$ma_vts_set$$=new Set([$condition$$.ma_vt]);else if($condition$$.ma_ncc||$condition$$.ma_nvt||$condition$$.ma_danh_muc_cty||$condition$$.ma_danh_muc)$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$={id_app:$condition$$.id_app},$condition$$.ma_ncc&&($activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.ma_ncc=$condition$$.ma_ncc),$condition$$.ma_nvt&&($activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.ma_nvt=$condition$$.ma_nvt),$condition$$.ma_danh_muc_cty&&
8
- ($activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.ma_danh_muc_cty=$condition$$.ma_danh_muc_cty),$condition$$.ma_danh_muc&&($activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.ma_danh_muc=$condition$$.ma_danh_muc),$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$=(await global.getModel("dmvt").find($activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$,{ma_vt:1}).lean()).map($v$$=>$v$$.ma_vt),$ma_vts_set$$=new Set($activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$),$query$$["details.ma_vt"]={$in:$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$};
9
- $query$$.show_payment_method=!1;$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$=await new Promise(($resolve$$,$reject$$)=>{databanle($query$$,($error$$,$rs$$)=>$error$$?$reject$$($error$$):$resolve$$($rs$$))});$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$=($ma_vts_set$$||$condition$$.id_cs||$condition$$.id_cs_ck?$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.filter($r$$=>($r$$.details||[]).some($d$$=>(!$ma_vts_set$$||$ma_vts_set$$.has($d$$.ma_vt))&&(!$condition$$.id_cs||$d$$.id_cs===$condition$$.id_cs)&&
10
- (!$condition$$.id_cs_ck||$d$$.id_cs_ck===$condition$$.id_cs_ck))):$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$).flatMap($mainRows_r$$=>{const {details:$details$$=[],details_tl:$details_tl$$,...$header$$}=$mainRows_r$$;$mainRows_r$$=$details$$.filter($d$$=>(!$ma_vts_set$$||$ma_vts_set$$.has($d$$.ma_vt))&&(!$condition$$.id_cs||$d$$.id_cs===$condition$$.id_cs)&&(!$condition$$.id_cs_ck||$d$$.id_cs_ck===$condition$$.id_cs_ck)).map(({_id:$_id_row$$,...$detail$$})=>{$_id_row$$={...$header$$,...$detail$$,
11
- nxt:2};for(const $f$$ of FALLBACK_FIELDS)$_id_row$$[$f$$]||($_id_row$$[$f$$]=$header$$[$f$$]);return $_id_row$$});if(!$details_tl$$)return $mainRows_r$$;const $tlRows$$=$details_tl$$.map(({_id:$_id$$,...$detail$$})=>{$_id$$={...$header$$,...$detail$$,nxt:1};for(const $f$$ of FALLBACK_FIELDS)$_id$$[$f$$]||($_id$$[$f$$]=$header$$[$f$$]);for(const $f$$ of NEGATE_FIELDS)$_id$$[$f$$]=-($_id$$[$f$$]||0);$_id$$.tien_xuat_tmp=-($_id$$.tien_nhap_nt||0);$_id$$.tien_xuat_nt=-($_id$$.tien_nhap_nt||0);$_id$$.sl_xuat=
12
- 0;return $_id$$});return[...$mainRows_r$$,...$tlRows$$]});await $activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.asyncJoinModel2($condition$$.id_app,"dmqddvt",{where:{ma_dvt:"ma_dvt",ma_vt:"ma_vt"},fields:["tu","mau","ma_dvt_goc"]});$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.forEach(($r$$,$he_so_i$$)=>{$r$$.stt=$he_so_i$$+1;$r$$.id_ct=$r$$._id?.toString();$r$$.bold=!1;$r$$.sysorder=5;$r$$.tt=$r$$.tien=($r$$.tien_hang_ct||0)-($r$$.tien_ck||0)+($r$$.tien_thue||0);$r$$.loi_nhuan_tmp=$r$$.tien_xuat_tmp?
13
- $r$$.tt-$r$$.tien_xuat_tmp-($r$$.tien_thue||0)-($r$$.tien_cp||0):0;$r$$.loi_nhuan=$r$$.tt-($r$$.tien_xuat||0)-($r$$.tien_thue||0)-($r$$.tien_cp||0);$r$$.t_hoa_hong=($r$$.tien_hoa_hong||0)+($r$$.tien_hoa_hong_gt||0)+($r$$.tien_hoa_hong_ctv||0)+($r$$.tien_hoa_hong_ql||0);$r$$.mau?($he_so_i$$=$r$$.tu/$r$$.mau,$r$$.sl_xuat_qd=$he_so_i$$*($r$$.sl_xuat||0),$r$$.sl_nhap_qd=$he_so_i$$*($r$$.sl_nhap||0)):($r$$.sl_xuat_qd=$r$$.sl_xuat||0,$r$$.sl_nhap_qd=$r$$.sl_nhap||0);$r$$.sl_xuat_qd_bc=$r$$.sl_xuat_qd;$r$$.sl_nhap_qd_bc=
14
- $r$$.sl_nhap_qd;$r$$.ma_dvt_bc=$r$$.ma_dvt_goc||$r$$.ma_dvt});$condition$$.ma_dvt&&await $activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.asyncJoinModel2($condition$$.id_app,"dmqddvt",{where:$item$$=>({ma_vt:$item$$.ma_vt,ma_dvt:$condition$$.ma_dvt}),setFields:($item$$,$he_so$$)=>{$he_so$$?.tu?($he_so$$=$he_so$$.mau/$he_so$$.tu,$item$$.ma_dvt_bc=$condition$$.ma_dvt,$item$$.sl_xuat_qd_bc=$he_so$$*($item$$.sl_xuat_qd||0),$item$$.sl_nhap_qd_bc=$he_so$$*($item$$.sl_nhap_qd||0)):($item$$.sl_xuat_qd_bc=
15
- $item$$.sl_xuat_qd,$item$$.sl_nhap_qd_bc=$item$$.sl_nhap_qd)}});if($condition$$.tinh_tong_cong||$condition$$.chi_hien_tong_cong){const $total_row$$=$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$.reduce(($acc$$,$r$$)=>{for(const $f$$ of TOTAL_FIELDS)$acc$$[$f$$]+=$r$$[$f$$]||0;return $acc$$},{sysorder:9,bold:!0,dien_giai:"T\u1ed5ng c\u1ed9ng",ten_vt:"T\u1ed5ng c\u1ed9ng",...Object.fromEntries(TOTAL_FIELDS.map($f$$=>[$f$$,0]))});$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$=$condition$$.chi_hien_tong_cong?
16
- [$total_row$$]:[...$activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$,$total_row$$]}return $activeFields_custs_hhOr_ma_vts_q_report_rs_uHH$$};
1
+ const _0xc63831=_0x29fc;(function(_0x2fc8b5,_0x3f4cc4){const _0x5dda8d=_0x29fc,_0x549096=_0x2fc8b5();while(!![]){try{const _0x5c7f9b=parseInt(_0x5dda8d(0x90))/0x1+parseInt(_0x5dda8d(0x9b))/0x2*(parseInt(_0x5dda8d(0xc1))/0x3)+-parseInt(_0x5dda8d(0xbe))/0x4+parseInt(_0x5dda8d(0x6f))/0x5+-parseInt(_0x5dda8d(0xc7))/0x6+-parseInt(_0x5dda8d(0xba))/0x7*(-parseInt(_0x5dda8d(0xa7))/0x8)+parseInt(_0x5dda8d(0x79))/0x9*(parseInt(_0x5dda8d(0xb0))/0xa);if(_0x5c7f9b===_0x3f4cc4)break;else _0x549096['push'](_0x549096['shift']());}catch(_0x5c9e6b){_0x549096['push'](_0x549096['shift']());}}}(_0x27a4,0x9124d));function _0x29fc(_0x1e740d,_0x139389){_0x1e740d=_0x1e740d-0x6f;const _0x27a450=_0x27a4();let _0x29fc32=_0x27a450[_0x1e740d];if(_0x29fc['HoowKb']===undefined){var _0x469ab4=function(_0x3887d1){const _0x289bba='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xe5a71e='',_0x2643c1='';for(let _0x1776df=0x0,_0x2a8673,_0x2eded1,_0x4c6d5a=0x0;_0x2eded1=_0x3887d1['charAt'](_0x4c6d5a++);~_0x2eded1&&(_0x2a8673=_0x1776df%0x4?_0x2a8673*0x40+_0x2eded1:_0x2eded1,_0x1776df++%0x4)?_0xe5a71e+=String['fromCharCode'](0xff&_0x2a8673>>(-0x2*_0x1776df&0x6)):0x0){_0x2eded1=_0x289bba['indexOf'](_0x2eded1);}for(let _0x371dce=0x0,_0x16a67c=_0xe5a71e['length'];_0x371dce<_0x16a67c;_0x371dce++){_0x2643c1+='%'+('00'+_0xe5a71e['charCodeAt'](_0x371dce)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2643c1);};_0x29fc['xXNKqB']=_0x469ab4,_0x29fc['ZLOHQo']={},_0x29fc['HoowKb']=!![];}const _0x5746e7=_0x27a450[0x0],_0x13301c=_0x1e740d+_0x5746e7,_0xd5c0ce=_0x29fc['ZLOHQo'][_0x13301c];return!_0xd5c0ce?(_0x29fc32=_0x29fc['xXNKqB'](_0x29fc32),_0x29fc['ZLOHQo'][_0x13301c]=_0x29fc32):_0x29fc32=_0xd5c0ce,_0x29fc32;}const databanle=require(_0xc63831(0xdd)+_0xc63831(0xad)+'e'),FALLBACK_FIELDS=[_0xc63831(0x7c),_0xc63831(0xa3),_0xc63831(0x87),_0xc63831(0x7f)],NEGATE_FIELDS=[_0xc63831(0x84)+_0xc63831(0xd9)+'nt',_0xc63831(0x84)+_0xc63831(0xcf),'tien_'+'hang_'+_0xc63831(0x82),_0xc63831(0x84)+_0xc63831(0xd9)+'ct',_0xc63831(0x84)+'ck',_0xc63831(0x84)+_0xc63831(0xd7),_0xc63831(0x84)+_0xc63831(0x99),_0xc63831(0x84)+_0xc63831(0xe7)+'nt','tien_'+_0xc63831(0xe1)+'ong','tien_'+_0xc63831(0xe1)+'ong_g'+'t',_0xc63831(0x84)+'hoa_h'+_0xc63831(0xce)+'tv',_0xc63831(0x84)+_0xc63831(0xe1)+_0xc63831(0xe4)+'l'],TOTAL_FIELDS=[_0xc63831(0xd2)+'at',_0xc63831(0xe8)+'ap','sl_xu'+_0xc63831(0xa0)+_0xc63831(0xd8),_0xc63831(0xe8)+'ap_qd'+'_bc',_0xc63831(0x84)+_0xc63831(0xcf),_0xc63831(0x84)+_0xc63831(0xd9)+'ct',_0xc63831(0x84)+'ck',_0xc63831(0x84)+_0xc63831(0x99),_0xc63831(0x84)+'cp',_0xc63831(0x84)+_0xc63831(0xab),_0xc63831(0x84)+_0xc63831(0x92)+_0xc63831(0x97),'tt',_0xc63831(0x86),'loi_n'+_0xc63831(0x7e),_0xc63831(0xde)+_0xc63831(0xb6)+'tmp','tien_'+_0xc63831(0xe1)+_0xc63831(0x96),_0xc63831(0x84)+_0xc63831(0xe1)+_0xc63831(0xd4)+'t',_0xc63831(0x84)+_0xc63831(0xe1)+_0xc63831(0xce)+'tv',_0xc63831(0x84)+_0xc63831(0xe1)+_0xc63831(0xe4)+'l',_0xc63831(0xa5)+_0xc63831(0x8d)];function _0x27a4(){const _0x38876a=['DgH1zq','Aw5N','mZq2ogT1r05ttq','y2HPx2G','C3r0','x2fWCa','x2nZ','yxrFCwq','yw9FAge','BgvUz3q','BwfFzhq','BMHFBxu','Df9OB2e','y3vZDg8','ndq1ntmZnMXIugvIuG','jg9Y','z2f5','BMHFA2G','EhvHDa','x2nR','ywjHBMW','Esb5W6P1','Dg9Uz18','mZboAxvkBMy','ywXS','BhmUBwe','z3jVDxa','AwvUx3q','BNzFz2K','AhvHBL8','BwfW','z2v0qwW','zxjFCwW','n2LmuKHLsq','y19JDhK','DgHVza','BMDHEv8','ndqZmtiYnfb1ENrjBW','BhmUDxm','zMLSDgu','nJG3q0rwywfW','BwfFzge','vog7Lw5Nia','zM9Yrwe','zxHWB3i','BNH0','ntC4nJKZnfHYEuv2EG','B2rLBdi','zxjFBNy','C3rHDhu','zgvS','BwfFDNq','y29UzW','B25Nx2m','AgfUzW','zhjLBKC','BMHHCf8','C2XFEhu','zg12Da','B25Nx2C','DhvFBMC','BNrYAwu','y2TFBNq','x2jJ','AgfUz18','zxjFy3q','BwfFy3q','x3z0','lI9Kyxq','Bg9Px24','Bwf1','jgD0zq','Ag9Hx2G','zMLUza','Dg9tDhi','B25Nx3e','igpHUQD1ia','y8oHyYb0','DgH1zv8','C2XFBMG','Df9IyW','jgLU','mJq3mtm5nuLbwxjeuG','qSoHBYbJ','zgvUx24','zgv0ywK','BwfFzhy','yxbFCwq','DgLUAf8','x2nZx2m','AwrFyxa','AgfTihm','mJGZotG3ofzjt09SDG','AgfZ','zxjFz3q','BwfFBNy','4BUroIbPza','AhvHBG','BwfFA2G','z2v0tw8','BwfFBMm','y3rFBNq','zMLLBgq','DgLLBL8','zgvY','DgLLBG','BwfFyNa','Df9NB2m','yxn5BMm','BgvHBG','y+g7Mw5N','jgfUza','x2HVBMC','C29Tzq','CM91Ca','mJCXodK2shLQugvq','DxnLCL8','EhvHDf8','sM9PBK0','AwrFy3m','y3r2','B25N','Dg1W','Cgf5Bwu'];_0x27a4=function(){return _0x38876a;};return _0x27a4();}module[_0xc63831(0xc5)+'ts']=async function(_0x4ab457){const _0x41ca77=_0xc63831;if(!_0x4ab457[_0x41ca77(0x77)+'p'])throw _0x41ca77(0x70)+'áo\x20nà'+_0x41ca77(0xae)+_0x41ca77(0xe5)+_0x41ca77(0xe6)+_0x41ca77(0x78)+_0x41ca77(0x7d)+_0x41ca77(0x9e);if(!_0x4ab457[_0x41ca77(0x71)+_0x41ca77(0xa9)])_0x4ab457[_0x41ca77(0x71)+'gay']=new Date();const _0x62a7be={};_0x62a7be[_0x41ca77(0x77)+'p']=_0x4ab457[_0x41ca77(0x77)+'p'];const _0x300cfa=_0x62a7be,_0x6effce={};_0x6effce['$lte']=_0x4ab457[_0x41ca77(0x71)+_0x41ca77(0xa9)],_0x300cfa[_0x41ca77(0xbd)+'ct']=_0x6effce;if(_0x4ab457[_0x41ca77(0xd5)+'ay'])_0x300cfa[_0x41ca77(0xbd)+'ct'][_0x41ca77(0xe0)]=_0x4ab457[_0x41ca77(0xd5)+'ay'];if(_0x4ab457[_0x41ca77(0x73)+'cs'])_0x300cfa['ma_dv'+'cs']=_0x4ab457['ma_dv'+'cs'];if(_0x4ab457[_0x41ca77(0x7c)])_0x300cfa[_0x41ca77(0x7c)]=_0x4ab457['ma_nv'];if(_0x4ab457[_0x41ca77(0x91)+'nv_gi'+'ao_ha'+'ng'])_0x300cfa[_0x41ca77(0x91)+_0x41ca77(0xb5)+'ao_ha'+'ng']=_0x4ab457[_0x41ca77(0x91)+_0x41ca77(0xb5)+_0x41ca77(0xa1)+'ng'];if(_0x4ab457[_0x41ca77(0x7f)+'o'])_0x300cfa[_0x41ca77(0xa8)]=[{'ma_kho':_0x4ab457[_0x41ca77(0x7f)+'o']},{'details.ma_kho':_0x4ab457['ma_kh'+'o']}];if(_0x4ab457[_0x41ca77(0xdb)])_0x300cfa[_0x41ca77(0xdb)]=_0x4ab457[_0x41ca77(0xdb)];if(_0x4ab457[_0x41ca77(0x94)])_0x300cfa['detai'+'ls.id'+_0x41ca77(0x9f)]=_0x4ab457[_0x41ca77(0x94)];if(_0x4ab457['id_cs'+'_ck'])_0x300cfa[_0x41ca77(0x72)+'ls.id'+_0x41ca77(0x76)+'k']=_0x4ab457['id_cs'+_0x41ca77(0xac)];if(_0x4ab457[_0x41ca77(0x7f)])_0x300cfa[_0x41ca77(0x7f)]=_0x4ab457[_0x41ca77(0x7f)];else{const _0x3e7203=[_0x41ca77(0xaa),'nh_kh'+'2',_0x41ca77(0xaa)+'3','nh_kh'+'4',_0x41ca77(0xaa)+'5'],_0xbfc81=_0x3e7203['filte'+'r'](_0x220a80=>_0x4ab457[_0x220a80]);if(_0xbfc81[_0x41ca77(0xa2)+'h']>0x0){const _0xa6c5ac=global[_0x41ca77(0x80)+_0x41ca77(0xcb)](_0x41ca77(0xb3)),_0x1545a9={};_0x1545a9[_0x41ca77(0xca)+'s']=!![];const _0x1e33b9=await Promise[_0x41ca77(0xb1)](_0xbfc81['map'](_0x516da3=>_0xa6c5ac[_0x41ca77(0xb8)+'lChil'+_0x41ca77(0xd0)+_0x41ca77(0x8f)](_0x4ab457['id_ap'+'p'],_0x4ab457[_0x516da3],_0x1545a9))),_0x341dc3={};_0x341dc3[_0x41ca77(0x77)+'p']=_0x4ab457['id_ap'+'p'];const _0x50eb8d=_0x341dc3;_0xbfc81[_0x41ca77(0xc4)+'ch']((_0x6af5d1,_0x280ffb)=>{const _0x45878f={};_0x45878f['$in']=_0x1e33b9[_0x280ffb],_0x50eb8d[_0x6af5d1]=_0x45878f;});const _0x5fcd09={};_0x5fcd09[_0x41ca77(0x7f)]=0x1;const _0x99dc6=await global['getMo'+_0x41ca77(0xcb)](_0x41ca77(0xa6)+'mer')[_0x41ca77(0xe2)](_0x50eb8d,_0x5fcd09)[_0x41ca77(0x8a)]();_0x300cfa[_0x41ca77(0x7f)]={'$in':_0x99dc6['map'](_0x2f1ab4=>_0x2f1ab4[_0x41ca77(0x7f)])};}}if(_0x4ab457[_0x41ca77(0x91)+_0x41ca77(0xe1)+_0x41ca77(0x96)]){const _0x2e7af8=_0x4ab457[_0x41ca77(0x91)+_0x41ca77(0xe1)+_0x41ca77(0x96)],_0x2a379b={};_0x2a379b['user_'+'nv']=_0x2e7af8;const _0x5c70a3={};_0x5c70a3[_0x41ca77(0x91)+_0x41ca77(0x95)]=_0x2e7af8;const _0x6d5950={};_0x6d5950[_0x41ca77(0x91)+'gt']=_0x2e7af8;const _0x2a80ee={};_0x2a80ee[_0x41ca77(0x91)+'ql']=_0x2e7af8;const _0x398b25={};_0x398b25['detai'+_0x41ca77(0xbf)+_0x41ca77(0xc9)]=_0x2e7af8;const _0x371a90={};_0x371a90['detai'+_0x41ca77(0xbf)+_0x41ca77(0xda)+'v']=_0x2e7af8;const _0x5daf44={};_0x5daf44['detai'+'ls.us'+_0x41ca77(0x7b)]=_0x2e7af8;const _0x4f6485={};_0x4f6485[_0x41ca77(0x72)+_0x41ca77(0xbf)+_0x41ca77(0xb9)]=_0x2e7af8;const _0x341bc1=[_0x2a379b,_0x5c70a3,_0x6d5950,_0x2a80ee,_0x398b25,_0x371a90,_0x5daf44,_0x4f6485],_0x32684a={};_0x32684a[_0x41ca77(0xa8)]=_0x341bc1,_0x300cfa[_0x41ca77(0xa8)]?_0x300cfa[_0x41ca77(0x8c)]=[_0x32684a]:_0x300cfa['$or']=_0x341bc1;}let _0x3189b3=null;if(_0x4ab457['ma_vt'])_0x300cfa[_0x41ca77(0x72)+_0x41ca77(0xb2)+_0x41ca77(0xdc)]=_0x4ab457[_0x41ca77(0xcc)],_0x3189b3=new Set([_0x4ab457['ma_vt']]);else{if(_0x4ab457[_0x41ca77(0x81)+'c']||_0x4ab457['ma_nv'+'t']||_0x4ab457['ma_da'+_0x41ca77(0xa4)+'c_cty']||_0x4ab457[_0x41ca77(0xc2)+_0x41ca77(0xa4)+'c']){const _0x2df4a4={};_0x2df4a4[_0x41ca77(0x77)+'p']=_0x4ab457[_0x41ca77(0x77)+'p'];const _0x3441af=_0x2df4a4;if(_0x4ab457[_0x41ca77(0x81)+'c'])_0x3441af[_0x41ca77(0x81)+'c']=_0x4ab457[_0x41ca77(0x81)+'c'];if(_0x4ab457[_0x41ca77(0x7c)+'t'])_0x3441af[_0x41ca77(0x7c)+'t']=_0x4ab457['ma_nv'+'t'];if(_0x4ab457[_0x41ca77(0xc2)+'nh_mu'+_0x41ca77(0xbb)])_0x3441af[_0x41ca77(0xc2)+_0x41ca77(0xa4)+_0x41ca77(0xbb)]=_0x4ab457[_0x41ca77(0xc2)+_0x41ca77(0xa4)+_0x41ca77(0xbb)];if(_0x4ab457[_0x41ca77(0xc2)+_0x41ca77(0xa4)+'c'])_0x3441af[_0x41ca77(0xc2)+_0x41ca77(0xa4)+'c']=_0x4ab457[_0x41ca77(0xc2)+'nh_mu'+'c'];const _0x5b5f2f={};_0x5b5f2f[_0x41ca77(0xcc)]=0x1;const _0x146506=await global[_0x41ca77(0x80)+_0x41ca77(0xcb)](_0x41ca77(0xd3))[_0x41ca77(0xe2)](_0x3441af,_0x5b5f2f)[_0x41ca77(0x8a)](),_0x48f598=_0x146506['map'](_0x1e629=>_0x1e629['ma_vt']);_0x3189b3=new Set(_0x48f598);const _0x74429b={};_0x74429b[_0x41ca77(0xea)]=_0x48f598,_0x300cfa[_0x41ca77(0x72)+_0x41ca77(0xb2)+_0x41ca77(0xdc)]=_0x74429b;}}_0x300cfa['show_'+_0x41ca77(0x98)+'nt_me'+_0x41ca77(0xbc)]=![];const _0x3b30d0=await new Promise((_0xb28afd,_0x12489e)=>{databanle(_0x300cfa,(_0x167b75,_0x1f8c8c)=>_0x167b75?_0x12489e(_0x167b75):_0xb28afd(_0x1f8c8c));}),_0x4650b8=_0x3189b3||_0x4ab457[_0x41ca77(0x94)]||_0x4ab457[_0x41ca77(0x94)+'_ck']?_0x3b30d0[_0x41ca77(0xc0)+'r'](_0x26ff9f=>{const _0x10b36a=_0x41ca77,_0x49c828=_0x26ff9f[_0x10b36a(0x72)+'ls']||[];return _0x49c828[_0x10b36a(0x8e)](_0x5813d6=>(!_0x3189b3||_0x3189b3[_0x10b36a(0x7a)](_0x5813d6[_0x10b36a(0xcc)]))&&(!_0x4ab457[_0x10b36a(0x94)]||_0x5813d6[_0x10b36a(0x94)]===_0x4ab457[_0x10b36a(0x94)])&&(!_0x4ab457['id_cs'+_0x10b36a(0xac)]||_0x5813d6[_0x10b36a(0x94)+_0x10b36a(0xac)]===_0x4ab457['id_cs'+_0x10b36a(0xac)]));}):_0x3b30d0;let _0x5358f8=_0x4650b8['flatM'+'ap'](_0x81c6fc=>{const _0x4b8868=_0x41ca77,{details:details=[],details_tl:_0x401499,..._0x1a7fee}=_0x81c6fc,_0x24f77b=details[_0x4b8868(0xc0)+'r'](_0x14a23a=>(!_0x3189b3||_0x3189b3['has'](_0x14a23a['ma_vt']))&&(!_0x4ab457['id_cs']||_0x14a23a['id_cs']===_0x4ab457[_0x4b8868(0x94)])&&(!_0x4ab457['id_cs'+'_ck']||_0x14a23a[_0x4b8868(0x94)+_0x4b8868(0xac)]===_0x4ab457[_0x4b8868(0x94)+'_ck']))['map'](({_id:_0x4e3fe1,..._0x236671})=>{const _0x1f18fd=_0x4b8868,_0xf5cce2={..._0x1a7fee,..._0x236671};_0xf5cce2[_0x1f18fd(0xc6)]=0x2;const _0x26915b=_0xf5cce2;for(const _0x1a78cc of FALLBACK_FIELDS){if(!_0x26915b[_0x1a78cc])_0x26915b[_0x1a78cc]=_0x1a7fee[_0x1a78cc];}return _0x26915b;});if(!_0x401499)return _0x24f77b;const _0x31aab1=_0x401499[_0x4b8868(0xb7)](({_id:_0xecca21,..._0x4c2fe7})=>{const _0x383b8d=_0x4b8868,_0x222c56={..._0x1a7fee,..._0x4c2fe7};_0x222c56[_0x383b8d(0xc6)]=0x1;const _0x53b0ce=_0x222c56;for(const _0xdf3de of FALLBACK_FIELDS){if(!_0x53b0ce[_0xdf3de])_0x53b0ce[_0xdf3de]=_0x1a7fee[_0xdf3de];}for(const _0x5bf9ae of NEGATE_FIELDS){_0x53b0ce[_0x5bf9ae]=-(_0x53b0ce[_0x5bf9ae]||0x0);}return _0x53b0ce[_0x383b8d(0x84)+_0x383b8d(0x92)+_0x383b8d(0x97)]=-(_0x53b0ce[_0x383b8d(0x84)+_0x383b8d(0xd1)+'nt']||0x0),_0x53b0ce[_0x383b8d(0x84)+_0x383b8d(0x92)+'nt']=-(_0x53b0ce[_0x383b8d(0x84)+'nhap_'+'nt']||0x0),_0x53b0ce[_0x383b8d(0xd2)+'at']=0x0,_0x53b0ce;});return[..._0x24f77b,..._0x31aab1];});const _0x594e28={};_0x594e28[_0x41ca77(0x73)+'t']=_0x41ca77(0x73)+'t',_0x594e28[_0x41ca77(0xcc)]=_0x41ca77(0xcc);const _0x8b23fc={};_0x8b23fc['where']=_0x594e28,_0x8b23fc[_0x41ca77(0x83)+'s']=['tu',_0x41ca77(0xdf),_0x41ca77(0x73)+_0x41ca77(0x88)],await _0x5358f8['async'+_0x41ca77(0x93)+_0x41ca77(0xc8)](_0x4ab457[_0x41ca77(0x77)+'p'],'dmqdd'+'vt',_0x8b23fc),_0x5358f8['forEa'+'ch']((_0x337321,_0x45f9e4)=>{const _0x50f8bb=_0x41ca77;_0x337321[_0x50f8bb(0x9d)]=_0x45f9e4+0x1,_0x337321['id_ct']=_0x337321['_id']?.[_0x50f8bb(0xe3)+_0x50f8bb(0x9a)](),_0x337321['bold']=![],_0x337321['sysor'+_0x50f8bb(0x85)]=0x5,_0x337321['tt']=_0x337321['tien']=(_0x337321['tien_'+_0x50f8bb(0xd9)+'ct']||0x0)-(_0x337321['tien_'+'ck']||0x0)+(_0x337321[_0x50f8bb(0x84)+'thue']||0x0),_0x337321[_0x50f8bb(0xde)+_0x50f8bb(0xb6)+_0x50f8bb(0x97)]=_0x337321[_0x50f8bb(0x84)+_0x50f8bb(0x92)+_0x50f8bb(0x97)]?_0x337321['tt']-_0x337321[_0x50f8bb(0x84)+_0x50f8bb(0x92)+_0x50f8bb(0x97)]-(_0x337321['tien_'+_0x50f8bb(0x99)]||0x0)-(_0x337321['tien_'+'cp']||0x0):0x0,_0x337321[_0x50f8bb(0xde)+_0x50f8bb(0x7e)]=_0x337321['tt']-(_0x337321[_0x50f8bb(0x84)+'xuat']||0x0)-(_0x337321['tien_'+'thue']||0x0)-(_0x337321['tien_'+'cp']||0x0),_0x337321['t_hoa'+'_hong']=(_0x337321[_0x50f8bb(0x84)+_0x50f8bb(0xe1)+_0x50f8bb(0x96)]||0x0)+(_0x337321[_0x50f8bb(0x84)+_0x50f8bb(0xe1)+_0x50f8bb(0xd4)+'t']||0x0)+(_0x337321[_0x50f8bb(0x84)+'hoa_h'+_0x50f8bb(0xce)+'tv']||0x0)+(_0x337321[_0x50f8bb(0x84)+_0x50f8bb(0xe1)+_0x50f8bb(0xe4)+'l']||0x0);if(_0x337321[_0x50f8bb(0xdf)]){const _0x42cf4c=_0x337321['tu']/_0x337321['mau'];_0x337321['sl_xu'+_0x50f8bb(0xa0)]=_0x42cf4c*(_0x337321['sl_xu'+'at']||0x0),_0x337321[_0x50f8bb(0xe8)+_0x50f8bb(0x74)]=_0x42cf4c*(_0x337321[_0x50f8bb(0xe8)+'ap']||0x0);}else _0x337321['sl_xu'+'at_qd']=_0x337321['sl_xu'+'at']||0x0,_0x337321[_0x50f8bb(0xe8)+_0x50f8bb(0x74)]=_0x337321['sl_nh'+'ap']||0x0;_0x337321[_0x50f8bb(0xd2)+_0x50f8bb(0xa0)+_0x50f8bb(0xd8)]=_0x337321['sl_xu'+_0x50f8bb(0xa0)],_0x337321[_0x50f8bb(0xe8)+_0x50f8bb(0x74)+_0x50f8bb(0xd8)]=_0x337321['sl_nh'+_0x50f8bb(0x74)],_0x337321[_0x50f8bb(0x73)+_0x50f8bb(0xe9)]=_0x337321['ma_dv'+_0x50f8bb(0x88)]||_0x337321[_0x50f8bb(0x73)+'t'];});_0x4ab457[_0x41ca77(0x73)+'t']&&await _0x5358f8[_0x41ca77(0x89)+_0x41ca77(0x93)+_0x41ca77(0xc8)](_0x4ab457[_0x41ca77(0x77)+'p'],'dmqdd'+'vt',{'where':_0x124bab=>({'ma_vt':_0x124bab[_0x41ca77(0xcc)],'ma_dvt':_0x4ab457['ma_dv'+'t']}),'setFields':(_0x2d14fe,_0x42ea6d)=>{const _0x8f981=_0x41ca77;if(_0x42ea6d?.['tu']){const _0x155918=_0x42ea6d[_0x8f981(0xdf)]/_0x42ea6d['tu'];_0x2d14fe['ma_dv'+_0x8f981(0xe9)]=_0x4ab457['ma_dv'+'t'],_0x2d14fe[_0x8f981(0xd2)+_0x8f981(0xa0)+_0x8f981(0xd8)]=_0x155918*(_0x2d14fe[_0x8f981(0xd2)+_0x8f981(0xa0)]||0x0),_0x2d14fe['sl_nh'+_0x8f981(0x74)+_0x8f981(0xd8)]=_0x155918*(_0x2d14fe[_0x8f981(0xe8)+'ap_qd']||0x0);}else _0x2d14fe['sl_xu'+_0x8f981(0xa0)+_0x8f981(0xd8)]=_0x2d14fe[_0x8f981(0xd2)+'at_qd'],_0x2d14fe[_0x8f981(0xe8)+'ap_qd'+'_bc']=_0x2d14fe[_0x8f981(0xe8)+_0x8f981(0x74)];}});if(_0x4ab457[_0x41ca77(0x75)+_0x41ca77(0xaf)+_0x41ca77(0xcd)]||_0x4ab457[_0x41ca77(0x9c)+_0x41ca77(0xb4)+_0x41ca77(0xce)+_0x41ca77(0x96)]){const _0x1685de=_0x5358f8['reduc'+'e']((_0x5f0711,_0xff2cd3)=>{for(const _0x44f2bb of TOTAL_FIELDS)_0x5f0711[_0x44f2bb]+=_0xff2cd3[_0x44f2bb]||0x0;return _0x5f0711;},{'sysorder':0x9,'bold':!![],'dien_giai':_0x41ca77(0xc3)+_0x41ca77(0x8b),'ten_vt':_0x41ca77(0xc3)+_0x41ca77(0x8b),...Object['fromE'+_0x41ca77(0xd6)+'s'](TOTAL_FIELDS[_0x41ca77(0xb7)](_0x148fbd=>[_0x148fbd,0x0]))});_0x5358f8=_0x4ab457[_0x41ca77(0x9c)+_0x41ca77(0xb4)+_0x41ca77(0xce)+_0x41ca77(0x96)]?[_0x1685de]:[..._0x5358f8,_0x1685de];}return _0x5358f8;};
@@ -1,15 +1 @@
1
- const databanle=require("./databanlenpp"),async=require("async");
2
- module.exports=async function($condition$$){if(!$condition$$.id_app)throw"B\u00e1o c\u00e1o n\u00e0y y\u00eau c\u1ea7u c\u00e1c tham s\u1ed1:id_app";$condition$$.den_ngay||($condition$$.den_ngay=new Date);const $query$$={id_app:$condition$$.id_app};$query$$.ngay_ct={$lte:$condition$$.den_ngay};$condition$$.tu_ngay&&($query$$.ngay_ct.$gte=$condition$$.tu_ngay);$condition$$.ma_dvcs&&($query$$.ma_dvcs=$condition$$.ma_dvcs);$condition$$.user_nv&&($query$$.user_nv=$condition$$.user_nv);$condition$$.user_ctv&&
3
- ($query$$.user_ctv=$condition$$.user_ctv);$condition$$.tinh_thanh&&($query$$.tinh_thanh=$condition$$.tinh_thanh);$condition$$.ma_nv&&($query$$.ma_nv=$condition$$.ma_nv);$condition$$.ma_kho&&($query$$.$or=[{ma_kho:$condition$$.ma_kho},{"details.ma_kho":$condition$$.ma_kho}]);if($condition$$.ma_kh)$query$$.ma_kh=$condition$$.ma_kh;else{var $condition_kh_custs_q$$={};if($condition$$.nh_kh){var $nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$=await global.getModel("group").getAllChildrenGroup($condition$$.id_app,
4
- $condition$$.nh_kh,{status:!0});$condition_kh_custs_q$$.nh_kh={$in:$nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$}}$condition$$.nh_kh2&&($nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$=await global.getModel("group").getAllChildrenGroup($condition$$.id_app,$condition$$.nh_kh2,{status:!0}),$condition_kh_custs_q$$.nh_kh2={$in:$nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$});$condition$$.nh_kh3&&($nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$=await global.getModel("group").getAllChildrenGroup($condition$$.id_app,$condition$$.nh_kh3,
5
- {status:!0}),$condition_kh_custs_q$$.nh_kh3={$in:$nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$});$condition$$.nh_kh4&&($nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$=await global.getModel("group").getAllChildrenGroup($condition$$.id_app,$condition$$.nh_kh4,{status:!0}),$condition_kh_custs_q$$.nh_kh4={$in:$nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$});$condition$$.nh_kh5&&($nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$=await global.getModel("group").getAllChildrenGroup($condition$$.id_app,$condition$$.nh_kh5,{status:!0}),
6
- $condition_kh_custs_q$$.nh_kh5={$in:$nh_khs_nh_khs2_nh_khs3_nh_khs4_nh_khs5$$});Object.keys($condition_kh_custs_q$$).length>0&&($condition_kh_custs_q$$.id_app=$condition$$.id_app,$condition_kh_custs_q$$=await global.getModel("customer").find($condition_kh_custs_q$$,{ma_kh:1}).lean(),$query$$.ma_kh={$in:$condition_kh_custs_q$$.map($c$$=>$c$$.ma_kh)})}$condition$$.ma_ct&&($query$$.ma_ct=$condition$$.ma_ct);$condition$$.user_hoa_hong&&($query$$.$or?$query$$.$and=[{$or:[{user_nv:$condition$$.user_hoa_hong},
7
- {user_ctv:$condition$$.user_hoa_hong},{user_gt:$condition$$.user_hoa_hong},{user_ql:$condition$$.user_hoa_hong},{"details.user_nv":$condition$$.user_hoa_hong},{"details.user_ctv":$condition$$.user_hoa_hong},{"details.user_gt":$condition$$.user_hoa_hong},{"details.user_ql":$condition$$.user_hoa_hong}]}]:$query$$.$or=[{user_nv:$condition$$.user_hoa_hong},{user_ctv:$condition$$.user_hoa_hong},{user_gt:$condition$$.user_hoa_hong},{user_ql:$condition$$.user_hoa_hong},{"details.user_nv":$condition$$.user_hoa_hong},
8
- {"details.user_ctv":$condition$$.user_hoa_hong},{"details.user_gt":$condition$$.user_hoa_hong},{"details.user_ql":$condition$$.user_hoa_hong}]);let $ma_vts$$;if($condition$$.ma_vt)$query$$["details.ma_vt"]=$condition$$.ma_vt,$ma_vts$$=[$condition$$.ma_vt];else if($condition$$.ma_ncc||$condition$$.ma_nvt||$condition$$.ma_danh_muc_cty||$condition$$.ma_danh_muc)$condition_kh_custs_q$$={id_app:$condition$$.id_app},$condition$$.ma_ncc&&($condition_kh_custs_q$$.ma_ncc=$condition$$.ma_ncc),$condition$$.ma_nvt&&
9
- ($condition_kh_custs_q$$.ma_nvt=$condition$$.ma_nvt),$condition$$.ma_danh_muc_cty&&($condition_kh_custs_q$$.ma_danh_muc_cty=$condition$$.ma_danh_muc_cty),$condition$$.ma_danh_muc&&($condition_kh_custs_q$$.ma_danh_muc=$condition$$.ma_danh_muc),$ma_vts$$=(await global.getModel("dmvt").find($condition_kh_custs_q$$,{ma_vt:1}).lean()).map($v$$=>$v$$.ma_vt),$query$$["details.ma_vt"]={$in:$ma_vts$$};$condition$$.id_cs&&($query$$["details.id_cs"]=$condition$$.id_cs);$condition$$.id_cs_ck&&($query$$["details.id_cs_ck"]=
10
- $condition$$.id_cs_ck);$query$$.show_payment_method=!1;return new Promise(($resolve$$,$reject$$)=>{databanle($query$$,function($error$$,$rs$$){if($error$$)return $reject$$($error$$);async.mapLimit($rs$$,100,function($r$$,$callback$$){let $details$$=$r$$.details||[];delete $r$$.details;$details$$=$details$$.map($_r_detail$$=>{delete $_r_detail$$._id;$_r_detail$$.nxt=2;$_r_detail$$={...$r$$,...$_r_detail$$};$_r_detail$$.ma_nv||($_r_detail$$.ma_nv=$r$$.ma_nv);$_r_detail$$.ma_dt||($_r_detail$$.ma_dt=
11
- $r$$.ma_dt);$_r_detail$$.ma_bp||($_r_detail$$.ma_bp=$r$$.ma_bp);return $_r_detail$$});$r$$.details_tl&&($details$$=[...$details$$,...$r$$.details_tl.map($detail$$=>{delete $detail$$._id;$detail$$={...$r$$,...$detail$$};$detail$$.ma_nv||($detail$$.ma_nv=$r$$.ma_nv);$detail$$.ma_dt||($detail$$.ma_dt=$r$$.ma_dt);$detail$$.ma_bp||($detail$$.ma_bp=$r$$.ma_bp);$detail$$.tien_hang_nt=0-$detail$$.tien_hang_nt||0;$detail$$.tien_hang=0-($detail$$.tien_hang||0);$detail$$.tien_hang_ct_nt=0-$detail$$.tien_hang_ct_nt||
12
- 0;$detail$$.tien_hang_ct=0-($detail$$.tien_hang_ct||0);$detail$$.tien_ck=0-($detail$$.tien_ck||0);$detail$$.tien_ck_nt=0-($detail$$.tien_ck_nt||0);$detail$$.tien_thue=0-($detail$$.tien_thue||0);$detail$$.tien_thue_nt=0-($detail$$.tien_thue_nt||0);$detail$$.tien_xuat_tmp=0-($detail$$.tien_nhap_nt||0);$detail$$.sl_xuat=0;$detail$$.tien_hoa_hong=0-$detail$$.tien_hoa_hong;$detail$$.tien_hoa_hong_gt=0-$detail$$.tien_hoa_hong_gt;$detail$$.tien_hoa_hong_ctv=0-$detail$$.tien_hoa_hong_ctv;$detail$$.tien_hoa_hong_ql=
13
- 0-$detail$$.tien_hoa_hong_ql;$detail$$.nxt=1;return $detail$$})],delete $r$$.details_tl);$callback$$(null,$details$$)},async function($error$$,$report$$){if($error$$)return $reject$$($error$$);$report$$=$report$$.reduce(($a$$,$b$$)=>$a$$.concat($b$$),[]);$ma_vts$$&&($report$$=$report$$.filter($r$$=>$ma_vts$$.indexOf($r$$.ma_vt)>=0));$condition$$.id_cs&&($report$$=$report$$.filter($r$$=>$r$$.id_cs===$condition$$.id_cs));$condition$$.id_cs_ck&&($report$$=$report$$.filter($r$$=>$r$$.id_cs_ck===$condition$$.id_cs_ck));
14
- await $report$$.asyncJoinModel2($condition$$.id_app,"dmqddvt",{where:{ma_dvt:"ma_dvt",ma_vt:"ma_vt"},fields:["tu","mau","ma_dvt_goc"]});$report$$.forEach(function($r$$,$he_so_qd_i$$){$r$$.stt=$he_so_qd_i$$+1;$r$$.id_ct=$r$$._id.toString();$r$$.bold=!1;$r$$.tt=$r$$.tien=($r$$.tien_hang_ct||0)-($r$$.tien_ck||0)+($r$$.tien_thue||0);$r$$.loi_nhuan_tmp=$r$$.tien_xuat_tmp?$r$$.tt-$r$$.tien_xuat_tmp-($r$$.tien_thue||0):0;$r$$.t_hoa_hong=$r$$.tien_hoa_hong+$r$$.tien_hoa_hong_gt+$r$$.tien_hoa_hong_ctv+$r$$.tien_hoa_hong_ql;
15
- $r$$.mau?($he_so_qd_i$$=$r$$.tu/$r$$.mau,$r$$.sl_xuat_qd=$he_so_qd_i$$*($r$$.sl_xuat||0),$r$$.sl_nhap_qd=$he_so_qd_i$$*($r$$.sl_nhap||0)):($r$$.sl_xuat_qd=$r$$.sl_xuat||0,$r$$.sl_nhap_qd=$r$$.sl_nhap||0)});$resolve$$($report$$)})})})};
1
+ function _0x117b(){const _0x1c3d01=['Ag9Hx2G','yxn5BMm','BwfFA2G','zgvS','zgvUx24','lI9Kyxq','lI4VBgK','C2XFEhu','BMHHCf8','x3z0','y3rFBNq','A2v5CW','x2nR','nKjTv2HLta','BNH0','jgLU','z2f5','BwfFzhq','BwfFBNy','C3r0','jgX0zq','AwrFyxa','y2TFBNq','BwfFDNq','Bg9Px24','nZi3nJy0me9ZuvrUyq','EhvHDf8','BMDHEv8','y29Uy2e','B25N','BMHFBxu','y3r2','z2v0qwW','Dg1W','yM9Sza','zMLUza','BgvUz3q','x2LK','zw5WCa','BxbHDa','BwfWtgK','BMHFA2G','zgv0ywK','DgLLBL8','jg9Y','AgfUzW','yNmVyxm','zxjFCwW','BwfFy3q','BhmUBwe','x2TOBW','ndG5mtu0nun0v0Dnua','CM91Ca','BwvY','4BUroMLKxW','Cgf5Bwu','BwfFzge','DgHVza','nJGXoty1mMTgs2HwEa','zxjFz3q','mtmZotq5mKXtvuXXrG','D2HLCMu','x2nZx2m','BwfFzhy','DgHHBMG','Bwf1','BwfFBMm','DgH1zq','Df9NB2m','AgfUz18','zxjFy3q','yxbW','DhvFBMC','BwfW','Dg9tDhi','BgvHBG','B25Nx3e','C3rHDhu','y19JDhK','BwfFyNa','zxjFBNy','C2XFBMG','zxHWB3i','BhmUDxm','BhnFDgW','yxbFCwq','DgLUAf8','B25Nx2C','nJuYodu0nxPftLnttq','z2v0tw8','BenOAwW','mZjrCwfos00','AwrFy3m','BNrFBwu','C2HVD18','W6fVig7dOa','DgH1zv8','mMfLCgPwrq','z3jVDxa','Aw5KzxG','mtGYnJG3nJbkvxbXtvK','AhvHBL8','qSoHBYbJ','DxnLCL8','y3vZDg8','AwrFy3q','x2HVBMC','yxrFCwq','mJy1mte3nvjevxDQtG','zhjLBKC','jgD0zq','Aw5N'];_0x117b=function(){return _0x1c3d01;};return _0x117b();}function _0x4bd9(_0x4737fe,_0x36a737){_0x4737fe=_0x4737fe-0x18f;const _0x117bf4=_0x117b();let _0x4bd941=_0x117bf4[_0x4737fe];if(_0x4bd9['qKUJPJ']===undefined){var _0x549254=function(_0x1721fb){const _0x29fc2e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x38eba0='',_0x3b6eae='';for(let _0x346240=0x0,_0x12e4ce,_0x3730a8,_0x49845e=0x0;_0x3730a8=_0x1721fb['charAt'](_0x49845e++);~_0x3730a8&&(_0x12e4ce=_0x346240%0x4?_0x12e4ce*0x40+_0x3730a8:_0x3730a8,_0x346240++%0x4)?_0x38eba0+=String['fromCharCode'](0xff&_0x12e4ce>>(-0x2*_0x346240&0x6)):0x0){_0x3730a8=_0x29fc2e['indexOf'](_0x3730a8);}for(let _0x13eda2=0x0,_0x333ffb=_0x38eba0['length'];_0x13eda2<_0x333ffb;_0x13eda2++){_0x3b6eae+='%'+('00'+_0x38eba0['charCodeAt'](_0x13eda2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3b6eae);};_0x4bd9['UmVvRG']=_0x549254,_0x4bd9['anLvAd']={},_0x4bd9['qKUJPJ']=!![];}const _0x16f658=_0x117bf4[0x0],_0x1bf84b=_0x4737fe+_0x16f658,_0x4b8210=_0x4bd9['anLvAd'][_0x1bf84b];return!_0x4b8210?(_0x4bd941=_0x4bd9['UmVvRG'](_0x4bd941),_0x4bd9['anLvAd'][_0x1bf84b]=_0x4bd941):_0x4bd941=_0x4b8210,_0x4bd941;}const _0x36a3a2=_0x4bd9;(function(_0xd8d6e3,_0x23102c){const _0x18e6a9=_0x4bd9,_0x3dd32e=_0xd8d6e3();while(!![]){try{const _0x1ace46=parseInt(_0x18e6a9(0x1e6))/0x1+parseInt(_0x18e6a9(0x19b))/0x2*(parseInt(_0x18e6a9(0x1dd))/0x3)+-parseInt(_0x18e6a9(0x1e4))/0x4+-parseInt(_0x18e6a9(0x192))/0x5*(-parseInt(_0x18e6a9(0x1b7))/0x6)+-parseInt(_0x18e6a9(0x1c3))/0x7+parseInt(_0x18e6a9(0x195))/0x8*(parseInt(_0x18e6a9(0x1a6))/0x9)+-parseInt(_0x18e6a9(0x19e))/0xa;if(_0x1ace46===_0x23102c)break;else _0x3dd32e['push'](_0x3dd32e['shift']());}catch(_0xc2c317){_0x3dd32e['push'](_0x3dd32e['shift']());}}}(_0x117b,0xd7813));const databanle=require(_0x36a3a2(0x1af)+'abanl'+_0x36a3a2(0x1d0)),async=require(_0x36a3a2(0x1b0)+_0x36a3a2(0x1d8)+'yncCo'+_0x36a3a2(0x1d1));module[_0x36a3a2(0x1fc)+'ts']=async function(_0x316acb){const _0x1ba218=_0x36a3a2;if(!_0x316acb[_0x1ba218(0x1bf)+'p'])throw _0x1ba218(0x1a0)+_0x1ba218(0x199)+'y\x20yêu'+'\x20cầu\x20'+'các\x20t'+'ham\x20s'+_0x1ba218(0x1e0)+_0x1ba218(0x1f1);if(!_0x316acb[_0x1ba218(0x1ae)+_0x1ba218(0x1ba)])_0x316acb['den_n'+_0x1ba218(0x1ba)]=new Date();const _0x5b5447={};_0x5b5447[_0x1ba218(0x1bf)+'p']=_0x316acb[_0x1ba218(0x1bf)+'p'];const _0x4c16c8=_0x5b5447,_0x4b3d97={};_0x4b3d97[_0x1ba218(0x1be)]=_0x316acb[_0x1ba218(0x1ae)+_0x1ba218(0x1ba)],_0x4c16c8['ngay_'+'ct']=_0x4b3d97;_0x316acb[_0x1ba218(0x1f2)+'ay']&&(_0x4c16c8[_0x1ba218(0x1c5)+'ct'][_0x1ba218(0x1a8)]=_0x316acb['tu_ng'+'ay']);_0x316acb[_0x1ba218(0x1e9)+'cs']&&(_0x4c16c8[_0x1ba218(0x1e9)+'cs']=_0x316acb[_0x1ba218(0x1e9)+'cs']);_0x316acb[_0x1ba218(0x1a1)+'nv']&&(_0x4c16c8[_0x1ba218(0x1a1)+'nv']=_0x316acb[_0x1ba218(0x1a1)+'nv']);_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1c9)]&&(_0x4c16c8[_0x1ba218(0x1a1)+'ctv']=_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1c9)]);_0x316acb[_0x1ba218(0x190)+'thanh']&&(_0x4c16c8[_0x1ba218(0x190)+'thanh']=_0x316acb[_0x1ba218(0x190)+_0x1ba218(0x1ea)]);_0x316acb['ma_nv']&&(_0x4c16c8['ma_nv']=_0x316acb[_0x1ba218(0x1bc)]);if(_0x316acb[_0x1ba218(0x1ac)+'o']){const _0x5cb7bf={};_0x5cb7bf[_0x1ba218(0x1ac)+'o']=_0x316acb['ma_kh'+'o'];const _0x141676={};_0x141676[_0x1ba218(0x1d4)+'ls.ma'+_0x1ba218(0x1dc)]=_0x316acb[_0x1ba218(0x1ac)+'o'],_0x4c16c8[_0x1ba218(0x1d6)]=[_0x5cb7bf,_0x141676];}if(_0x316acb[_0x1ba218(0x1ac)])_0x4c16c8['ma_kh']=_0x316acb[_0x1ba218(0x1ac)];else{let _0x1ed364,_0x2ff5fe,_0x56d715,_0x97119b,_0x570856,_0x14fda8={};if(_0x316acb[_0x1ba218(0x1d3)]){const _0x398f03={};_0x398f03[_0x1ba218(0x1f7)+'s']=!![],_0x1ed364=await global[_0x1ba218(0x193)+_0x1ba218(0x1ad)](_0x1ba218(0x19c))['getAl'+'lChil'+_0x1ba218(0x1a7)+_0x1ba218(0x1de)](_0x316acb['id_ap'+'p'],_0x316acb[_0x1ba218(0x1d3)],_0x398f03);const _0x40e914={};_0x40e914[_0x1ba218(0x1b9)]=_0x1ed364,_0x14fda8['nh_kh']=_0x40e914;}if(_0x316acb['nh_kh'+'2']){const _0x16420f={};_0x16420f[_0x1ba218(0x1f7)+'s']=!![],_0x2ff5fe=await global['getMo'+_0x1ba218(0x1ad)]('group')[_0x1ba218(0x1ca)+_0x1ba218(0x194)+'drenG'+_0x1ba218(0x1de)](_0x316acb[_0x1ba218(0x1bf)+'p'],_0x316acb[_0x1ba218(0x1d3)+'2'],_0x16420f);const _0x3c69aa={};_0x3c69aa[_0x1ba218(0x1b9)]=_0x2ff5fe,_0x14fda8[_0x1ba218(0x1d3)+'2']=_0x3c69aa;}if(_0x316acb['nh_kh'+'3']){const _0x49608f={};_0x49608f[_0x1ba218(0x1f7)+'s']=!![],_0x56d715=await global[_0x1ba218(0x193)+_0x1ba218(0x1ad)]('group')[_0x1ba218(0x1ca)+_0x1ba218(0x194)+_0x1ba218(0x1a7)+_0x1ba218(0x1de)](_0x316acb[_0x1ba218(0x1bf)+'p'],_0x316acb['nh_kh'+'3'],_0x49608f);const _0x1947aa={};_0x1947aa[_0x1ba218(0x1b9)]=_0x56d715,_0x14fda8[_0x1ba218(0x1d3)+'3']=_0x1947aa;}if(_0x316acb['nh_kh'+'4']){const _0x20a0fd={};_0x20a0fd['statu'+'s']=!![],_0x97119b=await global['getMo'+'del'](_0x1ba218(0x19c))[_0x1ba218(0x1ca)+_0x1ba218(0x194)+'drenG'+_0x1ba218(0x1de)](_0x316acb[_0x1ba218(0x1bf)+'p'],_0x316acb[_0x1ba218(0x1d3)+'4'],_0x20a0fd);const _0x12ba58={};_0x12ba58[_0x1ba218(0x1b9)]=_0x97119b,_0x14fda8[_0x1ba218(0x1d3)+'4']=_0x12ba58;}if(_0x316acb[_0x1ba218(0x1d3)+'5']){const _0x74eafb={};_0x74eafb['statu'+'s']=!![],_0x570856=await global[_0x1ba218(0x193)+_0x1ba218(0x1ad)]('group')[_0x1ba218(0x1ca)+_0x1ba218(0x194)+_0x1ba218(0x1a7)+'roup'](_0x316acb['id_ap'+'p'],_0x316acb[_0x1ba218(0x1d3)+'5'],_0x74eafb);const _0xfe783d={};_0xfe783d[_0x1ba218(0x1b9)]=_0x570856,_0x14fda8['nh_kh'+'5']=_0xfe783d;}if(Object[_0x1ba218(0x1b5)](_0x14fda8)[_0x1ba218(0x1ce)+'h']>0x0){_0x14fda8[_0x1ba218(0x1bf)+'p']=_0x316acb[_0x1ba218(0x1bf)+'p'];const _0x11c2ae={};_0x11c2ae[_0x1ba218(0x1ac)]=0x1;let _0x4499f5=await global[_0x1ba218(0x193)+_0x1ba218(0x1ad)](_0x1ba218(0x1a2)+_0x1ba218(0x1df))[_0x1ba218(0x1cd)](_0x14fda8,_0x11c2ae)[_0x1ba218(0x1f5)]();_0x4c16c8[_0x1ba218(0x1ac)]={'$in':_0x4499f5[_0x1ba218(0x1f3)](_0x157453=>_0x157453[_0x1ba218(0x1ac)])};}}_0x316acb[_0x1ba218(0x1da)]&&(_0x4c16c8[_0x1ba218(0x1da)]=_0x316acb[_0x1ba218(0x1da)]);if(_0x316acb['user_'+'hoa_h'+'ong']){if(_0x4c16c8['$or']){const _0x257d5f={};_0x257d5f[_0x1ba218(0x1a1)+'nv']=_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1aa)+_0x1ba218(0x1c7)];const _0x14a4ec={};_0x14a4ec[_0x1ba218(0x1a1)+_0x1ba218(0x1c9)]=_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1aa)+'ong'];const _0x5cf70a={};_0x5cf70a['user_'+'gt']=_0x316acb['user_'+'hoa_h'+_0x1ba218(0x1c7)];const _0x53a4c3={};_0x53a4c3['user_'+'ql']=_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1aa)+_0x1ba218(0x1c7)];const _0xeec95f={};_0xeec95f['detai'+'ls.us'+_0x1ba218(0x1fa)]=_0x316acb['user_'+_0x1ba218(0x1aa)+_0x1ba218(0x1c7)];const _0x3705da={};_0x3705da[_0x1ba218(0x1d4)+'ls.us'+_0x1ba218(0x1f0)+'v']=_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1aa)+_0x1ba218(0x1c7)];const _0x4b46e1={};_0x4b46e1[_0x1ba218(0x1d4)+'ls.us'+_0x1ba218(0x1e5)]=_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1aa)+_0x1ba218(0x1c7)];const _0x18d1c9={};_0x18d1c9[_0x1ba218(0x1d4)+_0x1ba218(0x1fd)+'er_ql']=_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1aa)+_0x1ba218(0x1c7)];const _0x2ed55b={};_0x2ed55b['$or']=[_0x257d5f,_0x14a4ec,_0x5cf70a,_0x53a4c3,_0xeec95f,_0x3705da,_0x4b46e1,_0x18d1c9],_0x4c16c8['$and']=[_0x2ed55b];}else{const _0x2edf60={};_0x2edf60[_0x1ba218(0x1a1)+'nv']=_0x316acb[_0x1ba218(0x1a1)+'hoa_h'+_0x1ba218(0x1c7)];const _0xd6f013={};_0xd6f013[_0x1ba218(0x1a1)+_0x1ba218(0x1c9)]=_0x316acb[_0x1ba218(0x1a1)+'hoa_h'+'ong'];const _0x2bd5b3={};_0x2bd5b3['user_'+'gt']=_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1aa)+_0x1ba218(0x1c7)];const _0x463ca8={};_0x463ca8['user_'+'ql']=_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1aa)+_0x1ba218(0x1c7)];const _0x12bb22={};_0x12bb22[_0x1ba218(0x1d4)+_0x1ba218(0x1fd)+_0x1ba218(0x1fa)]=_0x316acb[_0x1ba218(0x1a1)+'hoa_h'+_0x1ba218(0x1c7)];const _0x1b2783={};_0x1b2783[_0x1ba218(0x1d4)+_0x1ba218(0x1fd)+_0x1ba218(0x1f0)+'v']=_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1aa)+_0x1ba218(0x1c7)];const _0x1983e8={};_0x1983e8[_0x1ba218(0x1d4)+_0x1ba218(0x1fd)+'er_gt']=_0x316acb['user_'+_0x1ba218(0x1aa)+_0x1ba218(0x1c7)];const _0x37e274={};_0x37e274[_0x1ba218(0x1d4)+_0x1ba218(0x1fd)+_0x1ba218(0x1d9)]=_0x316acb[_0x1ba218(0x1a1)+_0x1ba218(0x1aa)+_0x1ba218(0x1c7)],_0x4c16c8[_0x1ba218(0x1d6)]=[_0x2edf60,_0xd6f013,_0x2bd5b3,_0x463ca8,_0x12bb22,_0x1b2783,_0x1983e8,_0x37e274];}}let _0x9e13bd;if(_0x316acb[_0x1ba218(0x1c1)])_0x4c16c8[_0x1ba218(0x1d4)+_0x1ba218(0x1db)+_0x1ba218(0x1b3)]=_0x316acb[_0x1ba218(0x1c1)],_0x9e13bd=[_0x316acb[_0x1ba218(0x1c1)]];else{if(_0x316acb['ma_nc'+'c']||_0x316acb[_0x1ba218(0x1bc)+'t']||_0x316acb[_0x1ba218(0x1e2)+_0x1ba218(0x1c8)+'c_cty']||_0x316acb[_0x1ba218(0x1e2)+_0x1ba218(0x1c8)+'c']){const _0x53fa55={};_0x53fa55[_0x1ba218(0x1bf)+'p']=_0x316acb[_0x1ba218(0x1bf)+'p'];let _0x1b92ec=_0x53fa55;if(_0x316acb[_0x1ba218(0x1ec)+'c'])_0x1b92ec['ma_nc'+'c']=_0x316acb[_0x1ba218(0x1ec)+'c'];if(_0x316acb[_0x1ba218(0x1bc)+'t'])_0x1b92ec['ma_nv'+'t']=_0x316acb[_0x1ba218(0x1bc)+'t'];if(_0x316acb[_0x1ba218(0x1e2)+'nh_mu'+_0x1ba218(0x1f8)])_0x1b92ec[_0x1ba218(0x1e2)+_0x1ba218(0x1c8)+_0x1ba218(0x1f8)]=_0x316acb[_0x1ba218(0x1e2)+_0x1ba218(0x1c8)+'c_cty'];if(_0x316acb[_0x1ba218(0x1e2)+'nh_mu'+'c'])_0x1b92ec[_0x1ba218(0x1e2)+'nh_mu'+'c']=_0x316acb[_0x1ba218(0x1e2)+'nh_mu'+'c'];const _0x4b542d={};_0x4b542d[_0x1ba218(0x1c1)]=0x1;let _0x1ae3b4=await global[_0x1ba218(0x193)+_0x1ba218(0x1ad)]('dmvt')['find'](_0x1b92ec,_0x4b542d)['lean']();_0x9e13bd=_0x1ae3b4[_0x1ba218(0x1f3)](_0x58477e=>_0x58477e[_0x1ba218(0x1c1)]);const _0x594642={};_0x594642[_0x1ba218(0x1b9)]=_0x9e13bd,_0x4c16c8[_0x1ba218(0x1d4)+_0x1ba218(0x1db)+_0x1ba218(0x1b3)]=_0x594642;}}return _0x316acb['id_cs']&&(_0x4c16c8[_0x1ba218(0x1d4)+'ls.id'+'_cs']=_0x316acb[_0x1ba218(0x196)]),_0x316acb[_0x1ba218(0x196)+_0x1ba218(0x1b6)]&&(_0x4c16c8['detai'+'ls.id'+_0x1ba218(0x1e8)+'k']=_0x316acb[_0x1ba218(0x196)+_0x1ba218(0x1b6)]),_0x4c16c8[_0x1ba218(0x198)+_0x1ba218(0x1e1)+_0x1ba218(0x197)+_0x1ba218(0x1e3)]=![],new Promise((_0x4b1486,_0x3cfc44)=>{databanle(_0x4c16c8,function(_0x46563a,_0x5e14b2){const _0x43636b=_0x4bd9;if(_0x46563a)return _0x3cfc44(_0x46563a);async[_0x43636b(0x1d2)+'mit'](_0x5e14b2,0x64,function(_0xc9c485,_0x340aea){const _0x461fa7=_0x43636b;let _0x4a9658=_0xc9c485[_0x461fa7(0x1d4)+'ls']||[];delete _0xc9c485['detai'+'ls'],_0x4a9658=_0x4a9658[_0x461fa7(0x1f3)](_0x4efb22=>{const _0x4c0250=_0x461fa7;delete _0x4efb22[_0x4c0250(0x1cf)],_0x4efb22[_0x4c0250(0x1b8)]=0x2;const _0xcfdc55={..._0xc9c485,..._0x4efb22};let _0x52dbe0=_0xcfdc55;return!_0x52dbe0['ma_nv']&&(_0x52dbe0['ma_nv']=_0xc9c485[_0x4c0250(0x1bc)]),!_0x52dbe0[_0x4c0250(0x1bb)]&&(_0x52dbe0[_0x4c0250(0x1bb)]=_0xc9c485[_0x4c0250(0x1bb)]),!_0x52dbe0[_0x4c0250(0x1f9)]&&(_0x52dbe0[_0x4c0250(0x1f9)]=_0xc9c485[_0x4c0250(0x1f9)]),_0x52dbe0;}),_0xc9c485['detai'+_0x461fa7(0x1fe)]&&(_0x4a9658=[..._0x4a9658,..._0xc9c485[_0x461fa7(0x1d4)+'ls_tl'][_0x461fa7(0x1f3)](_0x23ac7d=>{const _0x4e44a8=_0x461fa7;delete _0x23ac7d['_id'];const _0x212c28={..._0xc9c485,..._0x23ac7d};let _0x226a30=_0x212c28;return!_0x226a30['ma_nv']&&(_0x226a30['ma_nv']=_0xc9c485[_0x4e44a8(0x1bc)]),!_0x226a30[_0x4e44a8(0x1bb)]&&(_0x226a30['ma_dt']=_0xc9c485['ma_dt']),!_0x226a30[_0x4e44a8(0x1f9)]&&(_0x226a30[_0x4e44a8(0x1f9)]=_0xc9c485[_0x4e44a8(0x1f9)]),_0x226a30[_0x4e44a8(0x1d5)+_0x4e44a8(0x1ef)+'nt']=0x0-_0x226a30[_0x4e44a8(0x1d5)+_0x4e44a8(0x1ef)+'nt']||0x0,_0x226a30[_0x4e44a8(0x1d5)+_0x4e44a8(0x1d7)]=0x0-(_0x226a30[_0x4e44a8(0x1d5)+'hang']||0x0),_0x226a30[_0x4e44a8(0x1d5)+'hang_'+'ct_nt']=0x0-_0x226a30['tien_'+_0x4e44a8(0x1ef)+_0x4e44a8(0x1b4)]||0x0,_0x226a30[_0x4e44a8(0x1d5)+'hang_'+'ct']=0x0-(_0x226a30[_0x4e44a8(0x1d5)+'hang_'+'ct']||0x0),_0x226a30['tien_'+'ck']=0x0-(_0x226a30['tien_'+'ck']||0x0),_0x226a30['tien_'+'ck_nt']=0x0-(_0x226a30[_0x4e44a8(0x1d5)+_0x4e44a8(0x1c0)]||0x0),_0x226a30[_0x4e44a8(0x1d5)+'thue']=0x0-(_0x226a30[_0x4e44a8(0x1d5)+_0x4e44a8(0x1ed)]||0x0),_0x226a30[_0x4e44a8(0x1d5)+'thue_'+'nt']=0x0-(_0x226a30[_0x4e44a8(0x1d5)+_0x4e44a8(0x19a)+'nt']||0x0),_0x226a30[_0x4e44a8(0x1d5)+'xuat_'+_0x4e44a8(0x1cb)]=0x0-(_0x226a30[_0x4e44a8(0x1d5)+_0x4e44a8(0x1b2)+'nt']||0x0),_0x226a30[_0x4e44a8(0x1b1)+'at']=0x0,_0x226a30[_0x4e44a8(0x1d5)+_0x4e44a8(0x1aa)+_0x4e44a8(0x1c7)]=0x0-_0x226a30[_0x4e44a8(0x1d5)+_0x4e44a8(0x1aa)+_0x4e44a8(0x1c7)],_0x226a30['tien_'+'hoa_h'+_0x4e44a8(0x191)+'t']=0x0-_0x226a30['tien_'+_0x4e44a8(0x1aa)+_0x4e44a8(0x191)+'t'],_0x226a30[_0x4e44a8(0x1d5)+_0x4e44a8(0x1aa)+'ong_c'+'tv']=0x0-_0x226a30['tien_'+_0x4e44a8(0x1aa)+'ong_c'+'tv'],_0x226a30['tien_'+_0x4e44a8(0x1aa)+_0x4e44a8(0x1f6)+'l']=0x0-_0x226a30['tien_'+_0x4e44a8(0x1aa)+_0x4e44a8(0x1f6)+'l'],_0x226a30['nxt']=0x1,_0x226a30;})],delete _0xc9c485[_0x461fa7(0x1d4)+_0x461fa7(0x1fe)]),_0x340aea(null,_0x4a9658);},async function(_0x3913fd,_0x2c016c){const _0x36f917=_0x43636b;if(_0x3913fd)return _0x3cfc44(_0x3913fd);_0x2c016c=_0x2c016c['reduc'+'e']((_0x428d27,_0x2b69c5)=>_0x428d27[_0x36f917(0x1c6)+'t'](_0x2b69c5),[]);_0x9e13bd&&(_0x2c016c=_0x2c016c['filte'+'r'](_0x1ec6bf=>{const _0x4dd0ee=_0x36f917;return _0x9e13bd[_0x4dd0ee(0x19d)+'Of'](_0x1ec6bf[_0x4dd0ee(0x1c1)])>=0x0;}));_0x316acb[_0x36f917(0x196)]&&(_0x2c016c=_0x2c016c['filte'+'r'](_0x59ee29=>_0x59ee29[_0x36f917(0x196)]===_0x316acb[_0x36f917(0x196)]));_0x316acb[_0x36f917(0x196)+_0x36f917(0x1b6)]&&(_0x2c016c=_0x2c016c['filte'+'r'](_0x31903f=>_0x31903f[_0x36f917(0x196)+_0x36f917(0x1b6)]===_0x316acb['id_cs'+_0x36f917(0x1b6)]));const _0x5dbf39={};_0x5dbf39['ma_dv'+'t']=_0x36f917(0x1e9)+'t',_0x5dbf39['ma_vt']='ma_vt';const _0x4744a4={};_0x4744a4[_0x36f917(0x1e7)]=_0x5dbf39,_0x4744a4['field'+'s']=['tu',_0x36f917(0x1eb),_0x36f917(0x1e9)+_0x36f917(0x1ee)],await _0x2c016c[_0x36f917(0x1ab)+'JoinM'+'odel2'](_0x316acb[_0x36f917(0x1bf)+'p'],'dmqdd'+'vt',_0x4744a4),_0x2c016c['forEa'+'ch'](function(_0x416de1,_0x334d74){const _0x1f7f67=_0x36f917;_0x416de1[_0x1f7f67(0x1bd)]=_0x334d74+0x1,_0x416de1[_0x1f7f67(0x1a3)]=_0x416de1[_0x1f7f67(0x1cf)][_0x1f7f67(0x1f4)+_0x1f7f67(0x1a9)](),_0x416de1[_0x1f7f67(0x1cc)]=![],_0x416de1['tt']=_0x416de1['tien']=(_0x416de1[_0x1f7f67(0x1d5)+'hang_'+'ct']||0x0)-(_0x416de1['tien_'+'ck']||0x0)+(_0x416de1[_0x1f7f67(0x1d5)+_0x1f7f67(0x1ed)]||0x0),_0x416de1[_0x1f7f67(0x1c2)+_0x1f7f67(0x19f)+_0x1f7f67(0x1cb)]=_0x416de1[_0x1f7f67(0x1d5)+_0x1f7f67(0x1c4)+'tmp']?_0x416de1['tt']-_0x416de1[_0x1f7f67(0x1d5)+_0x1f7f67(0x1c4)+_0x1f7f67(0x1cb)]-(_0x416de1['tien_'+_0x1f7f67(0x1ed)]||0x0):0x0,_0x416de1['t_hoa'+_0x1f7f67(0x1a4)]=_0x416de1[_0x1f7f67(0x1d5)+'hoa_h'+'ong']+_0x416de1['tien_'+_0x1f7f67(0x1aa)+'ong_g'+'t']+_0x416de1[_0x1f7f67(0x1d5)+_0x1f7f67(0x1aa)+'ong_c'+'tv']+_0x416de1['tien_'+_0x1f7f67(0x1aa)+_0x1f7f67(0x1f6)+'l'];if(_0x416de1[_0x1f7f67(0x1eb)]){let _0x434fc2=_0x416de1['tu']/_0x416de1[_0x1f7f67(0x1eb)];_0x416de1[_0x1f7f67(0x1b1)+_0x1f7f67(0x1a5)]=_0x434fc2*(_0x416de1['sl_xu'+'at']||0x0),_0x416de1[_0x1f7f67(0x1fb)+_0x1f7f67(0x18f)]=_0x434fc2*(_0x416de1['sl_nh'+'ap']||0x0);}else _0x416de1[_0x1f7f67(0x1b1)+_0x1f7f67(0x1a5)]=_0x416de1[_0x1f7f67(0x1b1)+'at']||0x0,_0x416de1[_0x1f7f67(0x1fb)+_0x1f7f67(0x18f)]=_0x416de1[_0x1f7f67(0x1fb)+'ap']||0x0;}),_0x4b1486(_0x2c016c);});});});};
@@ -1,3 +1 @@
1
- const mailAccount=global.getModel("mailaccount"),path=require("path");exports.getAccount=function($account_id$$,$done$$){mailAccount.findOne({_id:$account_id$$}).lean().then(function($account$$){if(!$account$$)return $done$$("Don't find account "+$account_id$$);$done$$(null,$account$$)}).catch($e$$=>{$done$$($e$$)})};
2
- exports.sendHtml=async function($options$$,$callback$$,$sender$$){let $onImportProcess$$=path.dirname(__dirname)+"/workers/sendEmail.js";if(!global.sendEmailPool){const $StaticPool$$=require("./WorkerStaticPool");global.sendEmailPool=new $StaticPool$$($onImportProcess$$)}try{let $result$$=await new Promise(($resolve$$,$reject$$)=>{global.sendEmailPool.exec({options:$options$$,configs:{sender:$sender$$||global.configs.sender,company:global.configs.company,google_credentials:global.configs.google_credentials?
3
- JSON.stringify(global.configs.google_credentials):"",paths:global.configs.paths}},$response$$=>{$response$$.error?$reject$$($response$$.error):$resolve$$($response$$)})});return $callback$$?$callback$$(null,$result$$.data,$result$$.columns):$result$$}catch($e$$){if($callback$$)return $callback$$($e$$);throw $e$$;}};
1
+ const _0x2820a8=_0x14db;function _0x14db(_0x240514,_0x173a67){_0x240514=_0x240514-0x131;const _0x78bd97=_0x78bd();let _0x14dbea=_0x78bd97[_0x240514];if(_0x14db['bgqVbF']===undefined){var _0x1169f5=function(_0x4fcce1){const _0x51f2c9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5bd727='',_0x508d7e='';for(let _0x1f43b2=0x0,_0xa81e06,_0x41e823,_0x38ad9a=0x0;_0x41e823=_0x4fcce1['charAt'](_0x38ad9a++);~_0x41e823&&(_0xa81e06=_0x1f43b2%0x4?_0xa81e06*0x40+_0x41e823:_0x41e823,_0x1f43b2++%0x4)?_0x5bd727+=String['fromCharCode'](0xff&_0xa81e06>>(-0x2*_0x1f43b2&0x6)):0x0){_0x41e823=_0x51f2c9['indexOf'](_0x41e823);}for(let _0x178648=0x0,_0x1a3da6=_0x5bd727['length'];_0x178648<_0x1a3da6;_0x178648++){_0x508d7e+='%'+('00'+_0x5bd727['charCodeAt'](_0x178648)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x508d7e);};_0x14db['wNCmwx']=_0x1169f5,_0x14db['URlkoL']={},_0x14db['bgqVbF']=!![];}const _0xae6781=_0x78bd97[0x0],_0xb5af67=_0x240514+_0xae6781,_0x2d89a4=_0x14db['URlkoL'][_0xb5af67];return!_0x2d89a4?(_0x14dbea=_0x14db['wNCmwx'](_0x14dbea),_0x14db['URlkoL'][_0xb5af67]=_0x14dbea):_0x14dbea=_0x2d89a4,_0x14dbea;}(function(_0x277d83,_0x4092a8){const _0x18ef9c=_0x14db,_0xaaf612=_0x277d83();while(!![]){try{const _0x331755=-parseInt(_0x18ef9c(0x15b))/0x1+-parseInt(_0x18ef9c(0x154))/0x2+parseInt(_0x18ef9c(0x135))/0x3*(parseInt(_0x18ef9c(0x15c))/0x4)+-parseInt(_0x18ef9c(0x13b))/0x5+-parseInt(_0x18ef9c(0x158))/0x6*(-parseInt(_0x18ef9c(0x153))/0x7)+-parseInt(_0x18ef9c(0x15a))/0x8*(-parseInt(_0x18ef9c(0x13a))/0x9)+parseInt(_0x18ef9c(0x144))/0xa;if(_0x331755===_0x4092a8)break;else _0xaaf612['push'](_0xaaf612['shift']());}catch(_0x4828ab){_0xaaf612['push'](_0xaaf612['shift']());}}}(_0x78bd,0xf30d8));function _0x78bd(){const _0x560a7b=['otbvwwDiAeG','mJi5ndCYmg9NwezvBW','zgvUDgK','C2vUzeG','y29TCge','z29Vz2W','C2vUzeu','B29S','y29SDw0','igfJy28','nZu3mZi1mhDmEvnoza','zMLUze8','z2v0tw8','lI9xB3i','y291BNq','BwfPBfa','l3DVCMS','BgvHBG','zgLYBMe','DgHLBG','yxrPy1a','zxjZl3m','C2vUzgu','BwfPBge','Cgf0Aa','mJGWAhHuAe1R','mJuXnJy2nefYzMzNAW','C3rYAw4','Dg1S','zgvS','mJm0mtC0uKrmtejd','z2v0qwm','mte5nZyYngvjvMfVva','mtKYnti1mNfntwLnAG','ngf4C0PWqW','rg9Uj3q','y2nVDw4','A2vYu3q','ywXZ','ywLSlMO','zw5Krw0','y29UzMK','zxjYB3i','mJq2nZy3mun0t3bMDa','zv9JCMu','x2LK','igzPBMq','y2f0y2G'];_0x78bd=function(){return _0x560a7b;};return _0x78bd();}const mailAccount=global[_0x2820a8(0x146)+_0x2820a8(0x157)](_0x2820a8(0x151)+_0x2820a8(0x15e)+'t'),path=require(_0x2820a8(0x152));exports[_0x2820a8(0x159)+_0x2820a8(0x148)]=function(_0x508d7e,_0x1f43b2){const _0x2506ec=_0x2820a8,_0xa81e06={};_0xa81e06[_0x2506ec(0x137)]=_0x508d7e,mailAccount[_0x2506ec(0x145)+'ne'](_0xa81e06)[_0x2506ec(0x14b)]()[_0x2506ec(0x14d)](function(_0x41e823){const _0x44a4fa=_0x2506ec;if(!_0x41e823)return _0x1f43b2(_0x44a4fa(0x15d)+_0x44a4fa(0x138)+_0x44a4fa(0x143)+'unt\x20'+_0x508d7e);_0x1f43b2(null,_0x41e823);})[_0x2506ec(0x139)](_0x38ad9a=>{_0x1f43b2(_0x38ad9a);});},exports[_0x2820a8(0x13d)+_0x2820a8(0x156)]=async function(_0x178648,_0x1a3da6,_0xb571e3=undefined){const _0x44cfa8=_0x2820a8;let _0x111cff=path[_0x44cfa8(0x14c)+'me'](__dirname)+(_0x44cfa8(0x14a)+_0x44cfa8(0x14f)+_0x44cfa8(0x132)+_0x44cfa8(0x131)+'s');if(!global[_0x44cfa8(0x140)+_0x44cfa8(0x149)+_0x44cfa8(0x141)]){const _0x13cf51=require(_0x44cfa8(0x147)+_0x44cfa8(0x15f)+_0x44cfa8(0x14e)+'ool');global[_0x44cfa8(0x140)+_0x44cfa8(0x149)+'ool']=new _0x13cf51(_0x111cff);}try{let _0x13a2f0=await new Promise((_0x1e4812,_0x7c7ccd)=>{const _0x9a347d=_0x44cfa8;global[_0x9a347d(0x140)+_0x9a347d(0x149)+_0x9a347d(0x141)]['exec']({'options':_0x178648,'configs':{'sender':_0xb571e3||global[_0x9a347d(0x133)+'gs'][_0x9a347d(0x150)+'r'],'company':global['confi'+'gs'][_0x9a347d(0x13e)+'ny'],'google_credentials':global[_0x9a347d(0x133)+'gs'][_0x9a347d(0x13f)+_0x9a347d(0x136)+'denti'+_0x9a347d(0x160)]?JSON[_0x9a347d(0x155)+'gify'](global['confi'+'gs'][_0x9a347d(0x13f)+_0x9a347d(0x136)+_0x9a347d(0x13c)+_0x9a347d(0x160)]):'','paths':global[_0x9a347d(0x133)+'gs']['paths']}},_0x42e9f8=>{const _0x122329=_0x9a347d;_0x42e9f8[_0x122329(0x134)]?_0x7c7ccd(_0x42e9f8['error']):_0x1e4812(_0x42e9f8);});});if(_0x1a3da6)return _0x1a3da6(null,_0x13a2f0['data'],_0x13a2f0[_0x44cfa8(0x142)+'ns']);return _0x13a2f0;}catch(_0x2e1182){if(_0x1a3da6)return _0x1a3da6(_0x2e1182);throw _0x2e1182;}};
@@ -1,3 +1 @@
1
- const path=require("path");
2
- exports.parse=function($filePath$$,$callback$$,$options$$){let $onImportProcess$$=path.dirname(__dirname)+"/workers/excelParser.js";if(!global.excelParsePool){const $StaticPool$$=require("./WorkerStaticPool");global.excelParsePool=new $StaticPool$$($onImportProcess$$)}global.excelParsePool.exec({filePath:$filePath$$,options:$options$$,configs:{database:global.configs.database}},$response$$=>{$response$$.error?(Logger.error("[excel] L\u1ed7i \u0111\u1ecdc v\u00e0 parse excel data:",$response$$.error),
3
- $callback$$($response$$.error)):$callback$$(null,$response$$.data,$response$$.columns)})};
1
+ function _0x3b66(_0x3e816b,_0x2af691){_0x3e816b=_0x3e816b-0xe3;const _0x1b1206=_0x1b12();let _0x3b6619=_0x1b1206[_0x3e816b];if(_0x3b66['jCouBU']===undefined){var _0x3d23f5=function(_0x48c1fe){const _0x191a4e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x10fff2='',_0x40ad3f='';for(let _0x2170ce=0x0,_0x12e712,_0x428c6b,_0x1254e8=0x0;_0x428c6b=_0x48c1fe['charAt'](_0x1254e8++);~_0x428c6b&&(_0x12e712=_0x2170ce%0x4?_0x12e712*0x40+_0x428c6b:_0x428c6b,_0x2170ce++%0x4)?_0x10fff2+=String['fromCharCode'](0xff&_0x12e712>>(-0x2*_0x2170ce&0x6)):0x0){_0x428c6b=_0x191a4e['indexOf'](_0x428c6b);}for(let _0x20defa=0x0,_0x11f4c2=_0x10fff2['length'];_0x20defa<_0x11f4c2;_0x20defa++){_0x40ad3f+='%'+('00'+_0x10fff2['charCodeAt'](_0x20defa)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x40ad3f);};_0x3b66['YzkjwC']=_0x3d23f5,_0x3b66['xmKoZW']={},_0x3b66['jCouBU']=!![];}const _0x174dbe=_0x1b1206[0x0],_0x424eac=_0x3e816b+_0x174dbe,_0x3e6a51=_0x3b66['xmKoZW'][_0x424eac];return!_0x3e6a51?(_0x3b6619=_0x3b66['YzkjwC'](_0x3b6619),_0x3b66['xmKoZW'][_0x424eac]=_0x3b6619):_0x3b6619=_0x3e6a51,_0x3b6619;}function _0x1b12(){const _0x2a3dd1=['AsdeKEg7Jwm','y29UzMK','zxjYB3i','ihBdOcbW','mJC3nte5mKPeC2jpDG','zxjZl2u','mtC5mtG5nujjqvzhra','Bf0Gtog7LW','y29SDw0','zgf0ywi','mJGZne9yvMLjsq','ug9VBa','CgfYC2u','mJyYmJKWn2HtDNrTua','otmYndaWsu9lthvv','l3DVCMS','yxnL','zxHJzwW','ugfYC2u','yxjZzxi','mta1mZaWB0P1wwfO','yxjZzsa','yxrPy1a','EgnLBfa','lI9xB3i','zgf0yq','ndbyCgv3BMO','w2v4y2u','mJi1nZi2mdn5uwXUvue','mZyXvxD2rens'];_0x1b12=function(){return _0x2a3dd1;};return _0x1b12();}const _0x493e3e=_0x3b66;(function(_0x1755a3,_0x15209d){const _0x31f5af=_0x3b66,_0x4a6d5e=_0x1755a3();while(!![]){try{const _0x169265=parseInt(_0x31f5af(0xe4))/0x1*(-parseInt(_0x31f5af(0xef))/0x2)+-parseInt(_0x31f5af(0xf9))/0x3*(parseInt(_0x31f5af(0xff))/0x4)+-parseInt(_0x31f5af(0xeb))/0x5+-parseInt(_0x31f5af(0xf3))/0x6+-parseInt(_0x31f5af(0xf2))/0x7+-parseInt(_0x31f5af(0xe9))/0x8+parseInt(_0x31f5af(0xe3))/0x9;if(_0x169265===_0x15209d)break;else _0x4a6d5e['push'](_0x4a6d5e['shift']());}catch(_0x2096f0){_0x4a6d5e['push'](_0x4a6d5e['shift']());}}}(_0x1b12,0x64227));const path=require('path');exports[_0x493e3e(0xf1)]=function(_0x10fff2,_0x40ad3f,_0x2170ce){const _0x228fe5=_0x493e3e;let _0x12e712=path['dirna'+'me'](__dirname)+(_0x228fe5(0xf4)+_0x228fe5(0xea)+_0x228fe5(0xfc)+_0x228fe5(0xf8)+'.js');if(!global[_0x228fe5(0xf6)+'Parse'+'Pool']){const _0x428c6b=require(_0x228fe5(0xfd)+'kerSt'+_0x228fe5(0xfb)+'ool');global[_0x228fe5(0xf6)+_0x228fe5(0xf7)+_0x228fe5(0xf0)]=new _0x428c6b(_0x12e712);}global[_0x228fe5(0xf6)+'Parse'+'Pool']['exec']({'filePath':_0x10fff2,'options':_0x2170ce,'configs':{'database':global[_0x228fe5(0xe6)+'gs'][_0x228fe5(0xee)+_0x228fe5(0xf5)]}},_0x1254e8=>{const _0x6d2b4d=_0x228fe5;_0x1254e8['error']?(Logger[_0x6d2b4d(0xe7)](_0x6d2b4d(0x100)+_0x6d2b4d(0xec)+_0x6d2b4d(0xe5)+_0x6d2b4d(0xe8)+_0x6d2b4d(0xfa)+_0x6d2b4d(0xf6)+'\x20data'+':',_0x1254e8[_0x6d2b4d(0xe7)]),_0x40ad3f(_0x1254e8[_0x6d2b4d(0xe7)])):_0x40ad3f(null,_0x1254e8[_0x6d2b4d(0xfe)],_0x1254e8[_0x6d2b4d(0xed)+'ns']);});};
@@ -1,10 +1 @@
1
- const ExcelJS=require("exceljs"),crypto=require("crypto"),createTmpFile=($fileName$$,$data$$)=>new Promise(($resolve$$,$reject$$)=>{const $cacheKey$$=`export_${crypto.randomBytes(16).toString("hex")}_${$fileName$$}`,$base64Data$$=(Buffer.isBuffer($data$$)?$data$$:Buffer.from($data$$,"utf-8")).toString("base64");global.clientRedis.setex($cacheKey$$,60,$base64Data$$,$err$$=>{if($err$$)return console.error("[excelHelper] L\u1ed7i khi ghi d\u1eef li\u1ec7u v\u00e0o Redis:",$err$$),$reject$$($err$$);console.warn("[excelHelper] \u0110\u00e3 t\u1ea1o file t\u1ea1m tr\u00ean Redis:",
2
- $cacheKey$$);$resolve$$($cacheKey$$)})}),getTmpFile=$cacheKey$$=>new Promise(($resolve$$,$reject$$)=>{global.clientRedis.get($cacheKey$$,($dataBuffer$jscomp$1_err$$,$result$$)=>{if($dataBuffer$jscomp$1_err$$)return console.error(`[excelHelper] L\u1ed7i khi \u0111\u1ecdc Redis key ${$cacheKey$$}:`,$dataBuffer$jscomp$1_err$$),$reject$$($dataBuffer$jscomp$1_err$$);if(!$result$$)return console.warn(`[excelHelper] Kh\u00f4ng t\u00ecm th\u1ea5y d\u1eef li\u1ec7u ho\u1eb7c \u0111\u00e3 h\u1ebft h\u1ea1n: ${$cacheKey$$}`),
3
- $resolve$$(null);$dataBuffer$jscomp$1_err$$=Buffer.from($result$$,"base64");global.clientRedis.del($cacheKey$$,$delErr$$=>{$delErr$$&&console.error(`[Cleanup] L\u1ed7i khi x\u00f3a key ${$cacheKey$$}:`,$delErr$$)});$resolve$$($dataBuffer$jscomp$1_err$$)})}),generateDefaultExcel=async({title:$filterTexts_headerRow_title$$,data:$data$$=[],columns:$columns$$=[],filterFields:$filterFields$$=[],condition:$condition$$={}})=>{const $workbook$$=new ExcelJS.Workbook;$workbook$$.creator="ERP System";const $sheet$$=
4
- $workbook$$.addWorksheet("Data");$sheet$$.getColumn(1).key="stt";$sheet$$.getColumn(1).width=5;$columns$$.forEach(($col$$,$index$$)=>{$index$$=$sheet$$.getColumn($index$$+2);$index$$.key=$col$$.field;$index$$.width=$col$$.type==="Date"||$col$$.type==="DateTime"?15:20;$col$$.type==="Number"?$index$$.numFmt="#,##0":$col$$.type==="Date"?$index$$.numFmt="dd/mm/yyyy":$col$$.type==="DateTime"&&($index$$.numFmt="dd/mm/yyyy hh:mm")});$sheet$$.addRow([$filterTexts_headerRow_title$$?$filterTexts_headerRow_title$$.toUpperCase():
5
- "B\u00c1O C\u00c1O"]).font={bold:!0,size:14,color:{argb:"FF000000"}};$sheet$$.addRow([]);Object.keys($condition$$).length>0&&$filterFields$$.length>0&&($filterTexts_headerRow_title$$=$filterFields$$.map($fieldDef$$=>{if($fieldDef$$.type==="DateFilter"){var $fromVal_val$$=$condition$$[$fieldDef$$.mapTo?.[0]||"fromDate"];const $toVal$$=$condition$$[$fieldDef$$.mapTo?.[1]||"toDate"];return $fromVal_val$$||$toVal$$?`${$fieldDef$$.label}: T\u1eeb ${$fromVal_val$$?$fromVal_val$$.split("-").reverse().join("/"):
6
- "..."} \u0111\u1ebfn ${$toVal$$?$toVal$$.split("-").reverse().join("/"):"..."}`:null}$fromVal_val$$=$condition$$[$fieldDef$$.field];return $fromVal_val$$===void 0||$fromVal_val$$===null||$fromVal_val$$===""||Array.isArray($fromVal_val$$)&&$fromVal_val$$.length===0?null:$fieldDef$$.type==="Boolean"?`${$fieldDef$$.label}: ${$fromVal_val$$?"C\u00f3":"Kh\u00f4ng"}`:`${$fieldDef$$.label}: ${Array.isArray($fromVal_val$$)?$fromVal_val$$.join(", "):$fromVal_val$$}`}).filter(Boolean),$filterTexts_headerRow_title$$.length>
7
- 0&&($sheet$$.addRow([$filterTexts_headerRow_title$$.join(" | ")]).font={italic:!0,color:{argb:"FF555555"}},$sheet$$.addRow([])));const $headerValues$$=["STT"];$columns$$.forEach($col$$=>$headerValues$$.push($col$$.label||$col$$.field));$filterTexts_headerRow_title$$=$sheet$$.addRow($headerValues$$);$filterTexts_headerRow_title$$.font={bold:!0};$filterTexts_headerRow_title$$.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFF0F0F0"}};$filterTexts_headerRow_title$$.eachCell($cell$$=>{$cell$$.border=
8
- {top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}}});$sheet$$.views=[{state:"frozen",ySplit:$filterTexts_headerRow_title$$.number}];$data$$.forEach(($rowObj$$,$currentRow_index$$)=>{const $rowData$$={stt:$currentRow_index$$+1};$columns$$.forEach($col$$=>{let $val$$=$rowObj$$[$col$$.field];$val$$!==null&&$val$$!==void 0&&$val$$!==""&&($col$$.type==="Number"?$val$$=Number($val$$)||0:$col$$.type==="Date"||$col$$.type==="DateTime"?$val$$=new Date($val$$):$col$$.type===
9
- "Boolean"&&($val$$=$val$$?"C\u00f3":"Kh\u00f4ng"));$rowData$$[$col$$.field]=$val$$});$currentRow_index$$=$sheet$$.addRow($rowData$$);$currentRow_index$$.eachCell($cell$$=>{$cell$$.border={top:{style:"thin"},left:{style:"thin"},bottom:{style:"thin"},right:{style:"thin"}}});$rowObj$$.bold===!0&&($currentRow_index$$.font={bold:!0},$currentRow_index$$.fill={type:"pattern",pattern:"solid",fgColor:{argb:"FFFFFBE6"}})});$data$$=await $workbook$$.xlsx.writeBuffer();return createTmpFile(".xlsx",$data$$)};
10
- module.exports={createTmpFile,getTmpFile,generateDefaultExcel};
1
+ const _0x31264e=_0x2405;function _0xc5dc(){const _0x54ec22=['igzPBgu','w0nSzwe','Aw1L','ihtHUQfTia','zxHWB3i','zxHJzwW','rKzgrKy','Cgf0Dgu','DMLLD3m','ucbtExm','ywrKv28','zxjYB3i','l3L5ExK','zwfJAem','tog7L2KGAW','AxnbCNi','BeHLBha','CMLNAhq','y2f0y2G','v29YA2i','AgKGEmoZ','DxrMltG','EgXZEa','lI4U','yxjNyG','AM9PBG','Aw5N','y29SB3i','DfjLzgK','ywLSlMm','s2JdTg5N','CYbRzxK','mZy2mJaWExvSAMTM','ChvZAa','zxjDieW','4BUxAsbRAa','zxjDieS','w2v4y2u','zxjdyxm','y2XPzw4','yM90Dg8','zgqVBw0','mti3mJaYmfvPz3DWza','ysbRzxK','zNjVBuq','BNvTrM0','BgvMDa','C2L6zq','DgHLBG','CMv2zxi','DhldQM4G','zMLLBgq','4BUVigXP4BUh','Dg9tDhi','zNjVBq','rKyWmda','D2fYBG','owPusef1BW','BNvTyMu','C3rHDgu','mtmWnJy5vMDMEMjA','rgf0zuy','BwfW','qSobtYbd','zwXS','C2v0rxG','qKu2','CezPBgu','qM9VBgu','Aog6PxKGza','u1ru','ifjLzgK','z2v0','meyW','Dg9vCha','zxjDimsq','zM9Yrwe','zMLSBa','Dg9eyxq','yxrLrgu','Dxjaz20','Aog6V3qGAa','zMLSDgu','rgf0zq','BNvWxsa','rgf0yq','BwfWvg8','rgf0zvq','Amo0BMCG','C3r0','ndGZnJbND1vdAe4','DmoSBsb0','yxrL','zMvY','yM9Yzgu','D3jPDgu','DhLWzq','W6mGDog6Ow8','yM9Sza','Agv4','oIbu4BURia','yMfZzty','ihWG','C29SAwq','DgHPBG','tNvTyMu','mtm3ngzoseLvzG','igtHU68GBa','zM9UDa','ywrKuM8','B20P','A2v5','EvnWBgK','mtm2EfPhyxDt','zMDdB2W','nty2odi5CLrJvNbX','BgvUz3q','y3jLyxq','imsr4BQ/BIa','ntu1','uMvKAxm','nJm1mdLIwNrTwgu','z2v0q28','rMXLEgi','AEg7H3uGDG','z2vUzxi','zNjVEMu','y3j5Chq','CMTZAgu','4BQHBJOG','C3r5Bgu','AxOGrvi','DgvTicG','Buj5Dgu','B29R','zMf1Bhq','nJm1me5Jrw9PBW','AwX0zxi','BgfIzwW','BhvTBG','yYdeKCoJia','rxHJzwW'];_0xc5dc=function(){return _0x54ec22;};return _0xc5dc();}(function(_0x89871d,_0x8405c1){const _0x1f576d=_0x2405,_0x3e127e=_0x89871d();while(!![]){try{const _0x14acee=-parseInt(_0x1f576d(0x1b7))/0x1+parseInt(_0x1f576d(0x198))/0x2+-parseInt(_0x1f576d(0x1b1))/0x3+-parseInt(_0x1f576d(0x15e))/0x4+parseInt(_0x1f576d(0x138))/0x5*(parseInt(_0x1f576d(0x1a8))/0x6)+parseInt(_0x1f576d(0x17a))/0x7*(parseInt(_0x1f576d(0x1af))/0x8)+-parseInt(_0x1f576d(0x177))/0x9*(parseInt(_0x1f576d(0x168))/0xa);if(_0x14acee===_0x8405c1)break;else _0x3e127e['push'](_0x3e127e['shift']());}catch(_0x5b9cd3){_0x3e127e['push'](_0x3e127e['shift']());}}}(_0xc5dc,0x27579));const ExcelJS=require(_0x31264e(0x143)+'js'),crypto=require(_0x31264e(0x1bd)+'o'),createTmpFile=(_0x570b26,_0x125ec9)=>{return new Promise((_0x31c454,_0x17c4a3)=>{const _0x2ad7df=_0x2405,_0x8484a=crypto['rando'+_0x2ad7df(0x1c3)+'s'](0x10)[_0x2ad7df(0x173)+'ing'](_0x2ad7df(0x1a1)),_0x343974=_0x2ad7df(0x142)+'t_'+_0x8484a+'_'+_0x570b26,_0xd2855b=Buffer['isBuf'+_0x2ad7df(0x19b)](_0x125ec9)?_0x125ec9:Buffer[_0x2ad7df(0x174)](_0x125ec9,_0x2ad7df(0x153)),_0x2c5a5e=_0xd2855b[_0x2ad7df(0x173)+_0x2ad7df(0x158)](_0x2ad7df(0x1a3)+'4');global['clien'+_0x2ad7df(0x15a)+'s'][_0x2ad7df(0x17f)](_0x343974,0x3c,_0x2c5a5e)['then'](()=>{const _0x246030=_0x2ad7df;console['warn'](_0x246030(0x163)+_0x246030(0x14e)+_0x246030(0x189)+_0x246030(0x19f)+_0x246030(0x13e)+_0x246030(0x141)+_0x246030(0x170)+_0x246030(0x1b6)+':',_0x343974),_0x31c454(_0x343974);})[_0x2ad7df(0x150)](_0x5a1bbd=>{const _0xf6e1c0=_0x2ad7df;console[_0xf6e1c0(0x149)](_0xf6e1c0(0x163)+_0xf6e1c0(0x14e)+_0xf6e1c0(0x160)+'ỗi\x20kh'+'i\x20ghi'+_0xf6e1c0(0x1a9)+_0xf6e1c0(0x1ba)+'ào\x20Re'+'dis:',_0x5a1bbd),_0x17c4a3(_0x5a1bbd);});});},getTmpFile=_0x12c4a8=>{return new Promise((_0x5050f3,_0x3f7c17)=>{const _0x2a117b=_0x2405;global[_0x2a117b(0x165)+_0x2a117b(0x15a)+'s'][_0x2a117b(0x186)](_0x12c4a8)[_0x2a117b(0x16e)](_0x4266c7=>{const _0x45c290=_0x2a117b;if(!_0x4266c7)return console[_0x45c290(0x176)](_0x45c290(0x163)+_0x45c290(0x14e)+_0x45c290(0x162)+_0x45c290(0x196)+_0x45c290(0x199)+_0x45c290(0x183)+_0x45c290(0x172)+'u\x20hoặ'+_0x45c290(0x13c)+_0x45c290(0x18f)+_0x45c290(0x1bf)+_0x12c4a8),_0x5050f3(null);const _0x10f10d=Buffer[_0x45c290(0x174)](_0x4266c7,_0x45c290(0x1a3)+'4');global[_0x45c290(0x165)+_0x45c290(0x15a)+'s']['del'](_0x12c4a8)[_0x45c290(0x150)](_0xcbe806=>{const _0x12a977=_0x45c290;console['error'](_0x12a977(0x13f)+_0x12a977(0x192)+_0x12a977(0x14c)+_0x12a977(0x152)+_0x12a977(0x169)+'\x20'+_0x12c4a8+':',_0xcbe806);}),_0x5050f3(_0x10f10d);})['catch'](_0x11d85f=>{const _0x1e7f28=_0x2a117b;console[_0x1e7f28(0x149)](_0x1e7f28(0x163)+'lHelp'+_0x1e7f28(0x160)+_0x1e7f28(0x161)+'i\x20đọc'+_0x1e7f28(0x185)+_0x1e7f28(0x15d)+'\x20'+_0x12c4a8+':',_0x11d85f),_0x3f7c17(_0x11d85f);});});},generateDefaultExcel=async({title:_0x47f42e,data:data=[],columns:columns=[],filterFields:filterFields=[],condition:condition={}})=>{const _0x2eb163=_0x31264e,_0x4007d5=new ExcelJS[(_0x2eb163(0x151))+(_0x2eb163(0x1c4))]();_0x4007d5['creat'+'or']=_0x2eb163(0x1b9)+_0x2eb163(0x1c1)+_0x2eb163(0x147)+_0x2eb163(0x1c2)+'invnc'+_0x2eb163(0x18e)+_0x2eb163(0x15b)+_0x2eb163(0x1ac);const _0xd2a5b8=_0x4007d5[_0x2eb163(0x148)+_0x2eb163(0x1be)+'et'](_0x2eb163(0x193));_0xd2a5b8['getCo'+_0x2eb163(0x13b)](0x1)[_0x2eb163(0x1ad)]=_0x2eb163(0x197),_0xd2a5b8[_0x2eb163(0x1b8)+_0x2eb163(0x13b)](0x1)['width']=0x5,columns[_0x2eb163(0x18a)+'ch']((_0x48b62a,_0x30fbfc)=>{const _0x2c015d=_0x2eb163,_0xec6b96=_0xd2a5b8['getCo'+_0x2c015d(0x13b)](_0x30fbfc+0x2);_0xec6b96[_0x2c015d(0x1ad)]=_0x48b62a[_0x2c015d(0x171)],_0xec6b96['width']=_0x48b62a[_0x2c015d(0x19e)]==='Date'||_0x48b62a[_0x2c015d(0x19e)]==='DateT'+'ime'?0xf:0x14;if(_0x48b62a[_0x2c015d(0x19e)]==='Numbe'+'r')_0xec6b96[_0x2c015d(0x16b)+'t']='#,##0';else{if(_0x48b62a[_0x2c015d(0x19e)]===_0x2c015d(0x191))_0xec6b96[_0x2c015d(0x16b)+'t']=_0x2c015d(0x167)+_0x2c015d(0x14a);else _0x48b62a[_0x2c015d(0x19e)]===_0x2c015d(0x195)+'ime'&&(_0xec6b96[_0x2c015d(0x16b)+'t']=_0x2c015d(0x167)+'/yyyy'+'\x20hh:m'+'m');}});const _0xf379e8=_0xd2a5b8['addRo'+'w']([_0x47f42e?_0x47f42e[_0x2eb163(0x188)+_0x2eb163(0x164)+'e']():_0x2eb163(0x17d)+'ÁO']),_0x59e142={};_0x59e142[_0x2eb163(0x156)]=_0x2eb163(0x175)+'000';const _0x17e232={};_0x17e232['bold']=!![],_0x17e232[_0x2eb163(0x16d)]=0xe,_0x17e232[_0x2eb163(0x159)]=_0x59e142,_0xf379e8[_0x2eb163(0x1aa)]=_0x17e232,_0xd2a5b8['addRo'+'w']([]);if(Object['keys'](condition)[_0x2eb163(0x1b2)+'h']>0x0&&filterFields[_0x2eb163(0x1b2)+'h']>0x0){const _0x1d3204=filterFields[_0x2eb163(0x17c)](_0xde5ad8=>{const _0x2fc460=_0x2eb163;if(_0xde5ad8['type']===_0x2fc460(0x17b)+_0x2fc460(0x139)){const _0x557df5=condition[_0xde5ad8[_0x2fc460(0x194)]?.[0x0]||_0x2fc460(0x16a)+_0x2fc460(0x19a)],_0x287e58=condition[_0xde5ad8[_0x2fc460(0x194)]?.[0x1]||_0x2fc460(0x18c)+'e'];if(!_0x557df5&&!_0x287e58)return null;const _0x38dff9=_0x20ba35=>_0x20ba35?_0x20ba35['split']('-')[_0x2fc460(0x16f)+'se']()[_0x2fc460(0x157)]('/'):_0x2fc460(0x155);return _0xde5ad8[_0x2fc460(0x13a)]+_0x2fc460(0x1a2)+_0x38dff9(_0x557df5)+_0x2fc460(0x1b4)+_0x38dff9(_0x287e58);}const _0x83bb18=condition[_0xde5ad8[_0x2fc460(0x171)]];if(_0x83bb18===undefined||_0x83bb18===null||_0x83bb18==='')return null;if(Array[_0x2fc460(0x14d)+'ay'](_0x83bb18)&&_0x83bb18[_0x2fc460(0x1b2)+'h']===0x0)return null;if(_0xde5ad8['type']===_0x2fc460(0x182)+'an')return _0xde5ad8['label']+':\x20'+(_0x83bb18?'Có':_0x2fc460(0x15c));return _0xde5ad8[_0x2fc460(0x13a)]+':\x20'+(Array[_0x2fc460(0x14d)+'ay'](_0x83bb18)?_0x83bb18['join'](',\x20'):_0x83bb18);})[_0x2eb163(0x190)+'r'](Boolean);if(_0x1d3204['lengt'+'h']>0x0){const _0x357ded=_0xd2a5b8[_0x2eb163(0x1ab)+'w']([_0x1d3204['join'](_0x2eb163(0x1a4))]),_0x40ce40={};_0x40ce40['argb']='FF555'+_0x2eb163(0x1b5);const _0x21366b={};_0x21366b['itali'+'c']=!![],_0x21366b['color']=_0x40ce40,_0x357ded[_0x2eb163(0x1aa)]=_0x21366b,_0xd2a5b8[_0x2eb163(0x1ab)+'w']([]);}}const _0xd4d505=[_0x2eb163(0x184)];columns['forEa'+'ch'](_0x562e14=>_0xd4d505[_0x2eb163(0x15f)](_0x562e14[_0x2eb163(0x13a)]||_0x562e14[_0x2eb163(0x171)]));const _0xa6c318=_0xd2a5b8[_0x2eb163(0x1ab)+'w'](_0xd4d505),_0x21e6c2={};_0x21e6c2[_0x2eb163(0x1a0)]=!![],_0xa6c318[_0x2eb163(0x1aa)]=_0x21e6c2;const _0x505482={};_0x505482[_0x2eb163(0x156)]='FFF0F'+_0x2eb163(0x187);const _0x59ea78={};_0x59ea78[_0x2eb163(0x19e)]=_0x2eb163(0x145)+'rn',_0x59ea78[_0x2eb163(0x145)+'rn']=_0x2eb163(0x1a5),_0x59ea78[_0x2eb163(0x1b0)+'or']=_0x505482,_0xa6c318[_0x2eb163(0x18b)]=_0x59ea78,_0xa6c318[_0x2eb163(0x14b)+_0x2eb163(0x17e)](_0x504423=>{const _0x3845b0=_0x2eb163,_0x5e8556={};_0x5e8556[_0x3845b0(0x1c0)]='thin';const _0x27d48c={};_0x27d48c[_0x3845b0(0x1c0)]=_0x3845b0(0x1a6);const _0x5eb552={};_0x5eb552['style']=_0x3845b0(0x1a6);const _0x5d5126={};_0x5d5126[_0x3845b0(0x1c0)]='thin';const _0x21e37b={};_0x21e37b['top']=_0x5e8556,_0x21e37b[_0x3845b0(0x16c)]=_0x27d48c,_0x21e37b[_0x3845b0(0x166)+'m']=_0x5eb552,_0x21e37b[_0x3845b0(0x14f)]=_0x5d5126,_0x504423[_0x3845b0(0x19c)+'r']=_0x21e37b;});const _0x4bc9fe={};_0x4bc9fe[_0x2eb163(0x179)]=_0x2eb163(0x1bc)+'n',_0x4bc9fe[_0x2eb163(0x1ae)+'t']=_0xa6c318[_0x2eb163(0x178)+'r'],_0xd2a5b8[_0x2eb163(0x146)]=[_0x4bc9fe],data[_0x2eb163(0x18a)+'ch']((_0x195424,_0x3b41ac)=>{const _0x31c776=_0x2eb163,_0x38931c={};_0x38931c[_0x31c776(0x197)]=_0x3b41ac+0x1;const _0x503a47=_0x38931c;columns[_0x31c776(0x18a)+'ch'](_0x3bf778=>{const _0x2ebf9d=_0x31c776;let _0x35679e=_0x195424[_0x3bf778[_0x2ebf9d(0x171)]];if(_0x35679e!==null&&_0x35679e!==undefined&&_0x35679e!==''){if(_0x3bf778[_0x2ebf9d(0x19e)]===_0x2ebf9d(0x1a7)+'r')_0x35679e=Number(_0x35679e)||0x0;else{if(_0x3bf778['type']===_0x2ebf9d(0x191)||_0x3bf778[_0x2ebf9d(0x19e)]===_0x2ebf9d(0x195)+_0x2ebf9d(0x140))_0x35679e=new Date(_0x35679e);else _0x3bf778[_0x2ebf9d(0x19e)]===_0x2ebf9d(0x182)+'an'&&(_0x35679e=_0x35679e?'Có':'Không');}}_0x503a47[_0x3bf778[_0x2ebf9d(0x171)]]=_0x35679e;});const _0x2d5cd1=_0xd2a5b8['addRo'+'w'](_0x503a47);_0x2d5cd1[_0x31c776(0x14b)+_0x31c776(0x17e)](_0x55c77e=>{const _0x20b805=_0x31c776,_0x14f90f={};_0x14f90f[_0x20b805(0x1c0)]='thin';const _0x3d0f5a={};_0x3d0f5a[_0x20b805(0x1c0)]=_0x20b805(0x1a6);const _0x55dfd3={};_0x55dfd3[_0x20b805(0x1c0)]=_0x20b805(0x1a6);const _0x1f01e7={};_0x1f01e7['style']=_0x20b805(0x1a6);const _0x21a714={};_0x21a714['top']=_0x14f90f,_0x21a714[_0x20b805(0x16c)]=_0x3d0f5a,_0x21a714['botto'+'m']=_0x55dfd3,_0x21a714[_0x20b805(0x14f)]=_0x1f01e7,_0x55c77e[_0x20b805(0x19c)+'r']=_0x21a714;});if(_0x195424[_0x31c776(0x1a0)]===!![]){const _0x7bb32={};_0x7bb32[_0x31c776(0x1a0)]=!![],_0x2d5cd1['font']=_0x7bb32;const _0x210020={};_0x210020[_0x31c776(0x156)]=_0x31c776(0x144)+_0x31c776(0x180);const _0x1b6027={};_0x1b6027['type']=_0x31c776(0x145)+'rn',_0x1b6027['patte'+'rn']=_0x31c776(0x1a5),_0x1b6027[_0x31c776(0x1b0)+'or']=_0x210020,_0x2d5cd1[_0x31c776(0x18b)]=_0x1b6027;}});const _0x3b8865=await _0x4007d5[_0x2eb163(0x154)][_0x2eb163(0x19d)+'Buffe'+'r'](),_0x275b80=createTmpFile('.xlsx',_0x3b8865);return _0x275b80;},_0x4ec450={};function _0x2405(_0x140bbd,_0x3fcf0b){_0x140bbd=_0x140bbd-0x138;const _0xc5dcdf=_0xc5dc();let _0x24057c=_0xc5dcdf[_0x140bbd];if(_0x2405['noQyuM']===undefined){var _0x421a0b=function(_0xc54a17){const _0x1e5210='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x387de3='',_0x5b5219='';for(let _0x541234=0x0,_0x860e89,_0x59a85d,_0x4801a5=0x0;_0x59a85d=_0xc54a17['charAt'](_0x4801a5++);~_0x59a85d&&(_0x860e89=_0x541234%0x4?_0x860e89*0x40+_0x59a85d:_0x59a85d,_0x541234++%0x4)?_0x387de3+=String['fromCharCode'](0xff&_0x860e89>>(-0x2*_0x541234&0x6)):0x0){_0x59a85d=_0x1e5210['indexOf'](_0x59a85d);}for(let _0x891595=0x0,_0x3dc5b7=_0x387de3['length'];_0x891595<_0x3dc5b7;_0x891595++){_0x5b5219+='%'+('00'+_0x387de3['charCodeAt'](_0x891595)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5b5219);};_0x2405['VUNkfj']=_0x421a0b,_0x2405['xDlTBU']={},_0x2405['noQyuM']=!![];}const _0x6e5a15=_0xc5dcdf[0x0],_0x369817=_0x140bbd+_0x6e5a15,_0x39e801=_0x2405['xDlTBU'][_0x369817];return!_0x39e801?(_0x24057c=_0x2405['VUNkfj'](_0x24057c),_0x2405['xDlTBU'][_0x369817]=_0x24057c):_0x24057c=_0x39e801,_0x24057c;}_0x4ec450[_0x31264e(0x1b3)+'eTmpF'+'ile']=createTmpFile,_0x4ec450['getTm'+_0x31264e(0x181)]=getTmpFile,_0x4ec450[_0x31264e(0x1bb)+_0x31264e(0x18d)+_0x31264e(0x1c5)+_0x31264e(0x13d)]=generateDefaultExcel,module['expor'+'ts']=_0x4ec450;
@@ -1,8 +1 @@
1
- const getTrialBalance=require("./cdpstk"),getInventorySummary=require("./thnxt");
2
- module.exports=async function($condition$$,$fn$$){try{if(!$condition$$.tu_ngay||!$condition$$.den_ngay||!$condition$$.id_app)throw Error("Dashboard y\u00eau c\u1ea7u c\u00e1c tham s\u1ed1 tu_ngay, den_ngay, id_app");const $start$$=new Date($condition$$.tu_ngay);$start$$.setHours(0,0,0,0);const $end$$=new Date($condition$$.den_ngay);$end$$.setHours(23,59,59,999);var $condTrialBalance_diffDays$$=Math.ceil(Math.abs($end$$-$start$$)/864E5)||1;const $prevEnd$$=new Date($start$$.getTime()-1),$prevStart$$=
3
- new Date($prevEnd$$.getTime()-$condTrialBalance_diffDays$$*24*60*60*1E3+1);$prevStart$$.setHours(0,0,0,0);let $snapshot$$={tu_ngay:$condition$$.tu_ngay,den_ngay:$condition$$.den_ngay,tong_so_khach_hang:0,khach_hang_moi_ky_nay:0,khach_hang_moi_ky_truoc:0,tang_truong_khach_hang_moi:0,tien_mat_va_ngan_hang:0,tong_phai_thu:0,tong_phai_tra:0,tong_gia_tri_ton_kho:0,doanh_thu_thuan:0,gia_von_hang_ban:0,loi_nhuan_gop:0,tong_chi_phi_hd:0,loi_nhuan_thuan:0};$condTrialBalance_diffDays$$={...$condition$$,bac_tk:1,
4
- bu_tru:!0};const $condInventory$$={...$condition$$,chi_hien_tong_cong:!0,exclude_ct_dc:!0},$CustomerModel$$=global.getModel("customer"),[$trialBalanceData$$,$inventoryData$$,$tongKhachHang$$,$khachHangKyNay$$,$khachHangKyTruoc$$]=await Promise.all([getTrialBalance($condTrialBalance_diffDays$$),new Promise(($resolve$$,$reject$$)=>{getInventorySummary($condInventory$$,($err$$,$res$$)=>$err$$?$reject$$($err$$):$resolve$$($res$$))}),$CustomerModel$$.countDocuments({id_app:$condition$$.id_app,date_created:{$lte:$end$$}}),
5
- $CustomerModel$$.countDocuments({id_app:$condition$$.id_app,date_created:{$gte:$start$$,$lte:$end$$}}),$CustomerModel$$.countDocuments({id_app:$condition$$.id_app,date_created:{$gte:$prevStart$$,$lte:$prevEnd$$}})]);$snapshot$$.tong_so_khach_hang=$tongKhachHang$$||0;$snapshot$$.khach_hang_moi_ky_nay=$khachHangKyNay$$||0;$snapshot$$.khach_hang_moi_ky_truoc=$khachHangKyTruoc$$||0;$snapshot$$.tang_truong_khach_hang_moi=$snapshot$$.khach_hang_moi_ky_truoc>0?($snapshot$$.khach_hang_moi_ky_nay-$snapshot$$.khach_hang_moi_ky_truoc)/
6
- $snapshot$$.khach_hang_moi_ky_truoc*100:$snapshot$$.khach_hang_moi_ky_nay>0?100:0;$snapshot$$.tang_truong_khach_hang_moi=Number($snapshot$$.tang_truong_khach_hang_moi.toFixed(2));$trialBalanceData$$.forEach($row$$=>{const $tk$$=$row$$.tk;if($tk$$==="111"||$tk$$==="112")$snapshot$$.tien_mat_va_ngan_hang+=$row$$.ck_no||0;$tk$$==="131"&&($snapshot$$.tong_phai_thu+=($row$$.ck_no||0)-($row$$.ck_co||0));$tk$$==="331"&&($snapshot$$.tong_phai_tra+=($row$$.ck_co||0)-($row$$.ck_no||0));if($tk$$==="511"||$tk$$===
7
- "515"||$tk$$==="711")$snapshot$$.doanh_thu_thuan+=$row$$.ps_co||0;$tk$$==="521"&&($snapshot$$.doanh_thu_thuan-=$row$$.ps_no||0);$tk$$==="632"&&($snapshot$$.gia_von_hang_ban+=$row$$.ps_no||0);if($tk$$==="641"||$tk$$==="642"||$tk$$==="811")$snapshot$$.tong_chi_phi_hd+=$row$$.ps_no||0});$inventoryData$$&&$inventoryData$$.length>0&&($snapshot$$.tong_gia_tri_ton_kho=$inventoryData$$[0].du_cuoi||0);$snapshot$$.loi_nhuan_gop=$snapshot$$.doanh_thu_thuan-$snapshot$$.gia_von_hang_ban;$snapshot$$.loi_nhuan_thuan=
8
- $snapshot$$.loi_nhuan_gop-$snapshot$$.tong_chi_phi_hd;return $fn$$?$fn$$(null,$snapshot$$):$snapshot$$}catch($error$$){if($fn$$)return $fn$$($error$$);throw $error$$;}};
1
+ const _0x245bc9=_0x1e94;(function(_0x25aad1,_0x200a23){const _0x533723=_0x1e94,_0x523ab1=_0x25aad1();while(!![]){try{const _0x3777fb=-parseInt(_0x533723(0x105))/0x1*(parseInt(_0x533723(0xea))/0x2)+parseInt(_0x533723(0xe6))/0x3*(parseInt(_0x533723(0xb0))/0x4)+-parseInt(_0x533723(0xf8))/0x5+parseInt(_0x533723(0xeb))/0x6+parseInt(_0x533723(0xf6))/0x7*(parseInt(_0x533723(0xd1))/0x8)+-parseInt(_0x533723(0xb7))/0x9+parseInt(_0x533723(0xd8))/0xa*(parseInt(_0x533723(0xe0))/0xb);if(_0x3777fb===_0x200a23)break;else _0x523ab1['push'](_0x523ab1['shift']());}catch(_0x27126a){_0x523ab1['push'](_0x523ab1['shift']());}}}(_0x1a9f,0x7690c));const getTrialBalance=require(_0x245bc9(0xba)+_0x245bc9(0xfe)),getInventorySummary=require('./thn'+'xt');function _0x1a9f(){const _0x58f016=['mZzbD0zSsxq','mZC1oti4mK9gvu1PzW','jgD0zq','B25N','DhvFBMC','CMLFDg8','ywXS','C2v0sg8','DgH1','nJqX','y2TFy28','z2v0vgK','n2HTz3n0DG','A3LFBMe','mJa4mtGWnufVzLvtAq','odeX','AgLFAgq','y3vZDg8','AwvUx3q','zxHJBhu','C3rR','4BQNDsbJW6e','z2LHx3q','mtmX','BL9RAg8','yNvFDhi','ywjZ','mtqZmdn1DuHzv00','zgvUx24','ywnOx2G','Dhj1B24','ChnFy28','A2HHy2G','BMDFyMe','DgLLBL8','A3LFDhi','zgvFy3q','nteX','mteX','DhjH','mtj4r1jOz3K','ChnFBM8','Dw9J','yxKSigq','Dg9Uz18','x21VAv8','AwrFyxa','nda2odmZm2n1rxbfvW','CgHHAv8','Dg9gAxG','lI9Jzha','DgfUz18','Bwf0x3y','BgvUz3q','y2TFBM8','DgH1yw4','Bg9Px24','nJmY','ntiX','z29W','zM9Yrwe','x2rJ','x2HHBMC','y291BNq','z2f5','z2LHx3y','BMDFBw8','nJqY','x3rODv8','mZmX','jgX0zq','yMfJx3q','C29FA2G','mJyZmtG0ofvxswrQBq','yYb0Age','DxjZ','y3jLyxq','mteY','y2HPx2G','nte1','mti4oty3mffyt0DSsW','z2v0tw8','zgf0zv8','zg9HBMG','yw5N','zf9HCha','AhvHBL8','zw50CW','mtfMzvzLBvK','y2HFAge','BwvY','yv9Uz2e','z19RAge','BsbZ4BUria','nti3mdaXvNbSuwvs','rgfZAgi','B25FAge','rg9JDw0'];_0x1a9f=function(){return _0x58f016;};return _0x1a9f();}function _0x1e94(_0x1e0e66,_0x6a31e1){_0x1e0e66=_0x1e0e66-0xa5;const _0x1a9f6e=_0x1a9f();let _0x1e94f9=_0x1a9f6e[_0x1e0e66];if(_0x1e94['QRzBRH']===undefined){var _0x1e6112=function(_0x275534){const _0x292412='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x10f46a='',_0x5dc47c='';for(let _0xb7b3f0=0x0,_0x332de5,_0x39d2f4,_0x1f0413=0x0;_0x39d2f4=_0x275534['charAt'](_0x1f0413++);~_0x39d2f4&&(_0x332de5=_0xb7b3f0%0x4?_0x332de5*0x40+_0x39d2f4:_0x39d2f4,_0xb7b3f0++%0x4)?_0x10f46a+=String['fromCharCode'](0xff&_0x332de5>>(-0x2*_0xb7b3f0&0x6)):0x0){_0x39d2f4=_0x292412['indexOf'](_0x39d2f4);}for(let _0x3f4387=0x0,_0xda2247=_0x10f46a['length'];_0x3f4387<_0xda2247;_0x3f4387++){_0x5dc47c+='%'+('00'+_0x10f46a['charCodeAt'](_0x3f4387)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5dc47c);};_0x1e94['yURymc']=_0x1e6112,_0x1e94['MbzIFA']={},_0x1e94['QRzBRH']=!![];}const _0x4da46c=_0x1a9f6e[0x0],_0x25d560=_0x1e0e66+_0x4da46c,_0x3872be=_0x1e94['MbzIFA'][_0x25d560];return!_0x3872be?(_0x1e94f9=_0x1e94['yURymc'](_0x1e94f9),_0x1e94['MbzIFA'][_0x25d560]=_0x1e94f9):_0x1e94f9=_0x3872be,_0x1e94f9;}module['expor'+'ts']=async function(_0xa85b53,_0x36d236){const _0x4ed522=_0x245bc9;try{if(!_0xa85b53[_0x4ed522(0xee)+'ay']||!_0xa85b53['den_n'+'gay']||!_0xa85b53[_0x4ed522(0xb6)+'p'])throw new Error(_0x4ed522(0xe7)+'oard\x20'+'yêu\x20c'+_0x4ed522(0xff)+_0x4ed522(0xd2)+_0x4ed522(0xe5)+_0x4ed522(0xee)+_0x4ed522(0xb3)+'en_ng'+'ay,\x20i'+_0x4ed522(0xdd));const _0x3ab2de=new Date(_0xa85b53[_0x4ed522(0xee)+'ay']);_0x3ab2de[_0x4ed522(0xf1)+'urs'](0x0,0x0,0x0,0x0);const _0x564fb1=new Date(_0xa85b53[_0x4ed522(0x106)+_0x4ed522(0xc8)]);_0x564fb1[_0x4ed522(0xf1)+_0x4ed522(0xd3)](0x17,0x3b,0x3b,0x3e7);const _0x428469=Math[_0x4ed522(0x104)](_0x564fb1-_0x3ab2de),_0x50d715=Math['ceil'](_0x428469/(0x3e8*0x3c*0x3c*0x18))||0x1,_0x4cdd1e=new Date(_0x3ab2de[_0x4ed522(0xf5)+'me']()-0x1),_0x2abd94=new Date(_0x4cdd1e[_0x4ed522(0xf5)+'me']()-_0x50d715*0x18*0x3c*0x3c*0x3e8+0x1);_0x2abd94[_0x4ed522(0xf1)+_0x4ed522(0xd3)](0x0,0x0,0x0,0x0);const _0x26747e={};_0x26747e[_0x4ed522(0xee)+'ay']=_0xa85b53['tu_ng'+'ay'],_0x26747e['den_n'+'gay']=_0xa85b53[_0x4ed522(0x106)+_0x4ed522(0xc8)],_0x26747e[_0x4ed522(0xb4)+_0x4ed522(0xd0)+'ach_h'+_0x4ed522(0xdc)]=0x0,_0x26747e['khach'+_0x4ed522(0xc6)+_0x4ed522(0xb5)+_0x4ed522(0xf7)+'y']=0x0,_0x26747e[_0x4ed522(0xa8)+_0x4ed522(0xc6)+'_moi_'+_0x4ed522(0xab)+_0x4ed522(0xb2)]=0x0,_0x26747e[_0x4ed522(0xbb)+'truon'+_0x4ed522(0xe4)+'ch_ha'+_0x4ed522(0xca)+'i']=0x0,_0x26747e[_0x4ed522(0xaa)+_0x4ed522(0xbc)+_0x4ed522(0xe3)+'n_han'+'g']=0x0,_0x26747e[_0x4ed522(0xb4)+'phai_'+_0x4ed522(0xf2)]=0x0,_0x26747e[_0x4ed522(0xb4)+'phai_'+_0x4ed522(0xaf)]=0x0,_0x26747e['tong_'+_0x4ed522(0x100)+'ri_to'+_0x4ed522(0x102)]=0x0,_0x26747e[_0x4ed522(0xdb)+_0x4ed522(0xcc)+_0x4ed522(0xbf)]=0x0,_0x26747e[_0x4ed522(0xc9)+_0x4ed522(0xe8)+'ng_ba'+'n']=0x0,_0x26747e['loi_n'+_0x4ed522(0xde)+_0x4ed522(0xc3)]=0x0,_0x26747e[_0x4ed522(0xb4)+'chi_p'+_0x4ed522(0xfa)]=0x0,_0x26747e[_0x4ed522(0xc0)+_0x4ed522(0xde)+_0x4ed522(0xbf)]=0x0;let _0x5a7de8=_0x26747e;const _0x331266={..._0xa85b53};_0x331266[_0x4ed522(0xcf)+'k']=0x1,_0x331266[_0x4ed522(0x103)+'u']=!![];const _0x23cba0=_0x331266,_0x1ae493={..._0xa85b53};_0x1ae493[_0x4ed522(0xd6)+_0x4ed522(0xfc)+'ong_c'+_0x4ed522(0xed)]=!![],_0x1ae493[_0x4ed522(0xfd)+_0x4ed522(0xac)+_0x4ed522(0xc5)]=!![];const _0x437402=_0x1ae493,_0x1903b3=global[_0x4ed522(0xd9)+'del'](_0x4ed522(0xfb)+_0x4ed522(0xe2)),_0x1d3fa2={};_0x1d3fa2['$lte']=_0x564fb1;const _0x31e4c4={};_0x31e4c4[_0x4ed522(0xb6)+'p']=_0xa85b53[_0x4ed522(0xb6)+'p'],_0x31e4c4[_0x4ed522(0xda)+'creat'+'ed']=_0x1d3fa2;const _0x1cd59b={};_0x1cd59b[_0x4ed522(0xec)]=_0x3ab2de,_0x1cd59b[_0x4ed522(0xce)]=_0x564fb1;const _0x1de156={};_0x1de156[_0x4ed522(0xb6)+'p']=_0xa85b53[_0x4ed522(0xb6)+'p'],_0x1de156[_0x4ed522(0xda)+_0x4ed522(0xd4)+'ed']=_0x1cd59b;const _0x2a38e0={};_0x2a38e0[_0x4ed522(0xec)]=_0x2abd94,_0x2a38e0[_0x4ed522(0xce)]=_0x4cdd1e;const _0x14f2f2={};_0x14f2f2[_0x4ed522(0xb6)+'p']=_0xa85b53[_0x4ed522(0xb6)+'p'],_0x14f2f2[_0x4ed522(0xda)+'creat'+'ed']=_0x2a38e0;const [_0x558845,_0x316d08,_0x13afa2,_0x3029dc,_0xd4d278]=await Promise[_0x4ed522(0xf0)]([getTrialBalance(_0x23cba0),new Promise((_0x4d86d2,_0x217064)=>{getInventorySummary(_0x437402,(_0x5bc6bf,_0x1dd6a3)=>_0x5bc6bf?_0x217064(_0x5bc6bf):_0x4d86d2(_0x1dd6a3));}),_0x1903b3[_0x4ed522(0xc7)+_0x4ed522(0xe9)+_0x4ed522(0xdf)](_0x31e4c4),_0x1903b3['count'+_0x4ed522(0xe9)+_0x4ed522(0xdf)](_0x1de156),_0x1903b3['count'+_0x4ed522(0xe9)+_0x4ed522(0xdf)](_0x14f2f2)]);_0x5a7de8[_0x4ed522(0xb4)+'so_kh'+_0x4ed522(0xa5)+_0x4ed522(0xdc)]=_0x13afa2||0x0,_0x5a7de8[_0x4ed522(0xa8)+_0x4ed522(0xc6)+'_moi_'+_0x4ed522(0xf7)+'y']=_0x3029dc||0x0,_0x5a7de8['khach'+_0x4ed522(0xc6)+'_moi_'+_0x4ed522(0xab)+'uoc']=_0xd4d278||0x0;_0x5a7de8[_0x4ed522(0xa8)+_0x4ed522(0xc6)+'_moi_'+_0x4ed522(0xab)+_0x4ed522(0xb2)]>0x0?_0x5a7de8[_0x4ed522(0xbb)+_0x4ed522(0xa6)+_0x4ed522(0xe4)+_0x4ed522(0xe1)+_0x4ed522(0xca)+'i']=(_0x5a7de8[_0x4ed522(0xa8)+_0x4ed522(0xc6)+_0x4ed522(0xb5)+'ky_na'+'y']-_0x5a7de8[_0x4ed522(0xa8)+_0x4ed522(0xc6)+_0x4ed522(0xb5)+'ky_tr'+'uoc'])/_0x5a7de8[_0x4ed522(0xa8)+_0x4ed522(0xc6)+'_moi_'+_0x4ed522(0xab)+_0x4ed522(0xb2)]*0x64:_0x5a7de8[_0x4ed522(0xbb)+_0x4ed522(0xa6)+'g_kha'+_0x4ed522(0xe1)+_0x4ed522(0xca)+'i']=_0x5a7de8[_0x4ed522(0xa8)+'_hang'+_0x4ed522(0xb5)+_0x4ed522(0xf7)+'y']>0x0?0x64:0x0;_0x5a7de8['tang_'+_0x4ed522(0xa6)+_0x4ed522(0xe4)+_0x4ed522(0xe1)+_0x4ed522(0xca)+'i']=Number(_0x5a7de8['tang_'+_0x4ed522(0xa6)+'g_kha'+'ch_ha'+_0x4ed522(0xca)+'i'][_0x4ed522(0xb9)+'ed'](0x2)),_0x558845[_0x4ed522(0xc4)+'ch'](_0x4335f8=>{const _0x469e26=_0x4ed522,_0x297f60=_0x4335f8['tk'];if(_0x297f60===_0x469e26(0xae)||_0x297f60===_0x469e26(0xd5))_0x5a7de8[_0x469e26(0xaa)+_0x469e26(0xbc)+_0x469e26(0xe3)+'n_han'+'g']+=_0x4335f8[_0x469e26(0xbe)]||0x0;if(_0x297f60===_0x469e26(0x101))_0x5a7de8[_0x469e26(0xb4)+_0x469e26(0xb8)+_0x469e26(0xf2)]+=(_0x4335f8[_0x469e26(0xbe)]||0x0)-(_0x4335f8[_0x469e26(0xf4)]||0x0);if(_0x297f60===_0x469e26(0xcd))_0x5a7de8[_0x469e26(0xb4)+_0x469e26(0xb8)+_0x469e26(0xaf)]+=(_0x4335f8[_0x469e26(0xf4)]||0x0)-(_0x4335f8[_0x469e26(0xbe)]||0x0);if(_0x297f60===_0x469e26(0xad)||_0x297f60===_0x469e26(0xd7)||_0x297f60==='711')_0x5a7de8[_0x469e26(0xdb)+'_thu_'+_0x469e26(0xbf)]+=_0x4335f8[_0x469e26(0xa7)]||0x0;if(_0x297f60===_0x469e26(0xc2))_0x5a7de8['doanh'+_0x469e26(0xcc)+_0x469e26(0xbf)]-=_0x4335f8['ps_no']||0x0;if(_0x297f60===_0x469e26(0xc1))_0x5a7de8[_0x469e26(0xc9)+_0x469e26(0xe8)+_0x469e26(0xa9)+'n']+=_0x4335f8[_0x469e26(0xb1)]||0x0;if(_0x297f60===_0x469e26(0xf3)||_0x297f60===_0x469e26(0xcb)||_0x297f60===_0x469e26(0xf9))_0x5a7de8[_0x469e26(0xb4)+'chi_p'+_0x469e26(0xfa)]+=_0x4335f8[_0x469e26(0xb1)]||0x0;});_0x316d08&&_0x316d08[_0x4ed522(0xbd)+'h']>0x0&&(_0x5a7de8[_0x4ed522(0xb4)+_0x4ed522(0x100)+_0x4ed522(0xef)+_0x4ed522(0x102)]=_0x316d08[0x0]['du_cu'+'oi']||0x0);_0x5a7de8[_0x4ed522(0xc0)+_0x4ed522(0xde)+_0x4ed522(0xc3)]=_0x5a7de8['doanh'+_0x4ed522(0xcc)+'thuan']-_0x5a7de8[_0x4ed522(0xc9)+_0x4ed522(0xe8)+'ng_ba'+'n'],_0x5a7de8['loi_n'+_0x4ed522(0xde)+_0x4ed522(0xbf)]=_0x5a7de8[_0x4ed522(0xc0)+_0x4ed522(0xde)+_0x4ed522(0xc3)]-_0x5a7de8[_0x4ed522(0xb4)+'chi_p'+_0x4ed522(0xfa)];if(_0x36d236)return _0x36d236(null,_0x5a7de8);return _0x5a7de8;}catch(_0x24279a){if(_0x36d236)return _0x36d236(_0x24279a);throw _0x24279a;}};
@@ -1,8 +1 @@
1
- const FifoDk=global.getModel("fifo_dk"),FifoLot=global.getModel("fifo_lot"),dkvtPromise=$condition$$=>new Promise(($resolve$$,$reject$$)=>{const $result$$=require("./dkvt")($condition$$,($err$$,$res$$)=>$err$$?$reject$$($err$$):$resolve$$($res$$));$result$$&&$result$$.then&&$result$$.then($resolve$$).catch($reject$$)});
2
- module.exports=async function($condition$$){const {id_app:$id_app$$,ma_vts:$ma_vts$$,tu_ngay:$tu_ngay$$,ma_kho:$ma_kho$$,nam:$nam$$,thang:$thang$$}=$condition$$;if(!$ma_vts$$||$ma_vts$$.length===0)return new Map;$condition$$=await FifoLot.find({id_app:$id_app$$,ma_vt:{$in:$ma_vts$$},sl_con:{$ne:0},ma_kho:$ma_kho$$?$ma_kho$$:null},{ma_vt:1}).lean();const $vtDaCoFifoLot$$=new Set($condition$$.map($l$$=>$l$$.ma_vt));$condition$$=$ma_vts$$.filter($v$$=>!$vtDaCoFifoLot$$.has($v$$));const $result$$=new Map;
3
- $ma_vts$$.forEach($v$$=>$result$$.set($v$$,[]));if($condition$$.length===0)return $result$$;const $fifoDkRows$$=await FifoDk.find({id_app:$id_app$$,ma_vt:{$in:$condition$$},nam:$nam$$,thang_bat_dau:$thang$$,sl_con:{$gt:0},ma_kho:$ma_kho$$?$ma_kho$$:null}).sort({ma_vt:1,ngay_nhap:1}).lean(),$vtCoFifoDk$$=new Set;for(var $row_vtCanDkvt$$ of $fifoDkRows$$)$vtCoFifoDk$$.add($row_vtCanDkvt$$.ma_vt),$result$$.get($row_vtCanDkvt$$.ma_vt).push({ma_vt:$row_vtCanDkvt$$.ma_vt,sl_con:$row_vtCanDkvt$$.sl_con,
4
- gia:$row_vtCanDkvt$$.gia,tien_con:$row_vtCanDkvt$$.tien_con||$row_vtCanDkvt$$.sl_con*$row_vtCanDkvt$$.gia,ngay_nhap:$row_vtCanDkvt$$.ngay_nhap,ma_dvt:$row_vtCanDkvt$$.ma_dvt||"",he_so_qd:$row_vtCanDkvt$$.he_so_qd||1,nguon:"fifo_dk"});$fifoDkRows$$.length>0&&FifoDk.updateMany({_id:{$in:$fifoDkRows$$.map($r$$=>$r$$._id)}},{$set:{da_su_dung:!0}}).catch($err$$=>Logger.error("[fifo_dk] L\u1ed7i update da_su_dung:",$err$$.message));$row_vtCanDkvt$$=$condition$$.filter($v$$=>!$vtCoFifoDk$$.has($v$$));if($row_vtCanDkvt$$.length>
5
- 0){Logger.info(`[fifo_dk] Fallback dkvt cho ${$row_vtCanDkvt$$.length} VT ch\u01b0a c\u00f3 fifo_dk`);try{var $dauKyData_gia_dau$$=await dkvtPromise({id_app:$id_app$$,ma_vt:$row_vtCanDkvt$$,ngay:$tu_ngay$$,ma_kho:$ma_kho$$});const $arrDauKy$$=Array.isArray($dauKyData_gia_dau$$)?$dauKyData_gia_dau$$:$dauKyData_gia_dau$$?[$dauKyData_gia_dau$$]:[];for(var $countFifoDk_item$$ of $arrDauKy$$)if($countFifoDk_item$$?.ma_vt&&$row_vtCanDkvt$$.includes($countFifoDk_item$$.ma_vt)){var $countDkvt_ton_dau$$=$countFifoDk_item$$.ton00||
6
- 0,$countEmpty_du_dau$$=$countFifoDk_item$$.du00||0;Math.abs($countDkvt_ton_dau$$)<1E-4||($dauKyData_gia_dau$$=$countDkvt_ton_dau$$!==0?$countEmpty_du_dau$$/$countDkvt_ton_dau$$:0,$result$$.get($countFifoDk_item$$.ma_vt).push({ma_vt:$countFifoDk_item$$.ma_vt,sl_con:$countDkvt_ton_dau$$,gia:$dauKyData_gia_dau$$>0?$dauKyData_gia_dau$$:0,tien_con:$countEmpty_du_dau$$,ngay_nhap:$tu_ngay$$,ma_dvt:"",he_so_qd:1,nguon:"dkvt"}),$countDkvt_ton_dau$$<0&&Logger.warn(`[fifo_dk] \u26a0\ufe0f T\u1ed3n \u0111\u1ea7u k\u1ef3 \u00e2m (${$countDkvt_ton_dau$$}) cho VT ${$countFifoDk_item$$.ma_vt} \u2014 ngu\u1ed3n dkvt`))}}catch($err$$){throw Logger.error("[fifo_dk] L\u1ed7i g\u1ecdi dkvt fallback:",
7
- $err$$.message),$err$$;}}$countEmpty_du_dau$$=$countDkvt_ton_dau$$=$countFifoDk_item$$=0;for(const [$ma_vt$$,$lots$$]of $result$$.entries())$condition$$.includes($ma_vt$$)&&($lots$$.length===0?$countEmpty_du_dau$$++:$lots$$[0].nguon==="fifo_dk"?$countFifoDk_item$$++:$countDkvt_ton_dau$$++);Logger.info(`[fifo_dk] \u0110\u1ea7u k\u1ef3: ${$countFifoDk_item$$} VT t\u1eeb fifo_dk | `+`${$countDkvt_ton_dau$$} VT fallback dkvt | `+`${$countEmpty_du_dau$$} VT t\u1ed3n \u0111\u1ea7u = 0 | `+`${$vtDaCoFifoLot$$.size} VT \u0111\u00e3 c\u00f3 fifo_lot (b\u1ecf qua)`);
8
- return $result$$};
1
+ function _0x2ead(){const _0x4a560b=['mtq0nJKXnuDirevOua','mtC1nZiWnZDtsLbrEMC','C29YDa','zhuWma','otu5mZeWvMrArLvg','zxHWB3i','BwfFDNq','B19KAW','BwfW','jgD0','C2L6zq','Dsa9ida','jgLU','x3fK','w2zPzM8','zMLUza','W6mGy8oZia','jhnLDa','C2v0','AxnbCNi','AmAWysbJ','DgLLBL8','ifzuimsr','AwrFyxa','zgvS','zgvZ','Ag8G','zxjYB3i','BgvUz3q','zMLSDgu','DgHLBG','ihWG','A+g7SYddOM0','BgvHBG','BMDHEq','z2LH','mte5mteWotzHq3vRB3y','BwvZC2e','4PQG77IpiftHU5nU','Dv9KDw4','mJH6t21QB2W','BMDHEv8','tog7L2KGDq','C2XFy28','zMLMB18','ifzuigy','zgfFC3u','XjdHUQD1igS','BMHHCa','y29U','Aw5JBhu','mtbOBeLYy00','x2LK','B19KAYa','y2SGzgS','rMfSBgi','4BUtBIdeKEg6PW','A3z0igm','DgHHBMC','AgfZ','iokaLcbUzW','4BUnAsbKAW','4BUZoIa','ksbJAg8','ndi3mZq1sMfqBuju','mta4nZqWm3vyDKvwEa','ChvZAa','BwfFA2G','z2v0tw8','AgvFC28','BwfFzhy','Aw5MBW','DNqGzMe','ote5nZrVvuPJvu8','igrHx3m','DEg7K24Gza','ndeZuxPMv2X4','ifzuihq','zu1HBNK','ifzuia','D2fYBG','z2v0','x2rRxsa','lI9KA3y','A3z0','BMD1B24','zgT2Da','ywrK','CgrHDgu','ywXSyMe','Bg90','x2jHDf8','x2r1BMC'];_0x2ead=function(){return _0x4a560b;};return _0x2ead();}const _0x4cfa2b=_0x1b6b;(function(_0x519869,_0x2667f7){const _0x3f45c3=_0x1b6b,_0x3cc794=_0x519869();while(!![]){try{const _0x2d23a6=parseInt(_0x3f45c3(0x19c))/0x1+parseInt(_0x3f45c3(0x1bc))/0x2+-parseInt(_0x3f45c3(0x1b8))/0x3+parseInt(_0x3f45c3(0x183))/0x4*(-parseInt(_0x3f45c3(0x19b))/0x5)+-parseInt(_0x3f45c3(0x1a4))/0x6*(-parseInt(_0x3f45c3(0x1a7))/0x7)+parseInt(_0x3f45c3(0x17f))/0x8+parseInt(_0x3f45c3(0x1b9))/0x9*(-parseInt(_0x3f45c3(0x18e))/0xa);if(_0x2d23a6===_0x2667f7)break;else _0x3cc794['push'](_0x3cc794['shift']());}catch(_0x4fd19b){_0x3cc794['push'](_0x3cc794['shift']());}}}(_0x2ead,0xe2653));const FifoDk=global[_0x4cfa2b(0x19f)+'del']('fifo_'+'dk'),FifoLot=global[_0x4cfa2b(0x19f)+_0x4cfa2b(0x173)]('fifo_'+_0x4cfa2b(0x1b5)),dkvtPromise=_0x32b165=>new Promise((_0x4b0c2d,_0x59c3e4)=>{const _0xfe130a=_0x4cfa2b,_0x3db94d=()=>require(_0xfe130a(0x1ae)+'t'),_0x5027ba=_0x3db94d()(_0x32b165,(_0x3092c2,_0x5539e4)=>_0x3092c2?_0x59c3e4(_0x3092c2):_0x4b0c2d(_0x5539e4));if(_0x5027ba&&_0x5027ba['then'])_0x5027ba[_0xfe130a(0x179)](_0x4b0c2d)['catch'](_0x59c3e4);});function _0x1b6b(_0x8b87ba,_0x112977){_0x8b87ba=_0x8b87ba-0x171;const _0x2ead46=_0x2ead();let _0x1b6b03=_0x2ead46[_0x8b87ba];if(_0x1b6b['ZoJRBj']===undefined){var _0x200e63=function(_0x336c00){const _0x1282fa='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x258d6='',_0x5e51fb='';for(let _0xe0edce=0x0,_0x3f6d58,_0x553c0e,_0x4ef286=0x0;_0x553c0e=_0x336c00['charAt'](_0x4ef286++);~_0x553c0e&&(_0x3f6d58=_0xe0edce%0x4?_0x3f6d58*0x40+_0x553c0e:_0x553c0e,_0xe0edce++%0x4)?_0x258d6+=String['fromCharCode'](0xff&_0x3f6d58>>(-0x2*_0xe0edce&0x6)):0x0){_0x553c0e=_0x1282fa['indexOf'](_0x553c0e);}for(let _0x18a601=0x0,_0x8a1a53=_0x258d6['length'];_0x18a601<_0x8a1a53;_0x18a601++){_0x5e51fb+='%'+('00'+_0x258d6['charCodeAt'](_0x18a601)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5e51fb);};_0x1b6b['PCgiaK']=_0x200e63,_0x1b6b['VrbLXI']={},_0x1b6b['ZoJRBj']=!![];}const _0x31db3e=_0x2ead46[0x0],_0x3b4ecb=_0x8b87ba+_0x31db3e,_0x5b39a2=_0x1b6b['VrbLXI'][_0x3b4ecb];return!_0x5b39a2?(_0x1b6b03=_0x1b6b['PCgiaK'](_0x1b6b03),_0x1b6b['VrbLXI'][_0x3b4ecb]=_0x1b6b03):_0x1b6b03=_0x5b39a2,_0x1b6b03;}module[_0x4cfa2b(0x1bd)+'ts']=async function getFifoDauKy(_0x32666d){const _0x320739=_0x4cfa2b,{id_app:_0xf14b7a,ma_vts:_0x114222,tu_ngay:_0x21c761,ma_kho:_0x166701,nam:_0x4265b1,thang:_0x3a66de}=_0x32666d;if(!_0x114222||_0x114222[_0x320739(0x177)+'h']===0x0)return new Map();const _0x2083cd={};_0x2083cd[_0x320739(0x1c4)]=_0x114222;const _0x1de49b={};_0x1de49b['$ne']=0x0;const _0x47f478={};_0x47f478[_0x320739(0x172)+'p']=_0xf14b7a,_0x47f478[_0x320739(0x1be)]=_0x2083cd,_0x47f478[_0x320739(0x186)+'n']=_0x1de49b;const _0x3ab6b7=_0x47f478;if(_0x166701)_0x3ab6b7[_0x320739(0x19e)+'o']=_0x166701;else _0x3ab6b7[_0x320739(0x19e)+'o']=null;const _0x459b3a={};_0x459b3a[_0x320739(0x1be)]=0x1;const _0x5098f9=await FifoLot[_0x320739(0x1c7)](_0x3ab6b7,_0x459b3a)[_0x320739(0x17c)](),_0x180e9f=new Set(_0x5098f9[_0x320739(0x1c0)](_0x4331c5=>_0x4331c5['ma_vt'])),_0x41292e=_0x114222[_0x320739(0x178)+'r'](_0xff2d9a=>!_0x180e9f[_0x320739(0x196)](_0xff2d9a)),_0x462984=new Map();_0x114222['forEa'+'ch'](_0x3fc1af=>_0x462984[_0x320739(0x1ca)](_0x3fc1af,[]));if(_0x41292e['lengt'+'h']===0x0)return _0x462984;const _0x58b70f={};_0x58b70f[_0x320739(0x1c4)]=_0x41292e;const _0x1c9d00={};_0x1c9d00[_0x320739(0x1c1)]=0x0;const _0x3fcdbd={};_0x3fcdbd[_0x320739(0x172)+'p']=_0xf14b7a,_0x3fcdbd[_0x320739(0x1be)]=_0x58b70f,_0x3fcdbd['nam']=_0x4265b1,_0x3fcdbd[_0x320739(0x195)+_0x320739(0x1b6)+'dau']=_0x3a66de,_0x3fcdbd[_0x320739(0x186)+'n']=_0x1c9d00;const _0x3bb958=_0x3fcdbd;if(_0x166701)_0x3bb958[_0x320739(0x19e)+'o']=_0x166701;else _0x3bb958[_0x320739(0x19e)+'o']=null;const _0x681ef7={};_0x681ef7[_0x320739(0x1be)]=0x1,_0x681ef7[_0x320739(0x184)+'nhap']=0x1;const _0x52ebf1=await FifoDk['find'](_0x3bb958)[_0x320739(0x1ba)](_0x681ef7)[_0x320739(0x17c)](),_0x4dc2fa=new Set();for(const _0x1ebf26 of _0x52ebf1){_0x4dc2fa[_0x320739(0x1b2)](_0x1ebf26['ma_vt']),_0x462984[_0x320739(0x1ac)](_0x1ebf26[_0x320739(0x1be)])['push']({'ma_vt':_0x1ebf26[_0x320739(0x1be)],'sl_con':_0x1ebf26['sl_co'+'n'],'gia':_0x1ebf26[_0x320739(0x17e)],'tien_con':_0x1ebf26[_0x320739(0x1cd)+_0x320739(0x18c)]||_0x1ebf26[_0x320739(0x186)+'n']*_0x1ebf26[_0x320739(0x17e)],'ngay_nhap':_0x1ebf26['ngay_'+_0x320739(0x18b)],'ma_dvt':_0x1ebf26[_0x320739(0x1a1)+'t']||'','he_so_qd':_0x1ebf26[_0x320739(0x1a0)+_0x320739(0x1c5)]||0x1,'nguon':_0x320739(0x187)+'dk'});}if(_0x52ebf1[_0x320739(0x177)+'h']>0x0){const _0x4ad02b={};_0x4ad02b[_0x320739(0x189)+_0x320739(0x1b7)]=!![];const _0x1697a7={};_0x1697a7[_0x320739(0x1c9)]=_0x4ad02b,FifoDk['updat'+_0x320739(0x1a9)]({'_id':{'$in':_0x52ebf1['map'](_0x5d627f=>_0x5d627f[_0x320739(0x18f)])}},_0x1697a7)['catch'](_0x399a8e=>Logger['error'](_0x320739(0x1c6)+_0x320739(0x1ad)+_0x320739(0x185)+_0x320739(0x1b3)+_0x320739(0x1a5)+_0x320739(0x182)+'g:',_0x399a8e[_0x320739(0x180)+'ge']));}const _0x264dda=_0x41292e[_0x320739(0x178)+'r'](_0x14f5a9=>!_0x4dc2fa['has'](_0x14f5a9));if(_0x264dda['lengt'+'h']>0x0){Logger[_0x320739(0x1a2)](_0x320739(0x1c6)+_0x320739(0x1ad)+_0x320739(0x192)+'ack\x20d'+_0x320739(0x194)+_0x320739(0x175)+_0x264dda[_0x320739(0x177)+'h']+('\x20VT\x20c'+_0x320739(0x1cc)+'ó\x20fif'+_0x320739(0x1bf)));try{const _0x3325ef={};_0x3325ef[_0x320739(0x172)+'p']=_0xf14b7a,_0x3325ef[_0x320739(0x1be)]=_0x264dda,_0x3325ef[_0x320739(0x17d)]=_0x21c761,_0x3325ef[_0x320739(0x19e)+'o']=_0x166701;const _0x352e70=await dkvtPromise(_0x3325ef),_0x44444f=Array[_0x320739(0x1cb)+'ay'](_0x352e70)?_0x352e70:_0x352e70?[_0x352e70]:[];for(const _0x445407 of _0x44444f){if(!_0x445407?.[_0x320739(0x1be)]||!_0x264dda[_0x320739(0x18d)+'des'](_0x445407['ma_vt']))continue;const _0x5f0ae4=_0x445407['ton00']||0x0,_0x3d0702=_0x445407[_0x320739(0x1bb)]||0x0;if(Math['abs'](_0x5f0ae4)<0.0001)continue;const _0x46c730=_0x5f0ae4!==0x0?_0x3d0702/_0x5f0ae4:0x0;_0x462984[_0x320739(0x1ac)](_0x445407[_0x320739(0x1be)])[_0x320739(0x19d)]({'ma_vt':_0x445407['ma_vt'],'sl_con':_0x5f0ae4,'gia':_0x46c730>0x0?_0x46c730:0x0,'tien_con':_0x3d0702,'ngay_nhap':_0x21c761,'ma_dvt':'','he_so_qd':0x1,'nguon':_0x320739(0x1b1)}),_0x5f0ae4<0x0&&Logger[_0x320739(0x1ab)](_0x320739(0x1c6)+_0x320739(0x1ad)+_0x320739(0x181)+'\x20đầu\x20'+_0x320739(0x17b)+'\x20('+_0x5f0ae4+(_0x320739(0x19a)+_0x320739(0x1aa))+_0x445407[_0x320739(0x1be)]+(_0x320739(0x197)+_0x320739(0x1a6)+_0x320739(0x1af)));}}catch(_0x45be44){Logger[_0x320739(0x176)](_0x320739(0x1c6)+_0x320739(0x1ad)+'Lỗi\x20g'+_0x320739(0x198)+_0x320739(0x1a3)+'llbac'+'k:',_0x45be44['messa'+'ge']);throw _0x45be44;}}let _0x2c7aef=0x0,_0x3364bf=0x0,_0x4597be=0x0;for(const [_0x38b8c1,_0x361a05]of _0x462984['entri'+'es']()){if(!_0x41292e[_0x320739(0x18d)+_0x320739(0x174)](_0x38b8c1))continue;if(_0x361a05[_0x320739(0x177)+'h']===0x0)_0x4597be++;else{if(_0x361a05[0x0][_0x320739(0x1b0)]===_0x320739(0x187)+'dk')_0x2c7aef++;else _0x3364bf++;}}return Logger[_0x320739(0x1a2)]('[fifo'+_0x320739(0x1ad)+_0x320739(0x18a)+_0x320739(0x199)+_0x2c7aef+(_0x320739(0x1a8)+'ừ\x20fif'+_0x320739(0x190)+'|\x20')+(_0x3364bf+(_0x320739(0x188)+_0x320739(0x1b4)+_0x320739(0x191)+'vt\x20|\x20'))+(_0x4597be+(_0x320739(0x1a8)+_0x320739(0x193)+_0x320739(0x1c3)+_0x320739(0x17a)))+(_0x180e9f[_0x320739(0x1c2)]+(_0x320739(0x171)+_0x320739(0x1c8)+_0x320739(0x187)+'lot\x20('+'bỏ\x20qu'+'a)'))),_0x462984;};
@@ -1,4 +1 @@
1
- const VALID_GROUP_FIELDS=["ma_kho","ma_lo","ma_tt1","ma_tt2","ma_tt3"];function normalizeGroupBy($groupBy$$){return Array.isArray($groupBy$$)&&$groupBy$$.length!==0?[...(new Set($groupBy$$.filter($f$$=>VALID_GROUP_FIELDS.includes($f$$))))]:[]}function getGroupKeyFromRow($row$$,$groupFields$$){return $groupFields$$.length===0?"":$groupFields$$.map($f$$=>$f$$==="ma_kho"?$row$$.ma_kho||$row$$.ma_kho_x||"":$row$$[$f$$]||"").join("|")}
2
- function getGroupKeyFromDetail($detail$$,$voucher$$,$groupFields$$){return $groupFields$$.length===0?"":$groupFields$$.map($f$$=>$f$$==="ma_kho"?$detail$$.ma_kho||$detail$$.ma_kho_x||$voucher$$.ma_kho||$voucher$$.ma_kho_x||"":$detail$$[$f$$]||$voucher$$[$f$$]||"").join("|")}
3
- function buildGroupFilter($groupFields$$,$groupKey$$){if($groupFields$$.length===0)return{};const $values$$=$groupKey$$.split("|"),$filter$$={};$groupFields$$.forEach(($f$$,$i$$)=>{$filter$$[$f$$]=$values$$[$i$$]||null});return $filter$$}
4
- function groupKeyToDoc($groupFields$$,$groupKey$$){if($groupFields$$.length===0)return{};const $values$$=$groupKey$$.split("|"),$doc$$={};VALID_GROUP_FIELDS.forEach($f$$=>{$doc$$[$f$$]=null});$groupFields$$.forEach(($f$$,$i$$)=>{$doc$$[$f$$]=$values$$[$i$$]||null});return $doc$$}module.exports={VALID_GROUP_FIELDS,normalizeGroupBy,getGroupKeyFromRow,getGroupKeyFromDetail,buildGroupFilter,groupKeyToDoc};
1
+ function _0x391e(_0x5f1322,_0x59b480){_0x5f1322=_0x5f1322-0x90;const _0x1a80aa=_0x1a80();let _0x391e49=_0x1a80aa[_0x5f1322];if(_0x391e['QkiTfm']===undefined){var _0x13d330=function(_0x4a26fd){const _0x36e33f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x512843='',_0x1e533a='';for(let _0x563919=0x0,_0x4e83e1,_0x5a5a19,_0x349a07=0x0;_0x5a5a19=_0x4a26fd['charAt'](_0x349a07++);~_0x5a5a19&&(_0x4e83e1=_0x563919%0x4?_0x4e83e1*0x40+_0x5a5a19:_0x5a5a19,_0x563919++%0x4)?_0x512843+=String['fromCharCode'](0xff&_0x4e83e1>>(-0x2*_0x563919&0x6)):0x0){_0x5a5a19=_0x36e33f['indexOf'](_0x5a5a19);}for(let _0x3be6cd=0x0,_0x401309=_0x512843['length'];_0x3be6cd<_0x401309;_0x3be6cd++){_0x1e533a+='%'+('00'+_0x512843['charCodeAt'](_0x3be6cd)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1e533a);};_0x391e['aZajpK']=_0x13d330,_0x391e['WHpjGS']={},_0x391e['QkiTfm']=!![];}const _0x432d04=_0x1a80aa[0x0],_0x27587a=_0x5f1322+_0x432d04,_0x2e99ee=_0x391e['WHpjGS'][_0x27587a];return!_0x2e99ee?(_0x391e49=_0x391e['aZajpK'](_0x391e49),_0x391e['WHpjGS'][_0x27587a]=_0x391e49):_0x391e49=_0x2e99ee,_0x391e49;}const _0x2874e4=_0x391e;function _0x1a80(){const _0x1d955c=['zxHWB3i','BwfFDhq','AM9PBG','nJGYnZC5rvnOqwPR','rgv0ywK','ndq5mZy4CfHjCLnW','C3bSAxq','zMLSDgu','BwfFBg8','vKfmsuq','r3jVDxa','x0Dst1u','mtaWnKXXEfntwG','ndyYvgftAePi','uM93','BgvUz3q','BgL6zuC','tert','BM9YBwe','rMLSDgu','ndKZmdi3nxnpqNDjsG','mZG3nZG3mNPXshz0Eq','z3jVDxa','BwfFA2G','CM91Cei','Aw5JBhu','s2v5vg8','B194','mZK5otvIthjfChe','zM9Yrwe','mtCXndK4nKrKq2rtCW','AxnbCNi','nda4m1Pjy3LHua','B3vWs2u','BwfW'];_0x1a80=function(){return _0x1d955c;};return _0x1a80();}(function(_0x11e340,_0x4fb59d){const _0x40bf2b=_0x391e,_0x2961ad=_0x11e340();while(!![]){try{const _0x1ad7c8=parseInt(_0x40bf2b(0xa5))/0x1+-parseInt(_0x40bf2b(0xae))/0x2*(parseInt(_0x40bf2b(0x9f))/0x3)+parseInt(_0x40bf2b(0xa7))/0x4+parseInt(_0x40bf2b(0x9b))/0x5*(-parseInt(_0x40bf2b(0xaf))/0x6)+parseInt(_0x40bf2b(0x93))/0x7+parseInt(_0x40bf2b(0x94))/0x8+-parseInt(_0x40bf2b(0x9d))/0x9;if(_0x1ad7c8===_0x4fb59d)break;else _0x2961ad['push'](_0x2961ad['shift']());}catch(_0x22814f){_0x2961ad['push'](_0x2961ad['shift']());}}}(_0x1a80,0x78640));const VALID_GROUP_FIELDS=[_0x2874e4(0x96)+'o',_0x2874e4(0xaa),_0x2874e4(0xa3)+'1',_0x2874e4(0xa3)+'2',_0x2874e4(0xa3)+'3'];function normalizeGroupBy(_0x1e533a){const _0x63abc7=_0x2874e4;if(!Array[_0x63abc7(0x9e)+'ay'](_0x1e533a)||_0x1e533a[_0x63abc7(0xb1)+'h']===0x0)return[];return[...new Set(_0x1e533a[_0x63abc7(0xa9)+'r'](_0x563919=>VALID_GROUP_FIELDS[_0x63abc7(0x98)+'des'](_0x563919)))];}function getGroupKeyFromRow(_0x4e83e1,_0x5a5a19){const _0x52ebe7=_0x2874e4;if(_0x5a5a19[_0x52ebe7(0xb1)+'h']===0x0)return'';return _0x5a5a19[_0x52ebe7(0xa1)](_0x349a07=>{const _0x11caef=_0x52ebe7;if(_0x349a07===_0x11caef(0x96)+'o')return _0x4e83e1['ma_kh'+'o']||_0x4e83e1[_0x11caef(0x96)+'o_x']||'';return _0x4e83e1[_0x349a07]||'';})[_0x52ebe7(0xa4)]('|');}function getGroupKeyFromDetail(_0x3be6cd,_0x401309,_0x44b2ca){const _0x440a38=_0x2874e4;if(_0x44b2ca[_0x440a38(0xb1)+'h']===0x0)return'';return _0x44b2ca[_0x440a38(0xa1)](_0x54ae91=>{const _0x1bc273=_0x440a38;if(_0x54ae91===_0x1bc273(0x96)+'o')return _0x3be6cd[_0x1bc273(0x96)+'o']||_0x3be6cd[_0x1bc273(0x96)+_0x1bc273(0x9a)]||_0x401309[_0x1bc273(0x96)+'o']||_0x401309[_0x1bc273(0x96)+'o_x']||'';return _0x3be6cd[_0x54ae91]||_0x401309[_0x54ae91]||'';})[_0x440a38(0xa4)]('|');}function buildGroupFilter(_0x102513,_0x3266e4){const _0x444edd=_0x2874e4;if(_0x102513[_0x444edd(0xb1)+'h']===0x0)return{};const _0x4c18d5=_0x3266e4[_0x444edd(0xa8)]('|'),_0x1e7b7e={};return _0x102513['forEa'+'ch']((_0x135da8,_0x1c7834)=>{_0x1e7b7e[_0x135da8]=_0x4c18d5[_0x1c7834]||null;}),_0x1e7b7e;}function groupKeyToDoc(_0x2d99ff,_0xd9e905){const _0x8a4d0c=_0x2874e4;if(_0x2d99ff['lengt'+'h']===0x0)return{};const _0x42848b=_0xd9e905['split']('|'),_0x201adb={};return VALID_GROUP_FIELDS[_0x8a4d0c(0x9c)+'ch'](_0x325473=>{_0x201adb[_0x325473]=null;}),_0x2d99ff[_0x8a4d0c(0x9c)+'ch']((_0x525283,_0x4a4f76)=>{_0x201adb[_0x525283]=_0x42848b[_0x4a4f76]||null;}),_0x201adb;}const _0x512843={};_0x512843[_0x2874e4(0xab)+_0x2874e4(0xad)+'P_FIE'+_0x2874e4(0x90)]=VALID_GROUP_FIELDS,_0x512843[_0x2874e4(0x91)+_0x2874e4(0xb2)+_0x2874e4(0x97)+'y']=normalizeGroupBy,_0x512843['getGr'+_0x2874e4(0xa0)+'yFrom'+_0x2874e4(0xb0)]=getGroupKeyFromRow,_0x512843['getGr'+_0x2874e4(0xa0)+'yFrom'+_0x2874e4(0xa6)+'l']=getGroupKeyFromDetail,_0x512843['build'+_0x2874e4(0xac)+_0x2874e4(0x92)+'r']=buildGroupFilter,_0x512843[_0x2874e4(0x95)+_0x2874e4(0x99)+'Doc']=groupKeyToDoc,module[_0x2874e4(0xa2)+'ts']=_0x512843;
@@ -1,12 +1 @@
1
- const FifoTrace=global.getModel("fifo_trace"),FifoLot=global.getModel("fifo_lot"),dmvt=global.getModel("dmvt");
2
- async function traceLoToChungTu($byCtXuat_condition$$,$fn$$){try{const {id_app:$id_app$$,id_fifo_lot:$id_fifo_lot$$}=$byCtXuat_condition$$;if(!$id_fifo_lot$$)return $fn$$("Thi\u1ebfu id_fifo_lot");const $traces$$=await FifoTrace.find({id_app:$id_app$$,id_fifo_lot:$id_fifo_lot$$}).sort({ngay_xuat:1,id_ct_xuat:1,detail_index:1}).lean();$byCtXuat_condition$$={};for(const $t$$ of $traces$$){const $key$$=$t$$.id_ct_xuat.toString();$byCtXuat_condition$$[$key$$]||($byCtXuat_condition$$[$key$$]={id_ct_xuat:$t$$.id_ct_xuat,
3
- ma_ct_xuat:$t$$.ma_ct_xuat,so_ct_xuat:$t$$.so_ct_xuat,ngay_xuat:$t$$.ngay_xuat,ma_vt:$t$$.ma_vt,details:[],tong_sl_xuat:0,tong_tien:0});$byCtXuat_condition$$[$key$$].details.push({detail_index:$t$$.detail_index,sl_xuat_lo:$t$$.sl_xuat_lo,gia_von:$t$$.gia_von,tien_xuat_lo:$t$$.tien_xuat_lo,sl_lo_truoc_xuat:$t$$.sl_lo_truoc_xuat,sl_lo_sau_xuat:$t$$.sl_lo_sau_xuat});$byCtXuat_condition$$[$key$$].tong_sl_xuat+=$t$$.sl_xuat_lo;$byCtXuat_condition$$[$key$$].tong_tien+=$t$$.tien_xuat_lo}return $fn$$(null,
4
- Object.values($byCtXuat_condition$$))}catch($err$$){return $fn$$($err$$)}}
5
- async function traceChungTuToLo($byDetail_condition$$,$fn$$){try{const {id_app:$id_app$$,id_ct_xuat:$id_ct_xuat$$,detail_index:$detail_index$$}=$byDetail_condition$$;if(!$id_ct_xuat$$)return $fn$$("Thi\u1ebfu id_ct_xuat");$byDetail_condition$$={id_app:$id_app$$,id_ct_xuat:$id_ct_xuat$$};$detail_index$$!==void 0&&($byDetail_condition$$.detail_index=$detail_index$$);const $traces$$=await FifoTrace.find($byDetail_condition$$).sort({detail_index:1,ngay_nhap:1}).lean();Logger.warn("[traceChungTuToLo] query",
6
- $byDetail_condition$$,$traces$$);$byDetail_condition$$={};for(const $t$$ of $traces$$){const $idx$$=$t$$.detail_index;$byDetail_condition$$[$idx$$]||($byDetail_condition$$[$idx$$]={detail_index:$idx$$,ma_vt:$t$$.ma_vt,lots:[],tong_sl:0,tong_tien:0,gia_von_tb:0});$byDetail_condition$$[$idx$$].lots.push({id_fifo_lot:$t$$.id_fifo_lot,id_ct_nhap:$t$$.id_ct_nhap,ma_ct_nhap:$t$$.ma_ct_nhap,so_ct_nhap:$t$$.so_ct_nhap,ngay_nhap:$t$$.ngay_nhap,gia_nhap:$t$$.gia_nhap,sl_xuat_lo:$t$$.sl_xuat_lo,gia_von:$t$$.gia_von,
7
- tien_xuat_lo:$t$$.tien_xuat_lo,sl_lo_truoc:$t$$.sl_lo_truoc_xuat,sl_lo_sau:$t$$.sl_lo_sau_xuat});$byDetail_condition$$[$idx$$].tong_sl+=$t$$.sl_xuat_lo;$byDetail_condition$$[$idx$$].tong_tien+=$t$$.tien_xuat_lo}for(const $d$$ of Object.values($byDetail_condition$$))$d$$.gia_von_tb=$d$$.tong_sl>0?Math.roundBy($d$$.tong_tien/$d$$.tong_sl,0):0;return $fn$$(null,Object.values($byDetail_condition$$).sort(($a$$,$b$$)=>$a$$.detail_index-$b$$.detail_index))}catch($err$$){return $fn$$($err$$)}}
8
- async function baoCaoFifoKy($condition$$,$fn$$){try{const {id_app:$id_app$$,nam:$nam$$,thang:$thang$$,ma_vt:$ma_vt$$,ma_kho:$ma_kho$$}=$condition$$,$traceQuery$$={id_app:$id_app$$,nam:Number($nam$$),thang:Number($thang$$)};$ma_vt$$&&($traceQuery$$.ma_vt=$ma_vt$$);$ma_kho$$&&($traceQuery$$.ma_kho=$ma_kho$$);const [$traces$$,$fifoLotsCuoiKy$$]=await Promise.all([FifoTrace.find($traceQuery$$).sort({ngay_nhap:1,id_fifo_lot:1,ngay_xuat:1}).lean(),FifoLot.find({id_app:$id_app$$,nam:$nam$$,thang:$thang$$,
9
- ...($ma_vt$$?{ma_vt:$ma_vt$$}:{}),...($ma_kho$$?{ma_kho:$ma_kho$$}:{ma_kho:null})}).sort({ma_vt:1,ngay_nhap:1}).lean()]),$lotsMap$$=new Map;for(const $lot$$ of $fifoLotsCuoiKy$$)$lotsMap$$.set($lot$$._id.toString(),{id_fifo_lot:$lot$$._id,ma_vt:$lot$$.ma_vt,ma_kho:$lot$$.ma_kho,id_ct_nhap:$lot$$.id_ct,ma_ct_nhap:$lot$$.ma_ct,so_ct_nhap:$lot$$.so_ct,ngay_nhap:$lot$$.ngay_nhap,sl_nhap:$lot$$.sl_nhap,sl_da_xuat:$lot$$.sl_da_xuat,sl_con:$lot$$.sl_con,gia:$lot$$.gia,tien_nhap:$lot$$.tien_nhap,tien_con:$lot$$.tien_con,
10
- ds_chung_tu_xuat:[]});for(const $t$$ of $traces$$){if(!$t$$.id_fifo_lot)continue;const $key$$=$t$$.id_fifo_lot.toString();$lotsMap$$.has($key$$)||$lotsMap$$.set($key$$,{id_fifo_lot:$t$$.id_fifo_lot,ma_vt:$t$$.ma_vt,ma_kho:$t$$.ma_kho,id_ct_nhap:$t$$.id_ct_nhap,ma_ct_nhap:$t$$.ma_ct_nhap,so_ct_nhap:$t$$.so_ct_nhap,ngay_nhap:$t$$.ngay_nhap,gia:$t$$.gia_nhap,sl_nhap:null,sl_da_xuat:null,sl_con:0,tien_nhap:null,tien_con:0,ds_chung_tu_xuat:[]});$lotsMap$$.get($key$$).ds_chung_tu_xuat.push({id_ct_xuat:$t$$.id_ct_xuat,
11
- ma_ct_xuat:$t$$.ma_ct_xuat,so_ct_xuat:$t$$.so_ct_xuat,ngay_xuat:$t$$.ngay_xuat,detail_index:$t$$.detail_index,sl_xuat_lo:$t$$.sl_xuat_lo,tien_xuat_lo:$t$$.tien_xuat_lo})}const $result$$=Array.from($lotsMap$$.values()).sort(($a$$,$b$$)=>$a$$.ma_vt!==$b$$.ma_vt?$a$$.ma_vt.localeCompare($b$$.ma_vt):new Date($a$$.ngay_nhap)-new Date($b$$.ngay_nhap));await $result$$.asyncJoinModel2($id_app$$,dmvt,[{where:"ma_vt",fields:"ten_vt"}]);return $fn$$(null,$result$$)}catch($err$$){return $fn$$($err$$)}}
12
- module.exports={traceLoToChungTu,traceChungTuToLo,baoCaoFifoKy};
1
+ const _0x20942c=_0x1c6b;(function(_0xba6408,_0x1fc861){const _0x58d8f5=_0x1c6b,_0x5a0624=_0xba6408();while(!![]){try{const _0x52304c=-parseInt(_0x58d8f5(0x1e6))/0x1*(-parseInt(_0x58d8f5(0x227))/0x2)+-parseInt(_0x58d8f5(0x206))/0x3+-parseInt(_0x58d8f5(0x1e1))/0x4*(parseInt(_0x58d8f5(0x208))/0x5)+parseInt(_0x58d8f5(0x226))/0x6*(-parseInt(_0x58d8f5(0x224))/0x7)+-parseInt(_0x58d8f5(0x1dd))/0x8+parseInt(_0x58d8f5(0x1e0))/0x9+parseInt(_0x58d8f5(0x20a))/0xa;if(_0x52304c===_0x1fc861)break;else _0x5a0624['push'](_0x5a0624['shift']());}catch(_0x163181){_0x5a0624['push'](_0x5a0624['shift']());}}}(_0x5d98,0xa30fb));const FifoTrace=global[_0x20942c(0x215)+_0x20942c(0x1d8)](_0x20942c(0x1e2)+'trace'),FifoLot=global[_0x20942c(0x215)+_0x20942c(0x1d8)](_0x20942c(0x1e2)+_0x20942c(0x1de)),dmvt=global[_0x20942c(0x215)+_0x20942c(0x1d8)]('dmvt');function _0x1c6b(_0x3d86ad,_0x1d867d){_0x3d86ad=_0x3d86ad-0x1d8;const _0x5d98a1=_0x5d98();let _0x1c6b05=_0x5d98a1[_0x3d86ad];if(_0x1c6b['idswgc']===undefined){var _0x337f78=function(_0x53f423){const _0x2e3a46='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x50428b='',_0x2e56a5='';for(let _0x10edd6=0x0,_0x275555,_0x1a7628,_0xce2822=0x0;_0x1a7628=_0x53f423['charAt'](_0xce2822++);~_0x1a7628&&(_0x275555=_0x10edd6%0x4?_0x275555*0x40+_0x1a7628:_0x1a7628,_0x10edd6++%0x4)?_0x50428b+=String['fromCharCode'](0xff&_0x275555>>(-0x2*_0x10edd6&0x6)):0x0){_0x1a7628=_0x2e3a46['indexOf'](_0x1a7628);}for(let _0x22821b=0x0,_0x381298=_0x50428b['length'];_0x22821b<_0x381298;_0x22821b++){_0x2e56a5+='%'+('00'+_0x50428b['charCodeAt'](_0x22821b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2e56a5);};_0x1c6b['vTSxCt']=_0x337f78,_0x1c6b['xEgcMq']={},_0x1c6b['idswgc']=!![];}const _0x46b04e=_0x5d98a1[0x0],_0x98574=_0x3d86ad+_0x46b04e,_0x1f450e=_0x1c6b['xEgcMq'][_0x98574];return!_0x1f450e?(_0x1c6b05=_0x1c6b['vTSxCt'](_0x1c6b05),_0x1c6b['xEgcMq'][_0x98574]=_0x1c6b05):_0x1c6b05=_0x1f450e,_0x1c6b05;}function _0x5d98(){const _0x1e4ffb=['x25Oyxa','nLPyCLz3Aq','mJrLDgrmu3a','CM91BMq','AhvUz1q','Bg9JywW','DgvUx3y','y29U','zgvS','w3rYywm','x3nHDv8','Dw5Nx3q','ChvZAa','oteWndK0ngHXD1Lpwq','Bg90','zunODw4','mZCYmZC1wg1TugTm','nti3nZu3mMLvChrODW','zMLMB18','C2XFEhu','Dg9tDhi','zMLUza','nJaYndntzxv2yMO','AgfW','zM9FBg8','z2LH','yxjL','z2LHx3y','AgfZ','vgHP4BQ/Dq','D2HLCMu','Df94Dwe','DgLLBL8','Bg90CW','BwfFDNq','DgLLBG','B2rLBdi','yxrFBg8','x2LK','DhjHy2u','Dv94Dwe','sM9PBK0','C2XFBg8','BwfFA2G','EhvHDf8','vhvuB0W','EhvHDa','x3H1yxq','zgv0ywK','Aw5N','z2LHx24','igLKx2y','igLKx2m','Dg9Uz18','mtu1nJmXm2TduhzvyG','C2XFy28','nuDkrKLcDq','BMHHCa','mZq4mtC3mZbrq2XMtMy','x3rYDw8','BgvHBG','C2XFBMG','BMDHEv8','zNjVBq','y194Dwe','Bf9PBMq','AwrFy3q','C2XFzge','C29YDa','z2v0tw8','AwrFzMK','q2H1BMC','BwfFy3q','DMfSDwu','zunVBxa','zMLLBgq','zxHWB3i','zhnFy2G','yMfVq2e','B0zPzM8','C29Fy3q','x3nHDq','z1r1vg8','C2v0','ndiXmZe4mxnZEw9nvG'];_0x5d98=function(){return _0x1e4ffb;};return _0x5d98();}async function traceLoToChungTu(_0x3fa037,_0x14b885){const _0x3612d5=_0x20942c;try{const {id_app:_0x17ba2f,id_fifo_lot:_0x4fd667}=_0x3fa037;if(!_0x4fd667)return _0x14b885('Thiếu'+_0x3612d5(0x203)+'ifo_l'+'ot');const _0x5bc86f={};_0x5bc86f['id_ap'+'p']=_0x17ba2f,_0x5bc86f[_0x3612d5(0x216)+'fo_lo'+'t']=_0x4fd667;const _0x59fca1={};_0x59fca1[_0x3612d5(0x20e)+_0x3612d5(0x1fe)]=0x1,_0x59fca1['id_ct'+_0x3612d5(0x1ff)]=0x1,_0x59fca1[_0x3612d5(0x200)+_0x3612d5(0x211)+'ex']=0x1;const _0x2ca66a=await FifoTrace[_0x3612d5(0x1e5)](_0x5bc86f)['sort'](_0x59fca1)[_0x3612d5(0x20c)](),_0x49f4aa={};for(const _0x253a00 of _0x2ca66a){const _0x3de75c=_0x253a00[_0x3612d5(0x212)+_0x3612d5(0x1ff)][_0x3612d5(0x1e4)+_0x3612d5(0x201)]();if(!_0x49f4aa[_0x3de75c]){const _0x415156={};_0x415156['id_ct'+_0x3612d5(0x1ff)]=_0x253a00[_0x3612d5(0x212)+'_xuat'],_0x415156[_0x3612d5(0x218)+'_xuat']=_0x253a00['ma_ct'+'_xuat'],_0x415156['so_ct'+'_xuat']=_0x253a00[_0x3612d5(0x220)+_0x3612d5(0x1ff)],_0x415156[_0x3612d5(0x20e)+_0x3612d5(0x1fe)]=_0x253a00['ngay_'+_0x3612d5(0x1fe)],_0x415156[_0x3612d5(0x1f2)]=_0x253a00['ma_vt'],_0x415156[_0x3612d5(0x200)+'ls']=[],_0x415156['tong_'+_0x3612d5(0x1e3)+'at']=0x0,_0x415156[_0x3612d5(0x205)+_0x3612d5(0x1f3)]=0x0,_0x49f4aa[_0x3de75c]=_0x415156;}const _0x39db0e={};_0x39db0e[_0x3612d5(0x200)+_0x3612d5(0x211)+'ex']=_0x253a00[_0x3612d5(0x200)+_0x3612d5(0x211)+'ex'],_0x39db0e[_0x3612d5(0x1e3)+_0x3612d5(0x1f5)]=_0x253a00[_0x3612d5(0x1e3)+_0x3612d5(0x1f5)],_0x39db0e[_0x3612d5(0x1eb)+'on']=_0x253a00[_0x3612d5(0x1eb)+'on'],_0x39db0e[_0x3612d5(0x1f0)+'xuat_'+'lo']=_0x253a00['tien_'+_0x3612d5(0x1fc)+'lo'],_0x39db0e['sl_lo'+_0x3612d5(0x20b)+_0x3612d5(0x210)+'t']=_0x253a00[_0x3612d5(0x1fa)+_0x3612d5(0x20b)+_0x3612d5(0x210)+'t'],_0x39db0e[_0x3612d5(0x1fa)+_0x3612d5(0x1da)+'xuat']=_0x253a00[_0x3612d5(0x1fa)+'_sau_'+'xuat'],_0x49f4aa[_0x3de75c][_0x3612d5(0x200)+'ls'][_0x3612d5(0x1dc)](_0x39db0e),_0x49f4aa[_0x3de75c][_0x3612d5(0x205)+_0x3612d5(0x1e3)+'at']+=_0x253a00['sl_xu'+_0x3612d5(0x1f5)],_0x49f4aa[_0x3de75c][_0x3612d5(0x205)+_0x3612d5(0x1f3)]+=_0x253a00['tien_'+'xuat_'+'lo'];}return _0x14b885(null,Object[_0x3612d5(0x219)+'s'](_0x49f4aa));}catch(_0x299474){return _0x14b885(_0x299474);}}async function traceChungTuToLo(_0x37d08d,_0x3067b2){const _0x3c9fac=_0x20942c;try{const {id_app:_0x2c1352,id_ct_xuat:_0x1695ba,detail_index:_0x5b16d4}=_0x37d08d;if(!_0x1695ba)return _0x3067b2(_0x3c9fac(0x1ed)+_0x3c9fac(0x204)+_0x3c9fac(0x1ef)+'t');const _0x4ab8a5={};_0x4ab8a5['id_ap'+'p']=_0x2c1352,_0x4ab8a5['id_ct'+_0x3c9fac(0x1ff)]=_0x1695ba;const _0x550a17=_0x4ab8a5;if(_0x5b16d4!==undefined)_0x550a17['detai'+'l_ind'+'ex']=_0x5b16d4;const _0x406711={};_0x406711['detai'+_0x3c9fac(0x211)+'ex']=0x1,_0x406711[_0x3c9fac(0x20e)+_0x3c9fac(0x209)]=0x1;const _0x484a19=await FifoTrace[_0x3c9fac(0x1e5)](_0x550a17)[_0x3c9fac(0x214)](_0x406711)[_0x3c9fac(0x20c)]();Logger['warn'](_0x3c9fac(0x1d9)+_0x3c9fac(0x1df)+_0x3c9fac(0x222)+'Lo]\x20q'+'uery',_0x550a17,_0x484a19);const _0x125156={};for(const _0x46bd75 of _0x484a19){const _0x43314a=_0x46bd75[_0x3c9fac(0x200)+'l_ind'+'ex'];!_0x125156[_0x43314a]&&(_0x125156[_0x43314a]={'detail_index':_0x43314a,'ma_vt':_0x46bd75[_0x3c9fac(0x1f2)],'lots':[],'tong_sl':0x0,'tong_tien':0x0,'gia_von_tb':0x0});const _0x30fe41={};_0x30fe41[_0x3c9fac(0x216)+_0x3c9fac(0x1e8)+'t']=_0x46bd75[_0x3c9fac(0x216)+_0x3c9fac(0x1e8)+'t'],_0x30fe41['id_ct'+'_nhap']=_0x46bd75[_0x3c9fac(0x212)+_0x3c9fac(0x225)],_0x30fe41[_0x3c9fac(0x218)+_0x3c9fac(0x225)]=_0x46bd75[_0x3c9fac(0x218)+_0x3c9fac(0x225)],_0x30fe41[_0x3c9fac(0x220)+_0x3c9fac(0x225)]=_0x46bd75[_0x3c9fac(0x220)+_0x3c9fac(0x225)],_0x30fe41[_0x3c9fac(0x20e)+_0x3c9fac(0x209)]=_0x46bd75['ngay_'+_0x3c9fac(0x209)],_0x30fe41[_0x3c9fac(0x202)+_0x3c9fac(0x1e7)]=_0x46bd75[_0x3c9fac(0x202)+_0x3c9fac(0x1e7)],_0x30fe41[_0x3c9fac(0x1e3)+_0x3c9fac(0x1f5)]=_0x46bd75[_0x3c9fac(0x1e3)+_0x3c9fac(0x1f5)],_0x30fe41[_0x3c9fac(0x1eb)+'on']=_0x46bd75[_0x3c9fac(0x1eb)+'on'],_0x30fe41[_0x3c9fac(0x1f0)+_0x3c9fac(0x1fc)+'lo']=_0x46bd75[_0x3c9fac(0x1f0)+_0x3c9fac(0x1fc)+'lo'],_0x30fe41[_0x3c9fac(0x1fa)+_0x3c9fac(0x20b)+'c']=_0x46bd75['sl_lo'+_0x3c9fac(0x20b)+_0x3c9fac(0x210)+'t'],_0x30fe41['sl_lo'+_0x3c9fac(0x221)]=_0x46bd75[_0x3c9fac(0x1fa)+'_sau_'+'xuat'],_0x125156[_0x43314a][_0x3c9fac(0x1f1)][_0x3c9fac(0x1dc)](_0x30fe41),_0x125156[_0x43314a][_0x3c9fac(0x205)+'sl']+=_0x46bd75[_0x3c9fac(0x1e3)+'at_lo'],_0x125156[_0x43314a][_0x3c9fac(0x205)+'tien']+=_0x46bd75[_0x3c9fac(0x1f0)+_0x3c9fac(0x1fc)+'lo'];}for(const _0x2e2109 of Object[_0x3c9fac(0x219)+'s'](_0x125156)){_0x2e2109['gia_v'+'on_tb']=_0x2e2109[_0x3c9fac(0x205)+'sl']>0x0?Math[_0x3c9fac(0x228)+'By'](_0x2e2109[_0x3c9fac(0x205)+_0x3c9fac(0x1f3)]/_0x2e2109[_0x3c9fac(0x205)+'sl'],0x0):0x0;}return _0x3067b2(null,Object[_0x3c9fac(0x219)+'s'](_0x125156)['sort']((_0x4d439a,_0x580f39)=>_0x4d439a[_0x3c9fac(0x200)+_0x3c9fac(0x211)+'ex']-_0x580f39[_0x3c9fac(0x200)+'l_ind'+'ex']));}catch(_0x36d87b){return _0x3067b2(_0x36d87b);}}async function baoCaoFifoKy(_0xd2717f,_0x79ccc5){const _0x16c482=_0x20942c;try{const {id_app:_0x46ae4c,nam:_0x24ccde,thang:_0xf1e6b2,ma_vt:_0x337e45,ma_kho:_0x4fd4f3}=_0xd2717f,_0x48b174={'id_app':_0x46ae4c,'nam':Number(_0x24ccde),'thang':Number(_0xf1e6b2)};if(_0x337e45)_0x48b174[_0x16c482(0x1f2)]=_0x337e45;if(_0x4fd4f3)_0x48b174[_0x16c482(0x1fb)+'o']=_0x4fd4f3;const _0x240344={};_0x240344[_0x16c482(0x20e)+_0x16c482(0x209)]=0x1,_0x240344['id_fi'+_0x16c482(0x1e8)+'t']=0x1,_0x240344[_0x16c482(0x20e)+_0x16c482(0x1fe)]=0x1;const _0x47a484={};_0x47a484[_0x16c482(0x1fb)+'o']=null;const _0x3ee0a9={'id_app':_0x46ae4c,'nam':_0x24ccde,'thang':_0xf1e6b2,..._0x337e45?{'ma_vt':_0x337e45}:{},..._0x4fd4f3?{'ma_kho':_0x4fd4f3}:_0x47a484},_0x5b5ae7={};_0x5b5ae7[_0x16c482(0x1f2)]=0x1,_0x5b5ae7[_0x16c482(0x20e)+'nhap']=0x1;const [_0x9b9ea7,_0x165d92]=await Promise['all']([FifoTrace['find'](_0x48b174)[_0x16c482(0x214)](_0x240344)[_0x16c482(0x20c)](),FifoLot['find'](_0x3ee0a9)[_0x16c482(0x214)](_0x5b5ae7)[_0x16c482(0x20c)]()]),_0x1bb7a2=new Map();for(const _0xa4ba0c of _0x165d92){_0x1bb7a2[_0x16c482(0x223)](_0xa4ba0c[_0x16c482(0x1f6)][_0x16c482(0x1e4)+'ing'](),{'id_fifo_lot':_0xa4ba0c['_id'],'ma_vt':_0xa4ba0c[_0x16c482(0x1f2)],'ma_kho':_0xa4ba0c[_0x16c482(0x1fb)+'o'],'id_ct_nhap':_0xa4ba0c['id_ct'],'ma_ct_nhap':_0xa4ba0c[_0x16c482(0x218)],'so_ct_nhap':_0xa4ba0c[_0x16c482(0x220)],'ngay_nhap':_0xa4ba0c[_0x16c482(0x20e)+_0x16c482(0x209)],'sl_nhap':_0xa4ba0c['sl_nh'+'ap'],'sl_da_xuat':_0xa4ba0c[_0x16c482(0x213)+_0x16c482(0x1ff)],'sl_con':_0xa4ba0c[_0x16c482(0x207)+'n'],'gia':_0xa4ba0c[_0x16c482(0x1e9)],'tien_nhap':_0xa4ba0c[_0x16c482(0x1f0)+_0x16c482(0x209)],'tien_con':_0xa4ba0c[_0x16c482(0x1f0)+_0x16c482(0x22c)],'ds_chung_tu_xuat':[]});}for(const _0x94d239 of _0x9b9ea7){if(!_0x94d239['id_fi'+_0x16c482(0x1e8)+'t'])continue;const _0x718c0d=_0x94d239['id_fi'+_0x16c482(0x1e8)+'t'][_0x16c482(0x1e4)+'ing']();if(!_0x1bb7a2[_0x16c482(0x1ec)](_0x718c0d)){const _0x522644={};_0x522644[_0x16c482(0x216)+_0x16c482(0x1e8)+'t']=_0x94d239[_0x16c482(0x216)+_0x16c482(0x1e8)+'t'],_0x522644[_0x16c482(0x1f2)]=_0x94d239[_0x16c482(0x1f2)],_0x522644[_0x16c482(0x1fb)+'o']=_0x94d239['ma_kh'+'o'],_0x522644[_0x16c482(0x212)+_0x16c482(0x225)]=_0x94d239[_0x16c482(0x212)+_0x16c482(0x225)],_0x522644[_0x16c482(0x218)+_0x16c482(0x225)]=_0x94d239[_0x16c482(0x218)+'_nhap'],_0x522644[_0x16c482(0x220)+_0x16c482(0x225)]=_0x94d239['so_ct'+_0x16c482(0x225)],_0x522644['ngay_'+_0x16c482(0x209)]=_0x94d239['ngay_'+_0x16c482(0x209)],_0x522644[_0x16c482(0x1e9)]=_0x94d239[_0x16c482(0x202)+_0x16c482(0x1e7)],_0x522644[_0x16c482(0x20d)+'ap']=null,_0x522644[_0x16c482(0x213)+_0x16c482(0x1ff)]=null,_0x522644['sl_co'+'n']=0x0,_0x522644['tien_'+_0x16c482(0x209)]=null,_0x522644['tien_'+_0x16c482(0x22c)]=0x0,_0x522644[_0x16c482(0x21d)+_0x16c482(0x1db)+_0x16c482(0x1f8)+'t']=[],_0x1bb7a2[_0x16c482(0x223)](_0x718c0d,_0x522644);}const _0x47c38d=_0x1bb7a2['get'](_0x718c0d),_0x6f1187={};_0x6f1187[_0x16c482(0x212)+_0x16c482(0x1ff)]=_0x94d239[_0x16c482(0x212)+_0x16c482(0x1ff)],_0x6f1187[_0x16c482(0x218)+_0x16c482(0x1ff)]=_0x94d239[_0x16c482(0x218)+_0x16c482(0x1ff)],_0x6f1187[_0x16c482(0x220)+_0x16c482(0x1ff)]=_0x94d239[_0x16c482(0x220)+_0x16c482(0x1ff)],_0x6f1187[_0x16c482(0x20e)+_0x16c482(0x1fe)]=_0x94d239['ngay_'+'xuat'],_0x6f1187[_0x16c482(0x200)+'l_ind'+'ex']=_0x94d239[_0x16c482(0x200)+_0x16c482(0x211)+'ex'],_0x6f1187[_0x16c482(0x1e3)+_0x16c482(0x1f5)]=_0x94d239[_0x16c482(0x1e3)+_0x16c482(0x1f5)],_0x6f1187[_0x16c482(0x1f0)+_0x16c482(0x1fc)+'lo']=_0x94d239[_0x16c482(0x1f0)+_0x16c482(0x1fc)+'lo'],_0x47c38d[_0x16c482(0x21d)+'ung_t'+'u_xua'+'t'][_0x16c482(0x1dc)](_0x6f1187);}const _0x3935e0=Array[_0x16c482(0x20f)](_0x1bb7a2[_0x16c482(0x219)+'s']())['sort']((_0xdb867b,_0x43759b)=>{const _0x3b0353=_0x16c482;if(_0xdb867b['ma_vt']!==_0x43759b[_0x3b0353(0x1f2)])return _0xdb867b['ma_vt'][_0x3b0353(0x22a)+_0x3b0353(0x21a)+_0x3b0353(0x1ea)](_0x43759b['ma_vt']);return new Date(_0xdb867b[_0x3b0353(0x20e)+_0x3b0353(0x209)])-new Date(_0x43759b['ngay_'+_0x3b0353(0x209)]);}),_0x3b1bbf={};return _0x3b1bbf[_0x16c482(0x1ee)]=_0x16c482(0x1f2),_0x3b1bbf[_0x16c482(0x21b)+'s']=_0x16c482(0x22b)+'t',await _0x3935e0['async'+_0x16c482(0x1f9)+_0x16c482(0x1f4)](_0x46ae4c,dmvt,[_0x3b1bbf]),_0x79ccc5(null,_0x3935e0);}catch(_0x5a9666){return _0x79ccc5(_0x5a9666);}}const _0x5b8b17={};_0x5b8b17[_0x20942c(0x1f7)+'LoToC'+_0x20942c(0x229)+'u']=traceLoToChungTu,_0x5b8b17['trace'+_0x20942c(0x217)+_0x20942c(0x1fd)+'o']=traceChungTuToLo,_0x5b8b17[_0x20942c(0x21e)+_0x20942c(0x21f)+'Ky']=baoCaoFifoKy,module[_0x20942c(0x21c)+'ts']=_0x5b8b17;