PageRenderTime 27ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/public/js/collections/ReportCollection.js

https://bitbucket.org/AnuSekar/btree_pos
JavaScript | 885 lines | 836 code | 49 blank | 0 comment | 1 complexity | 0d376bc3c8786f898f760062b4c502d3 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, MIT, MPL-2.0-no-copyleft-exception, GPL-2.0, GPL-3.0
  1. var admin = admin || {};
  2. admin.CompanyReportCollection = Backbone.PageableCollection.extend({
  3. model: admin.CompanyReportModel,
  4. url: '/btree/admin/get_all_company_report',
  5. mode: "server",
  6. state: {
  7. pageSize: 5,
  8. sortKey: "updated",
  9. order: 1
  10. },
  11. queryParams: {
  12. totalPages: null,
  13. totalRecords: null,
  14. sortKey: "sort"
  15. },
  16. parseState: function (resp, queryParams, state, options) {
  17. return {totalRecords: resp.total};
  18. },
  19. parseRecords: function (resp, options) {
  20. return resp.data;
  21. }
  22. });
  23. admin.CompanyGraphReportCollection = Backbone.PageableCollection.extend({
  24. model: admin.CompanyReportModel,
  25. url: '/btree/admin/get_all_company_report',
  26. mode: "server",
  27. state: {
  28. pageSize: 5,
  29. sortKey: "updated",
  30. order: 1
  31. },
  32. queryParams: {
  33. totalPages: null,
  34. totalRecords: null,
  35. sortKey: "sort"
  36. },
  37. parseState: function (resp, queryParams, state, options) {
  38. return {totalRecords: resp.total};
  39. },
  40. parseRecords: function (resp, options) {
  41. return resp;
  42. }
  43. });
  44. admin.ProductReportCollection = Backbone.PageableCollection.extend({
  45. model: admin.ProductReportModel,
  46. url: '/btree/admin/get_all_product_report',
  47. mode: "server",
  48. state: {
  49. pageSize: 5,
  50. sortKey: "updated",
  51. order: 1
  52. },
  53. queryParams: {
  54. totalPages: null,
  55. totalRecords: null,
  56. sortKey: "sort"
  57. },
  58. parseState: function (resp, queryParams, state, options) {
  59. return {totalRecords: resp.total};
  60. },
  61. parseRecords: function (resp, options) {
  62. return resp.data;
  63. }
  64. });
  65. admin.ProductGraphReportCollection = Backbone.PageableCollection.extend({
  66. model: admin.ProductReportModel,
  67. url: '/btree/admin/get_all_product_report',
  68. mode: "server",
  69. state: {
  70. pageSize: 5,
  71. sortKey: "updated",
  72. order: 1
  73. },
  74. queryParams: {
  75. totalPages: null,
  76. totalRecords: null,
  77. sortKey: "sort"
  78. },
  79. parseState: function (resp, queryParams, state, options) {
  80. return {totalRecords: resp.total};
  81. },
  82. parseRecords: function (resp, options) {
  83. return resp;
  84. }
  85. });
  86. admin.CustomerReportCollection = Backbone.PageableCollection.extend({
  87. model: admin.CustomerReportModel,
  88. url: '/btree/admin/get_all_customer_report',
  89. mode: "server",
  90. state: {
  91. pageSize: 5,
  92. sortKey: "updated",
  93. order: 1
  94. },
  95. queryParams: {
  96. totalPages: null,
  97. totalRecords: null,
  98. sortKey: "sort"
  99. },
  100. parseState: function (resp, queryParams, state, options) {
  101. return {totalRecords: resp.total};
  102. },
  103. parseRecords: function (resp, options) {
  104. return resp.data;
  105. }
  106. });
  107. admin.CustomerDetailsReportCollection = Backbone.PageableCollection.extend({
  108. model: admin.CustomerDetailsReportModel,
  109. url: '/btree/admin/get_all_detailcustomer_report',
  110. mode: "server",
  111. state: {
  112. pageSize: 5,
  113. sortKey: "updated",
  114. order: 1,
  115. },
  116. queryParams: {
  117. totalPages: null,
  118. totalRecords: null,
  119. sortKey: "sort"
  120. },
  121. parseState: function (resp, queryParams, state, options) {
  122. return {totalRecords: resp.total};
  123. },
  124. parseRecords: function (resp, options) {
  125. return resp.data;
  126. }
  127. });
  128. admin.CustomerGraphReportCollection = Backbone.PageableCollection.extend({
  129. model: admin.CustomerReportModel,
  130. url: '/btree/admin/get_all_customer_report',
  131. mode: "server",
  132. state: {
  133. pageSize: 5,
  134. sortKey: "updated",
  135. order: 1
  136. },
  137. queryParams: {
  138. totalPages: null,
  139. totalRecords: null,
  140. sortKey: "sort"
  141. },
  142. parseState: function (resp, queryParams, state, options) {
  143. return {totalRecords: resp.total};
  144. },
  145. parseRecords: function (resp, options) {
  146. return resp;
  147. }
  148. });
  149. admin.SupplierReportCollection = Backbone.PageableCollection.extend({
  150. model: admin.SupplierReportModel,
  151. url: '/btree/admin/get_all_supplier_report',
  152. mode: "server",
  153. state: {
  154. pageSize: 5,
  155. sortKey: "updated",
  156. order: 1
  157. },
  158. queryParams: {
  159. totalPages: null,
  160. totalRecords: null,
  161. sortKey: "sort"
  162. },
  163. parseState: function (resp, queryParams, state, options) {
  164. return {totalRecords: resp.total};
  165. },
  166. parseRecords: function (resp, options) {
  167. return resp.data;
  168. }
  169. });
  170. admin.SupplierDetailsReportCollection = Backbone.PageableCollection.extend({
  171. model: admin.SupplierDetailsReportModel,
  172. url: '/btree/admin/get_all_detailsupplier_report',
  173. mode: "server",
  174. state: {
  175. pageSize: 5,
  176. sortKey: "updated",
  177. order: 1,
  178. },
  179. queryParams: {
  180. totalPages: null,
  181. totalRecords: null,
  182. sortKey: "sort"
  183. },
  184. parseState: function (resp, queryParams, state, options) {
  185. return {totalRecords: resp.total};
  186. },
  187. parseRecords: function (resp, options) {
  188. return resp.data;
  189. }
  190. });
  191. admin.SupplierGraphReportCollection = Backbone.PageableCollection.extend({
  192. model: admin.SupplierReportModel,
  193. url: '/btree/admin/get_all_supplier_report',
  194. mode: "server",
  195. state: {
  196. pageSize: 5,
  197. sortKey: "updated",
  198. order: 1
  199. },
  200. queryParams: {
  201. totalPages: null,
  202. totalRecords: null,
  203. sortKey: "sort"
  204. },
  205. parseState: function (resp, queryParams, state, options) {
  206. return {totalRecords: resp.total};
  207. },
  208. parseRecords: function (resp, options) {
  209. return resp;
  210. }
  211. });
  212. admin.ItemReportCollection = Backbone.PageableCollection.extend({
  213. model: admin.ItemReportModel,
  214. url: '/btree/admin/get_all_item_report',
  215. mode: "server",
  216. state: {
  217. pageSize: 5,
  218. sortKey: "updated",
  219. order: 1
  220. },
  221. queryParams: {
  222. totalPages: null,
  223. totalRecords: null,
  224. sortKey: "sort"
  225. },
  226. parseState: function (resp, queryParams, state, options) {
  227. return {totalRecords: resp.total};
  228. },
  229. parseRecords: function (resp, options) {
  230. return resp.data;
  231. }
  232. });
  233. admin.ItemGraphReportCollection = Backbone.PageableCollection.extend({
  234. model: admin.ItemReportModel,
  235. url: '/btree/admin/get_all_item_report',
  236. mode: "server",
  237. state: {
  238. pageSize: 5,
  239. sortKey: "updated",
  240. order: 1
  241. },
  242. queryParams: {
  243. totalPages: null,
  244. totalRecords: null,
  245. sortKey: "sort"
  246. },
  247. parseState: function (resp, queryParams, state, options) {
  248. return {totalRecords: resp.total};
  249. },
  250. parseRecords: function (resp, options) {
  251. return resp;
  252. }
  253. });
  254. admin.ExpenseCategoryReportCollection = Backbone.PageableCollection.extend({
  255. model: admin.ExpenseCategoryReportModel,
  256. url: '/btree/admin/get_all_expense_report',
  257. mode: "server",
  258. state: {
  259. pageSize: 5,
  260. sortKey: "updated",
  261. order: 1
  262. },
  263. queryParams: {
  264. totalPages: null,
  265. totalRecords: null,
  266. sortKey: "sort"
  267. },
  268. parseState: function (resp, queryParams, state, options) {
  269. return {totalRecords: resp.total};
  270. },
  271. parseRecords: function (resp, options) {
  272. return resp.data;
  273. }
  274. });
  275. admin.ExpenseGraphReportCollection = Backbone.PageableCollection.extend({
  276. model: admin.ExpenseCategoryReportModel,
  277. url: '/btree/admin/get_all_expense_report',
  278. mode: "server",
  279. state: {
  280. pageSize: 5,
  281. sortKey: "updated",
  282. order: 1
  283. },
  284. queryParams: {
  285. totalPages: null,
  286. totalRecords: null,
  287. sortKey: "sort"
  288. },
  289. parseState: function (resp, queryParams, state, options) {
  290. return {totalRecords: resp.total};
  291. },
  292. parseRecords: function (resp, options) {
  293. return resp;
  294. }
  295. });
  296. admin.SalesReportCollection = Backbone.PageableCollection.extend({
  297. model: admin.SalesReportModel,
  298. url: '/btree/admin/get_all_sales_report',
  299. mode: "server",
  300. state: {
  301. pageSize: 5,
  302. sortKey: "updated",
  303. order: 1
  304. },
  305. queryParams: {
  306. totalPages: null,
  307. totalRecords: null,
  308. sortKey: "sort"
  309. },
  310. parseState: function (resp, queryParams, state, options) {
  311. return {totalRecords: resp.total};
  312. },
  313. parseRecords: function (resp, options) {
  314. return resp.data;
  315. }
  316. });
  317. admin.SalesDetailsReportCollection = Backbone.PageableCollection.extend({
  318. model: admin.SalesDetailsReportModel,
  319. url: '/btree/admin/get_all_detailsales_report',
  320. mode: "server",
  321. state: {
  322. pageSize: 5,
  323. sortKey: "updated",
  324. order: 1,
  325. },
  326. queryParams: {
  327. totalPages: null,
  328. totalRecords: null,
  329. sortKey: "sort"
  330. },
  331. parseState: function (resp, queryParams, state, options) {
  332. return {totalRecords: resp.total};
  333. },
  334. parseRecords: function (resp, options) {
  335. return resp.data;
  336. }
  337. });
  338. admin.SalesDetailItemReportCollection = Backbone.Collection.extend({
  339. model: admin.SalesDetailsItemReportModel,
  340. url: '/btree/admin/get_all_detailsales_item',
  341. parse : function(response){
  342. this.current_page = response.current_page;
  343. return response;
  344. }
  345. });
  346. admin.ClaimPointsReportCollection = Backbone.Collection.extend({
  347. model: admin.SalesDetailsItemReportModel,
  348. url: '/btree/admin/customer_pointclaim',
  349. parse : function(response){
  350. this.current_page = response.current_page;
  351. return response;
  352. }
  353. });
  354. admin.SalesGraphReportCollection = Backbone.PageableCollection.extend({
  355. model: admin.SalesReportModel,
  356. url: '/btree/admin/get_all_sales_report',
  357. mode: "server",
  358. state: {
  359. pageSize: 5,
  360. sortKey: "updated",
  361. order: 1
  362. },
  363. queryParams: {
  364. totalPages: null,
  365. totalRecords: null,
  366. sortKey: "sort"
  367. },
  368. parseState: function (resp, queryParams, state, options) {
  369. return {totalRecords: resp.total};
  370. },
  371. parseRecords: function (resp, options) {
  372. return resp;
  373. }
  374. });
  375. admin.SuspendedSalesReportCollection = Backbone.PageableCollection.extend({
  376. model: admin.SuspendedSalesReportModel,
  377. url: '/btree/admin/get_all_suspendedsales_report',
  378. mode: "server",
  379. state: {
  380. pageSize: 5,
  381. sortKey: "updated",
  382. order: 1
  383. },
  384. queryParams: {
  385. totalPages: null,
  386. totalRecords: null,
  387. sortKey: "sort"
  388. },
  389. parseState: function (resp, queryParams, state, options) {
  390. return {totalRecords: resp.total};
  391. },
  392. parseRecords: function (resp, options) {
  393. return resp.data;
  394. }
  395. });
  396. admin.SuspendedSalesGraphReportCollection = Backbone.PageableCollection.extend({
  397. model: admin.SuspendedSalesReportModel,
  398. url: '/btree/admin/get_all_suspendedsales_report',
  399. mode: "server",
  400. state: {
  401. pageSize: 5,
  402. sortKey: "updated",
  403. order: 1
  404. },
  405. queryParams: {
  406. totalPages: null,
  407. totalRecords: null,
  408. sortKey: "sort"
  409. },
  410. parseState: function (resp, queryParams, state, options) {
  411. return {totalRecords: resp.total};
  412. },
  413. parseRecords: function (resp, options) {
  414. return resp;
  415. }
  416. });
  417. admin.ReceivingReportCollection = Backbone.PageableCollection.extend({
  418. model: admin.ReceivingReportModel,
  419. url: '/btree/admin/get_all_receiving_report',
  420. mode: "server",
  421. state: {
  422. pageSize: 5,
  423. sortKey: "updated",
  424. order: 1
  425. },
  426. queryParams: {
  427. totalPages: null,
  428. totalRecords: null,
  429. sortKey: "sort"
  430. },
  431. parseState: function (resp, queryParams, state, options) {
  432. return {totalRecords: resp.total};
  433. },
  434. parseRecords: function (resp, options) {
  435. return resp.data;
  436. }
  437. });
  438. admin.ReceivingGraphReportCollection = Backbone.PageableCollection.extend({
  439. model: admin.ReceivingReportModel,
  440. url: '/btree/admin/get_all_receiving_report',
  441. mode: "server",
  442. state: {
  443. pageSize: 5,
  444. sortKey: "updated",
  445. order: 1
  446. },
  447. queryParams: {
  448. totalPages: null,
  449. totalRecords: null,
  450. sortKey: "sort"
  451. },
  452. parseState: function (resp, queryParams, state, options) {
  453. return {totalRecords: resp.total};
  454. },
  455. parseRecords: function (resp, options) {
  456. return resp;
  457. }
  458. });
  459. admin.DiscountReportCollection = Backbone.PageableCollection.extend({
  460. model: admin.DiscountReportModel,
  461. url: '/btree/admin/get_all_discount_report',
  462. mode: "server",
  463. state: {
  464. pageSize: 5,
  465. sortKey: "updated",
  466. order: 1
  467. },
  468. queryParams: {
  469. totalPages: null,
  470. totalRecords: null,
  471. sortKey: "sort"
  472. },
  473. parseState: function (resp, queryParams, state, options) {
  474. return {totalRecords: resp.total};
  475. },
  476. parseRecords: function (resp, options) {
  477. return resp.data;
  478. }
  479. });
  480. admin.DiscountDetailsReportCollection = Backbone.PageableCollection.extend({
  481. model: admin.DiscountDetailsReportModel,
  482. url: '/btree/admin/get_all_discountdetails_report',
  483. mode: "server",
  484. state: {
  485. pageSize: 5,
  486. sortKey: "updated",
  487. order: 1
  488. },
  489. queryParams: {
  490. totalPages: null,
  491. totalRecords: null,
  492. sortKey: "sort"
  493. },
  494. parseState: function (resp, queryParams, state, options) {
  495. return {totalRecords: resp.total};
  496. },
  497. parseRecords: function (resp, options) {
  498. return resp.data;
  499. }
  500. });
  501. admin.DiscountGraphReportCollection = Backbone.PageableCollection.extend({
  502. model: admin.DiscountReportModel,
  503. url: '/btree/admin/get_all_discount_report',
  504. mode: "server",
  505. state: {
  506. pageSize: 5,
  507. sortKey: "updated",
  508. order: 1
  509. },
  510. queryParams: {
  511. totalPages: null,
  512. totalRecords: null,
  513. sortKey: "sort"
  514. },
  515. parseState: function (resp, queryParams, state, options) {
  516. return {totalRecords: resp.total};
  517. },
  518. parseRecords: function (resp, options) {
  519. return resp;
  520. }
  521. });
  522. admin.PaymentReportCollection = Backbone.PageableCollection.extend({
  523. model: admin.PaymentReportModel,
  524. url: '/btree/admin/get_all_payment_report',
  525. mode: "server",
  526. state: {
  527. pageSize: 5,
  528. sortKey: "updated",
  529. order: 1
  530. },
  531. queryParams: {
  532. totalPages: null,
  533. totalRecords: null,
  534. sortKey: "sort"
  535. },
  536. parseState: function (resp, queryParams, state, options) {
  537. return {totalRecords: resp.total};
  538. },
  539. parseRecords: function (resp, options) {
  540. return resp.data;
  541. }
  542. });
  543. admin.TaxReportCollection = Backbone.PageableCollection.extend({
  544. model: admin.TaxReportModel,
  545. url: '/btree/admin/get_all_tax_report',
  546. mode: "server",
  547. state: {
  548. pageSize: 5,
  549. sortKey: "updated",
  550. order: 1
  551. },
  552. queryParams: {
  553. totalPages: null,
  554. totalRecords: null,
  555. sortKey: "sort"
  556. },
  557. parseState: function (resp, queryParams, state, options) {
  558. return {totalRecords: resp.total};
  559. },
  560. parseRecords: function (resp, options) {
  561. return resp.data;
  562. }
  563. });
  564. admin.TaxGraphReportCollection = ackbone.PageableCollection.extend({
  565. model: admin.PaymentReportModel,
  566. url: '/btree/admin/get_all_payment_report',
  567. mode: "server",
  568. state: {
  569. pageSize: 5,
  570. sortKey: "updated",
  571. order: 1
  572. },
  573. queryParams: {
  574. totalPages: null,
  575. totalRecords: null,
  576. sortKey: "sort"
  577. },
  578. parseState: function (resp, queryParams, state, options) {
  579. return {totalRecords: resp.total};
  580. },
  581. parseRecords: function (resp, options) {
  582. return resp;
  583. }
  584. });
  585. admin.EmployeeReportCollection = Backbone.PageableCollection.extend({
  586. model: admin.EmployeeReportModel,
  587. url: '/btree/admin/get_all_employee_report',
  588. mode: "server",
  589. state: {
  590. pageSize: 5,
  591. sortKey: "updated",
  592. order: 1
  593. },
  594. queryParams: {
  595. totalPages: null,
  596. totalRecords: null,
  597. sortKey: "sort"
  598. },
  599. parseState: function (resp, queryParams, state, options) {
  600. return {totalRecords: resp.total};
  601. },
  602. parseRecords: function (resp, options) {
  603. return resp.data;
  604. }
  605. });
  606. admin.EmployeeDetailsReportCollection = Backbone.PageableCollection.extend({
  607. model: admin.EmployeeDetailsReportModel,
  608. url: '/btree/admin/get_all_detailemployee_report',
  609. mode: "server",
  610. state: {
  611. pageSize: 5,
  612. sortKey: "updated",
  613. order: 1,
  614. },
  615. queryParams: {
  616. totalPages: null,
  617. totalRecords: null,
  618. sortKey: "sort"
  619. },
  620. parseState: function (resp, queryParams, state, options) {
  621. return {totalRecords: resp.total};
  622. },
  623. parseRecords: function (resp, options) {
  624. return resp.data;
  625. }
  626. });
  627. admin.EmployeeGraphReportCollection = Backbone.PageableCollection.extend({
  628. model: admin.EmployeeReportModel,
  629. url: '/btree/admin/get_all_employee_report',
  630. mode: "server",
  631. state: {
  632. pageSize: 5,
  633. sortKey: "updated",
  634. order: 1
  635. },
  636. queryParams: {
  637. totalPages: null,
  638. totalRecords: null,
  639. sortKey: "sort"
  640. },
  641. parseState: function (resp, queryParams, state, options) {
  642. return {totalRecords: resp.total};
  643. },
  644. parseRecords: function (resp, options) {
  645. return resp;
  646. }
  647. });
  648. admin.ItemkitsReportCollection = Backbone.PageableCollection.extend({
  649. model: admin.ItemkitsReportModel,
  650. url: '/btree/admin/get_all_itemkits_report',
  651. mode: "server",
  652. state: {
  653. pageSize: 5,
  654. sortKey: "updated",
  655. order: 1
  656. },
  657. queryParams: {
  658. totalPages: null,
  659. totalRecords: null,
  660. sortKey: "sort"
  661. },
  662. parseState: function (resp, queryParams, state, options) {
  663. return {totalRecords: resp.total};
  664. },
  665. parseRecords: function (resp, options) {
  666. return resp.data;
  667. }
  668. });
  669. admin.ItemkitsGraphReportCollection = Backbone.PageableCollection.extend({
  670. model: admin.ItemkitsReportModel,
  671. url: '/btree/admin/get_all_itemkits_report',
  672. mode: "server",
  673. state: {
  674. pageSize: 5,
  675. sortKey: "updated",
  676. order: 1
  677. },
  678. queryParams: {
  679. totalPages: null,
  680. totalRecords: null,
  681. sortKey: "sort"
  682. },
  683. parseState: function (resp, queryParams, state, options) {
  684. return {totalRecords: resp.total};
  685. },
  686. parseRecords: function (resp, options) {
  687. return resp;
  688. }
  689. });
  690. admin.TransactionReportCollection = Backbone.PageableCollection.extend({
  691. model: admin.InventoryReportModel,
  692. url: '/btree/admin/get_all_transaction_report',
  693. mode: "server",
  694. state: {
  695. pageSize: 5,
  696. sortKey: "updated",
  697. order: 1
  698. },
  699. queryParams: {
  700. totalPages: null,
  701. totalRecords: null,
  702. sortKey: "sort"
  703. },
  704. parseState: function (resp, queryParams, state, options) {
  705. return {totalRecords: resp.total};
  706. },
  707. parseRecords: function (resp, options) {
  708. return resp.data;
  709. }
  710. });
  711. admin.TransactionGraphReportCollection = Backbone.PageableCollection.extend({
  712. model: admin.InventoryReportModel,
  713. url: '/btree/admin/get_all_transaction_report',
  714. mode: "server",
  715. state: {
  716. pageSize: 5,
  717. sortKey: "updated",
  718. order: 1
  719. },
  720. queryParams: {
  721. totalPages: null,
  722. totalRecords: null,
  723. sortKey: "sort"
  724. },
  725. parseState: function (resp, queryParams, state, options) {
  726. return {totalRecords: resp.total};
  727. },
  728. parseRecords: function (resp, options) {
  729. return resp;
  730. }
  731. });
  732. admin.CommissionReportCollection = Backbone.PageableCollection.extend({
  733. model: admin.CommissionReportModel,
  734. url: '/btree/admin/get_all_commission_report',
  735. mode: "server",
  736. state: {
  737. pageSize: 5,
  738. sortKey: "updated",
  739. order: 1
  740. },
  741. queryParams: {
  742. totalPages: null,
  743. totalRecords: null,
  744. sortKey: "sort"
  745. },
  746. parseState: function (resp, queryParams, state, options) {
  747. return {totalRecords: resp.total};
  748. },
  749. parseRecords: function (resp, options) {
  750. return resp.data;
  751. }
  752. });
  753. admin.CommissionGraphReportCollection = Backbone.PageableCollection.extend({
  754. model: admin.CommissionReportModel,
  755. url: '/btree/admin/get_all_commission_report',
  756. mode: "server",
  757. state: {
  758. pageSize: 5,
  759. sortKey: "updated",
  760. order: 1
  761. },
  762. queryParams: {
  763. totalPages: null,
  764. totalRecords: null,
  765. sortKey: "sort"
  766. },
  767. parseState: function (resp, queryParams, state, options) {
  768. return {totalRecords: resp.total};
  769. },
  770. parseRecords: function (resp, options) {
  771. return resp;
  772. }
  773. });
  774. admin.LowInventoryReportCollection = Backbone.PageableCollection.extend({
  775. model: admin.InventoryReportModel,
  776. url: '/btree/admin/get_all_lowinventory',
  777. mode: "server",
  778. state: {
  779. pageSize: 5,
  780. sortKey: "updated",
  781. order: 1
  782. },
  783. queryParams: {
  784. totalPages: null,
  785. totalRecords: null,
  786. sortKey: "sort"
  787. },
  788. parseState: function (resp, queryParams, state, options) {
  789. return {totalRecords: resp.total};
  790. },
  791. parseRecords: function (resp, options) {
  792. return resp.data;
  793. }
  794. });
  795. admin.InventorySummaryReportCollection = Backbone.PageableCollection.extend({
  796. model: admin.InventoryReportModel,
  797. url: '/btree/admin/get_all_inventorysummary',
  798. mode: "server",
  799. state: {
  800. pageSize: 5,
  801. sortKey: "updated",
  802. order: 1
  803. },
  804. queryParams: {
  805. totalPages: null,
  806. totalRecords: null,
  807. sortKey: "sort"
  808. },
  809. parseState: function (resp, queryParams, state, options) {
  810. return {totalRecords: resp.total};
  811. },
  812. parseRecords: function (resp, options) {
  813. return resp.data;
  814. }
  815. });
  816. admin.DeadItemReportCollection = Backbone.PageableCollection.extend({
  817. model: admin.InventoryReportModel,
  818. url: '/btree/admin/get_all_deaditem',
  819. mode: "server",
  820. state: {
  821. pageSize: 5,
  822. sortKey: "updated",
  823. order: 1
  824. },
  825. queryParams: {
  826. totalPages: null,
  827. totalRecords: null,
  828. sortKey: "sort"
  829. },
  830. parseState: function (resp, queryParams, state, options) {
  831. return {totalRecords: resp.total};
  832. },
  833. parseRecords: function (resp, options) {
  834. return resp.data;
  835. }
  836. });