From 9ae71efe6f603043e00480bed28cf55423afad73 Mon Sep 17 00:00:00 2001 From: Edwin Betancourt Date: Thu, 9 Nov 2023 10:41:29 -0400 Subject: [PATCH] feat: Update transcoding (#1609) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Feat: Transcoding Security (#1485) * Feat: Transcoding Security * Rename Folder security * remove / * feat: Transcoding common (#1486) * Feat: TransCoding Common * Support to File Dashboard * Feat: Transcoding Process (#1494) * Feat: Transcoding Process * Update index.ts --------- Co-authored-by: Edwin Betancourt * Support Browser (#1495) * Add All Dictionary API Services (#1498) * Feat: Support for the new service List Browser Items Request (#1499) * Feat: Support for the new service List Browser Items Request * add Langs * remove * Update operators.ts * Update operators.ts --------- Co-authored-by: Edwin Betancourt * fix: Warehouses List of session. (#1500) * Feat: Transcoding Default Value (#1501) * Feat: Transcoding Default Value * remove console.log * remove this unnecesary metadata * validate the field ids * Update default.json * minimal changes * minimal changes * Feature/update with experimental 3.1.3 (#1508) * feat: Accouting Dimentarions (#1474) * feat: Accouting viewer as form. * add accouting dimentions. * add action footer. * add filter accouting columns. * fix table column width * implement on window. * feat: POS Support Document Type (#1487) * Support Document Type * change `dialogo` to `dialog` word. --------- Co-authored-by: Edwin Betancourt * feat: Add `Accouting Viewer` on menu validate by role. (#1488) * feat: Add `Accouting Viewer` on menu. * remove unused const. * Fix: POS Error Creating Sales Order With Document Type (#1496) * Fix: POS Disable Total Payment Field (#1497) * feat: Tab web browser favicon and title. (#1502) * feat: Calendar View static. (#1503) * feat: Run process with `Smart Browser ID`. (#1505) * Feat: Todo List dashboard (#1506) * Todo LIst * Add translations * Update index.vue --------- Co-authored-by: Edwin Betancourt * Fix: Sytle Height Footer (#1507) * Fix: Sytle Height Footer * minimal changes * minimal changes --------- Co-authored-by: Elsio Sanchez <45974454+elsiosanchez@users.noreply.github.com> * feat: Add support to recent item (Transcoding). (#1510) * feat: (Transcoding) Process logs or `Process Activity`. (#1511) * feat: (Transcoding) Run Business Process. (#1512) * feat: (Transcoding) Run Business Process. * fix run cache reset. * feat: (Transcoding) Open Report (#1513) * feat: (Transcoding) Report print formats and report view (#1514) * Feat: (Transcoding) Support Get Entities (#1515) * Feat: Support Get Entities * remove console * Support Context Attributes * Support Search Value * minimal changes * Suppor Open Windows * remove console * Update window.ts * Update entities.ts * revert changes --------- Co-authored-by: Edwin Betancourt * Feat: (Transcoding) Entities (#1516) * Feat: Transcoding Entities * minimal changes * Update windowManager.js * Update window.js * Update persistence.js --------- Co-authored-by: Edwin Betancourt * fix: (Transcoding) Change warehouse. (#1517) * fix: (Transcoding) Change `Role`. (#1518) * Feat: (Transcoding) Support Tab Info on window (#1519) * Feat: Support Windows ( Tab Info) * minimal changes * minimal changes * fix: (Transcoding) Open and Run `Process`. (#1520) * feat: (Transcoding) Generate Report. (#1521) * Feat: Support Run Process WIndows (trasncoding) (#1522) * Fix: Support Lookup Process (Transcoding) (#1523) * feat: (Transcoding) Open dashboards. (#1524) * Fix: Support Default Value WIndows and Update Record (#1525) * fix: (Transcoding) Report options. (#1526) * Feat: Request Chat Entries (Transcoding) (#1529) * Feat: Support Open Form (#1530) * feat: (Transcoding) Load forms. (#1533) * feat: (Transcoding) Support Form Service Point of Sales (#1532) * Support Form Service Point of Sales * minimal changes * Feat: Support Line (Transcoding) (#1534) * Feat: Support Line (Transcoding) * minimal changes * minimal changes * copyCode * Update VPOS.js --------- Co-authored-by: Edwin Betancourt * feat: (transcoding) Mail template (#1535) * feat: (Transcoding) Mail Template * fix import file. * feat: (Transcoding) Change `Form` component to `FormDefinition`. (#1538) * Feat: Support POS Update Orders (Transcoding) (#1539) * feat: (Transcoding) `Import File Loader` form. (#1540) * Feat: Update Order Line (Transcoding) (#1541) * feat: (Transcoding) Import File Loader. (#1542) * feat: (Transcoding) `Import File Loader` process. (#1543) * feat: (Transcoding) `Import File Loader` process. * fix process. * Feat: (Transcoding) POS Create Payments (#1544) * Feat: Create Payments * minimal changes * minimal changes * Update VPOS.js --------- Co-authored-by: Edwin Betancourt * Feat: Support Convert Rate (Transcoding) (#1545) * Feat: Support Convert Rate (Transcoding) * minimal changes * feat: (Transcoding) Load `Field` from dictionary. (#1546) * feat: (Transcoding) Load Lookups. (#1547) * Feat: Support Process Order (Transcoding) (#1548) * feat: (Transcoding) `Payment Allocation` form. (#1549) * Feat: Support Display Field Payment (transcoding) (#1550) * Feat: Support Display Field Payment (transcoding) * minimal changes * feat: (Transcoding) `Payment Allocation` form. (#1551) - List Payments. - List Invoices. * Feat: Support Print Ticket and Credit Memo (Transcoding) (#1552) * Feat: Support Print Ticket and Credit Memo (Transcoding) * minimal changes * minimal changes * Feat: Support Validate Pin (transcoding) (#1553) * Feat: Support Print Ticket and Credit Memo (Transcoding) * minimal changes * minimal changes * Feat: Support Validate Pin (transcoding) * minimal changes * Feat: Refund Payment (Transcoding) (#1555) * feat: (Transcoding) List chat entries. (#1556) * feat: (Transcoding) Support to callout. (#1557) * fix: (Transcoding) Callout with comma decimal. (#1558) * Feat: Support Allowed to Refund (Transcoding) (#1559) * Feat: Support Allowed to Refund( Transcoding) * Update currencies.vue * Feat: Change Seller and Campaigns (Transcoding) (#1560) * Feat: Change Seller and Campaigns (Transcoding) * Update editQtyEntered.vue * Feat: Support to Panel the Options (#1561) * fix: (Transcoding) Load records on tab childs. (#1562) * Feat: Options Sales Orders (Transcoding) (#1563) * fix: (Transcoding) Deploy with `API_URL`. (#1566) * Feature/feat support confirm shipment transcoding (#1567) * Feat: Support Confirm Shipment (Transcoding) * minimal changes * minimal changes * Fea: Support RMA (Transcoding) (#1568) * Fea: Support RMA (Transcoding) * minimal changes * Update index.vue * Update index.vue * Update index.vue * Update previwerRMA.vue * Feat: Cash Managements (Transcoding) (#1569) * fix: (Transcoding) Cell value. (#1570) * Fix: Support Create Order from RMA (Transcoding) (#1571) * Feat: Add New Service (transcoding) (#1572) * feat: (Transcoding) Document Statutes/Actions. (#1573) * Feat: Discuent All Line (Transcoding) (#1576) * Feat: Support New Order From RMA (#1575) * fix: (Transcoding) Set resource reference. (#1578) * feat: (Transcoding) Bank Statement Match form. (#1574) * Feat: Cash Closing (Transcoding) (#1577) * Feat: Support Cash Open (transcoding) (#1579) * Feat: Support Cash Open (transcoding) * Update cashOpen.js * Feat: Assign Seller (Transcoding) (#1582) * Fix: Column `Business Partner` on `Project` window is not displayed. (#1585) * Fix: Columna SDN en Ventana de Proyectos no se visualiza solop-develop/frontend-core#1583 * minimal changes * Update index.vue * Fix: Zoom In" action fails in Vue Transcoding (#1589) * Fix: Acción "Acercar" da error en Vue Transcoding solop-develop/frontend-core#1580 * minimal changes * Minimal changes * Fix: SB does not scroll down with 50 records (#1590) * Fix: Product List when selecting from online field make wider (#1591) * Fix: Check support in text does not convert correctly to VUE (#1592) * Fix: Context Attributes (Lookup List Transcoding) (#1594) * Fix: Context Attributes (Lookup List Transcoding) * minimal changes * remove change * fix: Run Document Action. (#1596) * fix: Date value parse error. (#1597) * fix: Currency Rate `Currency` clean with default value. (#1581) (#1598) * feat: Change end-points `ReportManagement`. (#1599) * Feat:Support Field Locations Address (Transcoding) (#1600) * Feat:Support Field Locations Address (Transcoding) * minimal changes * feat: Load Payment Allocation form. (#1601) --------- Co-authored-by: Elsio Sanchez <45974454+elsiosanchez@users.noreply.github.com> --- .vscode/setting.json | 8 + build/start.sh | 2 +- config/default.json | 12 +- .../businessData/runBusinessProcess.ts | 76 + src/api/ADempiere/common/index.ts | 300 ++++ src/api/ADempiere/dashboard/index.ts | 138 ++ src/api/ADempiere/dashboard/user.js | 83 - src/api/ADempiere/dictionary/field.ts | 59 + src/api/ADempiere/dictionary/form.js | 42 - src/api/ADempiere/dictionary/index.ts | 200 +++ src/api/ADempiere/dictionary/window.js | 82 +- .../services.js => dictionary/window.ts} | 43 +- src/api/ADempiere/field/binary.js | 2 +- src/api/ADempiere/field/location.js | 2 +- src/api/ADempiere/field/locations.js | 203 +++ .../form/{VAllocation.js => VAllocation.ts} | 80 +- ...atementMatch.js => VBankStatementMatch.ts} | 4 +- src/api/ADempiere/form/VFileImport.js | 84 +- src/api/ADempiere/form/VPOS/index.js | 1564 +++++++++++++++++ src/api/ADempiere/form/point-of-sales.js | 2 +- .../{dashboard/chart.js => logs/index.ts} | 42 +- .../dashboard.js => logs/process.ts} | 53 +- .../ADempiere/logs/tabInfo/chatsEntries.ts | 113 ++ .../logs/tabInfo/windowAttachment.ts | 83 + .../logs/tabInfo/windowDashboards.ts | 37 + .../ADempiere/logs/tabInfo/windowIssues.ts | 34 + src/api/ADempiere/process.js | 40 - src/api/ADempiere/report.js | 125 +- .../ADempiere/reportManagement/drillTable.ts | 42 + src/api/ADempiere/reportManagement/index.ts | 45 + .../ADempiere/reportManagement/printFormat.ts | 42 + .../reportView.ts} | 56 +- src/api/ADempiere/security/index.ts | 201 +++ .../component/{index.js => index.ts} | 13 +- .../user-interface/component/issue.js | 25 +- .../ADempiere/userInterface/browserList.ts | 48 + .../ADempiere/userInterface/defaultValue.ts | 92 + src/api/ADempiere/userInterface/entities.ts | 145 ++ src/api/ADempiere/userInterface/lookups.ts | 92 + src/api/ADempiere/userInterface/window.ts | 57 + src/api/ADempiere/window.js | 254 +-- src/api/ADempiere/workflow.js | 64 +- src/api/role.js | 37 - src/api/user.js | 106 -- src/components/ADempiere/ActionMenu/index.vue | 40 +- .../ADempiere/ActionMenu/menuMobile.vue | 34 +- .../ADempiere/ContainerInfo/recordLogs.vue | 2 +- .../ContainerOptions/LockRecord/index.vue | 20 +- .../Dashboard/UnsupportedDashboard.vue | 26 +- .../ADempiere/Dashboard/activities.vue | 31 +- .../ADempiere/Dashboard/charts/AreaChart.vue | 30 +- .../ADempiere/Dashboard/charts/BarChart.vue | 30 +- .../Dashboard/charts/CustomerChart.vue | 30 +- .../ADempiere/Dashboard/charts/Gauge.vue | 30 +- .../ADempiere/Dashboard/charts/LineChart.vue | 30 +- .../ADempiere/Dashboard/charts/PieChart.vue | 30 +- .../Dashboard/charts/RaddarChart.vue | 30 +- .../ADempiere/Dashboard/charts/Scatter.vue | 30 +- .../Dashboard/charts/WaterfallChart.vue | 30 +- .../ADempiere/Dashboard/docstatus/index.vue | 53 +- src/components/ADempiere/Dashboard/index.vue | 30 +- .../ADempiere/Dashboard/mixinDashboard.js | 42 +- .../ADempiere/Dashboard/recentItems/index.vue | 70 +- .../Dashboard/userfavorites/index.vue | 55 +- .../ADempiere/DataTable/Browser/index.vue | 1 + .../DataTable/Components/CellDisplayInfo.vue | 34 +- .../DataTable/Components/CustomPagination.vue | 24 +- .../ADempiere/DataTable/Windows/index.vue | 32 +- .../ADempiere/FieldDefinition/FieldDate.vue | 120 +- .../FieldLocationAddress/Fields/Address.vue | 60 + .../FieldLocationAddress/Fields/Address2.vue | 60 + .../FieldLocationAddress/Fields/Address3.vue | 60 + .../FieldLocationAddress/Fields/Address4.vue | 60 + .../FieldLocationAddress/Fields/City.vue | 88 + .../FieldLocationAddress/Fields/CityLabel.vue | 72 + .../FieldLocationAddress/Fields/Country.vue | 96 + .../Fields/PosalCodeAdditional.vue | 64 + .../Fields/PostalCode.vue | 64 + .../FieldLocationAddress/Fields/Regions.vue | 96 + .../FieldLocationAddress/index.vue | 23 +- .../locationAddressForm2.vue | 208 +++ .../FieldOptions/ChangeLogs/index.vue | 2 +- .../FieldOptions/DocumentStatus/index.vue | 10 +- .../FieldOptions/fieldOptionsList.js | 12 +- .../ADempiere/FieldDefinition/FieldSelect.vue | 4 +- .../FieldSelect/emptyOptionSelect.vue | 62 + .../FieldDefinition/FieldYesNo/index.vue | 30 +- .../ADempiere/FieldDefinition/index.vue | 42 +- .../FieldDefinition/mixin/mixinField.js | 6 +- .../ADempiere/FileRender/PdfFile/index.vue | 54 +- src/components/ADempiere/FileRender/index.vue | 30 +- .../FilterFields/fieldsDisplayOptions.vue | 34 +- .../ADempiere/FilterFields/index.vue | 34 +- .../SelectFile/importFormatFields.vue | 115 -- .../Form/VFileImport/SelectFile/index.vue | 428 ----- .../VFileImport/SelectFile/tableRecords.vue | 92 - .../ADempiere/Form/VFileImport/index2.vue | 384 ---- .../Form/VFileImport/saveProcess.vue | 566 ------ .../Form/VFileImport/selectTable.vue | 473 ----- .../BusinessPartner/businessPartnerUpdate.vue | 2 +- .../ADempiere/Form/VPOS/Collection/index.vue | 4 +- .../Form/VPOS/Collection/typeCollection.vue | 2 +- .../Order/line/infoOrderLine/imageProduct.vue | 2 +- .../VPOS2/Collection/ButtonGroupOptions.vue | 212 +++ .../VPOS2/Collection/Charge/Field/bank.vue | 96 + .../Collection/Charge/Field/banksAccounts.vue | 147 ++ .../Collection/Charge/Field/creditMemo.vue | 149 ++ .../Collection/Charge/Field/currencies.vue | 146 ++ .../Collection/Charge/Field/fieldSelect.vue | 142 ++ .../Collection/Charge/Field/issuingBank.vue | 105 ++ .../Charge/Field/paymentMethods.vue | 77 + .../Collection/Charge/Field/recipientBank.vue | 96 + .../Form/VPOS2/Collection/Charge/index.vue | 334 ++++ .../Form/VPOS2/Collection/InfoCollection.vue | 182 ++ .../Collection/Payments/CardPayments.vue | 182 ++ .../Form/VPOS2/Collection/Payments/index.vue | 85 + .../Collection/Refund/Field/accountNo.vue | 76 + .../VPOS2/Collection/Refund/Field/bank.vue | 99 ++ .../Refund/Field/bankAccountType.vue | 99 ++ .../Collection/Refund/Field/banksAccounts.vue | 175 ++ .../Collection/Refund/Field/creditMemo.vue | 150 ++ .../Collection/Refund/Field/currencies.vue | 174 ++ .../VPOS2/Collection/Refund/Field/date.vue | 85 + .../Collection/Refund/Field/description.vue | 86 + .../Collection/Refund/Field/fieldSelect.vue | 142 ++ .../Collection/Refund/Field/issuingBank.vue | 106 ++ .../Refund/Field/paymentMethods.vue | 113 ++ .../VPOS2/Collection/Refund/Field/phone.vue | 76 + .../Collection/Refund/Field/recipientBank.vue | 97 + .../Collection/Refund/Field/referenceNo.vue | 84 + .../VPOS2/Collection/Refund/Field/value.vue | 76 + .../Form/VPOS2/Collection/Refund/index.vue | 469 +++++ .../ADempiere/Form/VPOS2/Collection/index.vue | 58 + .../ADempiere/Form/VPOS2/DialogInfo/index.vue | 161 ++ .../Form/VPOS2/DialogInfo/infoOrder.vue | 139 ++ .../Form/VPOS2/DialogInfo/openBalance.vue | 85 + .../VPOS2/DialogInfo/overdrawnInvoice.vue | 174 ++ .../ADempiere/Form/VPOS2/DialogInfo/pin.vue | 168 ++ .../VPOS2/FooterOrder/ButtonGroupOptions.vue | 99 ++ .../Form/VPOS2/FooterOrder/InfoOrder.vue | 284 +++ .../Form/VPOS2/FooterOrder/OptionsList.vue | 341 ++++ .../Form/VPOS2/FooterOrder/index.vue | 69 + .../HeaderOrder/ActionsOrder/ListOrders.vue | 269 +++ .../VPOS2/HeaderOrder/ActionsOrder/index.vue | 424 +++++ .../HeaderOrder/Customer/ListCostumer.vue | 253 +++ .../HeaderOrder/Customer/NewCustomer.vue | 297 ++++ .../Form/VPOS2/HeaderOrder/Customer/index.vue | 265 +++ .../ProductInfo/ProductListTable.vue | 284 +++ .../HeaderOrder/ProductInfo/SearchProduct.vue | 215 +++ .../Form/VPOS2/HeaderOrder/index.vue | 92 + .../OptionLine/editLine/editAmount.vue | 58 + .../OptionLine/editLine/editQtyEntered.vue | 64 + .../OptionLine/editLine/fieldAmount.vue | 101 ++ .../MainOrder/OptionLine/editLine/index.vue | 443 +++++ .../Form/VPOS2/MainOrder/OptionLine/index.vue | 75 + .../VPOS2/MainOrder/OptionLine/infoLine.vue | 157 ++ .../ADempiere/Form/VPOS2/MainOrder/index.vue | 320 ++++ .../Form/VPOS2/Options/RMA/index.vue | 336 ++++ .../Form/VPOS2/Options/RMA/infoRMA.vue | 190 ++ .../Form/VPOS2/Options/RMA/previwerRMA.vue | 321 ++++ .../Form/VPOS2/Options/Shipments/index.vue | 251 +++ .../Form/VPOS2/Options/Shipments/info.vue | 101 ++ .../Form/VPOS2/Options/Shipments/lineInfo.vue | 140 ++ .../cashManagement/cashClosing/index.vue | 79 + .../cashManagement/cashClosing/panel.vue | 128 ++ .../cashManagement/cashDetailClosing.vue | 79 + .../cashOpening/fields/cashBank.vue | 107 ++ .../cashOpening/fields/collectionAgent.vue | 130 ++ .../cashOpening/fields/currency.vue | 96 + .../cashOpening/fields/paymentMethods.vue | 105 ++ .../cashManagement/cashOpening/index.vue | 84 + .../cashManagement/cashOpening/info.vue | 131 ++ .../cashManagement/cashOpening/panel.vue | 300 ++++ .../Options/cashManagement/cashWithdrawal.vue | 62 + .../VPOS2/Options/cashManagement/index.vue | 119 ++ .../VPOS2/Options/cashManagement/seller.vue | 63 + .../Options/cashManagement/seller/index.vue | 80 + .../Options/cashManagement/seller/panel.vue | 186 ++ .../Options/cashManagement/unassignSeller.vue | 80 + .../ADempiere/Form/VPOS2/Options/index.vue | 99 ++ .../Form/VPOS2/Options/salesOrder.vue | 921 ++++++++++ src/components/ADempiere/Form/VPOS2/index.vue | 169 ++ .../VAllocation/components/InvoceTable.vue | 70 +- .../VAllocation/components/Payments.vue | 70 +- .../VAllocation/components/PaymentsTable.vue | 79 +- .../VAllocation/components/SearchCriteria.vue | 146 +- .../VAllocation/components/Summary.vue | 43 +- .../VAllocation/components/headersInvoice.js | 32 +- .../VAllocation/components/headersPayments.js | 32 +- .../VAllocation/index.vue | 53 +- .../VBankStatementMatch/AutomaticMatch.vue | 0 .../ManualMatch/currentPayments.vue | 0 .../ManualMatch/importedPayments.vue | 0 .../VBankStatementMatch/ManualMatch/index.vue | 0 .../SaveData/ResultTable.vue | 0 .../SaveData/bankStatementInfo.vue | 0 .../VBankStatementMatch/SaveData/index.vue | 0 .../SearchCriteria/bankAccount.vue | 74 + .../SearchCriteria/bankAccountsList.vue} | 30 +- .../SearchCriteria/bankStatement.vue | 32 +- .../SearchCriteria/businessPartnersList.vue} | 26 +- .../SearchCriteria/index.vue | 42 +- .../SearchCriteria/searchMode.vue | 0 .../containerManagerFrom.ts | 0 .../VBankStatementMatch/index.vue | 0 .../SelectFile/importFormatFields.vue | 112 ++ .../VFileImport/SelectFile/index.vue | 256 +++ .../VFileImport/SelectFile/selectResource.vue | 53 +- .../VFileImport/SelectFile/tableRecords.vue | 117 ++ .../VFileImport/SelectTable/charsetsList.vue | 115 ++ .../SelectTable/importFormatsList.vue | 120 ++ .../VFileImport/SelectTable/index.vue | 267 +++ .../VFileImport/index.vue | 111 +- .../VFileImport/saveProcess.vue | 329 ++++ .../{Form => FormDefinition}/index.vue | 43 +- .../ADempiere/ModalDialog/index.vue | 5 +- .../PanelDefinition/DocumentAction.vue | 34 +- .../PanelDefinition/DraggablePanel.vue | 34 +- .../ADempiere/PanelDefinition/SortPanel.vue | 40 +- .../PanelDefinition/StandardPanel.vue | 4 +- .../ADempiere/PanelDefinition/TreePanel.vue | 34 +- .../PanelDefinition/UnsupportedPanel.vue | 33 +- .../ADempiere/PanelDefinition/index.vue | 30 +- .../ADempiere/PanelFooter/index.vue | 6 +- .../AttachmentManager/modeDesktop.vue | 26 +- .../AttachmentManager/modeMobile.vue | 26 +- .../AttachmentManager/uploadResource.vue | 51 +- .../Component/workflowLogs/index.vue | 30 +- .../ReportManager/Setup/optionsReport.vue | 41 +- .../Setup/optionsReportViewer.vue | 58 +- .../TabManager/TabPanel/modeDesktop.vue | 30 +- .../convenienceButtons/DeleteRecordButton.vue | 13 +- .../convenienceButtons/NewRecordButton.vue | 4 +- .../convenienceButtons/OptionsSecuence.vue | 4 +- .../RefreshRecordButton.vue | 58 +- .../convenienceButtons/SaveRecordButton.vue | 13 +- .../convenienceButtons/UndoChangeButton.vue | 4 +- .../convenienceButtons/documentAction.vue | 44 +- .../convenienceButtons/documentStatus.vue | 4 +- .../TabManager/convenienceButtons/index.vue | 38 +- src/components/ADempiere/TabManager/index.vue | 68 +- .../ADempiere/TabManager/tabChild.vue | 2 + .../WorkflowManager/WorkflowDiagram.vue | 36 +- .../WorkflowManager/WorkflowStatusBar.vue | 41 +- src/lang/ADempiere/en/field/index.js | 4 +- .../ADempiere/en/field/locationsAddress.js | 31 + src/lang/ADempiere/en/form/pointOfSales.js | 28 +- src/lang/ADempiere/en/index.js | 22 +- src/lang/ADempiere/en/operators.ts | 38 + src/lang/ADempiere/es/field/index.js | 4 +- .../ADempiere/es/field/locationsAddress.js | 31 + src/lang/ADempiere/es/form/pointOfSales.js | 28 +- src/lang/ADempiere/es/index.js | 22 +- src/lang/ADempiere/es/operators.ts | 38 + src/layout/components/AppMain.vue | 5 +- src/layout/components/Navbar.vue | 2 +- src/main.js | 5 +- src/router/modules/ADempiere/menu.js | 11 +- src/router/modules/ADempiere/staticRoutes.js | 17 +- src/store/index.js | 2 +- src/store/modules/ADempiere/DocumentsTaks.js | 33 +- .../modules/ADempiere/actionMenuManager.js | 34 +- .../modules/ADempiere/attachmentManager.js | 10 +- src/store/modules/ADempiere/browserManager.js | 36 +- .../modules/ADempiere/businessPartnerPOS.js | 2 +- src/store/modules/ADempiere/calloutManager.js | 59 +- src/store/modules/ADempiere/chatEntries.js | 11 +- .../modules/ADempiere/containerInfo/index.js | 12 +- src/store/modules/ADempiere/dashboard.js | 23 +- src/store/modules/ADempiere/data/actions.js | 3 +- .../modules/ADempiere/defaultValueManager.js | 54 +- .../ADempiere/dictionary/browser/actions.js | 24 +- .../ADempiere/dictionary/browser/getters.js | 16 +- .../ADempiere/dictionary/browser/mutations.js | 8 +- .../ADempiere/dictionary/process/actions.js | 24 +- .../ADempiere/dictionary/process/getters.js | 20 +- .../ADempiere/dictionary/process/mutations.js | 32 +- .../ADempiere/dictionary/report/actions.js | 65 +- .../ADempiere/dictionary/report/getters.js | 49 +- .../ADempiere/dictionary/report/mutations.js | 33 +- .../ADempiere/dictionary/window/actions.js | 39 +- .../ADempiere/dictionary/window/getters.js | 5 +- .../modules/ADempiere/documentManager.js | 29 +- .../ADempiere/field/businessPartnerInfo.js | 2 +- .../ADempiere/field/locationAddress.js | 2 +- .../modules/ADempiere/field/locations.js | 400 +++++ .../modules/ADempiere/fieldDefinition.js | 46 +- .../modules/ADempiere/form/VAllocation.js | 61 +- .../ADempiere/form/VBankStatementMatch.js | 2 +- .../modules/ADempiere/form/VFileImport.js | 205 ++- .../modules/ADempiere/form/VPOS/collection.js | 354 ++++ .../modules/ADempiere/form/VPOS/customer.js | 114 ++ .../modules/ADempiere/form/VPOS/dialogInfo.js | 94 + .../ADempiere/form/VPOS/fieldsCollections.js | 529 ++++++ .../modules/ADempiere/form/VPOS/index.js | 389 ++++ .../modules/ADempiere/form/VPOS/lines.js | 371 ++++ .../modules/ADempiere/form/VPOS/options.js | 1261 +++++++++++++ .../VPOS/options/cashManagement/cashOpen.js | 274 +++ .../VPOS/options/cashManagement/seller.js | 122 ++ .../modules/ADempiere/form/VPOS/order.js | 497 ++++++ .../ADempiere/form/VPOS/productList.js | 119 ++ .../modules/ADempiere/form/expressShipment.js | 6 +- .../{issues.js => form/issueManagement.js} | 5 +- .../ADempiere/form/workflowActivity.js | 17 +- src/store/modules/ADempiere/formDefinition.js | 47 +- .../modules/ADempiere/languageManager.js | 2 +- src/store/modules/ADempiere/lookupManager.js | 146 +- .../{form/issues.js => mailTemplate.js} | 23 +- src/store/modules/ADempiere/panelWindows.js | 5 +- src/store/modules/ADempiere/persistence.js | 62 +- .../ADempiere/pointOfSales/campaigns.js | 10 +- .../pointOfSales/payments/actions.js | 6 +- .../pointOfSales/payments/getters.js | 6 +- src/store/modules/ADempiere/processLog.js | 46 +- src/store/modules/ADempiere/processManager.js | 30 +- src/store/modules/ADempiere/reportManager.js | 222 +-- src/store/modules/ADempiere/sessionContext.js | 36 +- src/store/modules/ADempiere/system.js | 12 +- src/store/modules/ADempiere/windowManager.js | 57 +- src/store/modules/app.js | 6 +- src/store/modules/user.js | 125 +- src/styles/ADempiere/view.scss | 33 +- src/utils/ADempiere/apiConverts/dictionary.js | 4 - src/utils/ADempiere/apiConverts/report.js | 18 - src/utils/ADempiere/componentUtils.js | 145 +- src/utils/ADempiere/constants/process.js | 33 +- .../contextUtils/contextAttributes.js | 20 +- src/utils/ADempiere/coreUtils.js | 18 +- src/utils/ADempiere/dataUtils.js | 44 +- src/utils/ADempiere/dictionary/browser.js | 11 +- .../dictionary/field/locationAddress.js | 95 + .../ADempiere/dictionary/form/VAllocation.js} | 17 +- src/utils/ADempiere/dictionary/form/VPOS.js | 454 +++++ src/utils/ADempiere/dictionary/form/index.js | 11 +- src/utils/ADempiere/dictionary/process.js | 60 +- .../dictionary/process/actionsMenu.ts | 60 + src/utils/ADempiere/dictionary/report.js | 138 +- .../dictionary/report/actionsMenu.ts | 153 ++ src/utils/ADempiere/dictionary/window.js | 31 +- src/utils/ADempiere/formatValue/dateFormat.js | 4 +- .../ADempiere/formatValue/iterableFormat.js | 10 +- .../ADempiere/formatValue/numberFormat.js | 44 +- .../ADempiere/formatValue/stringFormat.js | 6 +- src/utils/ADempiere/globalMethods.js | 4 +- src/utils/ADempiere/lookupFactory.js | 36 +- src/utils/ADempiere/lookups.ts | 61 + src/utils/ADempiere/references.js | 2 +- src/utils/ADempiere/request.js | 4 +- src/utils/ADempiere/resource.js | 11 +- src/utils/ADempiere/valueUtils.js | 74 +- src/utils/request.js | 11 +- src/views/ADempiere/Browser/index.vue | 48 +- src/views/ADempiere/Charts/index.vue | 23 +- src/views/ADempiere/Form/index.vue | 237 ++- src/views/ADempiere/Process/index.vue | 124 +- src/views/ADempiere/Process/mixinProcess.js | 52 +- src/views/ADempiere/Report/index.vue | 77 +- src/views/ADempiere/Report/mixinReport.js | 23 +- src/views/ADempiere/ReportViewer/index.vue | 61 +- src/views/ADempiere/Window/index.vue | 2 +- .../dashboard/admin/components/PanelGroup.vue | 5 +- .../admin/components/TodoList/index.scss | 2 +- src/views/dashboard/admin/index.vue | 35 +- src/views/login/index.vue | 3 +- src/views/profile/components/RolesNavbar.vue | 8 +- 365 files changed, 28324 insertions(+), 6038 deletions(-) create mode 100644 .vscode/setting.json create mode 100644 src/api/ADempiere/businessData/runBusinessProcess.ts create mode 100644 src/api/ADempiere/common/index.ts create mode 100644 src/api/ADempiere/dashboard/index.ts delete mode 100644 src/api/ADempiere/dashboard/user.js create mode 100644 src/api/ADempiere/dictionary/field.ts delete mode 100644 src/api/ADempiere/dictionary/form.js create mode 100644 src/api/ADempiere/dictionary/index.ts rename src/api/ADempiere/{open-id/services.js => dictionary/window.ts} (58%) create mode 100644 src/api/ADempiere/field/locations.js rename src/api/ADempiere/form/{VAllocation.js => VAllocation.ts} (70%) rename src/api/ADempiere/form/{VBankStatementMatch.js => VBankStatementMatch.ts} (98%) create mode 100644 src/api/ADempiere/form/VPOS/index.js rename src/api/ADempiere/{dashboard/chart.js => logs/index.ts} (68%) rename src/api/ADempiere/{dashboard/dashboard.js => logs/process.ts} (51%) create mode 100644 src/api/ADempiere/logs/tabInfo/chatsEntries.ts create mode 100644 src/api/ADempiere/logs/tabInfo/windowAttachment.ts create mode 100644 src/api/ADempiere/logs/tabInfo/windowDashboards.ts create mode 100644 src/api/ADempiere/logs/tabInfo/windowIssues.ts create mode 100644 src/api/ADempiere/reportManagement/drillTable.ts create mode 100644 src/api/ADempiere/reportManagement/index.ts create mode 100644 src/api/ADempiere/reportManagement/printFormat.ts rename src/api/ADempiere/{dashboard/tasks.js => reportManagement/reportView.ts} (52%) create mode 100644 src/api/ADempiere/security/index.ts rename src/api/ADempiere/user-interface/component/{index.js => index.ts} (78%) create mode 100644 src/api/ADempiere/userInterface/browserList.ts create mode 100644 src/api/ADempiere/userInterface/defaultValue.ts create mode 100644 src/api/ADempiere/userInterface/entities.ts create mode 100644 src/api/ADempiere/userInterface/lookups.ts create mode 100644 src/api/ADempiere/userInterface/window.ts create mode 100644 src/components/ADempiere/FieldDefinition/FieldLocationAddress/Fields/Address.vue create mode 100644 src/components/ADempiere/FieldDefinition/FieldLocationAddress/Fields/Address2.vue create mode 100644 src/components/ADempiere/FieldDefinition/FieldLocationAddress/Fields/Address3.vue create mode 100644 src/components/ADempiere/FieldDefinition/FieldLocationAddress/Fields/Address4.vue create mode 100644 src/components/ADempiere/FieldDefinition/FieldLocationAddress/Fields/City.vue create mode 100644 src/components/ADempiere/FieldDefinition/FieldLocationAddress/Fields/CityLabel.vue create mode 100644 src/components/ADempiere/FieldDefinition/FieldLocationAddress/Fields/Country.vue create mode 100644 src/components/ADempiere/FieldDefinition/FieldLocationAddress/Fields/PosalCodeAdditional.vue create mode 100644 src/components/ADempiere/FieldDefinition/FieldLocationAddress/Fields/PostalCode.vue create mode 100644 src/components/ADempiere/FieldDefinition/FieldLocationAddress/Fields/Regions.vue create mode 100644 src/components/ADempiere/FieldDefinition/FieldLocationAddress/locationAddressForm2.vue create mode 100644 src/components/ADempiere/FieldDefinition/FieldSelect/emptyOptionSelect.vue delete mode 100644 src/components/ADempiere/Form/VFileImport/SelectFile/importFormatFields.vue delete mode 100644 src/components/ADempiere/Form/VFileImport/SelectFile/index.vue delete mode 100644 src/components/ADempiere/Form/VFileImport/SelectFile/tableRecords.vue delete mode 100644 src/components/ADempiere/Form/VFileImport/index2.vue delete mode 100644 src/components/ADempiere/Form/VFileImport/saveProcess.vue delete mode 100644 src/components/ADempiere/Form/VFileImport/selectTable.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/ButtonGroupOptions.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Charge/Field/bank.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Charge/Field/banksAccounts.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Charge/Field/creditMemo.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Charge/Field/currencies.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Charge/Field/fieldSelect.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Charge/Field/issuingBank.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Charge/Field/paymentMethods.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Charge/Field/recipientBank.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Charge/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/InfoCollection.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Payments/CardPayments.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Payments/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/accountNo.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/bank.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/bankAccountType.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/banksAccounts.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/creditMemo.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/currencies.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/date.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/description.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/fieldSelect.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/issuingBank.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/paymentMethods.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/phone.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/recipientBank.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/referenceNo.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/Field/value.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/Refund/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Collection/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/DialogInfo/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/DialogInfo/infoOrder.vue create mode 100644 src/components/ADempiere/Form/VPOS2/DialogInfo/openBalance.vue create mode 100644 src/components/ADempiere/Form/VPOS2/DialogInfo/overdrawnInvoice.vue create mode 100644 src/components/ADempiere/Form/VPOS2/DialogInfo/pin.vue create mode 100644 src/components/ADempiere/Form/VPOS2/FooterOrder/ButtonGroupOptions.vue create mode 100644 src/components/ADempiere/Form/VPOS2/FooterOrder/InfoOrder.vue create mode 100644 src/components/ADempiere/Form/VPOS2/FooterOrder/OptionsList.vue create mode 100644 src/components/ADempiere/Form/VPOS2/FooterOrder/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/HeaderOrder/ActionsOrder/ListOrders.vue create mode 100644 src/components/ADempiere/Form/VPOS2/HeaderOrder/ActionsOrder/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/HeaderOrder/Customer/ListCostumer.vue create mode 100644 src/components/ADempiere/Form/VPOS2/HeaderOrder/Customer/NewCustomer.vue create mode 100644 src/components/ADempiere/Form/VPOS2/HeaderOrder/Customer/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/HeaderOrder/ProductInfo/ProductListTable.vue create mode 100644 src/components/ADempiere/Form/VPOS2/HeaderOrder/ProductInfo/SearchProduct.vue create mode 100644 src/components/ADempiere/Form/VPOS2/HeaderOrder/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/MainOrder/OptionLine/editLine/editAmount.vue create mode 100644 src/components/ADempiere/Form/VPOS2/MainOrder/OptionLine/editLine/editQtyEntered.vue create mode 100644 src/components/ADempiere/Form/VPOS2/MainOrder/OptionLine/editLine/fieldAmount.vue create mode 100644 src/components/ADempiere/Form/VPOS2/MainOrder/OptionLine/editLine/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/MainOrder/OptionLine/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/MainOrder/OptionLine/infoLine.vue create mode 100644 src/components/ADempiere/Form/VPOS2/MainOrder/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/RMA/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/RMA/infoRMA.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/RMA/previwerRMA.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/Shipments/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/Shipments/info.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/Shipments/lineInfo.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/cashClosing/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/cashClosing/panel.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/cashDetailClosing.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/cashOpening/fields/cashBank.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/cashOpening/fields/collectionAgent.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/cashOpening/fields/currency.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/cashOpening/fields/paymentMethods.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/cashOpening/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/cashOpening/info.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/cashOpening/panel.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/cashWithdrawal.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/seller.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/seller/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/seller/panel.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/cashManagement/unassignSeller.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/index.vue create mode 100644 src/components/ADempiere/Form/VPOS2/Options/salesOrder.vue create mode 100644 src/components/ADempiere/Form/VPOS2/index.vue rename src/components/ADempiere/{Form => FormDefinition}/VAllocation/components/InvoceTable.vue (79%) rename src/components/ADempiere/{Form => FormDefinition}/VAllocation/components/Payments.vue (94%) rename src/components/ADempiere/{Form => FormDefinition}/VAllocation/components/PaymentsTable.vue (81%) rename src/components/ADempiere/{Form => FormDefinition}/VAllocation/components/SearchCriteria.vue (85%) rename src/components/ADempiere/{Form => FormDefinition}/VAllocation/components/Summary.vue (65%) rename src/components/ADempiere/{Form => FormDefinition}/VAllocation/components/headersInvoice.js (64%) rename src/components/ADempiere/{Form => FormDefinition}/VAllocation/components/headersPayments.js (58%) rename src/components/ADempiere/{Form => FormDefinition}/VAllocation/index.vue (73%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/AutomaticMatch.vue (100%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/ManualMatch/currentPayments.vue (100%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/ManualMatch/importedPayments.vue (100%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/ManualMatch/index.vue (100%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/SaveData/ResultTable.vue (100%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/SaveData/bankStatementInfo.vue (100%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/SaveData/index.vue (100%) create mode 100644 src/components/ADempiere/FormDefinition/VBankStatementMatch/SearchCriteria/bankAccount.vue rename src/components/ADempiere/{Form/VBankStatementMatch/SearchCriteria/bankAccount.vue => FormDefinition/VBankStatementMatch/SearchCriteria/bankAccountsList.vue} (76%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/SearchCriteria/bankStatement.vue (80%) rename src/components/ADempiere/{Form/VBankStatementMatch/SearchCriteria/businessPartner.vue => FormDefinition/VBankStatementMatch/SearchCriteria/businessPartnersList.vue} (73%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/SearchCriteria/index.vue (83%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/SearchCriteria/searchMode.vue (100%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/containerManagerFrom.ts (100%) rename src/components/ADempiere/{Form => FormDefinition}/VBankStatementMatch/index.vue (100%) create mode 100644 src/components/ADempiere/FormDefinition/VFileImport/SelectFile/importFormatFields.vue create mode 100644 src/components/ADempiere/FormDefinition/VFileImport/SelectFile/index.vue rename src/components/ADempiere/{Form => FormDefinition}/VFileImport/SelectFile/selectResource.vue (61%) create mode 100644 src/components/ADempiere/FormDefinition/VFileImport/SelectFile/tableRecords.vue create mode 100644 src/components/ADempiere/FormDefinition/VFileImport/SelectTable/charsetsList.vue create mode 100644 src/components/ADempiere/FormDefinition/VFileImport/SelectTable/importFormatsList.vue create mode 100644 src/components/ADempiere/FormDefinition/VFileImport/SelectTable/index.vue rename src/components/ADempiere/{Form => FormDefinition}/VFileImport/index.vue (76%) create mode 100644 src/components/ADempiere/FormDefinition/VFileImport/saveProcess.vue rename src/components/ADempiere/{Form => FormDefinition}/index.vue (80%) create mode 100644 src/lang/ADempiere/en/field/locationsAddress.js create mode 100644 src/lang/ADempiere/en/operators.ts create mode 100644 src/lang/ADempiere/es/field/locationsAddress.js create mode 100644 src/lang/ADempiere/es/operators.ts create mode 100644 src/store/modules/ADempiere/field/locations.js create mode 100644 src/store/modules/ADempiere/form/VPOS/collection.js create mode 100644 src/store/modules/ADempiere/form/VPOS/customer.js create mode 100644 src/store/modules/ADempiere/form/VPOS/dialogInfo.js create mode 100644 src/store/modules/ADempiere/form/VPOS/fieldsCollections.js create mode 100644 src/store/modules/ADempiere/form/VPOS/index.js create mode 100644 src/store/modules/ADempiere/form/VPOS/lines.js create mode 100644 src/store/modules/ADempiere/form/VPOS/options.js create mode 100644 src/store/modules/ADempiere/form/VPOS/options/cashManagement/cashOpen.js create mode 100644 src/store/modules/ADempiere/form/VPOS/options/cashManagement/seller.js create mode 100644 src/store/modules/ADempiere/form/VPOS/order.js create mode 100644 src/store/modules/ADempiere/form/VPOS/productList.js rename src/store/modules/ADempiere/{issues.js => form/issueManagement.js} (98%) rename src/store/modules/ADempiere/{form/issues.js => mailTemplate.js} (82%) rename src/{api/ADempiere/dictionary/menu.js => utils/ADempiere/dictionary/form/VAllocation.js} (71%) create mode 100644 src/utils/ADempiere/dictionary/form/VPOS.js create mode 100644 src/utils/ADempiere/dictionary/process/actionsMenu.ts create mode 100644 src/utils/ADempiere/dictionary/report/actionsMenu.ts create mode 100644 src/utils/ADempiere/lookups.ts diff --git a/.vscode/setting.json b/.vscode/setting.json new file mode 100644 index 00000000000..2e2fff3e7db --- /dev/null +++ b/.vscode/setting.json @@ -0,0 +1,8 @@ +{ + "editor.detectIndentation": false, + "editor.indentSize": "tabSize", + "editor.tabSize": 2, + "editor.autoIndent": "false", + "editor.insertSpaces": false, + "files.insertFinalNewline": true +} diff --git a/build/start.sh b/build/start.sh index e5403b987bc..4a87bcbdfc2 100644 --- a/build/start.sh +++ b/build/start.sh @@ -11,7 +11,7 @@ cd /usr/share/nginx/html/static/js # Set API Proxy connection -find -name 'app.*.js' -exec sed -i "s|http://localhost:8085/api/adempiere/|$API_URL|g" {} \; +find -name 'app.*.js' -exec sed -i "s|http://localhost:8080/api/|$API_URL|g" {} \; # Set Task Manager connection find -name 'app.*.js' -exec sed -i "s|http://localhost:8080/v1|$TASK_MANAGER_URL|g" {} \; diff --git a/config/default.json b/config/default.json index 7487e3520ca..48fe8723586 100644 --- a/config/default.json +++ b/config/default.json @@ -7,7 +7,7 @@ "adempiere": { "api": { "dictionary": "http://localhost:7878/v1/", - "url": "http://localhost:8085/api/adempiere/", + "url": "http://localhost:8080/api/", "timeout": 99999999 }, "images": { @@ -44,10 +44,10 @@ "form": false }, "pointOfSales": { - "endpoint": "/form/addons/point-of-sales" + "endpoint": "/point-of-sales" }, "priceChecking": { - "endpoint": "/form/addons/point-of-sales" + "endpoint": "/point-of-sales" }, "match": { "endpoint": "/form/addons/match" @@ -56,16 +56,16 @@ "endpoint": "/form/addons/weight" }, "payrollActionNotice": { - "endpoint": "/form/addons/payroll-action-notice" + "endpoint": "/payroll-action-notice" }, "session": { "timeout": 300000 }, "vPayPrint": { - "endpoint": "form/addons/payment-print-export" + "endpoint": "/payment-print-export" }, "VBankStatementMatch": { - "endpoint": "form/addons/bank-statement-match" + "endpoint": "/bank-statement-match" }, "theme": "src/themes/default" } diff --git a/src/api/ADempiere/businessData/runBusinessProcess.ts b/src/api/ADempiere/businessData/runBusinessProcess.ts new file mode 100644 index 00000000000..9fe1ae34d45 --- /dev/null +++ b/src/api/ADempiere/businessData/runBusinessProcess.ts @@ -0,0 +1,76 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +/** + * Get default value for a field, parameter or query criteria + * @param {integer} id, identifier of field + */ +export function requestRunBusinessProcess({ + id, + parameters +}) { + return request({ + url: `/business-data/process/${id}`, + method: 'post', + data: { + parameters + } + }) +} + +/** + * Get default value for a field, parameter or query criteria + * @param {integer} id, identifier of field + */ +export function requestRunBusinessProcessAsBrowser({ + id, + parametersList, + browserId, + selectionsList +}) { + return request({ + url: `/business-data/process/${id}/smart-browse/${browserId}`, + method: 'post', + data: { + parameters: parametersList, + selections: selectionsList + } + }) +} + +/** + * Get default value for a field, parameter or query criteria + * @param {integer} id, identifier of field + */ +export function requestRunBusinessProcessAsWindow({ + id, + parametersList, + tableName, + recordId +}) { + return request({ + url: `/business-data/process/${id}/window/${tableName}/${recordId}`, + method: 'post', + data: { + parameters: parametersList + } + }) +} diff --git a/src/api/ADempiere/common/index.ts b/src/api/ADempiere/common/index.ts new file mode 100644 index 00000000000..e5f7048083f --- /dev/null +++ b/src/api/ADempiere/common/index.ts @@ -0,0 +1,300 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details.services + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { request } from '@/utils/ADempiere/request' +import { camelizeObjectKeys } from '@/utils/ADempiere/transformObject.js' +// Constants +import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' + +/** + * Conversion Rate + */ +export function requestGetConversionRate() { + return request({ + url: '/common/conversion-rates', + method: 'get' + }) + .then(response => { + return camelizeObjectKeys(response) + }) +} + +/** + * Get System Info + */ +export function systemInfo() { + return request({ + url: '/common/system-info', + method: 'get' + }) + .then(response => { + return camelizeObjectKeys(response) + }) +} + +/** + * Get Country definition from server using id or uuid for record + * @param {number} id + */ +export function requestGetCountryDefinition({ + id +}) { + return request({ + url: `/common/countries/${id}`, + method: 'get' + }) + .then(countryResponse => { + const { convertCountry } = require('@/utils/ADempiere/apiConverts/core.js') + return convertCountry(countryResponse) + }) +} + +/** + * Get Organization list from role + * @param param0 + * @returns + */ +export function requestOrganizationsList({ + roleId, + pageToken, + pageSize = 100 +}) { + return request({ + url: '/common/organizations', + method: 'get', + params: { + role_id: roleId, + page_token: pageToken, + page_size: pageSize + } + }) + .then(organizationsListResponse => { + return { + nextPageToken: organizationsListResponse.next_page_token, + recordCount: organizationsListResponse.record_count, + organizationsList: organizationsListResponse.organizations.map(organization => { + return camelizeObjectKeys(organization) + }) + } + }) +} + +/** + * Get Warehouses of Organization + * @param organizationId + * @returns + */ +export function requestWarehousesList({ + organizationId, + pageToken, + pageSize = 100 +}) { + return request({ + url: '/common/warehouses', + method: 'get', + params: { + organization_id: organizationId, + // Page Data + page_token: pageToken, + page_size: pageSize + } + }) +} + +/** + * Get Languages from Api + */ +export function requestLanguagesList({ + pageToken, + pageSize = ROWS_OF_RECORDS_BY_PAGE +}) { + return request({ + url: '/common/languages', + method: 'get', + params: { + // Page Data + page_token: pageToken, + page_size: pageSize + } + }) + .then(languagesListResponse => { + const { convertLanguage } = require('@/utils/ADempiere/apiConverts/core.js') + + return { + nextPageToken: languagesListResponse.next_page_token, + recordCount: languagesListResponse.record_count, + languagesList: languagesListResponse.languages.map(language => { + return convertLanguage(language) + }) + } + }) +} + +/** + * GET Business Partners + */ +export function requestListBusinessPartner({ + posUuid, + searchValue, + value, + name, + contactName, + eMail, + postalCode, + phone, + // Query + // criteria, + pageSize = ROWS_OF_RECORDS_BY_PAGE, + pageToken +}) { + return request({ + url: '/common/business-partners', + method: 'get', + params: { + pos_uuid: posUuid, + search_value: searchValue, + value, + name, + contact_name: contactName, + e_mail: eMail, + phone, + // Location + postal_code: postalCode, + page_size: pageSize, + page_token: pageToken + } + }) + .then(businessPartnerResponse => { + const { convertBusinessPartner } = require('@/utils/ADempiere/apiConverts/core.js') + + return { + nextPageToken: businessPartnerResponse.next_page_token, + recordCount: businessPartnerResponse.record_count, + businessPartnersList: businessPartnerResponse.business_partners.map(businessPartner => { + return convertBusinessPartner(businessPartner) + }) + } + }) +} + +/** + * GET Product Conversions + */ +export function productConversions({ + id +}) { + return request({ + url: `/common/product-conversions/${id}`, + method: 'get' + }) + .then(responseProductConversions => { + return { + nextPageToken: responseProductConversions.next_page_token, + recordCount: responseProductConversions.record_count, + businessPartnersList: responseProductConversions.product_conversion.map(list => { + return camelizeObjectKeys(list) + }) + } + }) +} + +/** + * GET Business Partne + */ +export function businessPartner({ + searchValue +}) { + return request({ + url: `/common/business-partners`, + method: 'get', + params: { + search_value: searchValue + } + }) + .then(businessPartnerResponse => { + return { + nextPageToken: businessPartnerResponse.next_page_token, + recordCount: businessPartnerResponse.record_count, + businessPartnersList: businessPartnerResponse.business_partners.map(list => { + return camelizeObjectKeys(list) + }) + } + }) +} + +/** + * POST Business Partner + */ +export function requestCreateBusinessPartner({ + value, + taxId, + duns, + naics, + name, + name2, + description, + contactName, + eMail, + phone, + businessPartnerGroupUuid, + // Location + address1, + address2, + address3, + address4, + cityUuid, + cityName, + postalCode, + regionUuid, + regionName, + countryUuid, + posUuid +}) { + return request({ + url: '/common/create-business-partner', + method: 'post', + data: { + value, + tax_id: taxId, + duns, + naics, + name, + last_name: name2, + description, + contact_name: contactName, + e_mail: eMail, + phone, + business_partner_group_uid: businessPartnerGroupUuid, + // Location + address1, + address2, + address3, + address4, + city_uuid: cityUuid, + city_name: cityName, + postal_code: postalCode, + region_uuid: regionUuid, + region_name: regionName, + country_uuid: countryUuid, + pos_uuid: posUuid + } + }) + .then(businessPartnerResponse => { + return camelizeObjectKeys(businessPartnerResponse) + }) +} diff --git a/src/api/ADempiere/dashboard/index.ts b/src/api/ADempiere/dashboard/index.ts new file mode 100644 index 00000000000..1ebcf7ea165 --- /dev/null +++ b/src/api/ADempiere/dashboard/index.ts @@ -0,0 +1,138 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details.services + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { request } from '@/utils/ADempiere/request' + +// Constants +import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' + +// Utils and Helper Methods +import { camelizeObjectKeys } from '@/utils/ADempiere/transformObject.js' + +/** + * Conversion Rate + */ +export function lisDashboardsRequest({ + pageToken, + pageSize = ROWS_OF_RECORDS_BY_PAGE +}) { + return request({ + url: '/dashboard/dashboards', + method: 'get', + params: { + // Page Data + page_token: pageToken, + page_size: pageSize + } + }) + .then(responseDashboard => { + return { + nextPageToken: responseDashboard.next_page_token, + recordCount: responseDashboard.record_count, + dashboardsList: responseDashboard.dashboards.map(list => { + return camelizeObjectKeys(list) + }) + } + }) +} + +/** + * Get Metrics for Charts + */ +export function getMetricRequest({ + id +}) { + return request({ + url: `/dashboard/metrics/${id}`, + method: 'get' + }) + .then(chart => { + return camelizeObjectKeys(chart) + }) +} + +/** + * Request Favorites List + */ +export function getFavoritesRequest({ + pageToken, + pageSize +}) { + return request({ + url: '/dashboard/favorites', + method: 'get', + params: { + // Page Data + page_token: pageToken, + page_size: pageSize + } + }) + .then(favoritesListReponse => { + const { convertFavorite } = require('@/utils/ADempiere/apiConverts/dashboard.js') + + return { + recordCount: favoritesListReponse.record_count, + favoritesList: favoritesListReponse.favorites.map(favorite => { + return convertFavorite(favorite) + }), + nextPageToken: favoritesListReponse.next_page_token + } + }) +} + +/** + * Get pending documents + */ +export function getPendingDocumentsRequest({ + pageToken, + pageSize = ROWS_OF_RECORDS_BY_PAGE +}) { + return request({ + url: '/dashboard/pending-documents', + method: 'get', + params: { + // Page Data + page_token: pageToken, + page_size: pageSize + } + }) + .then(pendingDocumentsListResponse => { + const { convertPendingDocument } = require('@/utils/ADempiere/apiConverts/dashboard.js') + + return { + recordCount: pendingDocumentsListResponse.record_count, + pendingDocumentsList: pendingDocumentsListResponse.pending_documents.map(pendingDocument => { + return convertPendingDocument(pendingDocument) + }), + nextPageToken: pendingDocumentsListResponse.next_page_token + } + }) +} + +/** + * GetNotifications + */ +export function listNotifiicationsRequest() { + return request({ + url: '/dashboard/notifications', + method: 'get' + }) + .then(notificationsResponse => { + return notificationsResponse + }) +} diff --git a/src/api/ADempiere/dashboard/user.js b/src/api/ADempiere/dashboard/user.js deleted file mode 100644 index 6b383085b32..00000000000 --- a/src/api/ADempiere/dashboard/user.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution - * Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com - * Contributor(s): Yamel Senih ysenih@erpya.com - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Get Instance for connection -import { request } from '@/utils/ADempiere/request' - -// Constants -import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' - -// Get Recent Items based on selection option -export function requestListRecentItems({ - userUuid, - roleUuid, - pageToken, - pageSize = ROWS_OF_RECORDS_BY_PAGE -}) { - return request({ - url: '/dashboard/addons/user/recent-items', - method: 'get', - params: { - user_uuid: userUuid, - role_uuid: roleUuid, - current_session: true, - // Page Data - page_token: pageToken, - page_size: pageSize - } - }) - .then(recentItmesReponse => { - const { convertRecentItemsList } = require('@/utils/ADempiere/apiConverts/dashboard.js') - - return convertRecentItemsList(recentItmesReponse) - }) -} - -/** - * Request Favorites List - * @param {string} userUuid - */ -export function getFavoritesFromServer({ - userId, - userUuid, - pageToken, - pageSize -}) { - return request({ - url: '/dashboard/addons/user/favorites', - method: 'get', - params: { - user_id: userId, - user_uuid: userUuid, - // Page Data - page_token: pageToken, - page_size: pageSize - } - }) - .then(favoritesListReponse => { - const { convertFavorite } = require('@/utils/ADempiere/apiConverts/dashboard.js') - - return { - recordCount: favoritesListReponse.record_count, - favoritesList: favoritesListReponse.records.map(favorite => { - return convertFavorite(favorite) - }), - nextPageToken: favoritesListReponse.next_page_token - } - }) -} diff --git a/src/api/ADempiere/dictionary/field.ts b/src/api/ADempiere/dictionary/field.ts new file mode 100644 index 00000000000..872cdce212f --- /dev/null +++ b/src/api/ADempiere/dictionary/field.ts @@ -0,0 +1,59 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +import { convertField } from '@/utils/ADempiere/apiConverts/field.js' +import { isEmptyValue } from '@/utils/ADempiere/valueUtils' + +// Utils and Helper Methods +export function requestFieldMetadata({ + id, + tableName, + columnName, + columnId, + elementId, + elementColumnName +}) { + let url + switch (true) { + case !isEmptyValue(id): + url = `/dictionary/fields/${id}` + break + case (!isEmptyValue(tableName) && isEmptyValue(columnName)): + url = `/dictionary/fields/${tableName}/${columnName}` + break + case !isEmptyValue(columnId): + url = `/dictionary/fields/column/${columnId}` + break + case !isEmptyValue(elementId): + url = `/dictionary/fields/element/${elementId}` + break + case !isEmptyValue(elementColumnName): + url = `/dictionary/fields/element/column/${elementColumnName}` + break + } + return request({ + url, + method: 'get' + }) + .then(fieldResponse => { + return convertField(fieldResponse) + }) +} diff --git a/src/api/ADempiere/dictionary/form.js b/src/api/ADempiere/dictionary/form.js deleted file mode 100644 index 1a950f982b0..00000000000 --- a/src/api/ADempiere/dictionary/form.js +++ /dev/null @@ -1,42 +0,0 @@ -// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution -// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. -// Contributor(s): Yamel Senih ysenih@erpya.com www.erpya.com -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// Get Instance for connection -import { request } from '@/utils/ADempiere/request' - -/** - * Request dictionary Form metadata - * @param {string} uuid universally unique identifier - * @param {number} id, integer identifier - */ -export function requestForm({ - uuid, - id -}) { - return request({ - url: '/dictionary/form', - method: 'get', - params: { - uuid, - id - } - }) - .then(formResponse => { - const { convertForm } = require('@/utils/ADempiere/apiConverts/dictionary.js') - - return convertForm(formResponse) - }) -} diff --git a/src/api/ADempiere/dictionary/index.ts b/src/api/ADempiere/dictionary/index.ts new file mode 100644 index 00000000000..b6a78ab0435 --- /dev/null +++ b/src/api/ADempiere/dictionary/index.ts @@ -0,0 +1,200 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +/** + * Request dictionary Window metadata + * @param {number} id, identifier + */ +export function requestWindowMetadata({ + id +}) { + return request({ + url: `/dictionary/windows/${id}`, + method: 'get' + }) + .then(windowResponse => { + const { convertWindow } = require('@/utils/ADempiere/apiConverts/dictionary.js') + return convertWindow(windowResponse) + }) +} + +/** + * Request Get Tabs + * @param {number} id + */ +export function requestTabsMetadata({ + id +}) { + return request({ + url: `/dictionary/tabs/${id}`, + method: 'get' + }) + .then(responde => { + return responde + }) +} + +/** + * GET References + * @param {String} id + */ +export function requestReference({ + id +}) { + return request({ + url: `/dictionary/references/${id}`, + method: 'get' + // params: { + // uuid, + // column_name: columnName + // } + }) + .then(validationResponse => { + const { convertReference } = require('@/utils/ADempiere/apiConverts/field.js') + + return convertReference(validationResponse) + }) +} + +export function requestProcessMetadata({ + id +}) { + return request({ + url: `/dictionary/processes/${id}`, + method: 'get' + // params: { + // id + // } + }) + .then(processResponse => { + const { convertProcess } = require('@/utils/ADempiere/apiConverts/dictionary.js') + + return convertProcess(processResponse) + }) +} + +/** + * Request dictionary Smart Browser metadata + * @param {string} uuid universally unique identifier + * @param {number} id, identifier + */ +export function requestBrowserMetadata({ + id +}) { + return request({ + url: `/dictionary/browsers/${id}`, + method: 'get' + }) + .then(browserResponse => { + const { convertBrowser } = require('@/utils/ADempiere/apiConverts/dictionary.js') + + return convertBrowser(browserResponse) + }) +} + +/** + * Request dictionary Forms metadata + * @param {number} id, identifier + */ +export function requestForm({ + id +}) { + return request({ + url: `/dictionary/forms/${id}`, + method: 'get' + }) +} + +/** + * Reques GET Search Info Fields + */ +export function tableSearchFields({ + tableName +}) { + // const table_name = tableName + return request({ + url: `/dictionary/forms/${tableName}`, + method: 'get' + }) + .then(response => { + const { camelizeObjectKeys } = require('@/utils/ADempiere/transformObject.js') + return { + recordCount: response.record_count, + fieldsList: response.fields.map(field => { + return camelizeObjectKeys(field) + }), + nextPageToken: response.next_page_token + } + }) +} + +/** + * Reques GET Identifier Fields + */ +export function identifierFields({ + tableName +}) { + return request({ + url: `/dictionary/identifier-fields/${tableName}`, + method: 'get' + // params: { + // table_name: tableName + // } + }) + .then(response => { + const { convertField } = require('@/utils/ADempiere/apiConverts/field.js') + + return { + recordCount: response.record_count, + fieldsList: response.fields.map(field => { + return convertField(field) + }), + nextPageToken: response.next_page_token + } + }) +} + +/** + * Reques GET Search Fields + */ +export function requestSearchFields({ + tableName +}) { + return request({ + url: `/dictionary/table-search-fields/${tableName}`, + method: 'get' + // params: { + // table_name: tableName + // } + }) + .then(response => { + const { convertField } = require('@/utils/ADempiere/apiConverts/field.js') + + return { + recordCount: response.record_count, + fieldsList: response.fields.map(field => { + return convertField(field) + }), + nextPageToken: response.next_page_token + } + }) +} + diff --git a/src/api/ADempiere/dictionary/window.js b/src/api/ADempiere/dictionary/window.js index d8cac60caf9..f74dd220cae 100644 --- a/src/api/ADempiere/dictionary/window.js +++ b/src/api/ADempiere/dictionary/window.js @@ -1,18 +1,20 @@ -// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution -// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. -// Contributor(s): Yamel Senih ysenih@erpya.com www.erpya.com -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ // Get Instance for connection import { request } from '@/utils/ADempiere/request' @@ -41,37 +43,6 @@ export function requestWindowMetadata({ }) } -export function requestFieldMetadata({ - uuid, - columnUuid, - elementUuid, - fieldUuid, - // TableName + ColumnName - tableName, - columnName, - elementColumnName -}) { - return request({ - url: '/dictionary/field', - method: 'get', - params: { - uuid, - column_uuid: columnUuid, - element_uuid: elementUuid, - field_uuid: fieldUuid, - // TableName + ColumnName - table_name: tableName, - column_name: columnName, - element_column_name: elementColumnName - } - }) - .then(fieldResponse => { - const { convertField } = require('@/utils/ADempiere/apiConverts/field.js') - - return convertField(fieldResponse) - }) -} - export function requestReference({ uuid, columnName @@ -90,22 +61,3 @@ export function requestReference({ return convertReference(validationResponse) }) } - -export function requestValidationRule({ - uuid, - id -}) { - return request({ - url: '/dictionary/validation', - method: 'get', - params: { - uuid, - id - } - }) - .then(validationResponse => { - const { convertValidationRule } = require('@/utils/ADempiere/apiConverts/dictionary.js') - - return convertValidationRule(validationResponse) - }) -} diff --git a/src/api/ADempiere/open-id/services.js b/src/api/ADempiere/dictionary/window.ts similarity index 58% rename from src/api/ADempiere/open-id/services.js rename to src/api/ADempiere/dictionary/window.ts index 5ce3af409a4..9e45f6cb0df 100644 --- a/src/api/ADempiere/open-id/services.js +++ b/src/api/ADempiere/dictionary/window.ts @@ -10,45 +10,28 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details.services + * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -import { isEmptyValue } from '@/utils/ADempiere' +// Get Instance for connection import { request } from '@/utils/ADempiere/request' -import { camelizeObjectKeys } from '@/utils/ADempiere/transformObject.js' -export function services() { - return request({ - url: '/user/open-id/services', - method: 'get' - }) - .then(response => { - if (isEmptyValue(response)) { - return [] - } - return response.map(list => camelizeObjectKeys(list)) - }) - .catch(error => { - console.info(error) - }) -} - -export function loginAuthentication({ - code, - state +/** + * Request dictionary Window metadata + * @param {number} id, identifier + */ +export function requestWindowMetadata({ + id }) { return request({ - url: '/user/open-id/login', - method: 'post', - data: { - code, - state - } + url: `/dictionary/windows/${id}`, + method: 'get' }) - .then(response => { - return response + .then(windowResponse => { + const { convertWindow } = require('@/utils/ADempiere/apiConverts/dictionary.js') + return convertWindow(windowResponse) }) } diff --git a/src/api/ADempiere/field/binary.js b/src/api/ADempiere/field/binary.js index f8226ac3525..2bb5dd01541 100644 --- a/src/api/ADempiere/field/binary.js +++ b/src/api/ADempiere/field/binary.js @@ -42,7 +42,7 @@ export function updateResource({ tableName, binaryFile }) { - const { updateEntity } = require('@/api/ADempiere/common/persistence.js') + const { updateEntity } = require('@/api/ADempiere/userInterface/entities.ts') return updateEntity({ recordUuid: uuid, diff --git a/src/api/ADempiere/field/location.js b/src/api/ADempiere/field/location.js index 0c8bd595276..368491111f8 100644 --- a/src/api/ADempiere/field/location.js +++ b/src/api/ADempiere/field/location.js @@ -60,7 +60,7 @@ export function updateLocationAddress({ uuid, attributesList }) { - const { updateEntity } = require('@/api/ADempiere/common/persistence.js') + const { updateEntity } = require('@/api/ADempiere/userInterface/entities.ts') return updateEntity({ tableName, diff --git a/src/api/ADempiere/field/locations.js b/src/api/ADempiere/field/locations.js new file mode 100644 index 00000000000..800572a2abe --- /dev/null +++ b/src/api/ADempiere/field/locations.js @@ -0,0 +1,203 @@ +// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution +// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. +// Contributor(s): Yamel Senih ysenih@erpya.com www.erpya.com +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +import { isEmptyValue } from '@/utils/ADempiere' +import { request } from '@/utils/ADempiere/request' + +/** + * List Countries + */ + +export function listCountries({ + sortBy, + filters, + searchValue, + groupColumns, + selectColumns +}) { + return request({ + url: '/location-address/countries', + method: 'get', + params: { + filters, + sort_by: sortBy, + search_value: searchValue, + group_columns: groupColumns, + select_columns: selectColumns + } + }) +} + +/** + * Get Countries + */ + +export function getCountries({ + id, + filters, + searchValue, + groupColumns, + selectColumns +}) { + return request({ + url: `/location-address/countries/${id}`, + method: 'get', + params: { + filters, + search_value: searchValue, + group_columns: groupColumns, + select_columns: selectColumns + } + }) +} + +/** + * List Regions + */ + +export function listRegion({ + countryId, + searchValue +}) { + return request({ + url: `/location-address/countries/${countryId}/regions`, + method: 'get', + params: { + search_value: searchValue + } + }) +} + +/** + * List Cities + */ + +export function listCities({ + countryId, + regionId +}) { + let url + switch (true) { + case isEmptyValue(regionId): + url = `/location-address/countries/${countryId}/cities` + break + case (!isEmptyValue(countryId) && !isEmptyValue(regionId)): + url = `/location-address/countries/${countryId}/${regionId}/cities` + break + } + return request({ + url, + method: 'get' + }) +} + +/** + * Get Location (Address) + */ + +export function getAddress({ + id +}) { + return request({ + url: `/location-address/addresses/${id}`, + method: 'get' + }) +} + +/** + * Create Location (Address) + */ + +export function createAddress({ + countryId, + regionId, + cityId, + cityLabel, + address1, + address2, + address3, + address4, + postalCode, + posalCodeAdditional, + latitude, + longitude, + altitude, + reference +}) { + return request({ + url: `/location-address/addresses`, + method: 'post', + data: { + country_id: countryId, + region_id: regionId, + city_id: cityId, + city: cityLabel, + address1, + address2, + address3, + address4, + postal_code: postalCode, + posal_code_additional: posalCodeAdditional, + latitude, + longitude, + altitude, + reference + } + }) +} + +/** + * Update Location (Address) + */ + +export function updateAddress({ + id, + countryId, + regionId, + cityId, + cityLabel, + address1, + address2, + address3, + address4, + postalCode, + posalCodeAdditional, + latitude, + longitude, + altitude, + reference +}) { + return request({ + url: `/location-address/addresses/${id}`, + method: 'patch', + data: { + country_id: countryId, + region_id: regionId, + city_id: cityId, + city: cityLabel, + address1, + address2, + address3, + address4, + postal_code: postalCode, + posal_code_additional: posalCodeAdditional, + latitude, + longitude, + altitude, + reference + } + }) +} diff --git a/src/api/ADempiere/form/VAllocation.js b/src/api/ADempiere/form/VAllocation.ts similarity index 70% rename from src/api/ADempiere/form/VAllocation.js rename to src/api/ADempiere/form/VAllocation.ts index f6920d1dca0..d17db1d5833 100644 --- a/src/api/ADempiere/form/VAllocation.js +++ b/src/api/ADempiere/form/VAllocation.ts @@ -1,6 +1,6 @@ /** * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution - * Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,13 +19,20 @@ import { request } from '@/utils/ADempiere/request' import { camelizeObjectKeys } from '@/utils/ADempiere/transformObject.js' +export function requestListTransactionTypes() { + return request({ + url: '/payment-allocation/transaction-types', + method: 'get' + }) +} + export function listBusinessPartners({ searchValue, pageToken, pageSize }) { return request({ - url: '/form/addons/payment-allocation/business-partners', + url: '/payment-allocation/business-partners', method: 'get', params: { page_size: pageSize, @@ -39,13 +46,13 @@ export function listBusinessPartners({ }) } -export function listOrganizations({ +export function requestListOrganizations({ searchValue, pageToken, pageSize = 250 }) { return request({ - url: '/form/addons/payment-allocation/organizations', + url: '/payment-allocation/organizations', method: 'get', params: { page_size: pageSize, @@ -54,18 +61,15 @@ export function listOrganizations({ search_value: searchValue } }) - .then(response => { - return camelizeObjectKeys(response) - }) } -export function listCurrencies({ +export function requestListCurrencies({ searchValue, pageToken, pageSize = 250 }) { return request({ - url: '/form/addons/payment-allocation/currencies', + url: '/payment-allocation/currencies', method: 'get', params: { page_size: pageSize, @@ -74,31 +78,15 @@ export function listCurrencies({ search_value: searchValue } }) - .then(response => { - return camelizeObjectKeys(response) - }) } -export function listTransactionTypes() { - return request({ - url: '/form/addons/payment-allocation/transaction-types', - method: 'get' - }) - .then(response => { - return camelizeObjectKeys(response) - }) -} - -export function listPayments({ +export function requestListPayments({ // DSL Query searchValue, businessPartnerId, - businessPartnerUuid, date, organizationId, - organizationUuid, currencyId, - currencyUuid, isMultiCurrency, transactionType, isAutomaticWriteOff, @@ -107,17 +95,13 @@ export function listPayments({ pageToken }) { return request({ - url: '/form/addons/payment-allocation/payments', + url: `/payment-allocation/payments/${businessPartnerId}`, method: 'get', params: { search_value: searchValue, - business_partner_id: businessPartnerId, - business_partner_uuid: businessPartnerUuid, date, organization_id: organizationId, - organization_uuid: organizationUuid, currency_id: currencyId, - currency_uuid: currencyUuid, is_multi_currency: isMultiCurrency, transaction_type: transactionType, is_automatic_write_off: isAutomaticWriteOff, @@ -131,16 +115,13 @@ export function listPayments({ }) } -export function listInvoices({ +export function requestListInvoices({ // DSL Query searchValue, businessPartnerId, - businessPartnerUuid, date, organizationId, - organizationUuid, currencyId, - currencyUuid, isMultiCurrency, transactionType, isAutomaticWriteOff, @@ -149,17 +130,13 @@ export function listInvoices({ pageToken }) { return request({ - url: '/form/addons/payment-allocation/invoices', + url: `/payment-allocation/invoices/${businessPartnerId}`, method: 'get', params: { search_value: searchValue, - business_partner_id: businessPartnerId, - business_partner_uuid: businessPartnerUuid, date, organization_id: organizationId, - organization_uuid: organizationUuid, currency_id: currencyId, - currency_uuid: currencyUuid, is_multi_currency: isMultiCurrency, transaction_type: transactionType, is_automatic_write_off: isAutomaticWriteOff, @@ -173,13 +150,13 @@ export function listInvoices({ }) } -export function listCharges({ +export function requestListCharges({ searchValue, pageToken, pageSize }) { return request({ - url: '/form/addons/payment-allocation/charges', + url: '/payment-allocation/charges', method: 'get', params: { page_size: pageSize, @@ -188,20 +165,16 @@ export function listCharges({ search_value: searchValue } }) - .then(response => { - return camelizeObjectKeys(response) - }) } // List Transaction Organizations - -export function listTransactionOrganizations({ +export function requestListTransactionOrganizations({ searchValue, pageToken, pageSize }) { return request({ - url: '/form/addons/payment-allocation/transaction-organizations', + url: '/payment-allocation/organizations/transactions', method: 'get', params: { page_size: pageSize, @@ -210,12 +183,10 @@ export function listTransactionOrganizations({ search_value: searchValue } }) - .then(response => { - return camelizeObjectKeys(response) - }) } + // process -export function process({ +export function requestProcess({ date, chargeId, currencyId, @@ -227,7 +198,7 @@ export function process({ transactionOrganizationId }) { return request({ - url: '/form/addons/payment-allocation/process-receipt', + url: '/payment-allocation/process', method: 'post', data: { // DSL Query @@ -242,7 +213,4 @@ export function process({ invoice_selections: invoiceSelectionList } }) - .then(response => { - return response - }) } diff --git a/src/api/ADempiere/form/VBankStatementMatch.js b/src/api/ADempiere/form/VBankStatementMatch.ts similarity index 98% rename from src/api/ADempiere/form/VBankStatementMatch.js rename to src/api/ADempiere/form/VBankStatementMatch.ts index 8dca00ea626..9418a973dc0 100644 --- a/src/api/ADempiere/form/VBankStatementMatch.js +++ b/src/api/ADempiere/form/VBankStatementMatch.ts @@ -46,12 +46,12 @@ export function requestListBankAccounts({ pageSize }) { return request({ - url: `${config.VBankStatementMatch.endpoint}/bank-accounts`, + url: `${config.VBankStatementMatch.endpoint}/accounts`, method: 'get', params: { search_value: searchValue, page_token: pageToken, - page_size: pageSize + page_size: 10000 } }) .then(response => { diff --git a/src/api/ADempiere/form/VFileImport.js b/src/api/ADempiere/form/VFileImport.js index b1325b08304..3f758ed7f4c 100644 --- a/src/api/ADempiere/form/VFileImport.js +++ b/src/api/ADempiere/form/VFileImport.js @@ -17,15 +17,14 @@ */ import { request } from '@/utils/ADempiere/request' -import { camelizeObjectKeys } from '@/utils/ADempiere/transformObject.js' -export function listCharsets({ +export function requestListCharsets({ searchValue, pageToken, pageSize = 250 }) { return request({ - url: '/form/addons/import-file-loader/list-charsets', + url: '/import-file-loader/charsets', method: 'get', params: { page_size: pageSize, @@ -34,94 +33,60 @@ export function listCharsets({ search_value: searchValue } }) - .then(response => { - return camelizeObjectKeys(response) - }) } -export function listImportFormats({ - searchValue, - pageToken, - id, - pageSize = 250 -}) { +export function requestListImportTables() { return request({ - url: '/form/addons/import-file-loader/list-import-formats', - method: 'get', - params: { - page_size: pageSize, - page_token: pageToken, - table_id: id, - // DSL Query - search_value: searchValue - } + url: '/import-file-loader/tables', + method: 'get' }) - .then(response => { - return camelizeObjectKeys(response) - }) } -export function getImportFormats({ - id +export function requestImportFormatsList({ + tableName }) { return request({ - url: '/form/addons/import-file-loader/get-import-formats', - method: 'get', - params: { - id - } + url: `/import-file-loader/formats/${tableName}`, + method: 'get' }) - .then(response => { - return camelizeObjectKeys(response) - }) } -export function getListImportTables() { +export function requestGetImportFormat({ + id +}) { return request({ - url: '/form/addons/import-file-loader/list-import-tables', + url: `/import-file-loader/formats/get/${id}`, method: 'get' }) - .then(response => { - return camelizeObjectKeys(response) - }) } -export function listImportProcess({ +export function requestListImportProcesses({ tableName }) { return request({ - url: '/form/addons/import-file-loader/list-import-processes', - method: 'get', - params: { - table_name: tableName - } + url: `/import-file-loader/processes/${tableName}`, + method: 'get' }) - .then(response => { - return camelizeObjectKeys(response) - }) } export function saveRecordImport({ - id, + id: resourceId, charset, + importFormatId, isProcess, processId, - importFormatId + parameters }) { return request({ - url: '/form/addons/import-file-loader/save-records', + url: `/import-file-loader/imports/${importFormatId}/${resourceId}`, method: 'post', data: { charset, - resource_id: id, is_process: isProcess, process_id: processId, - import_format_id: importFormatId + parameters } }) - .then(response => { - return camelizeObjectKeys(response) - }) } export function requestListFilePreview({ @@ -130,15 +95,10 @@ export function requestListFilePreview({ importFormatId }) { return request({ - url: '/form/addons/import-file-loader/list-file-preview', + url: `/import-file-loader/imports/${importFormatId}/${resourceId}/preview`, method: 'get', params: { - import_format_id: importFormatId, - resource_id: resourceId, charset } }) - .then(response => { - return camelizeObjectKeys(response) - }) } diff --git a/src/api/ADempiere/form/VPOS/index.js b/src/api/ADempiere/form/VPOS/index.js new file mode 100644 index 00000000000..b4d18a3f603 --- /dev/null +++ b/src/api/ADempiere/form/VPOS/index.js @@ -0,0 +1,1564 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { request } from '@/utils/ADempiere/request' + +/** ______________________________________________ + * | | + * | POS Service used for ADempiere integration | + * |______________________________________________| + */ + +/** + * List Point of Sales + * @returns {array} ListPointOfSalesResponse + */ +export function listPointOfSales() { + return request({ + url: '/point-of-sales/terminals', + method: 'get' + }) +} + +/** + * Get POS Definition + * @param {number} id + * @returns {object} PointOfSales + */ +export function getPointOfSales({ + id +}) { + return request({ + url: `/point-of-sales/terminals/${id}`, + method: 'get' + }) +} + +/** + * List of Available Warehouses + * @param {int32} posId + * @returns {array} ListAvailableWarehousesResponse + */ + +export function listAvailableWarehouses({ + posId +}) { + return request({ + url: `/point-of-sales/${posId}/warehouses`, + method: 'get' + }) +} + +/** + * List of Available Tender Types + * @param {int32} posId + * @returns {array} ListAvailablePaymentMethodsResponse + */ + +export function listAvailablePaymentMethods({ + posId +}) { + return request({ + url: `/point-of-sales/${posId}/payment-methods`, + method: 'get' + }) +} + +/** + * List of Available Price List + * @param {int32} posId + * @returns {array} ListAvailablePriceListResponse + */ + +export function listAvailablePriceList({ + posId +}) { + return request({ + url: `/point-of-sales/${posId}/price-lists`, + method: 'get' + }) +} + +/** + * List of Available Currencies + * @param {int32} posId + * @returns {array} ListAvailableCurrenciesResponse + */ + +export function listAvailableCurrencies({ + posId +}) { + return request({ + url: `/point-of-sales/${posId}/currencies`, + method: 'get' + }) +} + +/** + * List of Available Document Types + * @param {int32} posId + * @returns {array} ListAvailableDocumentTypesResponse + */ + +export function listAvailableDocumentTypes({ + posId +}) { + return request({ + url: `/point-of-sales/${posId}/document-types`, + method: 'get' + }) +} + +/** + * List of Available Discounts + * @param {int32} posId + * @returns {array} ListAvailableDiscountsResponse + */ + +export function listAvailableDiscounts({ + posId +}) { + return request({ + url: `/point-of-sales/${posId}/discounts`, + method: 'get' + }) +} + +/** + * List of Available Sellers + * @param {int32} posId + * @returns {array} ListAvailableSellersResponse + */ + +export function listAvailableSellers({ + posId, + searchValue +}) { + return request({ + url: `/point-of-sales/${posId}/sellers`, + method: 'get', + params: { + search_value: searchValue + } + }) +} + +/** + * List Campaigns + * @param {int32} posId + * @returns {array} ListCampaignsResponse + */ + +export function listCampaigns({ + posId +}) { + return request({ + url: `/point-of-sales/terminals/${posId}/campaigns`, + method: 'get' + }) +} + +/** __________________________________________ + * | | + * | List of Point of Sale Product Services | + * |__________________________________________| + */ + +/** + * Get Product Price from searchValue + * @param {int32} posId + * @param {string} searchValue + * @param {int32} businessPartnerId + * @param {string} validFrom + * @param {int32} priceListId + * @param {int32} warehouseId + */ + +export function getProductPriceSearchValue({ + businessPartnerId, + priceListId, + warehouseId, + searchValue, + validFrom, + posId +}) { + return request({ + url: `point-of-sales/${posId}/product-prices/${searchValue}`, + method: 'get', + params: { + business_partner_id: businessPartnerId, + valid_from: validFrom, + price_list_id: priceListId, + warehouse_id: warehouseId + } + }) +} + +/** + * Get Product Price from UPC + * @param {int32} posId + * @param {string} upc + * @param {int32} businessPartnerId + * @param {string} validFrom + * @param {int32} priceListId + * @param {int32} warehouseId + */ + +export function getProductPriceUPC({ + businessPartnerId, + priceListId, + warehouseId, + validFrom, + posId, + upc +}) { + return request({ + url: `point-of-sales/${posId}/product-prices/upc/${upc}`, + method: 'get', + params: { + business_partner_id: businessPartnerId, + valid_from: validFrom, + price_list_id: priceListId, + warehouse_id: warehouseId + } + }) +} + +/** + * Get Product Price from sku + * @param {int32} posId + * @param {string} sku + * @param {int32} businessPartnerId + * @param {string} validFrom + * @param {int32} priceListId + * @param {int32} warehouseId + */ + +export function getProductPriceSKU({ + businessPartnerId, + priceListId, + warehouseId, + validFrom, + posId, + sku +}) { + return request({ + url: `point-of-sales/${posId}/product-prices/sku/${sku}`, + method: 'get', + params: { + business_partner_id: businessPartnerId, + valid_from: validFrom, + price_list_id: priceListId, + warehouse_id: warehouseId + } + }) +} + +/** + * Get Product Price from Code(value) + * @param {int32} posId + * @param {string} value + * @param {int32} businessPartnerId + * @param {string} validFrom + * @param {int32} priceListId + * @param {int32} warehouseId + */ + +export function getProductPriceCode({ + businessPartnerId, + priceListId, + warehouseId, + validFrom, + posId, + value +}) { + return request({ + url: `point-of-sales/${posId}/product-prices/value/${value}`, + method: 'get', + params: { + business_partner_id: businessPartnerId, + valid_from: validFrom, + price_list_id: priceListId, + warehouse_id: warehouseId + } + }) +} + +/** + * Get Product Price from Name + * @param {int32} posId + * @param {string} name + * @param {int32} businessPartnerId + * @param {string} validFrom + * @param {int32} priceListId + * @param {int32} warehouseId + */ + +export function getProductPriceName({ + businessPartnerId, + priceListId, + warehouseId, + validFrom, + posId, + name +}) { + return request({ + url: `point-of-sales/${posId}/product-prices/name/${name}`, + method: 'get', + params: { + business_partner_id: businessPartnerId, + valid_from: validFrom, + price_list_id: priceListId, + warehouse_id: warehouseId + } + }) +} + +/** + * List Product Price + * @param {int32} posId + * @param {string} filters + * @param {string} searchValue + * @param {string} sortBy + * @param {repeated string} groupColumns + * @param {repeated string} selectColumns + * @param {int32} pageSize + * @param {string} pageToken + * @param {int32} businessPartnerId + * @param {string} validFrom + * @param {int32} priceListId + * @param {int32} warehouseId + */ + +export function listProductPrice({ + posId, + pageSize = 15, + pageToken, + validFrom, + searchValue, + priceListId, + warehouseId, + businessPartnerId +}) { + return request({ + url: `point-of-sales/${posId}/product-prices`, + method: 'get', + params: { + business_partner_id: businessPartnerId, + valid_from: validFrom, + price_list_id: priceListId, + search_value: searchValue, + warehouse_id: warehouseId, + page_size: pageSize, + page_token: pageToken + } + }) +} + +/** ___________________ + * | | + * | Orders Services | + * |___________________| + */ + +/** + * Create Order + * @param {int32} posId7 + * @param {int32} customerId + * @param {int32} documentTypeId + * @param {int32} priceListId + * @param {int32} warehouseId + * @param {int32} salesRepresentativeId + * @param {int32} campaignId + */ +export function createOrder({ + posId, + customerId, + documentTypeId, + priceListId, + warehouseId, + salesRepresentativeId, + campaignId +}) { + return request({ + url: `point-of-sales/${posId}/orders`, + method: 'post', + data: { + customer_id: customerId, + document_type_id: documentTypeId, + price_list_id: priceListId, + warehouse_id: warehouseId, + sales_representative_id: salesRepresentativeId, + campaign_id: campaignId + } + }) +} + +/** + * Get a Order + * @param {int32} posId + * @param {int32} orderId + */ +export function getOrder({ + posId, + orderId +}) { + return request({ + url: `point-of-sales/${posId}/orders/${orderId}`, + method: 'get' + }) +} + +/** + * UpdateOrder + * @param {int32} posId + * @param {int32} orderId + */ +export function updateOrder({ + posId, + orderId, + customer_id, + document_type_id, + price_list_id, + warehouse_id, + campaign_id, + discount_rate, + discount_rate_off, + discount_amount_off, + sales_representative_id +}) { + return request({ + url: `point-of-sales/${posId}/orders/${orderId}`, + method: 'put', + params: { + customer_id, + document_type_id, + price_list_id, + warehouse_id, + campaign_id, + discount_rate, + discount_rate_off, + discount_amount_off, + sales_representative_id + } + }) +} +/** + * Delete Order + * @param {int32} posId + * @param {int32} orderId + */ +export function deleteOrder({ + posId, + orderId +}) { + return request({ + url: `point-of-sales/${posId}/orders/${orderId}`, + method: 'delete' + }) +} + +/** + * List Orders + * @param {int32} posId + */ + +export function listOrders({ + posId, + pageSize, + pageToken, + search_value, + document_no, + document_status, + business_partner_id, + grand_total, + open_amount, + is_waiting_for_pay, + is_only_processed, + is_only_aisle_seller, + is_waiting_for_invoice, + is_waiting_for_shipment, + is_binding_offer, + is_closed, + is_nullified, + is_only_rma, + date_ordered_from, + date_ordered_to, + sales_representative_id +}) { + return request({ + url: `point-of-sales/${posId}/orders`, + method: 'get', + params: { + page_size: pageSize, + page_token: pageToken, + search_value, + document_no, + document_status, + business_partner_id, + grand_total, + open_amount, + is_waiting_for_pay, + is_only_processed, + is_only_aisle_seller, + is_waiting_for_invoice, + is_waiting_for_shipment, + is_binding_offer, + is_closed, + is_nullified, + is_only_rma, + date_ordered_from, + date_ordered_to, + sales_representative_id + } + }) +} + +/** + * Release Order + * @param {int32} posId + * @param {int32} orderId + */ + +export function releaseOrder({ + posId, + orderId +}) { + return request({ + url: `point-of-sales/${posId}/orders/${orderId}/release`, + method: 'put' + }) +} + +/** + * Hold Order + * @param {int32} posId + * @param {int32} orderId + */ + +export function holdOrder({ + posId, + orderId +}) { + return request({ + url: `point-of-sales/${posId}/orders/${orderId}/hold`, + method: 'put' + }) +} + +/** _________________________ + * | | + * | Order Line Services | + * |_________________________| + */ + +/** + * Create Order + * @param {int32} posId + * @param {int32} orderId + * @param {int32} chargeId + * @param {string} description + * @param {google.protobuf.Value} quantity + * @param {google.protobuf.Value} price + * @param {google.protobuf.Value} discountRate + * @param {int32} warehouseId + * @param {int32} resourceAssignmentId + */ +export function createOrderLine({ + posId, + orderId, + chargeId, + productId, + description, + quantity, + price, + discountRate, + warehouseId, + resourceAssignmentId +}) { + return request({ + url: `point-of-sales/${posId}/orders/${orderId}/lines`, + method: 'post', + data: { + product_id: productId, + charge_id: chargeId, + description, + quantity, + price, + discount_rate: discountRate, + warehouse_id: warehouseId, + resource_assignment_id: resourceAssignmentId + } + }) +} + +/** + * List Order Lines + * @param {string} filters + * @param {string} sortBy + * @param {repeated string} groupColumns + * @param {repeated string} selectColumns + * @param {int32} filters + * @param {int32} pageSize + * @param {string} pageToken + * @param {string} searchValue + * @param {int32} posId + * @param {int32} orderId + */ +export function listOrderLines({ + posId, + sortBy, + orderId, + filters, + pageSize = 15, + pageToken, + searchValue, + groupColumns, + selectColumns +}) { + return request({ + url: `point-of-sales/${posId}/orders/${orderId}/lines`, + method: 'get', + params: { + filters, + sort_by: sortBy, + group_columns: groupColumns, + select_columns: selectColumns, + page_size: pageSize, + page_token: pageToken, + search_value: searchValue + } + }) +} + +/** + * Update Order Line + * @param {int32} posId + * @param {int32} orderId + * @param {int32} lineId + * @param {int32} uom_id + * @param {int32} price + * @param {int32} quantity + * @param {int32} warehouse_id + */ +export function updateOrderLine({ + posId, + orderId, + lineId, + uom_id, + price, + quantity, + discount_rate, + warehouse_id +}) { + return request({ + url: `point-of-sales/${posId}/orders/${orderId}/lines/${lineId}`, + method: 'put', + params: { + uom_id, + price, + quantity, + discount_rate, + warehouse_id + } + }) +} + +/** + * Delete Order Line + * @param {int32} posId + * @param {int32} orderId + * @param {int32} lineId + */ +export function deleteOrderLine({ + posId, + orderId, + lineId +}) { + return request({ + url: `point-of-sales/${posId}/orders/${orderId}/lines/${lineId}`, + method: 'delete' + }) +} + +/** _________________________ + * | | + * | Customers Services | + * |_________________________| + */ + +/** + * List Customers + * @param {string} filters + * @param {string} sortBy + * @param {repeated string} groupColumns + * @param {repeated string} selectColumns + * @param {int32} filters + * @param {int32} pageSize + * @param {string} pageToken + * @param {string} searchValue + * @param {string} name + * @param {string} value + * @param {string} email + * @param {int32} posId + */ + +export function listCustomers({ + name, + email, + value, + posId, + sortBy, + filters, + pageToken, + searchValue, + groupColumns, + selectColumns, + pageSize = 15 +}) { + return request({ + url: `point-of-sales/customers`, + method: 'get', + params: { + filters, + pos_id: posId, + sort_by: sortBy, + group_columns: groupColumns, + select_columns: selectColumns, + page_size: pageSize, + page_token: pageToken, + search_value: searchValue, + name, + email, + value + } + }) +} + +/** ____________________________________ + * | | + * | Payments Point of Sale Services | + * |____________________________________| + */ + +/** + * Create Payment + */ + +export function createPayment({ + posId, + order_id, + invoice_id, + bank_id, + reference_no, + description, + amount, + payment_date, + tender_type_code, + currency_id, + payment_method_id, + payment_account_date, + is_refund, + charge_id, + collecting_agent_id, + reference_bank_account_id, + customer_bank_account_id, + invoice_reference_id +}) { + return request({ + url: `point-of-sales/${posId}/payments`, + method: 'post', + data: { + order_id, + invoice_id, + bank_id, + reference_no, + description, + amount, + payment_date, + tender_type_code, + currency_id, + payment_method_id, + payment_account_date, + is_refund, + charge_id, + collecting_agent_id, + reference_bank_account_id, + customer_bank_account_id, + invoice_reference_id + } + }) +} + +/** + * Update Payment + */ + +export function updatePayment({ + posId, + payment_id, + order_id, + invoice_id, + bank_id, + reference_no, + description, + amount, + payment_date, + tender_type_code, + currency_id, + payment_method_id, + payment_account_date, + is_refund, + charge_id, + collecting_agent_id, + reference_bank_account_id, + customer_bank_account_id, + invoice_reference_id +}) { + return request({ + url: `point-of-sales/${posId}/payments/${payment_id}`, + method: 'put', + data: { + order_id, + invoice_id, + bank_id, + reference_no, + description, + amount, + payment_date, + tender_type_code, + currency_id, + payment_method_id, + payment_account_date, + is_refund, + charge_id, + collecting_agent_id, + reference_bank_account_id, + customer_bank_account_id, + invoice_reference_id + } + }) +} + +/** + * Delete Payment + */ + +export function deletePayment({ + posId, + payment_id +}) { + return request({ + url: `point-of-sales/${posId}/payments/${payment_id}`, + method: 'delete' + }) +} + +/** + * List Payments + */ + +export function listPayments({ + posId, + orderId, + isOnlyRefund, + isOnlyReceipt +}) { + return request({ + url: `point-of-sales/${posId}/payments`, + method: 'get', + params: { + order_id: orderId, + is_only_refund: isOnlyRefund, + is_only_receipt: isOnlyReceipt + } + }) +} + +/** + * Process Order + */ + +export function processOrder({ + posId, + orderId, + createPayments, + isOpenRefund, + payments +}) { + return request({ + url: `point-of-sales/${posId}/orders/${orderId}/process`, + method: 'put', + data: { + create_payments: createPayments, + is_open_refund: isOpenRefund, + payments + } + }) +} + +/** ______________________________________ + * | | + * | Additional Point of Sale Services | + * |______________________________________| + */ + +/** + * List Product Conversion UOM + */ + +export function listProductConversion({ + id +}) { + return request({ + url: `common/product-conversions/${id}`, + method: 'get' + }) +} + +/** + * List Stock: GET /api/stocks + * @param {int32} posId + * @param {string} value + * @param {string} sku + */ +export function listStocks({ + posId, + value, + sku +}) { + return request({ + url: `point-of-sales/terminals/${posId}/stocks`, + method: 'get', + params: { + value, + sku + } + }) +} + +/** + * Get Currency Rate + * @param {int32} conversion_type_id + * @param {int32} currency_from_id + * @param {int32} currency_to_id + * @param {google.protobuf.Timestamp} conversion_date + */ + +export function getConversionRate({ + conversionTypeId, + currencyFromId, + currencyToId, + conversionDate +}) { + return request({ + url: 'common/conversion-rates', + method: 'get', + params: { + conversion_type_id: conversionTypeId, + currency_from_id: currencyFromId, + currency_to_id: currencyToId, + conversion_date: conversionDate + } + }) +} + +/** + * List Banks + */ +export function listBanks({ + posId +}) { + return request({ + url: `point-of-sales/${posId}/banks`, + method: 'get', + params: { + page_size: 100 + } + }) +} + +/** + * List Bank Accounts + */ +export function listBankAccounts({ + posId, + customerId, + bankId +}) { + return request({ + url: `point-of-sales/${posId}/customers/${customerId}/bank-accounts`, + method: 'get', + params: { + page_size: 100, + bank_id: bankId + } + }) +} + +/** + * Create Customer Account + */ +export function createCustomerBankAccount({ + posId, + customerId, + accountNo, + driverLicense, + bankId, + bankAccountType = 'C', + isAch = true +}) { + return request({ + url: `point-of-sales/${posId}/customers/${customerId}/bank-accounts`, + method: 'post', + data: { + account_no: accountNo, + driver_license: driverLicense, + bank_id: bankId, + bank_account_type: bankAccountType, + social_security_number: driverLicense, + is_ach: isAch + } + }) +} + +/** + * Credit Memo as Payment Method + */ +export function listCustomerCredits({ + posId, + customerId, + documentTypeId +}) { + return request({ + url: `point-of-sales/${posId}/customers/${customerId}/credits`, + method: 'get', + params: { + page_size: 100, + document_type_id: documentTypeId + } + }) +} + +/** + * Validate PIN + */ +export function validatePIN({ + pin, + posId, + orderId, + requestedAccess, + requestedAmount +}) { + return request({ + url: `point-of-sales/${posId}/validate-pin`, + method: 'post', + data: { + pin, + order_id: orderId, + requested_access: requestedAccess, + requested_amount: requestedAmount + } + }) +} +/** ___________________________________ + * | | + * | Options Point of Sale Services | + * |___________________________________| + */ + +/** + * Print Ticket + */ +export function printTicket({ + posId, + orderId, + invoiceId, + shipmentId, + recordId, + tableName +}) { + return request({ + url: `point-of-sales/${posId}/print-ticket`, + method: 'post', + data: { + order_id: orderId, + invoice_id: invoiceId, + shipment_id: shipmentId, + record_id: recordId, + table_name: tableName + } + }) +} + +/** + * Reverse Sales + */ +export function reverseSales({ + posId, + orderId, + description +}) { + return request({ + url: `point-of-sales/${posId}/orders/${orderId}/reverse`, + method: 'put', + data: { + description + } + }) +} + +/** + * Print Preview + * @param {int32} posId + * @param {int32} orderId + * @param {string} reportType + * @returns + */ + +export function printPreview({ + posId, + orderId, + reportType +}) { + return request({ + url: `point-of-sales/${posId}/print-preview`, + method: 'post', + data: { + order_id: orderId, + report_type: reportType + } + }) +} + +/** + * Copy Order + * @param {int32} posId + * @param {int32} orderId + * @param {string} reportType + * @returns + */ + +export function copyOrder({ + posId, + sourceOrderId, + salesRepresentativeId +}) { + return request({ + url: `point-of-sales/orders/${sourceOrderId}/copy`, + method: 'post', + data: { + sales_representative_id: salesRepresentativeId, + pos_id: posId + } + }) +} + +/** + * Shipment + * Create Shipment + */ + +export function createShipment({ + posId, + orderId, + salesRepresentativeId, + isCreateLinesFromOrder +}) { + return request({ + url: `point-of-sales/${posId}/shipments`, + method: 'post', + data: { + order_id: orderId, + sales_representative_id: salesRepresentativeId, + is_create_lines_from_order: isCreateLinesFromOrder + } + }) +} + +/** + * Create Shipment Line + */ +export function createShipmentLine({ + posId, + quantity, + shipmentId, + description, + orderLineId +}) { + return request({ + url: `point-of-sales/${posId}/shipments/${shipmentId}/lines`, + method: 'post', + data: { + order_line_id: orderLineId, + description, + quantity + } + }) +} + +/** + * Update Order Line + */ +export function updateShipmentLine({ + posId, + lineId, + quantity, + shipmentId, + description +}) { + return request({ + url: `point-of-sales/${posId}/shipments/${shipmentId}/lines/${lineId}`, + method: 'put', + data: { + description, + quantity + } + }) +} + +/** + * Delete Shipment Line + */ +export function deleteShipmentLine({ + posId, + lineId, + shipmentId +}) { + return request({ + url: `point-of-sales/${posId}/shipments/${shipmentId}/lines/${lineId}`, + method: 'delete' + }) +} + +/** + * List Shipment Line + */ +export function listShipmentLines({ + posId, + shipmentId +}) { + return request({ + url: `point-of-sales/${posId}/shipments/${shipmentId}/lines`, + method: 'get', + params: { + page_size: 100 + } + }) +} + +/** + * Process Shipment + */ +export function processShipment({ + id, + posId, + description, + documentAction = 'CO' +}) { + return request({ + url: `point-of-sales/${posId}/shipments/${id}/process`, + method: 'put', + data: { + document_action: documentAction, + description + } + }) +} + +/** + * Print Preview for Shipment + */ +export function printShipmentPreview({ + posId, + shipmentId, + reportType = 'application/pdf' +}) { + return request({ + url: `point-of-sales/${posId}/shipments/${shipmentId}/print-preview`, + method: 'post', + data: { + report_type: reportType + } + }) +} + +/** + * Create Return + */ +export function createRMA({ + posId, + sourceOrderId, + salesRepresentativeId, + isCreateLinesFromOrder +}) { + return request({ + url: 'point-of-sales/returns', + method: 'post', + data: { + pos_id: posId, + source_order_id: sourceOrderId, + sales_representative_id: salesRepresentativeId, + is_create_lines_from_order: isCreateLinesFromOrder + } + }) +} + +/** + * Create Return Line + */ +export function createRMALine({ + posId, + rmaId, + sourceOrderLineId, + description, + quantity +}) { + return request({ + url: `point-of-sales/returns/${rmaId}/lines`, + method: 'post', + data: { + pos_id: posId, + source_order_line_id: sourceOrderLineId, + description, + quantity + } + }) +} + +/** + * Delete Return Line + */ +export function deleteRMALine({ + posId, + rmaId, + lineId +}) { + return request({ + url: `point-of-sales/returns/${rmaId}/lines/${lineId}`, + method: 'delete', + data: { + pos_id: posId + } + }) +} + +/** + * Update RMA Line + */ +export function updateRMALine({ + posId, + rmaId, + lineId, + description, + quantity +}) { + return request({ + url: `point-of-sales/returns/${rmaId}/lines/${lineId}`, + method: 'put', + data: { + pos_id: posId, + description, + quantity + } + }) +} + +/** + * List Return Line + */ +export function listRMALine({ + posId, + rmaId +}) { + return request({ + url: `point-of-sales/returns/${rmaId}/lines`, + method: 'get', + params: { + pos_id: posId, + rma_id: rmaId + } + }) +} + +/** + * Process Return + */ +export function processRMA({ + posId, + rmaId, + documentAction = 'CO' +}) { + return request({ + url: `point-of-sales/returns/${rmaId}/process`, + method: 'put', + params: { + pos_id: posId, + rma_id: rmaId, + document_action: documentAction + } + }) +} + +/** + * Create Order from RMA + */ + +export function createOrderFromRMA({ + posId, + salesRepresentativeId, + sourceRmaId +}) { + return request({ + url: `point-of-sales/returns/${sourceRmaId}/create-order`, + method: 'post', + params: { + pos_id: posId, + sales_representative_id: salesRepresentativeId + } + }) +} + +/** + * Cash Management (Opening Process) + */ +export function cashOpening({ + posId, + payments, + description, + collectingAgentId +}) { + return request({ + url: `point-of-sales/${posId}/cash/process-opening`, + method: 'put', + data: { + collecting_agent_id: collectingAgentId, + description, + payments + } + }) +} + +/** + * Cash Withdrawal + */ +export function processCashWithdrawal({ + posId, + payments, + description, + collectingAgentId +}) { + return request({ + url: `point-of-sales/cash/process-withdrawal`, + method: 'put', + data: { + collecting_agent_id: collectingAgentId, + pos_id: posId, + description, + payments + } + }) +} + +/** + * Cash Closing + */ +export function processCashClosing({ + id, + posId, + description, + collectingAgentId +}) { + return request({ + url: `point-of-sales/cash/closings/{id}/process`, + method: 'put', + data: { + collecting_agent_id: collectingAgentId, + pos_id: posId, + description, + id + } + }) +} + +/** + * List Cash Summary + */ +export function listCashSummaryMovements({ + posId, + isOnlyProcessed, + isOnlyRefund +}) { + return request({ + url: `point-of-sales/cash/summary-movements`, + method: 'get', + params: { + pos_id: posId, + is_only_processed: isOnlyProcessed, + is_only_refund: isOnlyRefund + } + }) +} + +/** + * List all cash movements + */ +export function listCashMovements({ + posId, + isOnlyProcessed, + isOnlyRefund +}) { + return request({ + url: `point-of-sales/cash/movements`, + method: 'get', + params: { + pos_id: posId, + is_only_processed: isOnlyProcessed, + is_only_refund: isOnlyRefund + } + }) +} + +/** + * List Available Cash + * @param {int32} posId + */ +export function listAvailableCash({ + posId +}) { + return request({ + url: `/point-of-sales/terminals/${posId}/cashs`, + method: 'get' + }) +} + +/** + * Allocate Seller + */ +export function allocateSeller({ + posId, + salesRepresentativeId +}) { + return request({ + url: `/point-of-sales/terminals/${posId}/allocate-seller`, + method: 'put', + data: { + sales_representative_id: salesRepresentativeId + } + }) +} diff --git a/src/api/ADempiere/form/point-of-sales.js b/src/api/ADempiere/form/point-of-sales.js index cefa5c0182c..4bce1a86dc5 100644 --- a/src/api/ADempiere/form/point-of-sales.js +++ b/src/api/ADempiere/form/point-of-sales.js @@ -30,7 +30,7 @@ import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' * @author elsiosanchez */ export { getProductPrice as findProduct } from '@/api/ADempiere/form/price-checking.js' -export { requestGetConversionRate } from '@/api/ADempiere/system-core.js' +export { requestGetConversionRate } from '@/api/ADempiere/common/index.ts' // List Point of sales export function getPointOfSales({ diff --git a/src/api/ADempiere/dashboard/chart.js b/src/api/ADempiere/logs/index.ts similarity index 68% rename from src/api/ADempiere/dashboard/chart.js rename to src/api/ADempiere/logs/index.ts index 0796539002b..3725e5d2597 100644 --- a/src/api/ADempiere/dashboard/chart.js +++ b/src/api/ADempiere/logs/index.ts @@ -1,6 +1,6 @@ /** * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution - * Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,37 +16,41 @@ * along with this program. If not, see . */ -// This file is for get all information for dashboard of ADempiere client, -// please if you want to implement a custom dashboard create a new fielwith api definition - // Get Instance for connection import { request } from '@/utils/ADempiere/request' - -// Utils and Helper Methods -import { camelizeObjectKeys } from '@/utils/ADempiere/transformObject.js' - -// Constants import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' -// Get Metrics for Charts -export function getMetrics({ - id, - uuid, +// Get Recent Items based on selection option +export function requestListRecentItems({ pageToken, pageSize = ROWS_OF_RECORDS_BY_PAGE }) { return request({ - url: '/dashboard/addons/charts/metrics', + url: '/logs/recent-items', + method: 'get', + params: { + // Page Data + page_token: pageToken, + page_size: pageSize + } + }) +} + +// Get list of log for a records +export function requestListEntityLogs({ + tableName, + recordId, + pageToken, + pageSize = 100 +}) { + return request({ + url: `/logs/entities/${tableName}/${recordId}`, method: 'get', params: { - id, - uuid, // Page Data page_token: pageToken, page_size: pageSize } }) - .then(chart => { - return camelizeObjectKeys(chart) - }) } + diff --git a/src/api/ADempiere/dashboard/dashboard.js b/src/api/ADempiere/logs/process.ts similarity index 51% rename from src/api/ADempiere/dashboard/dashboard.js rename to src/api/ADempiere/logs/process.ts index 0c70f1e66cd..e900d7d3aa2 100644 --- a/src/api/ADempiere/dashboard/dashboard.js +++ b/src/api/ADempiere/logs/process.ts @@ -1,6 +1,6 @@ /** * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution - * Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,52 +16,39 @@ * along with this program. If not, see . */ -// This file is for get all information for dashboard of ADempiere client, -// please if you want to implement a custom dashboard create a new fielwith api definition - // Get Instance for connection import { request } from '@/utils/ADempiere/request' // Constants import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' -// List all dashboard for role -export function requestLisDashboards({ - roleId, - roleUuid, +/** + * Request a Process Activity list + */ +export function listProcessLogsRequest({ pageToken, - pageSize = ROWS_OF_RECORDS_BY_PAGE + pageSize = ROWS_OF_RECORDS_BY_PAGE, + searchValue }) { return request({ - url: '/dashboard/dashboards', + url: '/logs/process', method: 'get', params: { - role_id: roleId, - role_uuid: roleUuid, // Page Data page_token: pageToken, - page_size: pageSize + page_size: pageSize, + // filters + search_value: searchValue } - }) - .then(dashboardsListResponse => { - const { convertDashboard } = require('@/utils/ADempiere/apiConverts/dashboard.js') + }).then(processLogResponse => { + const { convertProcessLog } = require('@/utils/ADempiere/apiConverts/process.js') - return { - recordCount: dashboardsListResponse.record_count, - dashboardsList: dashboardsListResponse.records.map(dashboard => { - return convertDashboard(dashboard) - }), - nextPageToken: dashboardsListResponse.next_page_token - } - }) -} - -export function listNotifiications() { - return request({ - url: '/dashboard/list-notifications', - method: 'get' + return { + recordCount: processLogResponse.record_count, + processLogsList: processLogResponse.process_logs.map(itemProcess => { + return convertProcessLog(itemProcess) + }), + nextPageToken: processLogResponse.next_page_token + } }) - .then(notificationsResponse => { - return notificationsResponse - }) } diff --git a/src/api/ADempiere/logs/tabInfo/chatsEntries.ts b/src/api/ADempiere/logs/tabInfo/chatsEntries.ts new file mode 100644 index 00000000000..17148995623 --- /dev/null +++ b/src/api/ADempiere/logs/tabInfo/chatsEntries.ts @@ -0,0 +1,113 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +// Constants +import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' + +/** + * Is Chats Entries + */ +export function requestExistsChatsEntries({ + recordId, + tableName +}) { + return request({ + url: `logs/chat-entries/${tableName}/${recordId}/exists`, + method: 'get' + }) +} + +export function requestListEntityChats({ + recordId, + tableName, + pageToken, + pageSize = ROWS_OF_RECORDS_BY_PAGE +}) { + return request({ + url: `logs/chat-entities/${tableName}/${recordId}`, + method: 'get', + params: { + page_token: pageToken, + page_sise: pageSize + } + }) +} + +/** + * Add Chat Entry + * @param {string} tableName + * @param {string} recordId + * @param {string} recordUuid + * @param {string} comment + */ +export function requestCreateChatEntry({ + tableName, + recordId, + comment +}) { + return request({ + url: `/user-interface/chat-entry/${tableName}`, + method: 'post', + data: { + id: recordId, + comment: comment + } + }) + .then(chatEntryResponse => { + const { convertChatEntry } = require('@/utils/ADempiere/apiConverts/window.js') + + return convertChatEntry(chatEntryResponse) + }) +} + +/** + * Record Chat List + * @param {string} uuid + * @param {string} pageToken + * @param {string} pageSize + */ +export function requestListChatsEntries({ + id, + // tableName, + pageToken, + pageSize = 100 +}) { + return request({ + url: `/logs/chat-entities/${id}`, + method: 'get', + params: { + // Page Data + page_token: pageToken, + page_size: pageSize + } + }) + .then(chatEntriesListResponse => { + const { convertChatEntry } = require('@/utils/ADempiere/apiConverts/window.js') + + return { + nextPageToken: chatEntriesListResponse.next_page_token, + recordCount: chatEntriesListResponse.record_count, + chatEntriesList: chatEntriesListResponse.records.map(chatEntry => { + return convertChatEntry(chatEntry) + }) + } + }) +} diff --git a/src/api/ADempiere/logs/tabInfo/windowAttachment.ts b/src/api/ADempiere/logs/tabInfo/windowAttachment.ts new file mode 100644 index 00000000000..680db5c805e --- /dev/null +++ b/src/api/ADempiere/logs/tabInfo/windowAttachment.ts @@ -0,0 +1,83 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +// Constants +import { RESOURCE_TYPE_ATTACHMENT } from '@/utils/ADempiere/resource' + +/** + * Exists Window Attachment + */ +export function requestExistsAttachment({ + tableName, + recordId +}) { + return request({ + url: `/file-management/attachments/${tableName}/${recordId}/exists`, + method: 'get' + }) +} + +/** + * Get List Window Attachment + */ +export function requestAttachment({ + tableName, + recordId +}) { + return request({ + url: `/file-management/attachments/${tableName}/${recordId}`, + method: 'get' + }) +} + +/** + * Set resource reference + * @param {number} resourceId + * @param {string} recordUuid + * @param {string} resourceName as fileName + * @returns {promise} + */ +export function requestSetResourceReference({ + id, + // + resourceType = RESOURCE_TYPE_ATTACHMENT, + // + tableName, + recordId, + // + textMessage, + fileName, + fileSize +}) { + return request({ + url: `/file-management/references/attachment/${tableName}/${recordId}`, + method: 'put', + data: { + // parent values (attachment, image, archive) + resource_type: resourceType, + id, + // attachment reference values + text_message: textMessage, + file_name: fileName, + file_size: fileSize + } + }) +} diff --git a/src/api/ADempiere/logs/tabInfo/windowDashboards.ts b/src/api/ADempiere/logs/tabInfo/windowDashboards.ts new file mode 100644 index 00000000000..0b1303d4473 --- /dev/null +++ b/src/api/ADempiere/logs/tabInfo/windowDashboards.ts @@ -0,0 +1,37 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +/** + * Exists Window Dashboards + */ + +export function existsCharts({ + tabId, + windowId +}) { + return request({ + url: `/dashboard/exists-window-dashboards/${windowId}`, + method: 'get', + params: { + tab_id: tabId + } + }) +} diff --git a/src/api/ADempiere/logs/tabInfo/windowIssues.ts b/src/api/ADempiere/logs/tabInfo/windowIssues.ts new file mode 100644 index 00000000000..093e74ce767 --- /dev/null +++ b/src/api/ADempiere/logs/tabInfo/windowIssues.ts @@ -0,0 +1,34 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +/** + * Exists Window Issues + */ + +export function requestExistsIssues({ + tableName, + recordId +}) { + return request({ + url: `/issue-management/issues/${tableName}/${recordId}/exists`, + method: 'get' + }) +} diff --git a/src/api/ADempiere/process.js b/src/api/ADempiere/process.js index ed7ef1bceae..def9e2e3c92 100644 --- a/src/api/ADempiere/process.js +++ b/src/api/ADempiere/process.js @@ -19,9 +19,6 @@ // Get Instance for connection import { request } from '@/utils/ADempiere/request' -// Constants -import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' - /** * Request a process * This function allows follow structure: @@ -79,40 +76,3 @@ export function requestRunProcess({ return convertProcessLog(processRunResponse) }) } - -// Request a Process Activity list -export function requestListProcessesLogs({ - tableName, - instanceUuid, - userUuid, - recordId, - recordUuid, - pageSize = ROWS_OF_RECORDS_BY_PAGE, - pageToken -}) { - // Get Process Activity - return request({ - url: '/user/log/process-logs', - method: 'get', - params: { - instance_uuid: instanceUuid, - user_uuid: userUuid, - table_name: tableName, - id: recordId, - uuid: recordUuid, - page_size: pageSize, - page_token: pageToken - } - }) - .then(processLogResponse => { - const { convertProcessLog } = require('@/utils/ADempiere/apiConverts/process.js') - - return { - recordCount: processLogResponse.record_count, - processLogsList: processLogResponse.records.map(itemProcess => { - return convertProcessLog(itemProcess) - }), - nextPageToken: processLogResponse.next_page_token - } - }) -} diff --git a/src/api/ADempiere/report.js b/src/api/ADempiere/report.js index bf3d3615ab9..113c9a42805 100644 --- a/src/api/ADempiere/report.js +++ b/src/api/ADempiere/report.js @@ -1,6 +1,6 @@ /** * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution - * Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,9 +19,6 @@ // Get Instance for connection import { request } from '@/utils/ADempiere/request' -// Constants -import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' - /** * Request a Generate Report * This function allows follow structure: @@ -29,11 +26,10 @@ import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' * @param {string} reportType, format to output report (pdf, html, csv, ...) * @param {string} tableName, table name of tab, used only window * @param {number} recordId, record identifier, used only window - * @param {string} recordUuid, record universal unique identifier, used only window * @param {array} parametersList, parameters from process [{ columnName, value }] - * @param {string} printFormatUuid + * @param {string} printFormatId * @param {boolean} isSummary - * @param {string} reportViewUuid + * @param {string} reportViewId */ export function requestGenerateReport({ id, @@ -41,13 +37,10 @@ export function requestGenerateReport({ reportType, tableName, recordId, - recordUuid, parametersList = [], isSummary, printFormatId, - printFormatUuid, - reportViewId, - reportViewUuid + reportViewId }) { parametersList = parametersList.map(parameter => { return { @@ -65,15 +58,12 @@ export function requestGenerateReport({ // record table_name: tableName, record_id: recordId, - record_uuid: recordUuid, // report is_summary: isSummary, report_type: reportType, report_view_id: reportViewId, - report_view_uuid: reportViewUuid, parameters: parametersList, - print_format_id: printFormatId, - print_format_uuid: printFormatUuid + print_format_id: printFormatId } }) .then(reportGeneratedResponse => { @@ -83,111 +73,6 @@ export function requestGenerateReport({ }) } -/** - * Request Pending Documents List - * @param {string} tableName - * @param {string} uuid report universally unique identifier - * @param {string} pageToken token of pagination to number page - * @param {number} pageSize limit of records to return - * @returns {promise} - */ -export function requestListReportsViews({ - tableName, - uuid, - pageToken, - pageSize = ROWS_OF_RECORDS_BY_PAGE -}) { - return request({ - url: '/user-interface/process/report-views', - method: 'get', - params: { - table_name: tableName, - process_uuid: uuid, - page_token: pageToken, - page_size: pageSize - } - }) - .then(reportViewResponse => { - const { convertReportView } = require('@/utils/ADempiere/apiConverts/report.js') - - return { - nextPageToken: reportViewResponse.next_page_token, - recordCount: reportViewResponse.record_count, - reportViewsList: reportViewResponse.records.map(drill => { - return convertReportView(drill) - }) - } - }) -} - -/** - * Get print formats from table name, report view uuid or process uuid - * @param {string} reportViewUuid report view universally unique identifier - * @param {string} tableName - * @param {string} uuid report universally unique identifier - * @param {string} pageToken token of pagination to number page - * @param {number} pageSize limit of records to return - * @returns {promise} - */ -export function requestListPrintFormats({ - tableName, - reportViewUuid, - uuid, - pageToken, - pageSize = ROWS_OF_RECORDS_BY_PAGE -}) { - return request({ - url: '/user-interface/process/print-formats', - method: 'get', - params: { - table_name: tableName, - report_view_uuid: reportViewUuid, - process_uuid: uuid, - page_token: pageToken, - page_size: pageSize - } - }) - .then(responseListPrintFormats => { - const { convertListPrintFormats } = require('@/utils/ADempiere/apiConverts/report.js') - - return convertListPrintFormats(responseListPrintFormats) - }) -} - -/** - * Get drill tables for a report - * @param {string} tableName - * @param {string} pageToken token of pagination to number page - * @param {number} pageSize limit of records to return - * @returns {promise} - */ -export function requestListDrillTables({ - tableName, - pageToken, - pageSize = ROWS_OF_RECORDS_BY_PAGE -}) { - return request({ - url: '/user-interface/process/drill-tables', - method: 'get', - params: { - table_name: tableName, - page_token: pageToken, - page_size: pageSize - } - }) - .then(drillTablesResponse => { - const { convertDrillTables } = require('@/utils/ADempiere/apiConverts/report.js') - - return { - drillTablesList: drillTablesResponse.records.map(drill => { - return convertDrillTables(drill) - }), - nextPageToken: drillTablesResponse.next_page_token, - recordCount: drillTablesResponse.record_count - } - }) -} - // Get report output from parameters export function requestGetReportOutput({ processId, diff --git a/src/api/ADempiere/reportManagement/drillTable.ts b/src/api/ADempiere/reportManagement/drillTable.ts new file mode 100644 index 00000000000..6820c8d1802 --- /dev/null +++ b/src/api/ADempiere/reportManagement/drillTable.ts @@ -0,0 +1,42 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +// Constants +import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' + +/** + * Get default value for a field, parameter or query criteria + * @param {string} tableName, identifier of field + */ +export function listDrillTablesRequest({ + tableName, + pageToken, + pageSize = ROWS_OF_RECORDS_BY_PAGE +}) { + return request({ + url: `/report-management/drill-tables/${tableName}`, + method: 'get', + params: { + page_size: pageSize, + page_token: pageToken + } + }) +} diff --git a/src/api/ADempiere/reportManagement/index.ts b/src/api/ADempiere/reportManagement/index.ts new file mode 100644 index 00000000000..bebc285000c --- /dev/null +++ b/src/api/ADempiere/reportManagement/index.ts @@ -0,0 +1,45 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +/** + * Get default value for a field, parameter or query criteria + * @param {number} id, identifier of field + */ +export function generateReportRequest({ + id, + parameters, + reportType, + printFormatId, + reportViewId, + isSummary +}) { + return request({ + url: `/report-management/report/${id}`, + method: 'post', + data: { + parameters, + report_type: reportType, + print_format_id: printFormatId, + report_view_id: reportViewId, + is_summary: isSummary + } + }) +} diff --git a/src/api/ADempiere/reportManagement/printFormat.ts b/src/api/ADempiere/reportManagement/printFormat.ts new file mode 100644 index 00000000000..e9c0029925a --- /dev/null +++ b/src/api/ADempiere/reportManagement/printFormat.ts @@ -0,0 +1,42 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +// Constants +import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' + +/** + * Get default value for a field, parameter or query criteria + * @param {Number} reportId, identifier of report + */ +export function listPrintFormatsRequest({ + reportId, + pageToken, + pageSize = ROWS_OF_RECORDS_BY_PAGE +}) { + return request({ + url: `/report-management/print-formats/${reportId}`, + method: 'get', + params: { + page_size: pageSize, + page_token: pageToken + } + }) +} diff --git a/src/api/ADempiere/dashboard/tasks.js b/src/api/ADempiere/reportManagement/reportView.ts similarity index 52% rename from src/api/ADempiere/dashboard/tasks.js rename to src/api/ADempiere/reportManagement/reportView.ts index 54dabca9ed2..29294af0134 100644 --- a/src/api/ADempiere/dashboard/tasks.js +++ b/src/api/ADempiere/reportManagement/reportView.ts @@ -1,6 +1,6 @@ /** * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution - * Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,46 +16,44 @@ * along with this program. If not, see . */ -// This file is for get all information for dashboard of ADempiere client, -// please if you want to implement a custom dashboard create a new fielwith api definition - // Get Instance for connection import { request } from '@/utils/ADempiere/request' // Constants import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' -// Get pending documents -export function getPendingDocumentsFromServer({ - userId, - userUuid, - roleId, - roleUuid, +// Utils and Helper Methods +import { isEmptyValue } from '@/utils/ADempiere/valueUtils' + +/** + * Get default value for a field, parameter or query criteria + * @param {Number} reportId, identifier of report + * @param {String} tableName token of pagination to number page + * @param {String} pageToken token of pagination to number page + * @param {number} pageSize limit of records to return + */ +export function listReportViewsRequest({ + reportId, + tableName, pageToken, pageSize = ROWS_OF_RECORDS_BY_PAGE }) { + if (isEmptyValue(tableName)) { + return request({ + url: `/report-management/report-views/${tableName}`, + method: 'get', + params: { + page_size: pageSize, + page_token: pageToken + } + }) + } return request({ - url: '/dashboard/addons/tasks/pending-documents', + url: `/report-management/report-views/${reportId}`, method: 'get', params: { - user_id: userId, - user_uuid: userUuid, - role_id: roleId, - role_uuid: roleUuid, - // Page Data - page_token: pageToken, - page_size: pageSize + page_size: pageSize, + page_token: pageToken } }) - .then(pendingDocumentsListResponse => { - const { convertPendingDocument } = require('@/utils/ADempiere/apiConverts/dashboard.js') - - return { - recordCount: pendingDocumentsListResponse.record_count, - pendingDocumentsList: pendingDocumentsListResponse.records.map(pendingDocument => { - return convertPendingDocument(pendingDocument) - }), - nextPageToken: pendingDocumentsListResponse.next_page_token - } - }) } diff --git a/src/api/ADempiere/security/index.ts b/src/api/ADempiere/security/index.ts new file mode 100644 index 00000000000..172bc982600 --- /dev/null +++ b/src/api/ADempiere/security/index.ts @@ -0,0 +1,201 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details.services + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +// Utils and Helper Methods +import { camelizeObjectKeys } from '@/utils/ADempiere/transformObject.js' +import { getLanguage } from '@/lang/index' + +/** + * Make login by UserName and password, this function can return user data for show + * @param {string} userName + * @param {string} password + * @param {number} roleId + * @param {number} organizationId + * @param {number} warehouseId + * @param {number} lenguaje + */ +export function requestLogin({ + userName, + password, + roleId, + organizationId, + warehouseId +}) { + const language = getLanguage() || 'en_US' + + return request({ + url: '/security/login', + method: 'post', + params: { + language + }, + data: { + user_name: userName, + user_pass: password, + role_id: roleId, + organization_id: organizationId, + warehouse_id: warehouseId + } + }) + .then(response => { + const { token } = response + return token + }) +} + +/** + * Change session attribute + * @param {number} warehouseId + * @param {string} language + */ +export function setSessionAttribute({ + warehouseId, + language +}) { + return request({ + url: '/security/session-attribute', + method: 'put', + data: { + warehouse_id: warehouseId, + language + } + }) +} + +/** + * Get User Info + */ +export function requestUserInfoFromSession() { + return request({ + url: '/security/user-info', + method: 'get' + }) +} + +/** + * Get session info + */ +export function requestSessionInfo() { + return request({ + url: '/security/session-info', + method: 'get' + }) + .then(response => { + return camelizeObjectKeys(response) + }) +} + +/** + * Get Roles List + * @param {numbre} pageSize + * @param {string} pageToken + */ +export function requestRolesList() { + return request({ + url: '/security/roles', + method: 'get' + }) + .then(response => { + const { roles } = response + return roles.map(list => camelizeObjectKeys(list)) + }) +} + +/** + * Change role of access + * @param {number} roleId + * @param {number} organizationId + * @param {number} warehouseId + */ +export function requestChangeRole({ + roleId, + organizationId, + warehouseId +}) { + return request({ + url: '/security/change-role', + method: 'put', + data: { + role_id: roleId, + organization_id: organizationId, + warehouse_id: warehouseId + } + }) +} + +/** + * GET Menu + */ +export function requestMenu() { + return request({ + url: '/security/menu', + method: 'get' + }) +} + +/** + * GET Services + */ +export function services() { + return request({ + url: '/security/services', + method: 'get' + }) + .then(response => { + if (!response) { + return [] + } + return response.map(list => camelizeObjectKeys(list)) + }) +} + +/** + * Request login from Open ID + * @param {string} code + * @param {string} state + */ +export function loginAuthentication({ + code, + state +}) { + return request({ + url: '/user/open-id/login', + method: 'post', + data: { + code, + state + } + }) + .then(response => { + return response + }) +} + +/** + * Logout from server + */ +export function requestLogout() { + return request({ + method: 'post', + url: '/security/logout' + }) +} + diff --git a/src/api/ADempiere/user-interface/component/index.js b/src/api/ADempiere/user-interface/component/index.ts similarity index 78% rename from src/api/ADempiere/user-interface/component/index.js rename to src/api/ADempiere/user-interface/component/index.ts index 47515c400ce..c145ecfb4b0 100644 --- a/src/api/ADempiere/user-interface/component/index.js +++ b/src/api/ADempiere/user-interface/component/index.ts @@ -1,6 +1,6 @@ /** * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution - * Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com * Contributor(s): Elsio Sanchez Elsiosanches@gmail.com https://github.com/elsiosanchez * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,19 +28,12 @@ export function requestMailTemplates({ pageToken }) { return request({ - url: '/user-interface/component/list-mail-templates', - method: 'post', + url: '/user-interface/mail-templates', + method: 'get', data: { search_value: searchValue, page_size: pageSize, page_token: pageToken } }) - .then(response => { - return { - recordCount: response.record_count, - records: response.records, - nextPageToken: response.next_page_token - } - }) } diff --git a/src/api/ADempiere/user-interface/component/issue.js b/src/api/ADempiere/user-interface/component/issue.js index 970dc413ad9..ab2909c8dd1 100644 --- a/src/api/ADempiere/user-interface/component/issue.js +++ b/src/api/ADempiere/user-interface/component/issue.js @@ -21,21 +21,18 @@ import { request } from '@/utils/ADempiere/request' /** * Issues exist - * @param {string} tableName - * @param {number} recordId - * @param {string} recordUuid + * @param {string} tableName + * @param {number} recordId */ export function requestExistsIssues({ tableName, - recordId, - recordUuid + recordId }) { return request({ - url: '/user-interface/component/issue/exists-issues', + url: `/issue-management/issues/${tableName}/${recordId}/exists`, method: 'get', params: { record_id: recordId, - record_uuid: recordUuid, table_name: tableName } }) @@ -46,30 +43,24 @@ export function requestExistsIssues({ /** * Issues List from Window - * @param {string} tableName - * @param {number} recordId - * @param {string} recordUuid - * @param {string} searchValue + * @param {string} tableName + * @param {number} recordId + * @param {string} searchValue */ export function requestListIssues({ tableName, recordId, - recordUuid, searchValue }) { return request({ - url: '/user-interface/component/issue/list-issues', + url: '/issue-management/issues', method: 'get', params: { record_id: recordId, - record_uuid: recordUuid, table_name: tableName, search_value: searchValue } }) - .then(listExists => { - return listExists - }) } /** diff --git a/src/api/ADempiere/userInterface/browserList.ts b/src/api/ADempiere/userInterface/browserList.ts new file mode 100644 index 00000000000..b51cea1d27b --- /dev/null +++ b/src/api/ADempiere/userInterface/browserList.ts @@ -0,0 +1,48 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' +import { RECORD_ROWS_BY_LIST } from '@/utils/ADempiere/references.js' +/** + * Request dictionary Smart Browser metadata + * @param {string} uuid universally unique identifier + * @param {number} id, identifier + */ +export function requestBrowserSearch({ + id, + filters, + pageToken, + contextAttributes, + pageSize = RECORD_ROWS_BY_LIST +}) { + return request({ + url: `/user-interface/browser-items/${id}`, + method: 'get', + params: { + filters, + context_attributes: contextAttributes, + page_token: pageToken, + page_size: pageSize + } + }) + .then(responseBrowserSearch => { + // const { convertEntityList } = require('@/utils/ADempiere/apiConverts/persistence.js') + return responseBrowserSearch + }) +} diff --git a/src/api/ADempiere/userInterface/defaultValue.ts b/src/api/ADempiere/userInterface/defaultValue.ts new file mode 100644 index 00000000000..ad6a1f1c8ff --- /dev/null +++ b/src/api/ADempiere/userInterface/defaultValue.ts @@ -0,0 +1,92 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { isEmptyValue } from '@/utils/ADempiere' +import { request } from '@/utils/ADempiere/request' + +/** + * Get default value for a field, parameter or query criteria + * @param {array} contextAttributesList, key value + * @param {string} fieldUuid, uuid of window field + * @param {string} processParameterUuid, uuid of process/report field + * @param {string} browseFieldUuid, uuid of browser field + * @param {integer} id, identifier of field + * @param {string} columnUuid, uuid of column + * @param {mixed} value, value to overwrite default value on dictionary definition + */ +export function requestDefaultValue({ + columnName, + tableName, + columnId, + id, + processParameterId, + processParameterToId, + browseFieldId, + browseFieldToId, + contextAttributes, + value +}) { + const column_name = columnName + const table_name = tableName + const column_id = columnId + const process_parameter_id = processParameterId + const process_parameter_to_id = processParameterToId + const browse_field_id = browseFieldId + const browse_field_to_id = browseFieldToId + + let url + switch (true) { + case (!isEmptyValue(column_name) && isEmptyValue(table_name)): + url = `/user-interface/default-value/${table_name}/${column_name}` + break + case !isEmptyValue(column_id): + url = `/user-interface/default-value/column/${column_id}` + break + case !isEmptyValue(id): + url = `/user-interface/default-value/field/${id}` + break + case !isEmptyValue(process_parameter_id): + url = `/user-interface/default-value/parameter/${process_parameter_id}` + break + case !isEmptyValue(process_parameter_to_id): + url = `/user-interface/default-value/parameter/${process_parameter_to_id}/to` + break + case !isEmptyValue(browse_field_id): + url = `/user-interface/default-value/query-criteria/${browse_field_id}` + break + case !isEmptyValue(browse_field_to_id): + url = `/user-interface/default-value/query-criteria/${browse_field_to_id}/to` + break + default: + url = `/user-interface/default-value/` + break + } + return request({ + url, + method: 'get', + params: { + context_attributes: contextAttributes, + value + } + }) + .then(valueResponse => { + return valueResponse + }) +} + diff --git a/src/api/ADempiere/userInterface/entities.ts b/src/api/ADempiere/userInterface/entities.ts new file mode 100644 index 00000000000..877fb7773ad --- /dev/null +++ b/src/api/ADempiere/userInterface/entities.ts @@ -0,0 +1,145 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' +import { RECORD_ROWS_BY_LIST } from '@/utils/ADempiere/references.js' + +/** + * Request Entities + * @param {string} uuid universally unique identifier + * @param {number} id, identifier + */ +export function requestGetEntities({ + tabId, + filters, + pageToken, + searchValue, + contextAttributes, + pageSize = RECORD_ROWS_BY_LIST +}) { + return request({ + url: `/user-interface/entities/${tabId}`, + method: 'get', + params: { + filters, + search_value: searchValue, + context_attributes: contextAttributes, + page_token: pageToken, + page_size: pageSize + } + }) + .then(response => { + return { + nextPageToken: response.next_page_token, + recordCount: response.record_count, + records: response.records + } + }) +} + +/** + * Create Tab Entity + * @param {number} tabId + * @param {array} attributesList + */ +export function createEntity({ + tabId, + attributesList +}) { + const attributesObject = {} + attributesList.forEach(element => { + attributesObject[element.columnName] = element.value + }) + + return request({ + url: `/user-interface/entities/${tabId}`, + method: 'post', + data: { + attributes: attributesObject + } + }) +} + +/** + * Update Tab Entity + * @param {number} tabId + * @param {array} attributesList + */ +export function updateEntity({ + reccordId, + tabId, + attributesList, + keyColumnsList +}) { + const attributesObject = {} + attributesList.forEach(element => { + attributesObject[element.columnName] = element.value + }) + + return request({ + url: `/user-interface/entities/${tabId}/${reccordId}`, + method: 'patch', + data: { + attributes: { + ...attributesObject, + ...keyColumnsList + } + } + }) +} + +/** + * Delete Entity + * @param {string} tableName + * @param {number} recordId + */ + +export function deleteEntity({ + tableName, + recordId +}) { + return request({ + url: `/business-data/entities/${tableName}/${recordId}`, + method: 'delete' + }) +} + +/** + * Request Entities + * @param {string} uuid universally unique identifier + * @param {number} , + recordUuid, + listRecordIdid, identifier + */ +export function getEntity({ + id, + tabId +}) { + return request({ + url: `/user-interface/entities/${tabId}/${id}`, + method: 'get' + }) + .then(response => { + return { + nextPageToken: response.next_page_token, + recordCount: response.record_count, + records: response.records + } + }) +} diff --git a/src/api/ADempiere/userInterface/lookups.ts b/src/api/ADempiere/userInterface/lookups.ts new file mode 100644 index 00000000000..fcde32d8b66 --- /dev/null +++ b/src/api/ADempiere/userInterface/lookups.ts @@ -0,0 +1,92 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Elsio Sanchez elsiosanchez15@outlook.com https://github.com/elsiosanchez + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { isEmptyValue } from '@/utils/ADempiere' +import { request } from '@/utils/ADempiere/request' +import { RECORD_ROWS_BY_LIST } from '@/utils/ADempiere/references.js' +/** + * Request a Lookup list data from Reference + * The main attributes that function hope are: + * @param {string} fieldUuid + * @param {string} browseFieldUuid + * @param {string} processParameterUuid + * @param {array} contextAttributesList + * @param {string} pageToken + * @param {number} pageSize + */ +export function requestLookupList({ + contextAttributesList, + processParameterId, + browseFieldId, + fieldId, + // + referenceUuid, + searchValue, + // + tableName, + columnName, + columnId, + // + pageToken, + pageSize = RECORD_ROWS_BY_LIST +}) { + let url + switch (true) { + case (!isEmptyValue(columnId)): + url = `/user-interface/lookups/column/${columnId}` + break + case !isEmptyValue(fieldId): + url = `/user-interface/lookups/field/${fieldId}` + break + case !isEmptyValue(processParameterId): + url = `/user-interface/lookups/parameter/${processParameterId}` + break + case !isEmptyValue(browseFieldId): + url = `/user-interface/lookups/query-criteria/${browseFieldId}` + break + default: + url = `/user-interface/lookups/${tableName}/${columnName}` + break + } + + return request({ + url, + method: 'get', + params: { + context_attributes: contextAttributesList, + // + reference_uuid: referenceUuid, + search_value: searchValue, + // + table_name: tableName, + column_name: columnName, + column_id: columnId, + // Page Data + page_token: pageToken, + page_size: pageSize + } + }) + .then(lookupListResponse => { + return { + nextPageToken: lookupListResponse.next_page_token, + recordCount: lookupListResponse.record_count, + recordsList: lookupListResponse.records + } + }) +} diff --git a/src/api/ADempiere/userInterface/window.ts b/src/api/ADempiere/userInterface/window.ts new file mode 100644 index 00000000000..c95c650ca76 --- /dev/null +++ b/src/api/ADempiere/userInterface/window.ts @@ -0,0 +1,57 @@ +/** + * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Get Instance for connection +import { request } from '@/utils/ADempiere/request' + +/** + * Run callout request + * @param {Number} tabId + * @param {string} tableName + * @param {string} columnName + * @param {mixed} value + * @param {mixed} oldValue + * @param {string} callout + * @param {array} attributesList + * @returns {Map} Entity + */ +export function runCallOutRequest({ + tabId, + tableName, + contextAttributesList = [], + columnName, + callout, + value, + oldValue +}) { + return request({ + url: `/user-interface/run-callout/${tabId}/${columnName}/${callout}`, + method: 'post', + data: { + // window_uuid: windowUuid, + // window_no: windowNo, + tab_id: tabId, + table_name: tableName, + context_attributes: contextAttributesList, + column_name: columnName, + callout, + value, + old_value: oldValue + } + }) +} diff --git a/src/api/ADempiere/window.js b/src/api/ADempiere/window.js index 2cd5c30f645..a05632bb0ef 100644 --- a/src/api/ADempiere/window.js +++ b/src/api/ADempiere/window.js @@ -1,6 +1,6 @@ /** * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution - * Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,78 +18,9 @@ // Get Instance for connection import { request } from '@/utils/ADempiere/request' -import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js' // Constants import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' -import { RECORD_ROWS_BY_LIST } from '@/utils/ADempiere/references.js' - -/** - * Request a Lookup list data from Reference - * The main attributes that function hope are: - * @param {string} fieldUuid - * @param {string} browseFieldUuid - * @param {string} processParameterUuid - * @param {array} contextAttributesList - * @param {string} pageToken - * @param {number} pageSize - */ -export function requestLookupList({ - contextAttributesList, - fieldUuid, - processParameterUuid, - browseFieldUuid, - id, - // - referenceUuid, - searchValue, - // - tableName, - columnName, - columnUuid, - // - pageToken, - pageSize = RECORD_ROWS_BY_LIST -}) { - let contextAttributes = [] - if (!isEmptyValue(contextAttributesList)) { - contextAttributes = contextAttributesList.map(attribute => { - return { - key: attribute.columnName, - value: attribute.value - } - }) - } - - return request({ - url: '/user-interface/window/lookup-items', - method: 'get', - params: { - context_attributes: contextAttributes, - field_uuid: fieldUuid, - process_parameter_uuid: processParameterUuid, - browse_field_uuid: browseFieldUuid, - id, - // - reference_uuid: referenceUuid, - search_value: searchValue, - // - table_name: tableName, - column_name: columnName, - column_uuid: columnUuid, - // Page Data - page_token: pageToken, - page_size: pageSize - } - }) - .then(lookupListResponse => { - return { - nextPageToken: lookupListResponse.next_page_token, - recordCount: lookupListResponse.record_count, - recordsList: lookupListResponse.records - } - }) -} /** * Reference List from Window @@ -182,52 +113,6 @@ export function requestGetContextInfoValue({ }) } -/** - * Run callout request - * @param {string} windowUuid - * @param {number} windowNo - * @param {string} tabUuid - * @param {string} tableName - * @param {string} columnName - * @param {mixed} value - * @param {mixed} oldValue - * @param {string} callout - * @param {array} attributesList - * @returns {Map} Entity - */ -export function runCallOutRequest({ - windowUuid, - windowNo, - tabUuid, - tableName, - contextAttributesList = [], - columnName, - callout, - valueType, - value, - oldValue -}) { - return request({ - url: '/user-interface/window/run-callout', - method: 'post', - data: { - window_uuid: windowUuid, - window_no: windowNo, - tab_uuid: tabUuid, - table_name: tableName, - context_attributes: contextAttributesList, - column_name: columnName, - callout, - value_type: valueType, - value, - old_value: oldValue - } - }) - .then(response => { - return response - }) -} - // Get list of log for a records export function requestListEntityLogs({ tableName, @@ -265,17 +150,13 @@ export function requestListEntityLogs({ export function requestListWorkflowsLogs({ tableName, recordId, - recordUuid, pageToken, pageSize = ROWS_OF_RECORDS_BY_PAGE }) { return request({ - url: '/user/log/workflow-logs', + url: `/logs/workflows/${tableName}/${recordId}`, method: 'get', params: { - table_name: tableName, - id: recordId, - uuid: recordUuid, // Page Data page_token: pageToken, page_size: pageSize @@ -322,134 +203,3 @@ export function requestListWorkflows({ } }) } - -/** - * @param {string} tableName - * @param {integer} recordId - * @param {string} pageToken - * @param {string} pageSize - */ -export function requestListEntityChats({ - tableName, - recordId, - recordUuid, - pageToken, - pageSize = ROWS_OF_RECORDS_BY_PAGE -}) { - return request({ - url: '/user/log/entity-chats', - method: 'get', - params: { - table_name: tableName, - id: recordId, - uuid: recordUuid, - // Page Data - page_token: pageToken, - page_size: pageSize - } - }) - .then(entityChatListResponse => { - const { convertEntityChat } = require('@/utils/ADempiere/apiConverts/window.js') - - return { - nextPageToken: entityChatListResponse.next_page_token, - recordCount: entityChatListResponse.record_count, - entityChatsList: entityChatListResponse.records.map(entityChat => { - return convertEntityChat(entityChat) - }) - } - }) -} - -/** - * GET Exists chats entries - * @param {string} uuid - * @param {string} pageToken - * @param {string} pageSize - */ -export function existsChatsEntries({ - tableName, - recordId, - recordUuid, - pageToken, - pageSize = ROWS_OF_RECORDS_BY_PAGE -}) { - return request({ - url: '/user/log/exists-chat-entries', - method: 'get', - params: { - table_name: tableName, - record_id: recordId, - record_uuid: recordUuid, - // Page Data - page_token: pageToken, - page_size: pageSize - } - }) - .then(response => { - return response - }) -} -/** - * @param {string} uuid - * @param {string} pageToken - * @param {string} pageSize - */ -export function requestListChatsEntries({ - id, - uuid, - pageToken, - pageSize = ROWS_OF_RECORDS_BY_PAGE -}) { - return request({ - url: '/user/log/chat-entries', - method: 'get', - params: { - id, - uuid, - // Page Data - page_token: pageToken, - page_size: pageSize - } - }) - .then(chatEntriesListResponse => { - const { convertChatEntry } = require('@/utils/ADempiere/apiConverts/window.js') - - return { - nextPageToken: chatEntriesListResponse.next_page_token, - recordCount: chatEntriesListResponse.record_count, - chatEntriesList: chatEntriesListResponse.records.map(chatEntry => { - return convertChatEntry(chatEntry) - }) - } - }) -} - -/** - * @param {string} tableName - * @param {string} recordId - * @param {string} recordUuid - * @param {string} comment - */ -export function requestCreateChatEntry({ - tableName, - recordId, - recordUuid, - comment -}) { - return request({ - url: '/user-interface/component/notes/create-chat-entry', - method: 'post', - data: { - table_name: tableName, - id: recordId, - uuid: recordUuid, - comment: comment - } - }) - .then(chatEntryResponse => { - const { convertChatEntry } = require('@/utils/ADempiere/apiConverts/window.js') - - return convertChatEntry(chatEntryResponse) - }) -} diff --git a/src/api/ADempiere/workflow.js b/src/api/ADempiere/workflow.js index c3fe6b183e1..30506bed5f4 100644 --- a/src/api/ADempiere/workflow.js +++ b/src/api/ADempiere/workflow.js @@ -1,6 +1,6 @@ /** * ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution - * Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com + * Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com * Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,8 @@ // Get Instance for connection import { request } from '@/utils/ADempiere/request' -// constants +// Constants +import { RECORD_ROWS_BY_LIST } from '@/utils/ADempiere/references' import { ROWS_OF_RECORDS_BY_PAGE } from '@/utils/ADempiere/tableUtils' /** @@ -54,67 +55,40 @@ export function requestWorkflowMetadata({ export function requestListDocumentStatuses({ tableName, recordId, - recordUuid, - documentStatus, - pageSize = ROWS_OF_RECORDS_BY_PAGE, + searchValue, + pageSize = RECORD_ROWS_BY_LIST, pageToken }) { return request({ - url: '/workflow/document-statuses', + url: `/workflow/statuses/${tableName}/${recordId}`, method: 'get', params: { - id: recordId, - uuid: recordUuid, - table_name: tableName, - document_status: documentStatus, + search_value: searchValue, // Page Data page_token: pageToken, page_size: pageSize } }) - .then(listDocumentsActionsResponse => { - return { - nextPageToken: listDocumentsActionsResponse.next_page_token, - recordCount: listDocumentsActionsResponse.record_count, - documentStatusesList: listDocumentsActionsResponse.records - } - }) } // Request a document action list from current status of document export function requestListDocumentActions({ tableName, recordId, - recordUuid, - documentStatus, - documentAction, - pageSize = ROWS_OF_RECORDS_BY_PAGE, + searchValue, + pageSize = RECORD_ROWS_BY_LIST, pageToken }) { return request({ - url: '/workflow/document-actions', + url: `/workflow/actions/${tableName}/${recordId}`, method: 'get', params: { - id: recordId, - uuid: recordUuid, - table_name: tableName, - document_action: documentAction, - document_status: documentStatus, + search_value: searchValue, // Page Data page_token: pageToken, page_size: pageSize } }) - .then(listDocumentsActionsResponse => { - return { - nextPageToken: listDocumentsActionsResponse.next_page_token, - recordCount: listDocumentsActionsResponse.record_count, - defaultDocumentAction: { - ...listDocumentsActionsResponse.default_document_action - }, - documentActionsList: listDocumentsActionsResponse.records - } - }) } // Request a list of Activities from the user's Workflows @@ -171,25 +145,17 @@ export function getWorkflow({ /** * Request Document Status List * @param {string} tableName - * @param {number} id - * @param {string} uuid + * @param {number} recordId record identifier * @param {string} docAction */ export function requestRunDocumentAction({ tableName, - id, - uuid, + recordId, docAction }) { return request({ - url: '/workflow/run-document-action', - method: 'get', - params: { - table_name: tableName, - id, - uuid, - document_action: docAction - } + url: `/workflow/workflows/run-action/${tableName}/${recordId}/${docAction}`, + method: 'post' }) } diff --git a/src/api/role.js b/src/api/role.js index bbab6d80916..58790e874f2 100644 --- a/src/api/role.js +++ b/src/api/role.js @@ -32,21 +32,6 @@ export function getRoles() { }) } -export function requestRolesList() { - return request({ - url: 'user/roles', - method: 'get' - }) - .then(responseRoles => { - const { convertRole } = require('@/utils/ADempiere/apiConverts/user.js') - const rolesList = responseRoles.map(itemRol => { - return convertRole(itemRol) - }) - - return rolesList - }) -} - export function addRole(data) { return request({ url: '/vue-element-admin/role', @@ -69,25 +54,3 @@ export function deleteRole(id) { method: 'delete' }) } - -/** - * Change role of access - * @param {number} roleId - * @param {number} organizationId - * @param {number} warehouseId - */ -export function requestChangeRole({ - roleId, - organizationId, - warehouseId -}) { - return request({ - url: 'user/change-role', - method: 'post', - data: { - role_id: roleId, - organization_id: organizationId, - warehouse_id: warehouseId - } - }) -} diff --git a/src/api/user.js b/src/api/user.js index 984b582bb2d..4d6767c60b8 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -19,112 +19,6 @@ // Instance for connection import { request } from '@/utils/ADempiere/request' -// Utils and Helper Methods -import { getLanguage } from '@/lang/index' - -/** - * Make login by UserName and password, this function can return user data for show - * @param {string} userName - * @param {string} password - * @param {number} roleId - * @param {number} organizationId - * @param {number} warehouseId - */ -export function requestLogin({ - userName, - password, - roleId, - organizationId, - warehouseId, - token -}) { - const language = getLanguage() || 'en_US' - - return request({ - url: '/user/login', - method: 'post', - params: { - language - }, - data: { - username: userName, - password, - role_id: roleId, - organization_id: organizationId, - warehouse_id: warehouseId, - token - } - }) -} - -/** - * Get User Info - */ -export function requestUserInfoFromSession() { - return request({ - url: '/user/info', - method: 'get' - }) -} - -/** - * Get session info - */ -export function requestSessionInfo() { - return request({ - url: '/user/session', - method: 'get' - }) - .then(responseSession => { - const { convertSession } = require('@/utils/ADempiere/apiConverts/user.js') - - return convertSession(responseSession) - }) -} - -/** - * Get User menu from server - * @deprecated - */ -export function requestMenu() { - return request({ - url: '/user/menu', - method: 'get' - }) - .then(response => { - return response - }) -} - -/** - * Logout from server - */ -export function requestLogout() { - return request({ - method: 'post', - url: '/user/logout' - }) -} - -/** - * Change session attribute - * @param {number} warehouseId - * @param {string} language - */ -export function setSessionAttribute({ - warehouseId, - language -}) { - return request({ - url: 'user/set-session-attribute', - method: 'put', - data: { - warehouse_id: warehouseId, - language - } - }) -} - /** * Get User Activity */ diff --git a/src/components/ADempiere/ActionMenu/index.vue b/src/components/ADempiere/ActionMenu/index.vue index 2a129eeb833..34374626cfe 100644 --- a/src/components/ADempiere/ActionMenu/index.vue +++ b/src/components/ADempiere/ActionMenu/index.vue @@ -1,19 +1,19 @@