@mj-biz-apps/orders-ng 0.0.1 → 5.2.0

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 (597) hide show
  1. package/LICENSE +183 -0
  2. package/README.md +34 -2
  3. package/dist/checkout-element/main.js +38080 -0
  4. package/dist/lib/checkout-widget/checkout-draft-line.d.ts +25 -0
  5. package/dist/lib/checkout-widget/checkout-draft-line.d.ts.map +1 -0
  6. package/dist/lib/checkout-widget/checkout-draft-line.js +46 -0
  7. package/dist/lib/checkout-widget/checkout-draft-line.js.map +1 -0
  8. package/dist/lib/checkout-widget/checkout-public-host.component.d.ts +80 -0
  9. package/dist/lib/checkout-widget/checkout-public-host.component.d.ts.map +1 -0
  10. package/dist/lib/checkout-widget/checkout-public-host.component.js +360 -0
  11. package/dist/lib/checkout-widget/checkout-public-host.component.js.map +1 -0
  12. package/dist/lib/checkout-widget/checkout-widget.component.d.ts +143 -0
  13. package/dist/lib/checkout-widget/checkout-widget.component.d.ts.map +1 -0
  14. package/dist/lib/checkout-widget/checkout-widget.component.js +873 -0
  15. package/dist/lib/checkout-widget/checkout-widget.component.js.map +1 -0
  16. package/dist/lib/custom/OrderHeader/line-extension-cache.d.ts +22 -0
  17. package/dist/lib/custom/OrderHeader/line-extension-cache.d.ts.map +1 -0
  18. package/dist/lib/custom/OrderHeader/line-extension-cache.js +46 -0
  19. package/dist/lib/custom/OrderHeader/line-extension-cache.js.map +1 -0
  20. package/dist/lib/custom/OrderHeader/line-extension-fields.d.ts +58 -0
  21. package/dist/lib/custom/OrderHeader/line-extension-fields.d.ts.map +1 -0
  22. package/dist/lib/custom/OrderHeader/line-extension-fields.js +137 -0
  23. package/dist/lib/custom/OrderHeader/line-extension-fields.js.map +1 -0
  24. package/dist/lib/custom/OrderHeader/order-header-form.component.d.ts +127 -0
  25. package/dist/lib/custom/OrderHeader/order-header-form.component.d.ts.map +1 -0
  26. package/dist/lib/custom/OrderHeader/order-header-form.component.js +1429 -0
  27. package/dist/lib/custom/OrderHeader/order-header-form.component.js.map +1 -0
  28. package/dist/lib/custom/OrderHeader/order-header-prefs.d.ts +18 -0
  29. package/dist/lib/custom/OrderHeader/order-header-prefs.d.ts.map +1 -0
  30. package/dist/lib/custom/OrderHeader/order-header-prefs.js +20 -0
  31. package/dist/lib/custom/OrderHeader/order-header-prefs.js.map +1 -0
  32. package/dist/lib/custom/OrderHeader/order-lines-editor.component.d.ts +72 -0
  33. package/dist/lib/custom/OrderHeader/order-lines-editor.component.d.ts.map +1 -0
  34. package/dist/lib/custom/OrderHeader/order-lines-editor.component.js +621 -0
  35. package/dist/lib/custom/OrderHeader/order-lines-editor.component.js.map +1 -0
  36. package/dist/lib/custom/PaymentHeader/payment-header-form.component.d.ts +135 -0
  37. package/dist/lib/custom/PaymentHeader/payment-header-form.component.d.ts.map +1 -0
  38. package/dist/lib/custom/PaymentHeader/payment-header-form.component.js +2169 -0
  39. package/dist/lib/custom/PaymentHeader/payment-header-form.component.js.map +1 -0
  40. package/dist/lib/custom/PriceList/price-list-form.component.d.ts +46 -0
  41. package/dist/lib/custom/PriceList/price-list-form.component.d.ts.map +1 -0
  42. package/dist/lib/custom/PriceList/price-list-form.component.js +363 -0
  43. package/dist/lib/custom/PriceList/price-list-form.component.js.map +1 -0
  44. package/dist/lib/custom/Product/product-form.component.d.ts +81 -0
  45. package/dist/lib/custom/Product/product-form.component.d.ts.map +1 -0
  46. package/dist/lib/custom/Product/product-form.component.js +665 -0
  47. package/dist/lib/custom/Product/product-form.component.js.map +1 -0
  48. package/dist/lib/custom/Product/widgets/product-accounting-widget.component.d.ts +16 -0
  49. package/dist/lib/custom/Product/widgets/product-accounting-widget.component.d.ts.map +1 -0
  50. package/dist/lib/custom/Product/widgets/product-accounting-widget.component.js +55 -0
  51. package/dist/lib/custom/Product/widgets/product-accounting-widget.component.js.map +1 -0
  52. package/dist/lib/custom/Product/widgets/product-fulfillment-widget.component.d.ts +16 -0
  53. package/dist/lib/custom/Product/widgets/product-fulfillment-widget.component.d.ts.map +1 -0
  54. package/dist/lib/custom/Product/widgets/product-fulfillment-widget.component.js +65 -0
  55. package/dist/lib/custom/Product/widgets/product-fulfillment-widget.component.js.map +1 -0
  56. package/dist/lib/custom/Product/widgets/product-pricing-widget.component.d.ts +103 -0
  57. package/dist/lib/custom/Product/widgets/product-pricing-widget.component.d.ts.map +1 -0
  58. package/dist/lib/custom/Product/widgets/product-pricing-widget.component.js +950 -0
  59. package/dist/lib/custom/Product/widgets/product-pricing-widget.component.js.map +1 -0
  60. package/dist/lib/custom/Product/widgets/product-promotions-widget.component.d.ts +21 -0
  61. package/dist/lib/custom/Product/widgets/product-promotions-widget.component.d.ts.map +1 -0
  62. package/dist/lib/custom/Product/widgets/product-promotions-widget.component.js +67 -0
  63. package/dist/lib/custom/Product/widgets/product-promotions-widget.component.js.map +1 -0
  64. package/dist/lib/custom/Product/widgets/product-subscription-widget.component.d.ts +18 -0
  65. package/dist/lib/custom/Product/widgets/product-subscription-widget.component.d.ts.map +1 -0
  66. package/dist/lib/custom/Product/widgets/product-subscription-widget.component.js +55 -0
  67. package/dist/lib/custom/Product/widgets/product-subscription-widget.component.js.map +1 -0
  68. package/dist/lib/custom/Promotion/promotion-form.component.d.ts +33 -0
  69. package/dist/lib/custom/Promotion/promotion-form.component.d.ts.map +1 -0
  70. package/dist/lib/custom/Promotion/promotion-form.component.js +350 -0
  71. package/dist/lib/custom/Promotion/promotion-form.component.js.map +1 -0
  72. package/dist/lib/custom/Subscription/subscription-form.component.d.ts +96 -0
  73. package/dist/lib/custom/Subscription/subscription-form.component.d.ts.map +1 -0
  74. package/dist/lib/custom/Subscription/subscription-form.component.js +885 -0
  75. package/dist/lib/custom/Subscription/subscription-form.component.js.map +1 -0
  76. package/dist/lib/custom/SubscriptionTerm/subscription-term-form.component.d.ts +60 -0
  77. package/dist/lib/custom/SubscriptionTerm/subscription-term-form.component.d.ts.map +1 -0
  78. package/dist/lib/custom/SubscriptionTerm/subscription-term-form.component.js +567 -0
  79. package/dist/lib/custom/SubscriptionTerm/subscription-term-form.component.js.map +1 -0
  80. package/dist/lib/custom/custom-forms.module.d.ts +29 -0
  81. package/dist/lib/custom/custom-forms.module.d.ts.map +1 -0
  82. package/dist/lib/custom/custom-forms.module.js +127 -0
  83. package/dist/lib/custom/custom-forms.module.js.map +1 -0
  84. package/dist/lib/custom/form-navigation-helper.d.ts +10 -0
  85. package/dist/lib/custom/form-navigation-helper.d.ts.map +1 -0
  86. package/dist/lib/custom/form-navigation-helper.js +51 -0
  87. package/dist/lib/custom/form-navigation-helper.js.map +1 -0
  88. package/dist/lib/data/entity-names.d.ts +84 -0
  89. package/dist/lib/data/entity-names.d.ts.map +1 -0
  90. package/dist/lib/data/entity-names.js +85 -0
  91. package/dist/lib/data/entity-names.js.map +1 -0
  92. package/dist/lib/data/orders-queries.d.ts +394 -0
  93. package/dist/lib/data/orders-queries.d.ts.map +1 -0
  94. package/dist/lib/data/orders-queries.js +897 -0
  95. package/dist/lib/data/orders-queries.js.map +1 -0
  96. package/dist/lib/form-panels/catalog-overviews.panels.d.ts +36 -0
  97. package/dist/lib/form-panels/catalog-overviews.panels.d.ts.map +1 -0
  98. package/dist/lib/form-panels/catalog-overviews.panels.js +443 -0
  99. package/dist/lib/form-panels/catalog-overviews.panels.js.map +1 -0
  100. package/dist/lib/form-panels/commercial-overviews.panels.d.ts +30 -0
  101. package/dist/lib/form-panels/commercial-overviews.panels.d.ts.map +1 -0
  102. package/dist/lib/form-panels/commercial-overviews.panels.js +315 -0
  103. package/dist/lib/form-panels/commercial-overviews.panels.js.map +1 -0
  104. package/dist/lib/form-panels/document-form.helpers.d.ts +38 -0
  105. package/dist/lib/form-panels/document-form.helpers.d.ts.map +1 -0
  106. package/dist/lib/form-panels/document-form.helpers.js +183 -0
  107. package/dist/lib/form-panels/document-form.helpers.js.map +1 -0
  108. package/dist/lib/form-panels/document-forms.module.d.ts +34 -0
  109. package/dist/lib/form-panels/document-forms.module.d.ts.map +1 -0
  110. package/dist/lib/form-panels/document-forms.module.js +183 -0
  111. package/dist/lib/form-panels/document-forms.module.js.map +1 -0
  112. package/dist/lib/form-panels/document-hero.component.d.ts +28 -0
  113. package/dist/lib/form-panels/document-hero.component.d.ts.map +1 -0
  114. package/dist/lib/form-panels/document-hero.component.js +167 -0
  115. package/dist/lib/form-panels/document-hero.component.js.map +1 -0
  116. package/dist/lib/form-panels/document-overviews.panels.d.ts +42 -0
  117. package/dist/lib/form-panels/document-overviews.panels.d.ts.map +1 -0
  118. package/dist/lib/form-panels/document-overviews.panels.js +457 -0
  119. package/dist/lib/form-panels/document-overviews.panels.js.map +1 -0
  120. package/dist/lib/form-panels/lookup-headers.panels.d.ts +68 -0
  121. package/dist/lib/form-panels/lookup-headers.panels.d.ts.map +1 -0
  122. package/dist/lib/form-panels/lookup-headers.panels.js +399 -0
  123. package/dist/lib/form-panels/lookup-headers.panels.js.map +1 -0
  124. package/dist/lib/form-panels/organization-header.panel.d.ts +15 -0
  125. package/dist/lib/form-panels/organization-header.panel.d.ts.map +1 -0
  126. package/dist/lib/form-panels/organization-header.panel.js +77 -0
  127. package/dist/lib/form-panels/organization-header.panel.js.map +1 -0
  128. package/dist/lib/form-panels/organization-orders-overview.panel.d.ts +13 -0
  129. package/dist/lib/form-panels/organization-orders-overview.panel.d.ts.map +1 -0
  130. package/dist/lib/form-panels/organization-orders-overview.panel.js +77 -0
  131. package/dist/lib/form-panels/organization-orders-overview.panel.js.map +1 -0
  132. package/dist/lib/form-panels/organization-orders.panel.d.ts +16 -0
  133. package/dist/lib/form-panels/organization-orders.panel.d.ts.map +1 -0
  134. package/dist/lib/form-panels/organization-orders.panel.js +88 -0
  135. package/dist/lib/form-panels/organization-orders.panel.js.map +1 -0
  136. package/dist/lib/form-panels/overview-cards.component.d.ts +30 -0
  137. package/dist/lib/form-panels/overview-cards.component.d.ts.map +1 -0
  138. package/dist/lib/form-panels/overview-cards.component.js +250 -0
  139. package/dist/lib/form-panels/overview-cards.component.js.map +1 -0
  140. package/dist/lib/form-panels/overview-load.d.ts +7 -0
  141. package/dist/lib/form-panels/overview-load.d.ts.map +1 -0
  142. package/dist/lib/form-panels/overview-load.js +31 -0
  143. package/dist/lib/form-panels/overview-load.js.map +1 -0
  144. package/dist/lib/form-panels/party-headers.module.d.ts +18 -0
  145. package/dist/lib/form-panels/party-headers.module.d.ts.map +1 -0
  146. package/dist/lib/form-panels/party-headers.module.js +63 -0
  147. package/dist/lib/form-panels/party-headers.module.js.map +1 -0
  148. package/dist/lib/form-panels/party-order-stats.d.ts +26 -0
  149. package/dist/lib/form-panels/party-order-stats.d.ts.map +1 -0
  150. package/dist/lib/form-panels/party-order-stats.js +149 -0
  151. package/dist/lib/form-panels/party-order-stats.js.map +1 -0
  152. package/dist/lib/form-panels/payment-header.panel.d.ts +21 -0
  153. package/dist/lib/form-panels/payment-header.panel.d.ts.map +1 -0
  154. package/dist/lib/form-panels/payment-header.panel.js +111 -0
  155. package/dist/lib/form-panels/payment-header.panel.js.map +1 -0
  156. package/dist/lib/form-panels/payment-journals.panel.d.ts +32 -0
  157. package/dist/lib/form-panels/payment-journals.panel.d.ts.map +1 -0
  158. package/dist/lib/form-panels/payment-journals.panel.js +332 -0
  159. package/dist/lib/form-panels/payment-journals.panel.js.map +1 -0
  160. package/dist/lib/form-panels/person-header.panel.d.ts +15 -0
  161. package/dist/lib/form-panels/person-header.panel.d.ts.map +1 -0
  162. package/dist/lib/form-panels/person-header.panel.js +77 -0
  163. package/dist/lib/form-panels/person-header.panel.js.map +1 -0
  164. package/dist/lib/form-panels/person-orders-overview.panel.d.ts +13 -0
  165. package/dist/lib/form-panels/person-orders-overview.panel.d.ts.map +1 -0
  166. package/dist/lib/form-panels/person-orders-overview.panel.js +77 -0
  167. package/dist/lib/form-panels/person-orders-overview.panel.js.map +1 -0
  168. package/dist/lib/form-panels/person-orders.panel.d.ts +17 -0
  169. package/dist/lib/form-panels/person-orders.panel.d.ts.map +1 -0
  170. package/dist/lib/form-panels/person-orders.panel.js +89 -0
  171. package/dist/lib/form-panels/person-orders.panel.js.map +1 -0
  172. package/dist/lib/form-panels/price-list-header.panel.d.ts +11 -0
  173. package/dist/lib/form-panels/price-list-header.panel.d.ts.map +1 -0
  174. package/dist/lib/form-panels/price-list-header.panel.js +76 -0
  175. package/dist/lib/form-panels/price-list-header.panel.js.map +1 -0
  176. package/dist/lib/form-panels/price-list-simulator.panel.d.ts +19 -0
  177. package/dist/lib/form-panels/price-list-simulator.panel.d.ts.map +1 -0
  178. package/dist/lib/form-panels/price-list-simulator.panel.js +125 -0
  179. package/dist/lib/form-panels/price-list-simulator.panel.js.map +1 -0
  180. package/dist/lib/form-panels/product-category-hierarchy.panel.d.ts +23 -0
  181. package/dist/lib/form-panels/product-category-hierarchy.panel.d.ts.map +1 -0
  182. package/dist/lib/form-panels/product-category-hierarchy.panel.js +118 -0
  183. package/dist/lib/form-panels/product-category-hierarchy.panel.js.map +1 -0
  184. package/dist/lib/form-panels/product-header.panel.d.ts +14 -0
  185. package/dist/lib/form-panels/product-header.panel.d.ts.map +1 -0
  186. package/dist/lib/form-panels/product-header.panel.js +105 -0
  187. package/dist/lib/form-panels/product-header.panel.js.map +1 -0
  188. package/dist/lib/form-panels/product-widget.panels.d.ts +24 -0
  189. package/dist/lib/form-panels/product-widget.panels.d.ts.map +1 -0
  190. package/dist/lib/form-panels/product-widget.panels.js +253 -0
  191. package/dist/lib/form-panels/product-widget.panels.js.map +1 -0
  192. package/dist/lib/form-panels/promotion-header.panel.d.ts +14 -0
  193. package/dist/lib/form-panels/promotion-header.panel.d.ts.map +1 -0
  194. package/dist/lib/form-panels/promotion-header.panel.js +112 -0
  195. package/dist/lib/form-panels/promotion-header.panel.js.map +1 -0
  196. package/dist/lib/form-panels/subscription-header.panel.d.ts +17 -0
  197. package/dist/lib/form-panels/subscription-header.panel.d.ts.map +1 -0
  198. package/dist/lib/form-panels/subscription-header.panel.js +127 -0
  199. package/dist/lib/form-panels/subscription-header.panel.js.map +1 -0
  200. package/dist/lib/form-panels/subscription-revrec.panel.d.ts +32 -0
  201. package/dist/lib/form-panels/subscription-revrec.panel.d.ts.map +1 -0
  202. package/dist/lib/form-panels/subscription-revrec.panel.js +184 -0
  203. package/dist/lib/form-panels/subscription-revrec.panel.js.map +1 -0
  204. package/dist/lib/form-panels/subscription-term-header.panel.d.ts +13 -0
  205. package/dist/lib/form-panels/subscription-term-header.panel.d.ts.map +1 -0
  206. package/dist/lib/form-panels/subscription-term-header.panel.js +113 -0
  207. package/dist/lib/form-panels/subscription-term-header.panel.js.map +1 -0
  208. package/dist/lib/form-panels/subscription-term-revrec.panel.d.ts +23 -0
  209. package/dist/lib/form-panels/subscription-term-revrec.panel.d.ts.map +1 -0
  210. package/dist/lib/form-panels/subscription-term-revrec.panel.js +144 -0
  211. package/dist/lib/form-panels/subscription-term-revrec.panel.js.map +1 -0
  212. package/dist/lib/form-panels/subscription-terms.panel.d.ts +25 -0
  213. package/dist/lib/form-panels/subscription-terms.panel.d.ts.map +1 -0
  214. package/dist/lib/form-panels/subscription-terms.panel.js +173 -0
  215. package/dist/lib/form-panels/subscription-terms.panel.js.map +1 -0
  216. package/dist/lib/generated/Entities/mjBizAppsOrdersChargeType/mjbizappsorderschargetype.form.component.d.ts +10 -0
  217. package/dist/lib/generated/Entities/mjBizAppsOrdersChargeType/mjbizappsorderschargetype.form.component.d.ts.map +1 -0
  218. package/dist/lib/generated/Entities/mjBizAppsOrdersChargeType/mjbizappsorderschargetype.form.component.js +102 -0
  219. package/dist/lib/generated/Entities/mjBizAppsOrdersChargeType/mjbizappsorderschargetype.form.component.js.map +1 -0
  220. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSession/mjbizappsorderscheckoutsession.form.component.d.ts +10 -0
  221. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSession/mjbizappsorderscheckoutsession.form.component.d.ts.map +1 -0
  222. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSession/mjbizappsorderscheckoutsession.form.component.js +103 -0
  223. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutSession/mjbizappsorderscheckoutsession.form.component.js.map +1 -0
  224. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidget/mjbizappsorderscheckoutwidget.form.component.d.ts +10 -0
  225. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidget/mjbizappsorderscheckoutwidget.form.component.d.ts.map +1 -0
  226. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidget/mjbizappsorderscheckoutwidget.form.component.js +136 -0
  227. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidget/mjbizappsorderscheckoutwidget.form.component.js.map +1 -0
  228. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidgetDistribution/mjbizappsorderscheckoutwidgetdistribution.form.component.d.ts +10 -0
  229. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidgetDistribution/mjbizappsorderscheckoutwidgetdistribution.form.component.d.ts.map +1 -0
  230. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidgetDistribution/mjbizappsorderscheckoutwidgetdistribution.form.component.js +106 -0
  231. package/dist/lib/generated/Entities/mjBizAppsOrdersCheckoutWidgetDistribution/mjbizappsorderscheckoutwidgetdistribution.form.component.js.map +1 -0
  232. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerPaymentMethod/mjbizappsorderscustomerpaymentmethod.form.component.d.ts +10 -0
  233. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerPaymentMethod/mjbizappsorderscustomerpaymentmethod.form.component.d.ts.map +1 -0
  234. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerPaymentMethod/mjbizappsorderscustomerpaymentmethod.form.component.js +98 -0
  235. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerPaymentMethod/mjbizappsorderscustomerpaymentmethod.form.component.js.map +1 -0
  236. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerPaymentTerms/mjbizappsorderscustomerpaymentterms.form.component.d.ts +10 -0
  237. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerPaymentTerms/mjbizappsorderscustomerpaymentterms.form.component.d.ts.map +1 -0
  238. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerPaymentTerms/mjbizappsorderscustomerpaymentterms.form.component.js +89 -0
  239. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerPaymentTerms/mjbizappsorderscustomerpaymentterms.form.component.js.map +1 -0
  240. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerTaxExemption/mjbizappsorderscustomertaxexemption.form.component.d.ts +10 -0
  241. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerTaxExemption/mjbizappsorderscustomertaxexemption.form.component.d.ts.map +1 -0
  242. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerTaxExemption/mjbizappsorderscustomertaxexemption.form.component.js +103 -0
  243. package/dist/lib/generated/Entities/mjBizAppsOrdersCustomerTaxExemption/mjbizappsorderscustomertaxexemption.form.component.js.map +1 -0
  244. package/dist/lib/generated/Entities/mjBizAppsOrdersEntitlementGrant/mjbizappsordersentitlementgrant.form.component.d.ts +10 -0
  245. package/dist/lib/generated/Entities/mjBizAppsOrdersEntitlementGrant/mjbizappsordersentitlementgrant.form.component.d.ts.map +1 -0
  246. package/dist/lib/generated/Entities/mjBizAppsOrdersEntitlementGrant/mjbizappsordersentitlementgrant.form.component.js +107 -0
  247. package/dist/lib/generated/Entities/mjBizAppsOrdersEntitlementGrant/mjbizappsordersentitlementgrant.form.component.js.map +1 -0
  248. package/dist/lib/generated/Entities/mjBizAppsOrdersEventOrderLine/mjbizappsorderseventorderline.form.component.d.ts +10 -0
  249. package/dist/lib/generated/Entities/mjBizAppsOrdersEventOrderLine/mjbizappsorderseventorderline.form.component.d.ts.map +1 -0
  250. package/dist/lib/generated/Entities/mjBizAppsOrdersEventOrderLine/mjbizappsorderseventorderline.form.component.js +139 -0
  251. package/dist/lib/generated/Entities/mjBizAppsOrdersEventOrderLine/mjbizappsorderseventorderline.form.component.js.map +1 -0
  252. package/dist/lib/generated/Entities/mjBizAppsOrdersEventProduct/mjbizappsorderseventproduct.form.component.d.ts +10 -0
  253. package/dist/lib/generated/Entities/mjBizAppsOrdersEventProduct/mjbizappsorderseventproduct.form.component.d.ts.map +1 -0
  254. package/dist/lib/generated/Entities/mjBizAppsOrdersEventProduct/mjbizappsorderseventproduct.form.component.js +129 -0
  255. package/dist/lib/generated/Entities/mjBizAppsOrdersEventProduct/mjbizappsorderseventproduct.form.component.js.map +1 -0
  256. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderAdjustment/mjbizappsordersorderadjustment.form.component.d.ts +10 -0
  257. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderAdjustment/mjbizappsordersorderadjustment.form.component.d.ts.map +1 -0
  258. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderAdjustment/mjbizappsordersorderadjustment.form.component.js +122 -0
  259. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderAdjustment/mjbizappsordersorderadjustment.form.component.js.map +1 -0
  260. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderAdjustmentAllocation/mjbizappsordersorderadjustmentallocation.form.component.d.ts +10 -0
  261. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderAdjustmentAllocation/mjbizappsordersorderadjustmentallocation.form.component.d.ts.map +1 -0
  262. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderAdjustmentAllocation/mjbizappsordersorderadjustmentallocation.form.component.js +67 -0
  263. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderAdjustmentAllocation/mjbizappsordersorderadjustmentallocation.form.component.js.map +1 -0
  264. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCharge/mjbizappsordersordercharge.form.component.d.ts +10 -0
  265. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCharge/mjbizappsordersordercharge.form.component.d.ts.map +1 -0
  266. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCharge/mjbizappsordersordercharge.form.component.js +132 -0
  267. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCharge/mjbizappsordersordercharge.form.component.js.map +1 -0
  268. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderChargeAllocation/mjbizappsordersorderchargeallocation.form.component.d.ts +10 -0
  269. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderChargeAllocation/mjbizappsordersorderchargeallocation.form.component.d.ts.map +1 -0
  270. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderChargeAllocation/mjbizappsordersorderchargeallocation.form.component.js +67 -0
  271. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderChargeAllocation/mjbizappsordersorderchargeallocation.form.component.js.map +1 -0
  272. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCompanyPolicy/mjbizappsordersordercompanypolicy.form.component.d.ts +10 -0
  273. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCompanyPolicy/mjbizappsordersordercompanypolicy.form.component.d.ts.map +1 -0
  274. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCompanyPolicy/mjbizappsordersordercompanypolicy.form.component.js +85 -0
  275. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderCompanyPolicy/mjbizappsordersordercompanypolicy.form.component.js.map +1 -0
  276. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.d.ts +10 -0
  277. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.d.ts.map +1 -0
  278. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.js +342 -0
  279. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.js.map +1 -0
  280. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLine/mjbizappsordersorderline.form.component.d.ts +10 -0
  281. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLine/mjbizappsordersorderline.form.component.d.ts.map +1 -0
  282. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLine/mjbizappsordersorderline.form.component.js +378 -0
  283. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLine/mjbizappsordersorderline.form.component.js.map +1 -0
  284. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLineDimension/mjbizappsordersorderlinedimension.form.component.d.ts +10 -0
  285. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLineDimension/mjbizappsordersorderlinedimension.form.component.d.ts.map +1 -0
  286. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLineDimension/mjbizappsordersorderlinedimension.form.component.js +71 -0
  287. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLineDimension/mjbizappsordersorderlinedimension.form.component.js.map +1 -0
  288. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLinePriceComponent/mjbizappsordersorderlinepricecomponent.form.component.d.ts +10 -0
  289. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLinePriceComponent/mjbizappsordersorderlinepricecomponent.form.component.d.ts.map +1 -0
  290. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLinePriceComponent/mjbizappsordersorderlinepricecomponent.form.component.js +89 -0
  291. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderLinePriceComponent/mjbizappsordersorderlinepricecomponent.form.component.js.map +1 -0
  292. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderSequence/mjbizappsordersordersequence.form.component.d.ts +10 -0
  293. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderSequence/mjbizappsordersordersequence.form.component.d.ts.map +1 -0
  294. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderSequence/mjbizappsordersordersequence.form.component.js +63 -0
  295. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderSequence/mjbizappsordersordersequence.form.component.js.map +1 -0
  296. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentDetail/mjbizappsorderspaymentdetail.form.component.d.ts +10 -0
  297. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentDetail/mjbizappsorderspaymentdetail.form.component.d.ts.map +1 -0
  298. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentDetail/mjbizappsorderspaymentdetail.form.component.js +180 -0
  299. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentDetail/mjbizappsorderspaymentdetail.form.component.js.map +1 -0
  300. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentHeader/mjbizappsorderspaymentheader.form.component.d.ts +10 -0
  301. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentHeader/mjbizappsorderspaymentheader.form.component.d.ts.map +1 -0
  302. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentHeader/mjbizappsorderspaymentheader.form.component.js +206 -0
  303. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentHeader/mjbizappsorderspaymentheader.form.component.js.map +1 -0
  304. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentIntent/mjbizappsorderspaymentintent.form.component.d.ts +10 -0
  305. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentIntent/mjbizappsorderspaymentintent.form.component.d.ts.map +1 -0
  306. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentIntent/mjbizappsorderspaymentintent.form.component.js +128 -0
  307. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentIntent/mjbizappsorderspaymentintent.form.component.js.map +1 -0
  308. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentLine/mjbizappsorderspaymentline.form.component.d.ts +10 -0
  309. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentLine/mjbizappsorderspaymentline.form.component.d.ts.map +1 -0
  310. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentLine/mjbizappsorderspaymentline.form.component.js +87 -0
  311. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentLine/mjbizappsorderspaymentline.form.component.js.map +1 -0
  312. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentProvider/mjbizappsorderspaymentprovider.form.component.d.ts +10 -0
  313. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentProvider/mjbizappsorderspaymentprovider.form.component.d.ts.map +1 -0
  314. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentProvider/mjbizappsorderspaymentprovider.form.component.js +158 -0
  315. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentProvider/mjbizappsorderspaymentprovider.form.component.js.map +1 -0
  316. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentProviderType/mjbizappsorderspaymentprovidertype.form.component.d.ts +10 -0
  317. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentProviderType/mjbizappsorderspaymentprovidertype.form.component.d.ts.map +1 -0
  318. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentProviderType/mjbizappsorderspaymentprovidertype.form.component.js +110 -0
  319. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentProviderType/mjbizappsorderspaymentprovidertype.form.component.js.map +1 -0
  320. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentSequence/mjbizappsorderspaymentsequence.form.component.d.ts +10 -0
  321. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentSequence/mjbizappsorderspaymentsequence.form.component.d.ts.map +1 -0
  322. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentSequence/mjbizappsorderspaymentsequence.form.component.js +63 -0
  323. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentSequence/mjbizappsorderspaymentsequence.form.component.js.map +1 -0
  324. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentTermsType/mjbizappsorderspaymenttermstype.form.component.d.ts +10 -0
  325. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentTermsType/mjbizappsorderspaymenttermstype.form.component.d.ts.map +1 -0
  326. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentTermsType/mjbizappsorderspaymenttermstype.form.component.js +108 -0
  327. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentTermsType/mjbizappsorderspaymenttermstype.form.component.js.map +1 -0
  328. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentType/mjbizappsorderspaymenttype.form.component.d.ts +10 -0
  329. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentType/mjbizappsorderspaymenttype.form.component.d.ts.map +1 -0
  330. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentType/mjbizappsorderspaymenttype.form.component.js +144 -0
  331. package/dist/lib/generated/Entities/mjBizAppsOrdersPaymentType/mjbizappsorderspaymenttype.form.component.js.map +1 -0
  332. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceList/mjbizappsorderspricelist.form.component.d.ts +10 -0
  333. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceList/mjbizappsorderspricelist.form.component.d.ts.map +1 -0
  334. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceList/mjbizappsorderspricelist.form.component.js +134 -0
  335. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceList/mjbizappsorderspricelist.form.component.js.map +1 -0
  336. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceListAssignment/mjbizappsorderspricelistassignment.form.component.d.ts +10 -0
  337. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceListAssignment/mjbizappsorderspricelistassignment.form.component.d.ts.map +1 -0
  338. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceListAssignment/mjbizappsorderspricelistassignment.form.component.js +89 -0
  339. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceListAssignment/mjbizappsorderspricelistassignment.form.component.js.map +1 -0
  340. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceTier/mjbizappsorderspricetier.form.component.d.ts +10 -0
  341. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceTier/mjbizappsorderspricetier.form.component.d.ts.map +1 -0
  342. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceTier/mjbizappsorderspricetier.form.component.js +71 -0
  343. package/dist/lib/generated/Entities/mjBizAppsOrdersPriceTier/mjbizappsorderspricetier.form.component.js.map +1 -0
  344. package/dist/lib/generated/Entities/mjBizAppsOrdersProduct/mjbizappsordersproduct.form.component.d.ts +10 -0
  345. package/dist/lib/generated/Entities/mjBizAppsOrdersProduct/mjbizappsordersproduct.form.component.d.ts.map +1 -0
  346. package/dist/lib/generated/Entities/mjBizAppsOrdersProduct/mjbizappsordersproduct.form.component.js +294 -0
  347. package/dist/lib/generated/Entities/mjBizAppsOrdersProduct/mjbizappsordersproduct.form.component.js.map +1 -0
  348. package/dist/lib/generated/Entities/mjBizAppsOrdersProductBundleItem/mjbizappsordersproductbundleitem.form.component.d.ts +10 -0
  349. package/dist/lib/generated/Entities/mjBizAppsOrdersProductBundleItem/mjbizappsordersproductbundleitem.form.component.d.ts.map +1 -0
  350. package/dist/lib/generated/Entities/mjBizAppsOrdersProductBundleItem/mjbizappsordersproductbundleitem.form.component.js +83 -0
  351. package/dist/lib/generated/Entities/mjBizAppsOrdersProductBundleItem/mjbizappsordersproductbundleitem.form.component.js.map +1 -0
  352. package/dist/lib/generated/Entities/mjBizAppsOrdersProductCategory/mjbizappsordersproductcategory.form.component.d.ts +10 -0
  353. package/dist/lib/generated/Entities/mjBizAppsOrdersProductCategory/mjbizappsordersproductcategory.form.component.d.ts.map +1 -0
  354. package/dist/lib/generated/Entities/mjBizAppsOrdersProductCategory/mjbizappsordersproductcategory.form.component.js +168 -0
  355. package/dist/lib/generated/Entities/mjBizAppsOrdersProductCategory/mjbizappsordersproductcategory.form.component.js.map +1 -0
  356. package/dist/lib/generated/Entities/mjBizAppsOrdersProductEntitlement/mjbizappsordersproductentitlement.form.component.d.ts +10 -0
  357. package/dist/lib/generated/Entities/mjBizAppsOrdersProductEntitlement/mjbizappsordersproductentitlement.form.component.d.ts.map +1 -0
  358. package/dist/lib/generated/Entities/mjBizAppsOrdersProductEntitlement/mjbizappsordersproductentitlement.form.component.js +114 -0
  359. package/dist/lib/generated/Entities/mjBizAppsOrdersProductEntitlement/mjbizappsordersproductentitlement.form.component.js.map +1 -0
  360. package/dist/lib/generated/Entities/mjBizAppsOrdersProductPrice/mjbizappsordersproductprice.form.component.d.ts +10 -0
  361. package/dist/lib/generated/Entities/mjBizAppsOrdersProductPrice/mjbizappsordersproductprice.form.component.d.ts.map +1 -0
  362. package/dist/lib/generated/Entities/mjBizAppsOrdersProductPrice/mjbizappsordersproductprice.form.component.js +162 -0
  363. package/dist/lib/generated/Entities/mjBizAppsOrdersProductPrice/mjbizappsordersproductprice.form.component.js.map +1 -0
  364. package/dist/lib/generated/Entities/mjBizAppsOrdersProductType/mjbizappsordersproducttype.form.component.d.ts +10 -0
  365. package/dist/lib/generated/Entities/mjBizAppsOrdersProductType/mjbizappsordersproducttype.form.component.d.ts.map +1 -0
  366. package/dist/lib/generated/Entities/mjBizAppsOrdersProductType/mjbizappsordersproducttype.form.component.js +136 -0
  367. package/dist/lib/generated/Entities/mjBizAppsOrdersProductType/mjbizappsordersproducttype.form.component.js.map +1 -0
  368. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotion/mjbizappsorderspromotion.form.component.d.ts +10 -0
  369. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotion/mjbizappsorderspromotion.form.component.d.ts.map +1 -0
  370. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotion/mjbizappsorderspromotion.form.component.js +182 -0
  371. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotion/mjbizappsorderspromotion.form.component.js.map +1 -0
  372. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionCode/mjbizappsorderspromotioncode.form.component.d.ts +10 -0
  373. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionCode/mjbizappsorderspromotioncode.form.component.d.ts.map +1 -0
  374. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionCode/mjbizappsorderspromotioncode.form.component.js +108 -0
  375. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionCode/mjbizappsorderspromotioncode.form.component.js.map +1 -0
  376. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionTarget/mjbizappsorderspromotiontarget.form.component.d.ts +10 -0
  377. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionTarget/mjbizappsorderspromotiontarget.form.component.d.ts.map +1 -0
  378. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionTarget/mjbizappsorderspromotiontarget.form.component.js +75 -0
  379. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionTarget/mjbizappsorderspromotiontarget.form.component.js.map +1 -0
  380. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionType/mjbizappsorderspromotiontype.form.component.d.ts +10 -0
  381. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionType/mjbizappsorderspromotiontype.form.component.d.ts.map +1 -0
  382. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionType/mjbizappsorderspromotiontype.form.component.js +90 -0
  383. package/dist/lib/generated/Entities/mjBizAppsOrdersPromotionType/mjbizappsorderspromotiontype.form.component.js.map +1 -0
  384. package/dist/lib/generated/Entities/mjBizAppsOrdersRevenueRecognitionType/mjbizappsordersrevenuerecognitiontype.form.component.d.ts +10 -0
  385. package/dist/lib/generated/Entities/mjBizAppsOrdersRevenueRecognitionType/mjbizappsordersrevenuerecognitiontype.form.component.d.ts.map +1 -0
  386. package/dist/lib/generated/Entities/mjBizAppsOrdersRevenueRecognitionType/mjbizappsordersrevenuerecognitiontype.form.component.js +138 -0
  387. package/dist/lib/generated/Entities/mjBizAppsOrdersRevenueRecognitionType/mjbizappsordersrevenuerecognitiontype.form.component.js.map +1 -0
  388. package/dist/lib/generated/Entities/mjBizAppsOrdersSalesAuthority/mjbizappsorderssalesauthority.form.component.d.ts +10 -0
  389. package/dist/lib/generated/Entities/mjBizAppsOrdersSalesAuthority/mjbizappsorderssalesauthority.form.component.d.ts.map +1 -0
  390. package/dist/lib/generated/Entities/mjBizAppsOrdersSalesAuthority/mjbizappsorderssalesauthority.form.component.js +98 -0
  391. package/dist/lib/generated/Entities/mjBizAppsOrdersSalesAuthority/mjbizappsorderssalesauthority.form.component.js.map +1 -0
  392. package/dist/lib/generated/Entities/mjBizAppsOrdersSalesRule/mjbizappsorderssalesrule.form.component.d.ts +10 -0
  393. package/dist/lib/generated/Entities/mjBizAppsOrdersSalesRule/mjbizappsorderssalesrule.form.component.d.ts.map +1 -0
  394. package/dist/lib/generated/Entities/mjBizAppsOrdersSalesRule/mjbizappsorderssalesrule.form.component.js +87 -0
  395. package/dist/lib/generated/Entities/mjBizAppsOrdersSalesRule/mjbizappsorderssalesrule.form.component.js.map +1 -0
  396. package/dist/lib/generated/Entities/mjBizAppsOrdersStoredValueAccount/mjbizappsordersstoredvalueaccount.form.component.d.ts +10 -0
  397. package/dist/lib/generated/Entities/mjBizAppsOrdersStoredValueAccount/mjbizappsordersstoredvalueaccount.form.component.d.ts.map +1 -0
  398. package/dist/lib/generated/Entities/mjBizAppsOrdersStoredValueAccount/mjbizappsordersstoredvalueaccount.form.component.js +134 -0
  399. package/dist/lib/generated/Entities/mjBizAppsOrdersStoredValueAccount/mjbizappsordersstoredvalueaccount.form.component.js.map +1 -0
  400. package/dist/lib/generated/Entities/mjBizAppsOrdersStoredValueTransaction/mjbizappsordersstoredvaluetransaction.form.component.d.ts +10 -0
  401. package/dist/lib/generated/Entities/mjBizAppsOrdersStoredValueTransaction/mjbizappsordersstoredvaluetransaction.form.component.d.ts.map +1 -0
  402. package/dist/lib/generated/Entities/mjBizAppsOrdersStoredValueTransaction/mjbizappsordersstoredvaluetransaction.form.component.js +87 -0
  403. package/dist/lib/generated/Entities/mjBizAppsOrdersStoredValueTransaction/mjbizappsordersstoredvaluetransaction.form.component.js.map +1 -0
  404. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscription/mjbizappsorderssubscription.form.component.d.ts +10 -0
  405. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscription/mjbizappsorderssubscription.form.component.d.ts.map +1 -0
  406. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscription/mjbizappsorderssubscription.form.component.js +234 -0
  407. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscription/mjbizappsorderssubscription.form.component.js.map +1 -0
  408. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionEvent/mjbizappsorderssubscriptionevent.form.component.d.ts +10 -0
  409. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionEvent/mjbizappsorderssubscriptionevent.form.component.d.ts.map +1 -0
  410. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionEvent/mjbizappsorderssubscriptionevent.form.component.js +87 -0
  411. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionEvent/mjbizappsorderssubscriptionevent.form.component.js.map +1 -0
  412. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionSequence/mjbizappsorderssubscriptionsequence.form.component.d.ts +10 -0
  413. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionSequence/mjbizappsorderssubscriptionsequence.form.component.d.ts.map +1 -0
  414. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionSequence/mjbizappsorderssubscriptionsequence.form.component.js +63 -0
  415. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionSequence/mjbizappsorderssubscriptionsequence.form.component.js.map +1 -0
  416. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionTerm/mjbizappsorderssubscriptionterm.form.component.d.ts +10 -0
  417. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionTerm/mjbizappsorderssubscriptionterm.form.component.d.ts.map +1 -0
  418. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionTerm/mjbizappsorderssubscriptionterm.form.component.js +122 -0
  419. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionTerm/mjbizappsorderssubscriptionterm.form.component.js.map +1 -0
  420. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionType/mjbizappsorderssubscriptiontype.form.component.d.ts +10 -0
  421. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionType/mjbizappsorderssubscriptiontype.form.component.d.ts.map +1 -0
  422. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionType/mjbizappsorderssubscriptiontype.form.component.js +188 -0
  423. package/dist/lib/generated/Entities/mjBizAppsOrdersSubscriptionType/mjbizappsorderssubscriptiontype.form.component.js.map +1 -0
  424. package/dist/lib/generated/class-registrations-manifest.d.ts +7 -0
  425. package/dist/lib/generated/class-registrations-manifest.d.ts.map +1 -0
  426. package/dist/lib/generated/class-registrations-manifest.js +7 -0
  427. package/dist/lib/generated/class-registrations-manifest.js.map +1 -0
  428. package/dist/lib/generated/generated-forms.module.d.ts +79 -0
  429. package/dist/lib/generated/generated-forms.module.d.ts.map +1 -0
  430. package/dist/lib/generated/generated-forms.module.js +276 -0
  431. package/dist/lib/generated/generated-forms.module.js.map +1 -0
  432. package/dist/lib/pages/catalog/pricing.page.d.ts +81 -0
  433. package/dist/lib/pages/catalog/pricing.page.d.ts.map +1 -0
  434. package/dist/lib/pages/catalog/pricing.page.js +555 -0
  435. package/dist/lib/pages/catalog/pricing.page.js.map +1 -0
  436. package/dist/lib/pages/catalog/products.page.d.ts +98 -0
  437. package/dist/lib/pages/catalog/products.page.d.ts.map +1 -0
  438. package/dist/lib/pages/catalog/products.page.js +877 -0
  439. package/dist/lib/pages/catalog/products.page.js.map +1 -0
  440. package/dist/lib/pages/orders/fulfillment.page.d.ts +54 -0
  441. package/dist/lib/pages/orders/fulfillment.page.d.ts.map +1 -0
  442. package/dist/lib/pages/orders/fulfillment.page.js +279 -0
  443. package/dist/lib/pages/orders/fulfillment.page.js.map +1 -0
  444. package/dist/lib/pages/orders/order-document.page.d.ts +71 -0
  445. package/dist/lib/pages/orders/order-document.page.d.ts.map +1 -0
  446. package/dist/lib/pages/orders/order-document.page.js +573 -0
  447. package/dist/lib/pages/orders/order-document.page.js.map +1 -0
  448. package/dist/lib/pages/orders/orders-dashboard.page.d.ts +79 -0
  449. package/dist/lib/pages/orders/orders-dashboard.page.d.ts.map +1 -0
  450. package/dist/lib/pages/orders/orders-dashboard.page.js +819 -0
  451. package/dist/lib/pages/orders/orders-dashboard.page.js.map +1 -0
  452. package/dist/lib/pages/orders/orders-list.page.d.ts +21 -0
  453. package/dist/lib/pages/orders/orders-list.page.d.ts.map +1 -0
  454. package/dist/lib/pages/orders/orders-list.page.js +74 -0
  455. package/dist/lib/pages/orders/orders-list.page.js.map +1 -0
  456. package/dist/lib/pages/orders/return.page.d.ts +96 -0
  457. package/dist/lib/pages/orders/return.page.d.ts.map +1 -0
  458. package/dist/lib/pages/orders/return.page.js +549 -0
  459. package/dist/lib/pages/orders/return.page.js.map +1 -0
  460. package/dist/lib/pages/payments/account-credit.page.d.ts +96 -0
  461. package/dist/lib/pages/payments/account-credit.page.d.ts.map +1 -0
  462. package/dist/lib/pages/payments/account-credit.page.js +463 -0
  463. package/dist/lib/pages/payments/account-credit.page.js.map +1 -0
  464. package/dist/lib/pages/payments/payments-dashboard.page.d.ts +61 -0
  465. package/dist/lib/pages/payments/payments-dashboard.page.d.ts.map +1 -0
  466. package/dist/lib/pages/payments/payments-dashboard.page.js +359 -0
  467. package/dist/lib/pages/payments/payments-dashboard.page.js.map +1 -0
  468. package/dist/lib/pages/payments/payments-list.page.d.ts +18 -0
  469. package/dist/lib/pages/payments/payments-list.page.d.ts.map +1 -0
  470. package/dist/lib/pages/payments/payments-list.page.js +71 -0
  471. package/dist/lib/pages/payments/payments-list.page.js.map +1 -0
  472. package/dist/lib/pages/payments/refund.page.d.ts +74 -0
  473. package/dist/lib/pages/payments/refund.page.d.ts.map +1 -0
  474. package/dist/lib/pages/payments/refund.page.js +477 -0
  475. package/dist/lib/pages/payments/refund.page.js.map +1 -0
  476. package/dist/lib/pages/receivables/customer-ar.page.d.ts +102 -0
  477. package/dist/lib/pages/receivables/customer-ar.page.d.ts.map +1 -0
  478. package/dist/lib/pages/receivables/customer-ar.page.js +782 -0
  479. package/dist/lib/pages/receivables/customer-ar.page.js.map +1 -0
  480. package/dist/lib/pages/receivables/overdue.page.d.ts +71 -0
  481. package/dist/lib/pages/receivables/overdue.page.d.ts.map +1 -0
  482. package/dist/lib/pages/receivables/overdue.page.js +338 -0
  483. package/dist/lib/pages/receivables/overdue.page.js.map +1 -0
  484. package/dist/lib/pages/receivables/subscriptions.page.d.ts +115 -0
  485. package/dist/lib/pages/receivables/subscriptions.page.d.ts.map +1 -0
  486. package/dist/lib/pages/receivables/subscriptions.page.js +632 -0
  487. package/dist/lib/pages/receivables/subscriptions.page.js.map +1 -0
  488. package/dist/lib/panels/aging-bar.component.d.ts +59 -0
  489. package/dist/lib/panels/aging-bar.component.d.ts.map +1 -0
  490. package/dist/lib/panels/aging-bar.component.js +180 -0
  491. package/dist/lib/panels/aging-bar.component.js.map +1 -0
  492. package/dist/lib/panels/allocation-grid.component.d.ts +90 -0
  493. package/dist/lib/panels/allocation-grid.component.d.ts.map +1 -0
  494. package/dist/lib/panels/allocation-grid.component.js +425 -0
  495. package/dist/lib/panels/allocation-grid.component.js.map +1 -0
  496. package/dist/lib/panels/allocation-math.d.ts +59 -0
  497. package/dist/lib/panels/allocation-math.d.ts.map +1 -0
  498. package/dist/lib/panels/allocation-math.js +99 -0
  499. package/dist/lib/panels/allocation-math.js.map +1 -0
  500. package/dist/lib/panels/chips.component.d.ts +104 -0
  501. package/dist/lib/panels/chips.component.d.ts.map +1 -0
  502. package/dist/lib/panels/chips.component.js +274 -0
  503. package/dist/lib/panels/chips.component.js.map +1 -0
  504. package/dist/lib/panels/day-bars.component.d.ts +64 -0
  505. package/dist/lib/panels/day-bars.component.d.ts.map +1 -0
  506. package/dist/lib/panels/day-bars.component.js +143 -0
  507. package/dist/lib/panels/day-bars.component.js.map +1 -0
  508. package/dist/lib/panels/decomposition-ladder.component.d.ts +68 -0
  509. package/dist/lib/panels/decomposition-ladder.component.d.ts.map +1 -0
  510. package/dist/lib/panels/decomposition-ladder.component.js +217 -0
  511. package/dist/lib/panels/decomposition-ladder.component.js.map +1 -0
  512. package/dist/lib/panels/index.d.ts +46 -0
  513. package/dist/lib/panels/index.d.ts.map +1 -0
  514. package/dist/lib/panels/index.js +58 -0
  515. package/dist/lib/panels/index.js.map +1 -0
  516. package/dist/lib/panels/journal-entry-preview.component.d.ts +71 -0
  517. package/dist/lib/panels/journal-entry-preview.component.d.ts.map +1 -0
  518. package/dist/lib/panels/journal-entry-preview.component.js +281 -0
  519. package/dist/lib/panels/journal-entry-preview.component.js.map +1 -0
  520. package/dist/lib/panels/money-format.d.ts +182 -0
  521. package/dist/lib/panels/money-format.d.ts.map +1 -0
  522. package/dist/lib/panels/money-format.js +297 -0
  523. package/dist/lib/panels/money-format.js.map +1 -0
  524. package/dist/lib/panels/money-strip.component.d.ts +69 -0
  525. package/dist/lib/panels/money-strip.component.d.ts.map +1 -0
  526. package/dist/lib/panels/money-strip.component.js +233 -0
  527. package/dist/lib/panels/money-strip.component.js.map +1 -0
  528. package/dist/lib/panels/order-stages.d.ts +75 -0
  529. package/dist/lib/panels/order-stages.d.ts.map +1 -0
  530. package/dist/lib/panels/order-stages.js +100 -0
  531. package/dist/lib/panels/order-stages.js.map +1 -0
  532. package/dist/lib/panels/party-orders-overview.component.d.ts +79 -0
  533. package/dist/lib/panels/party-orders-overview.component.d.ts.map +1 -0
  534. package/dist/lib/panels/party-orders-overview.component.js +906 -0
  535. package/dist/lib/panels/party-orders-overview.component.js.map +1 -0
  536. package/dist/lib/panels/stat-tile.component.d.ts +75 -0
  537. package/dist/lib/panels/stat-tile.component.d.ts.map +1 -0
  538. package/dist/lib/panels/stat-tile.component.js +214 -0
  539. package/dist/lib/panels/stat-tile.component.js.map +1 -0
  540. package/dist/lib/panels/status-stepper.component.d.ts +60 -0
  541. package/dist/lib/panels/status-stepper.component.d.ts.map +1 -0
  542. package/dist/lib/panels/status-stepper.component.js +160 -0
  543. package/dist/lib/panels/status-stepper.component.js.map +1 -0
  544. package/dist/lib/panels/summary-strip.component.d.ts +48 -0
  545. package/dist/lib/panels/summary-strip.component.d.ts.map +1 -0
  546. package/dist/lib/panels/summary-strip.component.js +100 -0
  547. package/dist/lib/panels/summary-strip.component.js.map +1 -0
  548. package/dist/lib/panels/worklist-table.component.d.ts +127 -0
  549. package/dist/lib/panels/worklist-table.component.d.ts.map +1 -0
  550. package/dist/lib/panels/worklist-table.component.js +444 -0
  551. package/dist/lib/panels/worklist-table.component.js.map +1 -0
  552. package/dist/lib/sections/orders-sections.component.d.ts +282 -0
  553. package/dist/lib/sections/orders-sections.component.d.ts.map +1 -0
  554. package/dist/lib/sections/orders-sections.component.js +1117 -0
  555. package/dist/lib/sections/orders-sections.component.js.map +1 -0
  556. package/dist/lib/sections/section-nav.model.d.ts +74 -0
  557. package/dist/lib/sections/section-nav.model.d.ts.map +1 -0
  558. package/dist/lib/sections/section-nav.model.js +114 -0
  559. package/dist/lib/sections/section-nav.model.js.map +1 -0
  560. package/dist/lib/sections/section-shell.component.d.ts +70 -0
  561. package/dist/lib/sections/section-shell.component.d.ts.map +1 -0
  562. package/dist/lib/sections/section-shell.component.js +193 -0
  563. package/dist/lib/sections/section-shell.component.js.map +1 -0
  564. package/dist/lib/services/pricing-scheduler.service.d.ts +181 -0
  565. package/dist/lib/services/pricing-scheduler.service.d.ts.map +1 -0
  566. package/dist/lib/services/pricing-scheduler.service.js +292 -0
  567. package/dist/lib/services/pricing-scheduler.service.js.map +1 -0
  568. package/dist/lib/services/save-error.d.ts +24 -0
  569. package/dist/lib/services/save-error.d.ts.map +1 -0
  570. package/dist/lib/services/save-error.js +47 -0
  571. package/dist/lib/services/save-error.js.map +1 -0
  572. package/dist/lib/styles/orders-kit.css +841 -0
  573. package/dist/lib/transfer-pending/workspace-tabs/workspace-card.component.d.ts +55 -0
  574. package/dist/lib/transfer-pending/workspace-tabs/workspace-card.component.d.ts.map +1 -0
  575. package/dist/lib/transfer-pending/workspace-tabs/workspace-card.component.js +243 -0
  576. package/dist/lib/transfer-pending/workspace-tabs/workspace-card.component.js.map +1 -0
  577. package/dist/lib/transfer-pending/workspace-tabs/workspace-tab-store.d.ts +47 -0
  578. package/dist/lib/transfer-pending/workspace-tabs/workspace-tab-store.d.ts.map +1 -0
  579. package/dist/lib/transfer-pending/workspace-tabs/workspace-tab-store.js +112 -0
  580. package/dist/lib/transfer-pending/workspace-tabs/workspace-tab-store.js.map +1 -0
  581. package/dist/lib/transfer-pending/workspace-tabs/workspace-tab-strip.component.d.ts +36 -0
  582. package/dist/lib/transfer-pending/workspace-tabs/workspace-tab-strip.component.d.ts.map +1 -0
  583. package/dist/lib/transfer-pending/workspace-tabs/workspace-tab-strip.component.js +179 -0
  584. package/dist/lib/transfer-pending/workspace-tabs/workspace-tab-strip.component.js.map +1 -0
  585. package/dist/lib/transfer-pending/workspace-tabs/workspace-tabs.types.d.ts +36 -0
  586. package/dist/lib/transfer-pending/workspace-tabs/workspace-tabs.types.d.ts.map +1 -0
  587. package/dist/lib/transfer-pending/workspace-tabs/workspace-tabs.types.js +9 -0
  588. package/dist/lib/transfer-pending/workspace-tabs/workspace-tabs.types.js.map +1 -0
  589. package/dist/lib/transfer-pending/workspace-tabs/workspace-tip.directive.d.ts +35 -0
  590. package/dist/lib/transfer-pending/workspace-tabs/workspace-tip.directive.d.ts.map +1 -0
  591. package/dist/lib/transfer-pending/workspace-tabs/workspace-tip.directive.js +124 -0
  592. package/dist/lib/transfer-pending/workspace-tabs/workspace-tip.directive.js.map +1 -0
  593. package/dist/public-api.d.ts +80 -0
  594. package/dist/public-api.d.ts.map +1 -0
  595. package/dist/public-api.js +98 -0
  596. package/dist/public-api.js.map +1 -0
  597. package/package.json +78 -5
@@ -0,0 +1,897 @@
1
+ /**
2
+ * @fileoverview The reads the list and detail surfaces make, as plain functions over `RunView`.
3
+ *
4
+ * WHAT THIS REPLACED, AND WHY
5
+ *
6
+ * `MJOOrdersDataService` — an `@Injectable` every page took in its constructor, returning
7
+ * `Record<string, unknown>` rows and two hand-written row interfaces (`MJOOrderRow`,
8
+ * `MJOPaymentRow`). It predates `docs/ui-architecture.md`, and it is the shape that document names:
9
+ * a data-access service layer whose real cost is the TYPING.
10
+ *
11
+ * The cost was not hypothetical. `MJOOrderRow` declared `OriginChannel?: string | null`. There is no
12
+ * such column and never was — so a filter, a table column, a chip class and a whole preset were
13
+ * written against a field the schema does not have, and the compiler had nothing to say, because the
14
+ * type was hand-written. The feature survived behind a `MJO_ORIGIN_CHANNEL_AVAILABLE = false` flag
15
+ * precisely BECAUSE nothing could tell anyone it was fiction. Typing these reads from the schema
16
+ * deleted it: `mjBizAppsOrdersOrderHeaderEntity` has no `OriginChannel`, so the code stopped
17
+ * compiling and had to go.
18
+ *
19
+ * WHAT DID NOT CHANGE, AND WHY IT IS NOT A SERVICE
20
+ *
21
+ * These are QUERIES, not an abstraction over MJ. Each one is an entity name, a filter that encodes a
22
+ * real rule, and an order-by. They live together so four screens do not independently decide what
23
+ * "open" means — and they are functions rather than an injected class because there is no state to
24
+ * hold and no lifetime to manage. A caller wanting something unusual still writes `RunView` directly;
25
+ * that was always true and is the point.
26
+ *
27
+ * `ResultType: 'entity_object'` — the screens hold REAL ENTITIES, which is what
28
+ * `docs/ui-architecture.md` asks for and also what makes the types honest. Declaring one shape and
29
+ * returning another is how this code came to hold `String(r.OrderDate).slice(0, 4)` to read a year:
30
+ * it works only while the value is secretly a string, and on a `Date` it yields `'Mon '`.
31
+ *
32
+ * Which shape a `'simple'` read returns is not a fact worth encoding in call sites — it used to be
33
+ * the raw transport value and MJ now normalizes date columns to `Date` there too. Read date cells
34
+ * with `ToISODate`/`IsBefore` from the entities package and the question stops needing an answer.
35
+ *
36
+ * The one exception is {@link GetOrderSummary}, which reduces up to 5,000 rows into six numbers and
37
+ * has no use for entity behaviour. It reads the four columns it needs and says so.
38
+ *
39
+ * CONNECTS TO:
40
+ * DOC: docs/ui-architecture.md — the rule this file exists to satisfy
41
+ * TYPES: @mj-biz-apps/orders-entities generated entity classes
42
+ *
43
+ * @module @mj-biz-apps/orders-ng
44
+ */
45
+ import { Metadata, RunView } from '@memberjunction/core';
46
+ import { NetLines } from '@mj-biz-apps/accounting-engine-base';
47
+ import { IsBefore, Today } from '@mj-biz-apps/orders-entities';
48
+ import { MJO_ACCOUNTING_ENTITIES, MJO_COMMON_ENTITIES, MJO_ENTITIES } from './entity-names.js';
49
+ /** Ids reach filter strings as SQL text, so they are shape-checked first. */
50
+ const UUID_PATTERN = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
51
+ /**
52
+ * Entities whose last read came back capped.
53
+ *
54
+ * Module-scoped rather than per-instance because it is a DIAGNOSTIC REGISTER, not application state:
55
+ * the question it answers ("did anything get truncated in this session") has one answer for the whole
56
+ * page, and nobody should be able to get a second opinion by injecting a different copy.
57
+ *
58
+ * Deliberately NOT a UI element — the fix for a truncated total is a server-side aggregate, not a
59
+ * disclaimer next to a wrong number. This exists so the condition is *detectable* (by a test, by a
60
+ * caller that wants to refuse to render a total, or by anyone reading the console) instead of being
61
+ * invisible until someone reconciles by hand.
62
+ */
63
+ const truncated = new Set();
64
+ /** True when the last read of `entityName` was capped by its default `MaxRows`. */
65
+ export function WasTruncated(entityName) {
66
+ return truncated.has(entityName);
67
+ }
68
+ /**
69
+ * One `RunView`, with the provider resolved the standard way.
70
+ *
71
+ * `MaxRows` defaults to 500 rather than being unbounded: these are worklists, and the tail of a
72
+ * ten-thousand-row aging list is not something anyone works through in a table. A screen that needs
73
+ * more should say so explicitly.
74
+ */
75
+ async function run(entityName, filters, orderBy, maxRows, user) {
76
+ const rv = new RunView();
77
+ const result = await rv.RunView({
78
+ EntityName: entityName,
79
+ ExtraFilter: filters.filter(Boolean).join(' AND '),
80
+ OrderBy: orderBy,
81
+ MaxRows: maxRows ?? 500,
82
+ ResultType: 'entity_object',
83
+ }, user ?? currentUser());
84
+ if (!result.Success) {
85
+ // NEVER fail silently into an empty list. Every caller renders an empty state, and an empty
86
+ // state is the most reassuring thing on the screen — "no orders", "nothing overdue", "no
87
+ // payments". A failed query that reads as good news is the worst outcome available.
88
+ //
89
+ // This is not theoretical: two entity names were wrong for the entire build, and the only
90
+ // symptom was dashboards reporting zero against a database with 73 orders.
91
+ console.error(`[orders-queries] Query failed for "${entityName}" — the screen will render an empty ` +
92
+ `state that does NOT mean "no data".\n` +
93
+ ` Filter: ${filters.filter(Boolean).join(' AND ') || '(none)'}\n` +
94
+ ` Reason: ${result.ErrorMessage ?? 'no error message supplied'}`);
95
+ return [];
96
+ }
97
+ // A TRUNCATED read is not an error, so nothing above catches it — and a truncated read that
98
+ // feeds a TOTAL is a wrong number rather than a short list. Past the cap the headline figure
99
+ // silently understates with nothing on screen to say so: the same class of failure as the
100
+ // empty-state case, since a plausible number is more dangerous than an obvious blank.
101
+ //
102
+ // ONLY the implicit default is reported. A caller that passed its own `maxRows` chose a short
103
+ // list on purpose — the typeahead asks for a handful of products out of hundreds and is right
104
+ // to. Flagging those buries the real signal under noise.
105
+ if (maxRows === undefined && result.TotalRowCount > result.RowCount) {
106
+ truncated.add(entityName);
107
+ console.error(`[orders-queries] TRUNCATED read of "${entityName}" — returned ${result.RowCount} of ` +
108
+ `${result.TotalRowCount} matching rows.\n` +
109
+ ` Any TOTAL derived from this read is UNDERSTATED by the remainder.\n` +
110
+ ` Filter: ${filters.filter(Boolean).join(' AND ') || '(none)'}\n` +
111
+ ` Fix: pass an explicit MaxRows for a worklist, or aggregate server-side (RunQuery) ` +
112
+ `for a figure. See BACKLOG.md task 11d.`);
113
+ }
114
+ return result.Results ?? [];
115
+ }
116
+ /**
117
+ * The acting user.
118
+ *
119
+ * The browser session supplies one; on the server a caller passes it explicitly. Read lazily so these
120
+ * functions work in both places without anything to construct.
121
+ */
122
+ function currentUser() {
123
+ return new Metadata().CurrentUser;
124
+ }
125
+ /**
126
+ * A `'simple'` read — raw rows, no entities.
127
+ *
128
+ * For AGGREGATES only. `GetOrderSummary` reduces up to 5,000 orders into six numbers, and
129
+ * materialising 5,000 `BaseEntity` instances to sum three columns is work with no answer attached to
130
+ * it. Everything a screen RENDERS goes through {@link run} and gets real entities.
131
+ */
132
+ async function runRows(entityName, filters, orderBy, maxRows, user, fields) {
133
+ const rv = new RunView();
134
+ const result = await rv.RunView({
135
+ EntityName: entityName,
136
+ ExtraFilter: filters.filter(Boolean).join(' AND '),
137
+ OrderBy: orderBy,
138
+ MaxRows: maxRows,
139
+ Fields: fields,
140
+ ResultType: 'simple',
141
+ }, user ?? currentUser());
142
+ if (!result.Success) {
143
+ console.error(`[orders-queries] Aggregate read failed for "${entityName}" — the figures above the list ` +
144
+ `will read as zero, which does NOT mean "nothing owing".\n` +
145
+ ` Reason: ${result.ErrorMessage ?? 'no error message supplied'}`);
146
+ return [];
147
+ }
148
+ return result.Results ?? [];
149
+ }
150
+ /** Quoted, comma-separated ids, or null when none survive validation. */
151
+ function uuidList(ids) {
152
+ const safe = [...new Set(ids)].filter((id) => UUID_PATTERN.test(id));
153
+ return safe.length ? safe.map((id) => `'${id}'`).join(',') : null;
154
+ }
155
+ /** Escape a user-typed fragment for a LIKE clause. */
156
+ function likeText(value) {
157
+ return value.replace(/'/g, "''");
158
+ }
159
+ /**
160
+ * Orders matching a preset.
161
+ *
162
+ * The presets are the business rules, and each is a filter rather than a stored flag because every
163
+ * one of them changes with the clock or with a rollup:
164
+ *
165
+ * - `overdue` — a balance past its due date. Never a column: it changes as time passes, not as
166
+ * anything is written, so storing it would need a nightly job whose only purpose is keeping it
167
+ * honest.
168
+ * - `unpaid` — a balance owing on an order that has confirmed. Drafts are excluded because a draft
169
+ * owes nothing yet.
170
+ * - `notposted` — confirmed but not yet posted. Normally a matter of seconds; a row lingering here
171
+ * is worth investigating.
172
+ * - `credits` — a NEGATIVE balance, which IS the customer's credit. There is no separate instrument
173
+ * to look up.
174
+ */
175
+ export async function GetOrders(options = {}) {
176
+ const filters = [];
177
+ const today = new Date().toISOString().slice(0, 10);
178
+ switch (options.Preset) {
179
+ case 'overdue':
180
+ filters.push(`Balance > 0 AND DueDate IS NOT NULL AND DueDate < '${today}'`);
181
+ filters.push(`Status NOT IN ('Draft','Quoted','Voided')`);
182
+ break;
183
+ case 'unpaid':
184
+ filters.push(`Balance > 0 AND Status NOT IN ('Draft','Quoted','Voided')`);
185
+ break;
186
+ case 'notposted':
187
+ filters.push(`Status = 'Confirmed'`);
188
+ break;
189
+ case 'drafts':
190
+ filters.push(`Status IN ('Draft','Quoted')`);
191
+ break;
192
+ case 'credits':
193
+ filters.push(`Balance < 0`);
194
+ break;
195
+ default:
196
+ filters.push(`Status <> 'Voided'`);
197
+ break;
198
+ }
199
+ // Guarded rather than interpolated raw. The server package has `RequireUUID` for exactly this,
200
+ // but it does not ship to the browser, so this is the same idea locally: an id that is not a
201
+ // UUID never reaches the filter string.
202
+ if (options.OrderHeaderID) {
203
+ if (!UUID_PATTERN.test(options.OrderHeaderID)) {
204
+ throw new Error(`OrderHeaderID is not a UUID: ${options.OrderHeaderID}`);
205
+ }
206
+ filters.push(`ID = '${options.OrderHeaderID}'`);
207
+ }
208
+ if (options.CompanyID)
209
+ filters.push(`CompanyID = '${options.CompanyID}'`);
210
+ if (options.BillToPersonID && options.BillToOrganizationID) {
211
+ filters.push(`(BillToOrganizationID = '${options.BillToOrganizationID}' OR BillToPersonID = '${options.BillToPersonID}')`);
212
+ }
213
+ else {
214
+ if (options.BillToPersonID)
215
+ filters.push(`BillToPersonID = '${options.BillToPersonID}'`);
216
+ if (options.BillToOrganizationID)
217
+ filters.push(`BillToOrganizationID = '${options.BillToOrganizationID}'`);
218
+ }
219
+ if (options.Search?.trim()) {
220
+ const escaped = likeText(options.Search);
221
+ filters.push(`(OrderNumber LIKE '%${escaped}%' OR Description LIKE '%${escaped}%' ` +
222
+ `OR ExternalDocumentNumber LIKE '%${escaped}%')`);
223
+ }
224
+ return run(MJO_ENTITIES.OrderHeader, filters, 'OrderDate DESC', options.MaxRows, options.User);
225
+ }
226
+ /**
227
+ * The counts and totals the orders list shows above its table.
228
+ *
229
+ * ONE query, not one per preset. The presets partition the same population six different ways, so
230
+ * six COUNT round trips would ask the database the same question repeatedly to fill one strip. This
231
+ * reads the few columns the arithmetic needs and derives every figure from them.
232
+ *
233
+ * The filters mirror `GetOrders` exactly. They are stated once here as the same expressions rather
234
+ * than re-queried, because a count that disagrees with the list it labels is worse than no count.
235
+ */
236
+ export async function GetOrderSummary(user) {
237
+ const rows = await runRows(MJO_ENTITIES.OrderHeader, [`Status <> 'Voided'`], 'OrderDate DESC', 5000, user,
238
+ // Four columns, because that is what the arithmetic reads. Fetching fifty to sum three is
239
+ // work with no answer attached.
240
+ ['Status', 'Balance', 'TotalGross', 'DueDate']);
241
+ // The operator's calendar day, not a UTC instant: an order due today is not overdue at 8pm in
242
+ // New York just because it is already tomorrow in London.
243
+ const today = Today();
244
+ const settleable = (o) => !['Draft', 'Quoted', 'Voided'].includes(o.Status ?? '');
245
+ const credits = rows.filter((o) => settleable(o) && Number(o.Balance ?? 0) < 0);
246
+ const owing = rows.filter((o) => settleable(o) && Number(o.Balance ?? 0) > 0);
247
+ return {
248
+ Total: rows.length,
249
+ TotalValue: rows.reduce((sum, o) => sum + Number(o.TotalGross ?? 0), 0),
250
+ OpenBalance: owing.reduce((sum, o) => sum + Number(o.Balance ?? 0), 0),
251
+ CreditsHeld: Math.abs(credits.reduce((sum, o) => sum + Number(o.Balance ?? 0), 0)),
252
+ Counts: {
253
+ all: rows.length,
254
+ overdue: owing.filter((o) => IsBefore(o.DueDate, today)).length,
255
+ unpaid: owing.length,
256
+ notposted: rows.filter((o) => o.Status === 'Confirmed').length,
257
+ drafts: rows.filter((o) => ['Draft', 'Quoted'].includes(o.Status ?? '')).length,
258
+ credits: credits.length,
259
+ },
260
+ };
261
+ }
262
+ /** Lines belonging to one order. */
263
+ export async function GetOrderLines(orderHeaderID, user) {
264
+ if (!UUID_PATTERN.test(orderHeaderID))
265
+ return [];
266
+ return run(MJO_ENTITIES.OrderLine, [`OrderHeaderID = '${orderHeaderID}'`], 'LineNumber', undefined, user);
267
+ }
268
+ /**
269
+ * Lines for MANY orders in one query, grouped by order id.
270
+ *
271
+ * WHY THIS EXISTS ALONGSIDE `GetOrderLines`. The fulfillment board needs the lines of every posted
272
+ * order, and asking per order is one round trip per order — fine against a seeded fixture, visibly
273
+ * slow the moment a company has a few hundred posted orders. The single-order function stays because
274
+ * the editor genuinely wants one order's lines.
275
+ */
276
+ export async function GetOrderLinesForOrders(orderHeaderIDs, user) {
277
+ const grouped = new Map();
278
+ const list = uuidList(orderHeaderIDs);
279
+ if (!list)
280
+ return grouped;
281
+ const rows = await run(MJO_ENTITIES.OrderLine, [`OrderHeaderID IN (${list})`], 'LineNumber',
282
+ // One cap for the whole board rather than per order, so a single enormous order cannot
283
+ // silently crowd out every other one.
284
+ 5000, user);
285
+ for (const row of rows) {
286
+ const key = String(row.OrderHeaderID ?? '');
287
+ const existing = grouped.get(key);
288
+ if (existing)
289
+ existing.push(row);
290
+ else
291
+ grouped.set(key, [row]);
292
+ }
293
+ return grouped;
294
+ }
295
+ /**
296
+ * The ids of an order's lines — the key both consequence grids filter on.
297
+ *
298
+ * @returns Line ids in line-number order. Empty when the order has no lines or the id is not a
299
+ * UUID; callers must treat empty as "there is nothing to show", never as a filter.
300
+ */
301
+ export async function GetOrderLineIDs(orderHeaderID, user) {
302
+ const lines = await GetOrderLines(orderHeaderID, user);
303
+ return lines.map((line) => String(line.ID ?? '')).filter((id) => UUID_PATTERN.test(id));
304
+ }
305
+ /* ── The order's consequences: what it booked, and what it started ─────────────
306
+ *
307
+ * Both tabs render through `mj-entity-data-grid` (@memberjunction/ng-entity-viewer), which takes a
308
+ * `RunViewParams` and does its own loading, paging and column generation from entity metadata. So
309
+ * the job here is NOT to fetch and reshape rows — it is to hand the grid the right question.
310
+ *
311
+ * BOTH ARE KEYED ON THE ORDER'S LINES, not the order:
312
+ * · a journal entry points at the ORDER LINE that caused it (`LinkedRecordID`, D25) — one entry
313
+ * per line, per company;
314
+ * · a subscription records the line that brought it into existence (`OrderLineID`, D39/D40).
315
+ * There is no column on either that names the order header, which is why the line ids come first and
316
+ * why an order with no lines can have neither.
317
+ */
318
+ /**
319
+ * What this order booked into the ledger, as grid params.
320
+ *
321
+ * Newest first: a corrected or reversed order accumulates entries, and the one that explains the
322
+ * current state is the most recent.
323
+ *
324
+ * @returns Params for `mj-entity-data-grid`, or **null** when the order has no lines. Null means "do
325
+ * not load": an `IN ()` with nothing in it is not valid SQL, and a filter that matches
326
+ * everything would show another order's ledger.
327
+ */
328
+ export function JournalEntryViewParams(orderLineIDs) {
329
+ const list = uuidList(orderLineIDs);
330
+ if (!list)
331
+ return null;
332
+ return {
333
+ EntityName: MJO_ACCOUNTING_ENTITIES.JournalEntry,
334
+ ExtraFilter: `LinkedRecordID IN (${list})`,
335
+ OrderBy: '__mj_CreatedAt DESC',
336
+ ResultType: 'entity_object',
337
+ };
338
+ }
339
+ const EMPTY_ROLLUP = { Cards: [], TotalDebit: 0, TotalCredit: 0, JournalCount: 0 };
340
+ /**
341
+ * Turn NetLines groups into display rows. Pure — the form never nets itself.
342
+ *
343
+ * Preserves {@link NetLines} order (company, then every debit, then every credit).
344
+ * Labels are looked up by lowercased id so SQL Server / PostgreSQL UUID casing cannot split a key.
345
+ */
346
+ export function PresentOrderJournalRollup(groups, labels) {
347
+ return groups.map((group) => {
348
+ const amount = Math.abs(group.net);
349
+ const account = labels.Account[group.glAccountId.toLowerCase()];
350
+ return {
351
+ Key: `${group.companyId}#${group.glAccountId}#${group.dimKey}`,
352
+ CompanyID: group.companyId,
353
+ Company: labels.Company[group.companyId.toLowerCase()] || group.companyId,
354
+ GLAccountID: group.glAccountId,
355
+ AccountCode: account?.Code ?? '',
356
+ AccountName: account?.Name || group.glAccountId,
357
+ Dimensions: presentDimensions(group.dims, labels),
358
+ Side: group.side,
359
+ Debit: group.side === 'Debit' ? amount : 0,
360
+ Credit: group.side === 'Credit' ? amount : 0,
361
+ SourceLineCount: group.sourceLineCount,
362
+ };
363
+ });
364
+ }
365
+ /** Split a flat rollup into one card per company, keeping NetLines order inside each. */
366
+ export function GroupOrderJournalByCompany(rows) {
367
+ const cards = [];
368
+ const index = new Map();
369
+ for (const row of rows) {
370
+ const key = row.CompanyID.toLowerCase();
371
+ let card = index.get(key);
372
+ if (!card) {
373
+ card = {
374
+ CompanyID: row.CompanyID,
375
+ Company: row.Company,
376
+ Rows: [],
377
+ TotalDebit: 0,
378
+ TotalCredit: 0,
379
+ };
380
+ index.set(key, card);
381
+ cards.push(card);
382
+ }
383
+ card.Rows.push(row);
384
+ card.TotalDebit += row.Debit;
385
+ card.TotalCredit += row.Credit;
386
+ }
387
+ return cards;
388
+ }
389
+ /**
390
+ * The order-level journal: every line JE rolled up with {@link NetLines}.
391
+ *
392
+ * This is a DISPLAY aggregation. Orders books one JE per line; there is no stored
393
+ * "order journal" row.
394
+ */
395
+ export async function GetOrderJournalRollup(orderLineIDs, user) {
396
+ const journals = await loadJournalsForOrderLines(orderLineIDs, user);
397
+ if (journals.length === 0)
398
+ return EMPTY_ROLLUP;
399
+ const { lines, dims } = await loadJournalLinesAndDims(journals.map((j) => j.ID), user);
400
+ const accounts = await loadGLAccounts(lines.map((line) => line.GLAccountID), user);
401
+ const nettable = toNettableLines(journals, lines, dims);
402
+ const rows = PresentOrderJournalRollup(NetLines(nettable), rollupLabels(journals, lines, dims, accounts));
403
+ const cards = GroupOrderJournalByCompany(rows);
404
+ return {
405
+ Cards: cards,
406
+ TotalDebit: cards.reduce((sum, card) => sum + card.TotalDebit, 0),
407
+ TotalCredit: cards.reduce((sum, card) => sum + card.TotalCredit, 0),
408
+ JournalCount: journals.length,
409
+ };
410
+ }
411
+ /**
412
+ * Filter expression resolving all journal entries linked to a payment header
413
+ * or its payment line allocations.
414
+ */
415
+ export function BuildPaymentJournalFilter(payment) {
416
+ if (!payment?.IsSaved || !payment.ID)
417
+ return '1 = 0';
418
+ const filters = [];
419
+ if (payment.JournalEntryID) {
420
+ filters.push(`ID = '${payment.JournalEntryID}'`);
421
+ }
422
+ filters.push(`LinkedRecordID = '${payment.ID}'`);
423
+ filters.push(`LinkedRecordID IN (SELECT ID FROM [__mj_BizAppsOrders].[PaymentLine] WHERE PaymentHeaderID = '${payment.ID}')`);
424
+ return filters.join(' OR ');
425
+ }
426
+ /**
427
+ * Rollup of all journal entries produced by a payment and its line allocations.
428
+ */
429
+ export async function GetPaymentJournalRollup(payment, user) {
430
+ if (!payment?.IsSaved || !payment.ID)
431
+ return EMPTY_ROLLUP;
432
+ const filter = BuildPaymentJournalFilter(payment);
433
+ const journals = await runRows(MJO_ACCOUNTING_ENTITIES.JournalEntry, [filter], '__mj_CreatedAt DESC', 500, user, ['ID', 'CompanyID', 'Company']);
434
+ if (journals.length === 0)
435
+ return EMPTY_ROLLUP;
436
+ const { lines, dims } = await loadJournalLinesAndDims(journals.map((j) => j.ID), user);
437
+ const accounts = await loadGLAccounts(lines.map((line) => line.GLAccountID), user);
438
+ const nettable = toNettableLines(journals, lines, dims);
439
+ const rows = PresentOrderJournalRollup(NetLines(nettable), rollupLabels(journals, lines, dims, accounts));
440
+ const cards = GroupOrderJournalByCompany(rows);
441
+ return {
442
+ Cards: cards,
443
+ TotalDebit: cards.reduce((sum, card) => sum + card.TotalDebit, 0),
444
+ TotalCredit: cards.reduce((sum, card) => sum + card.TotalCredit, 0),
445
+ JournalCount: journals.length,
446
+ };
447
+ }
448
+ function presentDimensions(dims, labels) {
449
+ return dims.map((dim) => ({
450
+ Name: labels.Dimension[dim.DimensionID.toLowerCase()] || dim.DimensionID,
451
+ Value: labels.DimensionValue[dim.DimensionValueID.toLowerCase()] || dim.DimensionValueID,
452
+ }));
453
+ }
454
+ async function loadJournalsForOrderLines(orderLineIDs, user) {
455
+ const list = uuidList(orderLineIDs);
456
+ if (!list)
457
+ return [];
458
+ return runRows(MJO_ACCOUNTING_ENTITIES.JournalEntry, [`LinkedRecordID IN (${list})`], '__mj_CreatedAt DESC', 500, user, ['ID', 'CompanyID', 'Company']);
459
+ }
460
+ async function loadJournalLinesAndDims(journalIDs, user) {
461
+ const jeList = uuidList(journalIDs);
462
+ if (!jeList)
463
+ return { lines: [], dims: [] };
464
+ const lines = await runRows(MJO_ACCOUNTING_ENTITIES.JournalEntryLine, [`JournalEntryID IN (${jeList})`], 'LineNumber', 2000, user, ['ID', 'JournalEntryID', 'GLAccountID', 'GLAccount', 'DebitAmount', 'CreditAmount']);
465
+ const lineList = uuidList(lines.map((line) => line.ID));
466
+ if (!lineList)
467
+ return { lines, dims: [] };
468
+ const dims = await runRows(MJO_ACCOUNTING_ENTITIES.JournalEntryLineDimension, [`JournalEntryLineID IN (${lineList})`], 'DimensionID', 2000, user, ['JournalEntryLineID', 'DimensionID', 'DimensionValueID', 'Dimension', 'DimensionValue']);
469
+ return { lines, dims };
470
+ }
471
+ async function loadGLAccounts(ids, user) {
472
+ const list = uuidList(ids);
473
+ if (!list)
474
+ return [];
475
+ return runRows(MJO_ACCOUNTING_ENTITIES.GLAccount, [`ID IN (${list})`], 'Code', 500, user, ['ID', 'Code', 'Name']);
476
+ }
477
+ function toNettableLines(journals, lines, dims) {
478
+ const companyByJE = new Map(journals.map((j) => [j.ID.toLowerCase(), j.CompanyID]));
479
+ const dimsByLine = new Map();
480
+ for (const dim of dims) {
481
+ const existing = dimsByLine.get(dim.JournalEntryLineID) ?? [];
482
+ existing.push({ DimensionID: dim.DimensionID, DimensionValueID: dim.DimensionValueID });
483
+ dimsByLine.set(dim.JournalEntryLineID, existing);
484
+ }
485
+ return lines.map((line) => ({
486
+ companyId: companyByJE.get(line.JournalEntryID.toLowerCase()) ?? '',
487
+ glAccountId: line.GLAccountID,
488
+ debit: line.DebitAmount ?? 0,
489
+ credit: line.CreditAmount ?? 0,
490
+ dims: dimsByLine.get(line.ID) ?? [],
491
+ }));
492
+ }
493
+ function rollupLabels(journals, lines, dims, accounts) {
494
+ const Company = {};
495
+ for (const journal of journals) {
496
+ Company[journal.CompanyID.toLowerCase()] = journal.Company;
497
+ }
498
+ const Account = {};
499
+ for (const line of lines) {
500
+ Account[line.GLAccountID.toLowerCase()] = { Code: '', Name: line.GLAccount };
501
+ }
502
+ for (const account of accounts) {
503
+ Account[account.ID.toLowerCase()] = { Code: account.Code, Name: account.Name || Account[account.ID.toLowerCase()]?.Name || '' };
504
+ }
505
+ const Dimension = {};
506
+ const DimensionValue = {};
507
+ for (const dim of dims) {
508
+ Dimension[dim.DimensionID.toLowerCase()] = dim.Dimension;
509
+ DimensionValue[dim.DimensionValueID.toLowerCase()] = dim.DimensionValue;
510
+ }
511
+ return { Company, Account, Dimension, DimensionValue };
512
+ }
513
+ /** What this order started, as grid params. Null when the order has no lines. */
514
+ export function SubscriptionViewParams(orderLineIDs) {
515
+ const list = uuidList(orderLineIDs);
516
+ if (!list)
517
+ return null;
518
+ return {
519
+ EntityName: MJO_ENTITIES.Subscription,
520
+ ExtraFilter: `OrderLineID IN (${list})`,
521
+ OrderBy: 'StartDate DESC',
522
+ ResultType: 'entity_object',
523
+ };
524
+ }
525
+ /** Dimension tags on an order's lines — the analysis axes a line was filed under. */
526
+ export async function GetLineDimensionsForOrder(orderLineIDs, user) {
527
+ const list = uuidList(orderLineIDs);
528
+ if (!list)
529
+ return [];
530
+ return run(MJO_ENTITIES.OrderLineDimension, [`OrderLineID IN (${list})`], 'Dimension', undefined, user);
531
+ }
532
+ /** Payments, newest first. */
533
+ export async function GetPayments(options = {}) {
534
+ const filters = [];
535
+ switch (options.Preset) {
536
+ case 'captured':
537
+ filters.push(`Status = 'Captured'`);
538
+ break;
539
+ case 'pending':
540
+ filters.push(`Status = 'Pending'`);
541
+ break;
542
+ case 'refunds':
543
+ filters.push(`Status = 'Refunded'`);
544
+ break;
545
+ default:
546
+ break;
547
+ }
548
+ if (options.Search?.trim()) {
549
+ const escaped = likeText(options.Search);
550
+ filters.push(`(PaymentNumber LIKE '%${escaped}%' OR Description LIKE '%${escaped}%')`);
551
+ }
552
+ return run(MJO_ENTITIES.PaymentHeader, filters, 'PaymentDate DESC', options.MaxRows, options.User);
553
+ }
554
+ /**
555
+ * One customer's payments.
556
+ *
557
+ * The A/R screen shows a customer at a time, so this is fetched for the SELECTED customer rather
558
+ * than for everyone up front — a hundred customers' payment histories to render one is work with no
559
+ * answer attached to it.
560
+ */
561
+ export async function GetPaymentsForCustomer(customer, user) {
562
+ const filters = [];
563
+ if (customer.OrganizationID && UUID_PATTERN.test(customer.OrganizationID)) {
564
+ filters.push(`BillToOrganizationID = '${customer.OrganizationID}'`);
565
+ }
566
+ else if (customer.PersonID && UUID_PATTERN.test(customer.PersonID)) {
567
+ filters.push(`BillToPersonID = '${customer.PersonID}'`);
568
+ }
569
+ else {
570
+ return [];
571
+ }
572
+ return run(MJO_ENTITIES.PaymentHeader, filters, 'PaymentDate DESC', 50, user);
573
+ }
574
+ /**
575
+ * Payments that have landed on one order.
576
+ *
577
+ * An allocation LINE, not a payment header: one payment can settle several orders, so the amount
578
+ * that matters here is what reached THIS order rather than what the customer handed over.
579
+ */
580
+ export async function GetPaymentLinesForOrder(orderHeaderID, user) {
581
+ if (!UUID_PATTERN.test(orderHeaderID))
582
+ return [];
583
+ return run(MJO_ENTITIES.PaymentLine, [`OrderHeaderID = '${orderHeaderID}'`], 'AllocatedAt DESC', undefined, user);
584
+ }
585
+ /**
586
+ * Payment numbers for a set of payment ids.
587
+ *
588
+ * WHY THIS EXISTS. `PaymentLine` carries `PaymentHeaderID` and nothing else about the payment — no
589
+ * number, because the base view does not join one. The order editor's "applied payments" table
590
+ * rendered `line['PaymentHeader']`, a field that has never existed, so its Payment column showed a
591
+ * dash on every row of every order that had ever been paid. Nothing failed; the column was simply
592
+ * always empty, and an empty column reads as "no data" rather than as a wrong field name.
593
+ *
594
+ * One query for the whole set, keyed by id, rather than one per line.
595
+ */
596
+ export async function GetPaymentNumbers(paymentHeaderIDs, user) {
597
+ const numbers = new Map();
598
+ const list = uuidList(paymentHeaderIDs);
599
+ if (!list)
600
+ return numbers;
601
+ const rows = await run(MJO_ENTITIES.PaymentHeader, [`ID IN (${list})`], 'PaymentDate DESC', undefined, user);
602
+ for (const row of rows) {
603
+ if (row.ID && row.PaymentNumber)
604
+ numbers.set(String(row.ID).toLowerCase(), row.PaymentNumber);
605
+ }
606
+ return numbers;
607
+ }
608
+ /**
609
+ * Tenders a payment can be taken on, in the order they should be offered.
610
+ *
611
+ * Reversal types are excluded because they are not something a person CHOOSES — a refund creates
612
+ * one, and offering it here would let someone record a reversal with nothing to reverse.
613
+ */
614
+ export async function GetPaymentTypes(user) {
615
+ return run(MJO_ENTITIES.PaymentType, [`IsActive = 1`, `IsReversal = 0`], 'Sequence', undefined, user);
616
+ }
617
+ /* ── Subscriptions ───────────────────────────────────────────────────────────── */
618
+ /**
619
+ * Subscriptions a customer holds or benefits from.
620
+ *
621
+ * Both sides are checked because they are genuinely different roles — an employer HOLDS a seat that
622
+ * an employee BENEFITS from, and the A/R screen wants either to count as "theirs".
623
+ */
624
+ export async function GetSubscriptionsForCustomer(customer, user) {
625
+ const clauses = [];
626
+ if (customer.OrganizationID && UUID_PATTERN.test(customer.OrganizationID)) {
627
+ clauses.push(`HolderOrganizationID = '${customer.OrganizationID}'`);
628
+ }
629
+ if (customer.PersonID && UUID_PATTERN.test(customer.PersonID)) {
630
+ clauses.push(`BeneficiaryPersonID = '${customer.PersonID}'`);
631
+ }
632
+ if (!clauses.length)
633
+ return [];
634
+ return run(MJO_ENTITIES.Subscription, [`(${clauses.join(' OR ')})`], 'EndDate DESC', 50, user);
635
+ }
636
+ /**
637
+ * Coverage terms for one subscription, oldest first.
638
+ *
639
+ * A term is a PERIOD of coverage, and renewals APPEND one rather than moving a pointer. That is why
640
+ * "current" is not a field: it is the term whose window covers today, which cannot go stale.
641
+ */
642
+ export async function GetSubscriptionTerms(subscriptionID, user) {
643
+ if (!UUID_PATTERN.test(subscriptionID))
644
+ return [];
645
+ return run(MJO_ENTITIES.SubscriptionTerm, [`SubscriptionID = '${subscriptionID}'`], 'TermNumber', undefined, user);
646
+ }
647
+ /** What happened to a subscription, newest first. */
648
+ export async function GetSubscriptionEvents(subscriptionID, user) {
649
+ if (!UUID_PATTERN.test(subscriptionID))
650
+ return [];
651
+ return run(MJO_ENTITIES.SubscriptionEvent, [`SubscriptionID = '${subscriptionID}'`], 'OccurredAt DESC', undefined, user);
652
+ }
653
+ /* ── Catalog ─────────────────────────────────────────────────────────────────── */
654
+ /** Active products, for a picker. */
655
+ export async function GetProducts(options = {}) {
656
+ const filters = [
657
+ `Status = 'Active'`,
658
+ // Leftover IT-ORD-* fixture rows from the retired prefix-and-sweep catalog. They sort
659
+ // first by name, often have no price, and made Fast Entry refuse with "no price rule".
660
+ // The live catalog is ORD-WORLD (natural names). Keep this filter as a leftover guard.
661
+ `Name NOT LIKE 'IT-ORD-%'`,
662
+ ];
663
+ if (options.Search?.trim()) {
664
+ const escaped = likeText(options.Search);
665
+ filters.push(`(Name LIKE '%${escaped}%' OR SKU LIKE '%${escaped}%')`);
666
+ }
667
+ return run(MJO_ENTITIES.Product, filters, 'Name', options.MaxRows ?? 200, options.User);
668
+ }
669
+ /** Price rules, highest priority first — that is the order that resolves a tie. */
670
+ export async function GetProductPrices(user) {
671
+ return run(MJO_ENTITIES.ProductPrice, [], 'Priority DESC', undefined, user);
672
+ }
673
+ /** Flatten a product + its type into the picker row. */
674
+ export function CatalogOptionFrom(product, type, listPrice) {
675
+ return {
676
+ ID: product.ID,
677
+ Name: product.Name,
678
+ SKU: product.SKU ?? '',
679
+ TypeName: product.ProductType ?? '',
680
+ ProductTypeID: product.ProductTypeID,
681
+ OrderLineExtensionEntity: type?.OrderLineExtensionEntity ?? null,
682
+ CompanyName: product.Company ?? '',
683
+ ListPrice: product.StandaloneSellingPrice || listPrice || 0,
684
+ Taxable: !!product.IsTaxable,
685
+ MaxQuantityPerLine: readMaxQuantityPerLine(product),
686
+ };
687
+ }
688
+ function readMaxQuantityPerLine(product) {
689
+ const value = product.MaxQuantityPerLine;
690
+ return typeof value === 'number' && Number.isFinite(value) ? value : null;
691
+ }
692
+ /**
693
+ * Products the picker can add, with an indicative list price.
694
+ *
695
+ * The figure comes from the PRICE RULES, not `StandaloneSellingPrice`: SSP is
696
+ * null for anything priced by a rule, and rendering that as $0.00 tells an
697
+ * order taker the item is free. The engine still resolves the real price on
698
+ * the line.
699
+ */
700
+ let catalogCache = null;
701
+ let catalogLoad = null;
702
+ /** Catalog picker rows, loaded once per session. */
703
+ export async function GetCatalogOptions(user) {
704
+ if (catalogCache)
705
+ return catalogCache;
706
+ if (catalogLoad)
707
+ return catalogLoad;
708
+ catalogLoad = loadCatalogOptions(user).then((rows) => {
709
+ catalogCache = rows;
710
+ catalogLoad = null;
711
+ return rows;
712
+ });
713
+ return catalogLoad;
714
+ }
715
+ async function loadCatalogOptions(user) {
716
+ const [products, prices, types] = await Promise.all([
717
+ GetProducts({ MaxRows: 500, User: user }),
718
+ GetProductPrices(user),
719
+ GetProductTypes(user),
720
+ ]);
721
+ const byProduct = new Map();
722
+ for (const price of prices) {
723
+ if (!byProduct.has(price.ProductID))
724
+ byProduct.set(price.ProductID, price.Amount);
725
+ }
726
+ const typesById = new Map(types.map((type) => [type.ID, type]));
727
+ return products.map((product) => CatalogOptionFrom(product, typesById.get(product.ProductTypeID), byProduct.get(product.ID) ?? 0));
728
+ }
729
+ /** Promotions, newest window first. */
730
+ export async function GetPromotions(user) {
731
+ return run(MJO_ENTITIES.Promotion, [],
732
+ // The window columns are EffectiveFrom/EffectiveTo. `StartDate` does not exist on this
733
+ // entity, and ordering by it made SQL Server reject the whole query — so the promotions
734
+ // screen showed "No promotions", which reads as an empty catalog rather than a broken one.
735
+ 'EffectiveFrom DESC', undefined, user);
736
+ }
737
+ /** Categories, which supply a product's defaults when it states none. */
738
+ export async function GetProductCategories(user) {
739
+ return run(MJO_ENTITIES.ProductCategory, [`IsActive = 1`], 'Name', undefined, user);
740
+ }
741
+ /**
742
+ * Product types — the behaviour root.
743
+ *
744
+ * A type decides recognition, taxability, fulfilment and recurrence, and every order line inherits
745
+ * those answers. That is why an order screen never asks.
746
+ */
747
+ export async function GetProductTypes(user) {
748
+ return run(MJO_ENTITIES.ProductType, [`IsActive = 1`], 'Name', undefined, user);
749
+ }
750
+ /** Price lists — the named sets a customer can be assigned to. */
751
+ export async function GetPriceLists(user) {
752
+ return run(MJO_ENTITIES.PriceList, [], 'Name', undefined, user);
753
+ }
754
+ /**
755
+ * Quantity bands, in the order they are read.
756
+ *
757
+ * A band belongs to a PRICE, not a product: the same product can be banded differently on two price
758
+ * lists, which is the point of having price lists.
759
+ */
760
+ export async function GetPriceTiers(user) {
761
+ return run(MJO_ENTITIES.PriceTier, [], 'SortOrder', undefined, user);
762
+ }
763
+ /** Charge types, in the sequence they compute. */
764
+ export async function GetChargeTypes(user) {
765
+ return run(MJO_ENTITIES.ChargeType, [],
766
+ // Sequence, not name: the ORDER is the behaviour — non-tax charges run first and enlarge the
767
+ // taxable base, tax charges run after.
768
+ 'Sequence', undefined, user);
769
+ }
770
+ /** Customer exemption certificates, newest first. */
771
+ export async function GetTaxExemptions(user) {
772
+ return run(MJO_ENTITIES.TaxExemption, [], 'StartedAt DESC', undefined, user);
773
+ }
774
+ /* ── Tax reference data, read from ACCOUNTING ─────────────────────────────────
775
+ *
776
+ * Jurisdictions, rates and nexus belong to the accounting app; Orders consumes them. That direction
777
+ * is deliberate (D44) — cross-app references point UP the graph, so tax can be reasoned about
778
+ * without knowing anything about orders.
779
+ *
780
+ * Typed as `Record<string, unknown>` rather than an accounting row type: importing accounting's
781
+ * generated types into this package would pull a second app's schema into every screen's compile,
782
+ * and these three feed a read-only reference table. The moment one of them drives a DECISION here,
783
+ * it should take the real type.
784
+ */
785
+ /** Tax jurisdictions with their current rates. */
786
+ export async function GetTaxJurisdictions(user) {
787
+ return run(MJO_ACCOUNTING_ENTITIES.TaxJurisdiction, [`IsActive = 1`], 'Name', undefined, user);
788
+ }
789
+ /** Rates, newest effective window first. */
790
+ export async function GetTaxRates(user) {
791
+ return run(MJO_ACCOUNTING_ENTITIES.TaxRate, [], 'EffectiveFrom DESC', undefined, user);
792
+ }
793
+ /**
794
+ * Where each company is registered to collect.
795
+ *
796
+ * Nexus is the question that decides whether tax applies at all — a rate without a registration is a
797
+ * rate we must NOT charge.
798
+ */
799
+ export async function GetTaxNexus(user) {
800
+ return run(MJO_ACCOUNTING_ENTITIES.CompanyTaxNexus, [], 'RegisteredFrom DESC', undefined, user);
801
+ }
802
+ /* ── Parties ─────────────────────────────────────────────────────────────────── */
803
+ /**
804
+ * Customers matching a query — organizations and people together.
805
+ *
806
+ * BOTH are searched because an order can be billed to either, and making the user choose which KIND
807
+ * of party they are looking for before they have found it is a question the screen can answer itself.
808
+ *
809
+ * Typed as `Record<string, unknown>` inside: the party model belongs to the COMMON app, and its
810
+ * generated types are not a dependency of this package. The shape that leaves here is
811
+ * `MJOCustomerOption`, which is what the picker actually renders.
812
+ */
813
+ export async function SearchCustomers(query, user) {
814
+ const text = query.trim();
815
+ if (text.length < 2)
816
+ return [];
817
+ const escaped = likeText(text);
818
+ const [orgs, people] = await Promise.all([
819
+ run(MJO_COMMON_ENTITIES.Organization, [`Name LIKE '%${escaped}%'`], 'Name', 20, user),
820
+ run(MJO_COMMON_ENTITIES.Person, [`(FirstName LIKE '%${escaped}%' OR LastName LIKE '%${escaped}%' OR Email LIKE '%${escaped}%')`], 'LastName', 20, user),
821
+ ]);
822
+ return [
823
+ ...orgs.map((o) => ({
824
+ ID: String(o['ID']),
825
+ Name: String(o['Name'] ?? ''),
826
+ IsOrganization: true,
827
+ Email: o['Email'] ?? null,
828
+ })),
829
+ ...people.map((p) => ({
830
+ ID: String(p['ID']),
831
+ Name: [p['FirstName'], p['LastName']].filter(Boolean).join(' ').trim() || String(p['Email'] ?? ''),
832
+ IsOrganization: false,
833
+ Email: p['Email'] ?? null,
834
+ })),
835
+ ];
836
+ }
837
+ /**
838
+ * The customers this desk has billed most recently, newest first.
839
+ *
840
+ * WHY THIS EXISTS. The customer field only searched, and only from two characters in — so an order
841
+ * taker facing an empty box had to already know a name to type. On seeded data that is close to
842
+ * unusable, and even on real data it makes the commonest case — the customer you billed an hour ago
843
+ * — the slowest one.
844
+ *
845
+ * RECENCY, not alphabetical: a desk bills the same handful of accounts over and over, so the last
846
+ * few orders predict the next one far better than the top of the alphabet does. Derived from recent
847
+ * orders rather than stored, because "who we deal with" is already recorded there and a second list
848
+ * would be one more thing to keep true.
849
+ *
850
+ * Returns the same shape as {@link SearchCustomers} so the picker renders both through one template
851
+ * and selection behaves identically.
852
+ */
853
+ export async function RecentCustomers(limit = 8, user) {
854
+ const orders = await run(MJO_ENTITIES.OrderHeader, [], 'OrderDate DESC', 80, user);
855
+ const seen = new Set();
856
+ const out = [];
857
+ for (const order of orders) {
858
+ // An order can carry BOTH a bill-to organization and a bill-to person (an employee ordering
859
+ // against their employer's account), and either is a legitimate thing to start the next
860
+ // order from — so consider both.
861
+ const candidates = [
862
+ { id: String(order.BillToOrganizationID ?? ''), name: String(order.BillToOrganization ?? ''), isOrg: true },
863
+ { id: String(order.BillToPersonID ?? ''), name: String(order.BillToPerson ?? ''), isOrg: false },
864
+ ];
865
+ for (const c of candidates) {
866
+ if (!c.id || !c.name || seen.has(c.id))
867
+ continue;
868
+ seen.add(c.id);
869
+ out.push({ ID: c.id, Name: c.name, IsOrganization: c.isOrg, Email: null });
870
+ if (out.length >= limit)
871
+ return out;
872
+ }
873
+ }
874
+ return out;
875
+ }
876
+ /**
877
+ * The companies this instance can SELL as, ordered by name.
878
+ *
879
+ * Derived from which companies own PRODUCTS rather than from the Company table: a company with
880
+ * nothing to sell cannot raise an order, and the Company table is MJ-core-wide, so it carries every
881
+ * company any app ever created. Note this does NOT exclude integration-test fixture companies —
882
+ * those own products too, so they appear here until the fixture data is purged
883
+ * (`test-harnesses/purge-fixture-data.mjs`).
884
+ */
885
+ export async function GetSellingCompanies(user) {
886
+ const products = await GetProducts({ MaxRows: 500, User: user });
887
+ const byID = new Map();
888
+ for (const p of products) {
889
+ const id = String(p.CompanyID ?? '');
890
+ if (!id)
891
+ continue;
892
+ if (!byID.has(id))
893
+ byID.set(id, String(p.Company ?? ''));
894
+ }
895
+ return [...byID].map(([ID, Name]) => ({ ID, Name })).sort((a, b) => a.Name.localeCompare(b.Name));
896
+ }
897
+ //# sourceMappingURL=orders-queries.js.map