Compare commits

...

172 Commits

Author SHA1 Message Date
Muhammad Eko ac9d9aa18e tax 2025-03-10 14:53:15 +07:00
Muhammad Eko ccaf5a808a fix conflict midsuit 2024-12-31 10:50:59 +07:00
Muhammad Eko ff64aab5ca midsuit 2024-12-31 10:39:09 +07:00
Carlos Ruiz 751f6a5d33 IDEMPIERE-6342 Issues when renaming a table that already has records saved (#2591) 2024-12-22 13:26:01 +01:00
Carlos Ruiz f384951277 IDEMPIERE-6341 Automatic Close tabs on Chrome #resolve (#2596) 2024-12-22 13:26:01 +01:00
Vitor Villa 2ea4730458 IDEMPIERE-6335 - Create parameter to specify document type in material receipt (#2581)
* IDEMPIERE-6335 - Create parameter to specify document type in material receipt

* IDEMPIERE-6335 - Adjust to use centralized ID management

* IDEMPIERE-6335 - apply the patch
2024-12-22 13:26:01 +01:00
Vitor Henrique Dos Santos aebedaee28 IDEMPIERE-6331 - (MWFActivity) SaveError (#2578) 2024-12-22 13:26:01 +01:00
Carlos Ruiz 5ea94dad45 IDEMPIERE-6332 Implement MChart.getData to return the data used to paint the chart - add chart type (#2589) 2024-12-22 13:26:01 +01:00
Carlos Ruiz 978c8a6e25 IDEMPIERE-6329 Bug in BOM* SQL functions not getting the correct BOM children (#2586)
- fix as suggested by Vitor Santos at mattermost
2024-12-11 12:23:42 +01:00
Carlos Ruiz fd647247ba IDEMPIERE-6334 Non Advanced Role cannot open Chart window (#2582) 2024-12-11 12:23:42 +01:00
hengsin 6e1a7c3dc5 IDEMPIERE-6330 For zoom to level 2 tab, the parent level 1 tab will only retrieve 1 record (#2576) 2024-12-04 14:37:14 +01:00
hengsin edea913918 IDEMPIERE-6327 Interest Area Window: Subscription tab should not enable "Insert Record" (#2574) 2024-12-04 14:37:14 +01:00
Carlos Ruiz e5f364f391 IDEMPIERE-6332 Implement MChart.getData to return the data used to paint the chart (#2579) 2024-12-04 14:37:14 +01:00
Anozi Mada 1522dd84d1 IDEMPIERE-6323 fix Process Run as Job doesn't create change log (#2575) 2024-12-04 14:36:50 +01:00
Carlos Ruiz 99e038c4a3 IDEMPIERE-6329 Bug in BOM* SQL functions not getting the correct BOM children (#2571) 2024-12-04 13:50:27 +01:00
Carlos Ruiz e34371db60 IDEMPIERE-99 01_add_missing_Translations.sql does not create UUIDs (#2570) 2024-12-04 13:50:27 +01:00
Carlos Ruiz 36c08e7476 IDEMPIERE-6314 Issues with attachment on System records (#2567)
- IDEMPIERE-5567 fix for the PO.is_new method
2024-12-04 13:50:27 +01:00
Macchiarch a875f477ed IDEMPIERE-6315 WPAttributeDialog: added filter for M_Product_ID when loading Lots (#2557)
On M_Lot M_Product_ID is mandatory, so the filter for M_Product_ID is needed when loading Lots
2024-12-04 13:49:57 +01:00
Jose Leite b6e25d71f8 IDEMPIERE-6317 - Create message for errors in msysconfig (#2564)
* IDEMPIERE-6317 - Create message for errors in msysconfig

* IDEMPIERE-6317 - Create message for errors in msysconfig
2024-12-04 13:47:29 +01:00
Nicolas Micoud be264655dc IDEMPIERE-6316: Wrong Name on RecordInfo panel when the value of the … (#2560)
* IDEMPIERE-6316: Wrong Name on RecordInfo panel when the value of the column is Context

* IDEMPIERE-6316: Wrong Name on RecordInfo panel when the value of the column is Context

Change all translate to getElement

* IDEMPIERE-6316: Wrong Name on RecordInfo panel when the value of the column is Context - patch from Carlos

Co-Authored-By: Carlos Ruiz <carg67@gmail.com>

---------

Co-authored-by: Carlos Ruiz <carg67@gmail.com>
2024-12-04 13:46:55 +01:00
Carlos Ruiz 38f452e4b0 IDEMPIERE-6314 Issues with attachment on System records (#2556)
* IDEMPIERE-6314 Issues with attachment on System records

* - change approach to make it read-only

* - support for UUID key tables
- IDEMPIERE-5567 fix for the PO.is_new method
2024-12-04 13:43:47 +01:00
hengsin f4fb07b66f IDEMPIERE-6311 Parent context missing when zoom to detail tab above level 1 (#2554) 2024-12-04 13:43:47 +01:00
Nicolas Micoud 9bb107864f IDEMPIERE-6193: Trial Balance : remove lines where account has no beg… (#2422)
* IDEMPIERE-6193: Trial Balance : remove lines where account has no beginning balance and movement

* IDEMPIERE-6193: Trial Balance : remove lines where account has no beginning balance and movement - patch from Carlos

Co-Authored-By: Carlos Ruiz <carg67@gmail.com>

---------

Co-authored-by: Carlos Ruiz <carg67@gmail.com>
2024-12-04 13:43:15 +01:00
Carlos Ruiz e65879c201 IDEMPIERE-6309 Output of task is better formatted as a console font (#2550)
* IDEMPIERE-6309 Output of task is better formatted as a console font

* - minor improvement
2024-12-04 13:40:34 +01:00
Zuhri Utama b9d6cdc4e9 IDEMPIERE-5946 : Drill Assistant Error - For input string: "null" (#2549)
* IDEMPIERE-5946 : Drill Assistant Error - For input string: "null"

* IDEMPIERE-5946 : show drill assistant when value is not null
2024-12-04 13:40:34 +01:00
Zuhri Utama f88b49f1ff IDEMPIERE-6259 : Query After Change is not working for Range criteria with the 'To' field on Info Window (#2547) 2024-12-04 13:40:34 +01:00
Carlos Ruiz c82810a269 IDEMPIERE-6305 Improve some Error Messages (#2544)
* IDEMPIERE-6305 Improve some Error Messages

* - verify also if the message ends with :
2024-11-19 15:12:34 +01:00
Nicolas Micoud 25ccc6951b IDEMPIERE-6307: MenuSearch doesn't display tooltip (#2545) 2024-11-19 15:12:34 +01:00
hengsin c191234b53 IDEMPIERE-6295 OIDC SSO: logout not working for Amazon Cognito (#2533)
* IDEMPIERE-6295 OIDC SSO: logout not working for Amazon Cognito

* IDEMPIERE-6295 OIDC SSO: logout not working for Amazon Cognito

- Fix logout for keycloak and azure
2024-11-19 15:12:33 +01:00
Vitor Henrique Dos Santos 157269644c IDEMPIERE-6294 default expression for multi-select fields (#2532)
* IDEMPIERE-6294 default expression for multi-select fields

* IDEMPIERE-6294 - Adjusts
2024-11-19 15:12:33 +01:00
hengsin b4f89d9c0e IDEMPIERE-6297 Fix RelatedInfoWindow Order By (#2535)
Fix build error
2024-11-19 15:12:33 +01:00
Macchiarch 2d4befbfa7 IDEMPIERE-6297 Fix RelatedInfoWindow Order By (#2529)
* Fix RelatedInfoWindow Order By

The info's default Order By clause must be separated by a comma if there is a user-entered order

* raise exception

---------

Co-authored-by: Carlos Ruiz <carg67@gmail.com>
2024-11-19 15:12:33 +01:00
Diego Ruiz f61e2f569a IDEMPIERE-6296 -Fixed process workflow node using inactive parameters (#2534) 2024-11-19 15:12:33 +01:00
hieplq 6b2455c6f4 IDEMPIERE-6255:Incorrect column count on datatables / fix headers of CSV on change language (#2527)
* IDEMPIERE-6255:Incorrect column count on datatables
* IDEMPIERE-6255:Incorrect column count on datatables (language on csv preview)
2024-11-19 15:12:33 +01:00
Carlos Ruiz e9a71c4092 IDEMPIERE-6000 Reset AD_SysConfig cache automatically when configured (#2525) 2024-11-19 15:12:33 +01:00
Carlos Ruiz 3a810791d0 Revert "IDEMPIERE-6255:Incorrect column count on datatables (#2483)"
This reverts commit 3512cd00da.
2024-11-07 17:47:23 +01:00
Jose Leite 5ee17ae649 IDEMPIERE-6288 - Fix script in format item (#2516) 2024-11-07 17:47:17 +01:00
Zuhri Utama d61d6b2cf1 IDEMPIERE-6286-optimize-image-background-on-landing-page (#2515) 2024-11-07 17:47:17 +01:00
Carlos Ruiz 42b56141cd IDEMPIERE-6279 Problem with hazelcast with multiple server running on localhost postgres on same network (#2514) 2024-11-07 17:47:17 +01:00
matheus-marcelinux 4ab86f7f4e IDEMPIERE-6285 - Component doesn't enable when user clicks on new record if positioned in a record without access (#2513) 2024-11-07 17:47:17 +01:00
Diego Ruiz 87f6d93d8c IDEMPIERE-6284 - Order is not validating user values when 0 is set (#2511) 2024-11-07 17:47:17 +01:00
Zuhri Utama 19305437e9 IDEMPIERE-6282 : idempiere login page enhancement (#2509)
* IDEMPIERE-6282 : idempiere login page enhancement

* revert latest change and added APPLICATION_LOGIN_LEFT_PANEL_SHOWN to configure the left panel visibilty

* remove unnecessary change
2024-11-07 17:47:17 +01:00
Carlos Ruiz 8b511cdaa1 Extract just Env.java fixes -> IDEMPIERE-6116 Implement escape sequence in Env parseVariable and parseContext methods (#2503) 2024-10-30 14:21:17 +01:00
Carlos Ruiz bac29a7059 IDEMPIERE-6277 When deleting a Recent Item the list is shrunk, instead of showing the next recent item (#2506)
* IDEMPIERE-6277 When deleting a Recent Item the list is shrunk, instead of showing the next recent item

* - implement suggestion from Heng Sin
2024-10-30 14:15:03 +01:00
Carlos Ruiz 8fc5aa14e0 IDEMPIERE-6276 Window > Tab > Copy Tab Fields - must copy just the missing fields (#2505) 2024-10-30 14:15:03 +01:00
HideakiHagiwara c46fd668b8 IDEMPIERE-6267 Fields with dynamic validation using TabNo do not reve… (#2495)
* IDEMPIERE-6267 Fields with dynamic validation using TabNo do not revert to blank automatically when the target value is changed

* Handle ~ and make : optional

* Use regex to handle expression with default value

* - remove unnecessary $ from regex

---------

Co-authored-by: hengsin <hengsin@gmail.com>
Co-authored-by: Carlos Ruiz <carg67@gmail.com>
2024-10-30 14:15:03 +01:00
Diego Ruiz f3e5601a13 IDEMPIERE-6272 - Model Generator fails in silence when the query does… (#2499)
* IDEMPIERE-6272 - Model Generator fails in silence when the query does not return any record

* IDEMPIERE-6272 - Model Generator fails in silence when the query does not return any record
2024-10-30 14:15:03 +01:00
Carlos Ruiz ecd8563a58 IDEMPIERE-6048 Check access - based on Heng Sin's PR2485 (#2494)
* IDEMPIERE-6048 Check access - based on Heng Sin's PR2485

* - remove warning

* - add a refactor to MChart Column Lookup, to be used by REST

* - fix wrong call - suggested by Heng Sin
2024-10-30 14:15:03 +01:00
Carlos Ruiz 3864166213 IDEMPIERE-3551 Automatic Packin - lower verbosity (#2491) 2024-10-30 14:15:03 +01:00
hengsin 89e6e6209f IDEMPIERE-6263 Wrong line net amount (#2490) 2024-10-30 14:15:03 +01:00
hengsin 9158a638f4 IDEMPIERE-6260 Posting error not creating Notice (#2489)
Fix unit test error
2024-10-14 19:05:11 +02:00
Carlos Ruiz d89f8b9801 IDEMPIERE-6264 - other cases with double :: on Error (#2486) 2024-10-14 19:05:11 +02:00
hieplq 3512cd00da IDEMPIERE-6255:Incorrect column count on datatables (#2483)
* IDEMPIERE-6255:Incorrect column count on datatables

* IDEMPIERE-6255:Incorrect column count on datatables (csv header isn't translate)

* Remove never used warning

---------

Co-authored-by: hieplq <hieplq@debian.vn>
Co-authored-by: hengsin <hengsin@gmail.com>
2024-10-14 19:05:01 +02:00
Diego Ruiz 70cde611a0 IDEMPIERE-6264 - Error message on BEFORE_PROCESS and AFTER_PROCESS is shown wrongly (#2484) 2024-10-14 18:56:27 +02:00
Nicolas Micoud b9cfc8c6e6 IDEMPIERE-6248: System Property to avoid cutting log (#2482)
* IDEMPIERE-6248: System Property to avoid cutting log

* IDEMPIERE-6248: System Property to avoid cutting log

Remove SysConfig

* IDEMPIERE-6248: System Property to avoid cutting log

fix import
2024-10-14 18:56:26 +02:00
Carlos Ruiz ad267ad247 IDEMPIERE-6260 Posting error not creating Notice (#2478) 2024-10-14 18:56:26 +02:00
Nicolas Micoud fa576f0e70 IDEMPIERE-6196 - AD_SysConfig (#2479) 2024-10-14 18:56:26 +02:00
Zuhri Utama 2dd6971626 IDEMPIERE-6210 : Dashboard Menu - not showed (#2477) 2024-10-14 18:56:26 +02:00
hengsin 9f84b0607f IDEMPIERE-6211 Dashboard Goal - Chart doesn't work. (#2476) 2024-10-14 18:56:26 +02:00
Nicolas Micoud a2a86c62bf IDEMPIERE-6247: Issue with Zoom Across when several records should open a window using ZoomCondition (#2464) 2024-10-14 18:56:26 +02:00
Nicolas Micoud 43c78b3018 IDEMPIERE-6257: WListbox cannot add total line for Integer (#2470)
* IDEMPIERE-6257: WListbox cannot add total line for Integer

* IDEMPIERE-6257: WListbox cannot add total line for Integer

implement Carlos's suggestion (to reduce number of lines)

Co-Authored-By: Carlos Ruiz <carg67@gmail.com>

---------

Co-authored-by: Carlos Ruiz <carg67@gmail.com>
2024-10-14 18:56:26 +02:00
Carlos Ruiz f60f599619 IDEMPIERE-6013 Implement a way to filter dinamically records on MRole.addAccessSQL (#2471)
- fix queries with alias (like InfoWindow)
- fix InfoWindow issue when the table has no alias
2024-10-03 13:59:13 +02:00
hengsin 62c86f82c3 IDEMPIERE-6146 Recently access menu item: minor refresh refinement (#2370)
* IDEMPIERE-6146 Recently access menu item: minor refresh refinement

* IDEMPIERE-6146 Recently access menu item: minor refresh refinement

- Fix handling of "enter" key
2024-10-03 13:51:27 +02:00
hengsin 66819ecf79 IDEMPIERE-6146 Recently access menu item: minor refresh refinement (#2365) 2024-10-03 13:51:20 +02:00
Carlos Ruiz eb4def6f86 Eclipse warning clean-up after cherry-picks 2024-09-27 15:12:59 +02:00
Nicolas Micoud b4532b3eb8 IDEMPIERE-6249: CLogFormatter.fillExceptionTrace should filter org.adempiere. and org.idempiere. (#2462) 2024-09-27 15:05:29 +02:00
Nicolas Micoud afa5dcfeae IDEMPIERE-6248: SysConfig to avoid cutting log (#2463) 2024-09-27 15:05:29 +02:00
Carlos Ruiz b0ef82de43 IDEMPIERE-5760 Manage mail.smtp.connectiontimeout and mail.smtp.writetimeout using SysConfig (#2465) 2024-09-27 15:05:29 +02:00
hieplq 776b135a4a IDEMPIERE-6251:clean status bar error info (#2468)
Co-authored-by: hieplq <hieplq@debian.vn>
2024-09-27 15:05:29 +02:00
hieplq 32d7e2e96a IDEMPIERE-6250:NPE when open SortTab (#2467)
Co-authored-by: hieplq <hieplq@debian.vn>
2024-09-27 15:05:29 +02:00
hieplq 1051bae3d5 IDEMPIERE-5432:Performance Measure Calculation - Improve SQL Definition(cover more case) (#2460) 2024-09-27 15:05:29 +02:00
Carlos Ruiz 6dce6368e9 IDEMPIERE-6244 Required change on idempiere-server.sh for docker (#2458) 2024-09-27 15:05:29 +02:00
Carlos Ruiz bf3fb64d3b IDEMPIERE-5567 Support of UUID as Key (FHCA-4195) - Record Info Improvements (#2455)
- allow generating permalink also for multi-key tables using UUID
- use TableName instead of AD_Table_ID for permalink
- add zoom condition to role for access tables on non-system tenants
- on copy select, prefer to generate using ID than UUID when possible - is easier when copying a select that is needed to search also for children
2024-09-27 15:05:29 +02:00
Carlos Ruiz 30057f7a12 IDEMPIERE-6007 Log Warning: Evaluator.parseSQLLogic: (AD_Table_ID) - SQL variable parse failed: @SQL=SELECT 1 FROM AD_Field WHERE AD_Tab_ID=@AD_Tab_ID@ (#2456) 2024-09-27 15:05:29 +02:00
hengsin e4808398c9 IDEMPIERE-6225 Improve IsSingleRow logic when opening 1 record (#2454) 2024-09-27 15:05:28 +02:00
Carlos Ruiz 3de220daec IDEMPIERE-5647 Allow definition of context variables by Role - fix issue not being used in Logic (#2452) 2024-09-11 12:09:03 +02:00
Carlos Ruiz 90c4b7a64a IDEMPIERE-6230 ConcurrentModificationException on MTable (#2453) 2024-09-11 12:09:03 +02:00
muriloht 976d5ff19a IDEMPIERE-6228 - Info Window and Info Windows process support for tables with UUID as key / IDEMPIERE-5567 (#2450) 2024-09-11 12:09:03 +02:00
Nicolas Micoud 514bf2fc21 IDEMPIERE-6229: 2Pack / Data : fill table field using SQL Statement content (#2451) 2024-09-11 12:09:03 +02:00
Carlos Ruiz aaaecb42e9 IDEMPIERE-2981 Implement JSON Field type + IDEMPIERE-6227 - fixes (#2449)
* IDEMPIERE-2981 Implement JSON Field type

- Fix the JSON Editor, is sending to the database the value non prettified

* - Fix issue adding a JSON column with log migration script enabled

When logging migration script the Convert layer is applied, and we didn't implement Convert for the JSON column

* IDEMPIERE-6227 Cannot add a column with spaces on the default value (Convert layer logging migration script)
2024-09-11 12:09:03 +02:00
Carlos Ruiz eb5f03f8e5 IDEMPIERE-6223 Add new field JsonData to AD_PInstance - Peer Review Fixes (#2448) 2024-09-11 12:08:11 +02:00
muriloht 57f33550ee IDEMPIERE-6223 / COF #17758 - Add new field JsonData to AD_PInstance and AD_PInstance_Log (#2447) 2024-09-11 12:07:56 +02:00
hengsin ec7d0b5eb2 IDEMPIERE-6217 An Error Occurred While Uploading the CSV File as an Attachment (#2446)
- Fix Eclipse warnings
2024-09-11 12:01:07 +02:00
hengsin 9f14c96134 IDEMPIERE-3040 Invoice Price Variations for Average PO costing method (#2428)
* IDEMPIERE-3040 Invoice Price Variations for Average PO costing method

Co-authored-by: dpansheriya <deepakpansheriya@gmail.com>
2024-09-11 12:01:07 +02:00
Carlos Ruiz f61bda9a14 IDEMPIERE-6189 Performance: queries on RV_C_Invoice doing unnecesary index or seq scan (#2437) 2024-08-21 12:52:28 +02:00
Carlos Ruiz 6f20622001 IDEMPIERE-3294 Process Audit generate unused AD_PInstance_Para (#2439) (#2445) 2024-08-21 12:52:28 +02:00
Elaine Tan c286348cb0 IDEMPIERE-6218 Failed to import location record when there are multiple region records with the same name (#2444) 2024-08-21 12:52:28 +02:00
Carlos Ruiz d4356b7e67 IDEMPIERE-6215 Advanced Search Error -> Not unique in the ID space of <Window eJzF__g>: Row2 (#2440) 2024-08-21 12:52:28 +02:00
Carlos Ruiz cdfa764b08 IDEMPIERE-6216 Usability - Initial Tenant Setup - Missing required parameters (#2441) 2024-08-21 12:52:28 +02:00
Elaine Tan 1f913baa7a IDEMPIERE-6217 An Error Occurred While Uploading the CSV File as an Attachment (#2443) 2024-08-21 12:52:28 +02:00
Carlos Ruiz 8100d9c092 IDEMPIERE-3294 Process Audit generate unused AD_PInstance_Para (#2439) 2024-08-19 21:03:53 +02:00
Carlos Ruiz ba5d576fdd IDEMPIERE-6212 CONTEXT_EMAIL_USER_CC overrides the email user set with CONTEXT_EMAIL_USER_TO in the WEMailDialog (#2438) 2024-08-19 21:03:53 +02:00
Carlos Ruiz 01ac9e0248 IDEMPIERE-6214 PackIn AD_TableIndex can fail if the index exists previously without columns (#2436) 2024-08-19 21:03:53 +02:00
Carlos Ruiz 766654087b IDEMPIERE-6209 Detail Zoom Across not working (#2434)
Caused by IDEMPIERE-5567
2024-08-12 16:53:45 +02:00
Carlos Ruiz a577c1a343 IDEMPIERE-6206 Shortcut for Payment not working with there are different windows for Receipt/Payment (#2432)
* IDEMPIERE-6206 Shortcut for Payment not working with there are different windows for Receipt/Payment

* - remove unnecessary commented code
2024-08-12 16:53:45 +02:00
Carlos Ruiz 86c7e2d026 IDEMPIERE-6202 Field status that applied to new record is applied to the existing a record too in a specific operation at Window (#2430) 2024-08-12 16:53:45 +02:00
Peter Takács 61229b3277 IDEMPIERE-6204 - Env.parseVariable returns wrong parsed message if default value is used (#2431) 2024-08-12 16:53:45 +02:00
Carlos Ruiz 219aeffafe IDEMPIERE-6199 Payment Print/Export cannot set filesuffix depending on the document type (#2427) 2024-08-12 16:53:45 +02:00
Carlos Ruiz 951f9681b2 IDEMPIERE-5567 Support of UUID as Key (FHCA-4195) - fix zoom (#2429) 2024-08-12 16:53:45 +02:00
Carlos Ruiz 1093272fa1 IDEMPIERE-6196 Fix selection columns on several windows (#2426) 2024-08-12 16:53:45 +02:00
Carlos Ruiz 7a667bc5db IDEMPIERE-6194 2Pack must ignore the SIMILAR TO preference from user (#2423)
- make the SIMILAR TO conversion work just for SELECT queries
2024-08-12 16:53:45 +02:00
Diego Ruiz d1450a5ce0 IDEMPIERE-6195 - Add code to return virtual UI columns SQL without the prefix in MColumn (#2424)
* IDEMPIERE-6195 - Add code to return virtual UI columns SQL without the prefix in MColumn
2024-08-12 16:53:45 +02:00
Nicolas Micoud a07047a5ea IDEMPIERE-6196: Restoring Selection Columns for AD_Table (#2425) 2024-08-12 16:53:45 +02:00
Carlos Ruiz aac79ae622 IDEMPIERE-6188 Read-Only Session (#2415)
* IDEMPIERE-6188 Read-Only Session

* IDEMPIERE-6188 Read-Only Session

- improvements suggested by Nicolas Micoud and Alejandro Guerra
2024-07-19 11:49:40 +02:00
Carlos Ruiz bcc6bd5684 IDEMPIERE-6190 TabCreateFields.doIt postgresql exception found in log (#2419) 2024-07-19 11:40:59 +02:00
Carlos Ruiz 58c1aa5904 IDEMPIERE-2981 - Implement JSON field type / fix missing space in certain scenarios (#2417) 2024-07-19 11:40:59 +02:00
hengsin 2813cab603 IDEMPIERE-6182 Update datatables extension for HTML report (#2406) 2024-07-19 11:40:59 +02:00
Carlos Ruiz 22fc9ea462 IDEMPIERE-6187 Transaction closed when running workflow on certain conditions (#2413) 2024-07-05 20:48:58 +02:00
Carlos Ruiz 55f9bf2349 IDEMPIERE-6168 Found problems with jasper setting filename (#2411)
- fix issues found sending orders after complete on workflow
2024-07-05 20:47:01 +02:00
Diego Ruiz 8938fe1d3c IDEMPIERE-6186 - Fix MMailText setting the wrong language when bp language is null (#2410) 2024-07-05 20:43:21 +02:00
Carlos Ruiz 1a89cd6b8f IDEMPIERE-6123 Query in search window causing slowness and load spikes in the database (FHCA-5356) (#2408) (#2409) 2024-07-04 22:43:25 +02:00
Diego Ruiz afe578e9b3 IDEMPIERE-4087 - Set isDisplayed='N' by default for virtual search columns in field (#2407) 2024-07-04 20:02:24 +02:00
Carlos Ruiz 6192a8fff8 IDEMPIERE-6123 Query in search window causing slowness and load spikes in the database (FHCA-5356) (#2408)
fix new issue found informing timeout errors when no records are found after a failed count
2024-07-04 20:02:24 +02:00
Diego Ruiz b118283530 IDEMPIERE-6181 - Fix MBPartner.getPrimaryAD_User_ID() returning 0 when the business partner has no contacts (#2405) 2024-07-04 20:02:24 +02:00
Carlos Ruiz b28edf2be1 IDEMPIERE-2981 Implement JSON Field type - generate model for Test (#2402) 2024-06-28 15:22:14 +02:00
hengsin 0641e614c2 IDEMPIERE-6178 Level 3 tab is invisible after collapse and expand of bottom pane (#2401) 2024-06-28 15:22:14 +02:00
hengsin 4e250b6a52 IDEMPIERE-6172 Open from a highlighted window, DateRangePicker popup will auto close when selecting an item in dropdown list (#2400)
- Implement workaround for highlighted+popup+combobox
2024-06-28 15:22:14 +02:00
Peter Takács 061ef5fec4 IDEMPIERE-6174 - Create Production from Order process doesn't set BOM Formula (#2399) 2024-06-28 15:22:14 +02:00
Carlos Ruiz 77f0ababe6 IDEMPIERE-6176 UUID indexes without constraint (#2397) 2024-06-28 15:22:14 +02:00
Carlos Ruiz 10d327f4e2 IDEMPIERE-2981 Implement JSON Field type - integrate to release-11 (#2396) 2024-06-17 23:54:15 +02:00
Carlos Ruiz abeb245226 IDEMPIERE-6169 Performance on AD_ChangeLog with Record_UU (#2393) 2024-06-17 23:53:47 +02:00
Carlos Ruiz 924bdb6fc1 IDEMPIERE-2981 Fixes to failing unit tests (#2263) 2024-06-17 23:53:21 +02:00
Diego Ruiz 5f44c9c19d IDEMPIERE-2981 - Implement JSON field type (#2255)
* IDEMPIERE-2981 - Implement JSON Field Type
* IDEMPIERE-2981 - Added field to the Test Window and Unit Tests
* IDEMPIERE-2981 - Fixed migration scripts
* IDEMPIERE-2981 - Changed oracle json syntax
* IDEMPIERE-2981 - Increased the number of lines of jsonData test field
* IDEMPIERE-2981 - Validate and Prettify JSON string on the field editor
* IDEMPIERE-2981 - Support for oracle
* IDEMPIERE-2981 - Applied patch from Carlos Ruiz
2024-06-17 23:53:01 +02:00
Carlos Ruiz a45283b855 IDEMPIERE-6165 + IDEMPIERE-6168 More problems with jasper setting filename (#2392)
- the test case is failing for orders with jasper print format
- the downloadable file name for jasper is wrong in zk when using FileNamePattern
2024-06-13 14:23:12 +02:00
Diego Ruiz 689573c90d IDEMPIERE-6165 - Custom name is not taken when running a core report … (#2386)
* IDEMPIERE-6165 - Custom name is not taken when running a core report programatically

* IDEMPIERE-6165 - Add unit test

* IDEMPIERE-6165 - Peer review changes

* IDEMPIERE-6165 - Modified condition to avoid potential NPE

* IDEMPIERE-6165 - Changed Unit Test to be thread safe

* IDEMPIERE-6165 - Create file in a thread-safe way respecting folder name if existing

* IDEMPIERE-6165 - Updated Unit test

* IDEMPIERE-6165 - Updated Unit test

* IDEMPIERE-6165 - Code refactor to remove code duplication in different classes

* IDEMPIERE-6165 - Improved Javadoc
2024-06-13 14:12:08 +02:00
Carlos Ruiz 6d9c35a365 IDEMPIERE-6168 Found problems with jasper setting filename (#2390) 2024-06-13 14:01:40 +02:00
hengsin 4875568cf2 IDEMPIERE-6117 POI: WorkbookFactory.create cannot be used to open XLSX files (#2357)
* IDEMPIERE-6117 POI: WorkbookFactory.create cannot be used to open XLSX files

* IDEMPIERE-6117 POI: WorkbookFactory.create cannot be used to open XLSX files

* IDEMPIERE-6117 POI: WorkbookFactory.create cannot be used to open XLSX files

- Incorporate patch from Carlos
2024-06-13 13:53:42 +02:00
Carlos Ruiz 0f02545dbb IDEMPIERE-6166 PostgreSQL DUAL table with more than one record (#2387)
* IDEMPIERE-6166 PostgreSQL DUAL table with more than one record

- create unique index on dual.dummy for postgresql

* - implement suggestion from hengsin - make dual a view instead of a table
- fix similar issue with the table dbreplicasyncverifier - it must ensure to contain just one table - running again a COPY command must fail
2024-06-13 13:53:42 +02:00
Carlos Ruiz 9042f8319a IDEMPIERE-6167 BOM Price List must search just for Verified BOMs (#2388) 2024-06-13 13:53:42 +02:00
hieplq 45544a2058 IDEMPIERE-6161:JasperReports encounters issues using encrypted functions due to incompatible dependencies (#2381)
* IDEMPIERE-6161:JasperReports encounters issues using encrypted functions due to incompatible dependencies

Co-authored-by: Carlos Ruiz <carg67@gmail.com>
Co-authored-by: hengsin <hengsin@gmail.com>
2024-06-13 13:39:07 +02:00
Carlos Ruiz cad01851d5 IDEMPIERE-6159 Add drop ship location to ITaxLookup (#2380) 2024-06-13 13:37:24 +02:00
Carlos Ruiz 9d6f8c852f IDEMPIERE-6162 Error with Create PO from Requisition for different BPs on multiple lines with same product (#2383) 2024-06-13 13:37:23 +02:00
Carlos Ruiz 76adcb1f98 Revert "IDEMPIERE-5923 Info Window should use key and display columns setting from lookup (#2108)"
This reverts commit 6f484ee701.
2024-05-30 12:46:34 +02:00
Carlos Ruiz 5994292dbb IDEMPIERE-6160 Remove Eclipse warnings (#2379) 2024-05-30 12:46:07 +02:00
Carlos Ruiz 69995b178b IDEMPIERE-6150 NON-DB attachments are disappearing when a DB deletion fails (#2377)
* IDEMPIERE-6150 NON-DB attachments are disappearing when a DB deletion fails

- delete AD_Attachment and AD_Archive after commit of deletion Trx

* - add patch from Heng Sin to convert string concatenation to text block

---------

Co-authored-by: hengsin <hengsin@gmail.com>
2024-05-28 16:30:01 +02:00
Carlos Ruiz 9740f2bf18 IDEMPIERE-5849 Fix PackOut broken with GenericPO after Cache Reset (#2382) 2024-05-28 16:30:01 +02:00
Carlos Ruiz 6f4686f9db IDEMPIERE-6158 Warehouse Purchase Order cannot be completed after change of product (#2376)
* IDEMPIERE-6158 Warehouse Purchase Order cannot be completed after change of product

* - fix callouts to avoid setting M_Product_ID to null
2024-05-28 16:29:52 +02:00
Carlos Ruiz fb594a5f56 IDEMPIERE-6102 Performance: avoid SQL on AD_TreeNode when the table doesn't have a custom tree (#2309) 2024-05-22 12:41:01 +02:00
Carlos Ruiz 7cd0c88e3a IDEMPIERE-5567 Support of UUID as Key (FHCA-4195) (#2371)
- avoid calling delete cascade for ID when is UUID table
2024-05-21 19:41:28 +02:00
Carlos Ruiz 9071ae38d6 IDEMPIERE-5728 Fix RV_UnPosted view definition in dictionary (#2361) 2024-05-21 19:41:28 +02:00
Carlos Ruiz a5a1ce3050 IDEMPIERE-6144 Can't export a report if the name has less than 3 characters (#2363) 2024-05-21 19:41:28 +02:00
Carlos Ruiz 88a9d3eb3a IDEMPIERE-6137 Payment Rule does not appear in reports from Sales Order (#2364) 2024-05-21 19:41:28 +02:00
Carlos Ruiz 2aa7215e2c IDEMPIERE-5567 Support of UUID as Key (FHCA-4195) + IDEMPIERE-6143 (#2367)
- fix export and import for UUID based tables
- fix ExportAction creating temporary files with the wrong extension
- fix export and import of multi-selection fields IDEMPIERE-6143
2024-05-21 19:41:28 +02:00
Carlos Ruiz a3fb6f5b9c IDEMPIERE-6149 Model[Class|Interface]Generator must have a predictable order independent of the developer language (collation) (#2368) 2024-05-21 19:41:28 +02:00
Nicolas Micoud ecfb71bd7d IDEMPIERE-5796: Generate Model Template for several tables in a row (#2244)
* IDEMPIERE-5796: for several tables in a row

https://idempiere.atlassian.net/browse/IDEMPIERE-5796

* IDEMPIERE-5796: for several tables in a row - changes done in ModelInterfaceGenerator / ModelClassGenerator

Implement suggesion from @hengsin

* IDEMPIERE-5796: for several tables in a row - changes done in ModelInterfaceGenerator / ModelClassGenerator

Implement suggesion from @hengsin

* IDEMPIERE-5796: for several tables in a row - changes done in ModelInterfaceGenerator / ModelClassGenerator

Implement suggestion from @CarlosRuiz-globalqss removing duplicated code

* IDEMPIERE-5796: for several tables in a row - changes done in ModelInterfaceGenerator / ModelClassGenerator

fix error
2024-05-21 19:41:28 +02:00
hengsin c47db344e8 IDEMPIERE-6142 Can't add new column to partitioned table (#2358)
* IDEMPIERE-6142 Can't add new column to partitioned table

* IDEMPIERE-6142 Can't add new column to partitioned table

- Fix issue with foreign key

* IDEMPIERE-6142 Can't add new column to partitioned table

- Fix issue with foreign key
2024-05-21 19:41:07 +02:00
Carlos Ruiz 4091c74093 IDEMPIERE-6110 New Error Message To Indicate When Sales Order has just Freight Product or Charge Freight - fix migration script (#2360) 2024-05-13 18:30:07 +02:00
Carlos Ruiz 4409415d55 IDEMPIERE-6123 Query in search window causing slowness and load spikes in the database (FHCA-5356) (#2354)
* IDEMPIERE-6123 Query in search window causing slowness and load spikes in the database (FHCA-5356)

- make also configurable the timeout and number of records from windows
- improve timing of reports avoiding unncessary load of array when not jasper

* - implement suggestions from Heng Sin
2024-05-13 17:32:06 +02:00
Carlos Ruiz e1ed11f224 IDEMPIERE-6140 Chosen Multiple Selection Table column bug in Info window (#2353) 2024-05-13 17:28:06 +02:00
Carlos Ruiz a86a73c391 IDEMPIERE-6137 Payment Rule does not appear in reports from Sales Order (#2351)
- safer approach
2024-05-13 17:28:06 +02:00
hengsin 6cb5788651 IDEMPIERE-6119 Show dashboard content layout on column when open on mobile screen size (#2350) 2024-05-13 17:28:06 +02:00
hengsin 47f1336df4 IDEMPIERE-6136 ModelEventDelegate doesn't works with DocAction, PostCreate, PostUpdate and PostDelete annotation (#2346) 2024-05-13 17:28:06 +02:00
Carlos Ruiz 39fff47de6 IDEMPIERE-6137 Payment Rule does not appear in reports from Sales Order (#2347) 2024-05-13 17:28:06 +02:00
Carlos Ruiz 42e998ff7d IDEMPIERE-6123 Query in search window causing slowness and load spikes in the database (FHCA-5356) (#2340)
* IDEMPIERE-6123 Query in search window causing slowness and load spikes in the database (FHCA-5356)

* - create SysConfig
- add Dialog when reaching max query records

* - minor fix comment
- add timeout management to MLookup query

* - Fix for the GridTable.Loader.Open issue

* - add SysConfig and Messages
- add showing error message when the number of records loaded in background exceed the allowed
- add timeout to GridTable.fillBuffer

---------

Co-authored-by: hengsin <hengsin@gmail.com>
2024-05-13 17:28:06 +02:00
Carlos Ruiz 766ca60cd4 IDEMPIERE-6118 fix broken build (#2344) 2024-05-13 17:28:06 +02:00
Zuhri Utama 95fee2623b IDEMPIERE-6118 : Missing resources on idempiere server monitor (#2326)
* IDEMPIERE-6118 : Missing resources on idempiere server monitor

* remove unused class and add table style

* rename css file and remove javaclient condition
2024-05-13 17:28:06 +02:00
Zuhri Utama 0e17a03d37 IDEMPIERE-6127 : Improve Report Process Parameter for Mobile Screen (#2334)
* IDEMPIERE-6127 : Improve Report Process Parameter for Mobile Screen

* apply patch from hengsin

- Combine summary checkbox and label into one component
- update default theme version
2024-05-13 17:27:37 +02:00
Carlos Ruiz 4c7a1b124f IDEMPIERE-6130 Move garbage collection to a button in About Window (#2341) 2024-05-13 17:24:09 +02:00
Carlos Ruiz 439b158224 IDEMPIERE-6130 Show gc information (#2339) 2024-05-13 17:24:09 +02:00
Carlos Ruiz f82c6a9468 IDEMPIERE-6128 make org.idempiere.db.debug show just native Postgresql by default (#2335) 2024-05-13 17:24:09 +02:00
Carlos Ruiz 44688e37a1 IDEMPIERE-6044 CLogMgt.enable not working properly after InitialClientSetup (#2328)
* IDEMPIERE-6044 CLogMgt.enable not working properly after InitialClientSetup

* - add deprecation comment
2024-05-13 17:24:09 +02:00
Nicolas Micoud 7d70e4ef02 IDEMPIERE-6126: ProcessParameterPanel - method to get ProcessInfo (#2333) 2024-05-13 17:24:09 +02:00
Carlos Ruiz 8e08cb5cc8 IDEMPIERE-6125 Allow monitoring null transactions on idempiereMonitor (#2332)
* IDEMPIERE-6125 Allow monitoring null transactions on idempiereMonitor

* - add warning
2024-05-13 17:24:09 +02:00
hieplq bd26ce7b37 IDEMPIERE-6121:github action fail by tycho update => setup maven to 3.9 (#2330)
* IDEMPIERE-6121:github action fail by tycho update => setup maven to 3.9

1. update maven to 9.3
2. step setup java generate 2 file
.m2/toolchains.xml
.m2/settings.xml

    bellow case make conflict

    1. setup java for java-17 => create toolchains.xml point to java-17 home
    2. cache save toolchains.xml
    3. update java to java-17.1 create toolchains.xml point to java-17.1 home
    4. cache restore old toolchains.xml make conflict because it point to java-17 home

so change to cache only .m2/repository

* IDEMPIERE-6121:github action fail by tycho update => setup maven to 3.9

update some action, add comment
2024-05-13 17:24:08 +02:00
Zuhri Utama 67948cbad2 IDEMPIERE-6113 : Date Range boxes on Info Window are too small (#2320)
* IDEMPIERE-6113 : Date Range boxes on Info Window are too small
* Update InfoWindow.java
Update class based on the ideas from Zuhri and Heng Sin
* - Fix issue getting the number of columns used on a row
* - no need for extra column as the parameter grid has already a size of 95%
* - getRowSize must also exclude DateRangeButton on Order Info
* - increase size as suggested by Zuhri

---------

Co-authored-by: Carlos Ruiz <carg67@gmail.com>
Co-authored-by: hengsin <hengsin@gmail.com>
2024-05-13 17:24:08 +02:00
Peter Takács ac5f84f48d IDEMPIERE-6107 Improve Table Partitioning API (#2315)
* IDEMPIERE-6107 - Improve Table Partitioning API
2024-05-13 17:23:35 +02:00
Nicolas Micoud 13bf6bf51d IDEMPIERE-5136: Set Messages at tenant level - missing Oracle DROP INDEX (#2322) 2024-05-13 17:11:02 +02:00
Nicolas Micoud 611a863707 IDEMPIERE-6115 : Fix NPE in ADTabpanel while selecting a tree item (#2323) 2024-05-13 17:11:02 +02:00
hengsin e577f45770 IDEMPIERE-6114 Eclipse 2024-03 create false changes for org.adempiere.base.AnnotationBasedModelFactory.xml (#2321)
trivial fix
2024-05-13 17:11:02 +02:00
hengsin 0eabdd9d08 IDEMPIERE-6105 Implement recently access menu items (#2311) 2024-05-13 17:11:02 +02:00
Vitor Henrique Dos Santos e4e27f4ee5 IDEMPIERE-6110 New Error Message (#2318)
* IDEMPIERE-6110 New Error Message

* IDEMPIERE-6110 - Added script in iD11

* IDEMPIERE - 6110 Change validation to beforeSave

* IDEMPIERE-6110 Improve messsage

* IDEMPIERE-6110 - Adjust message
2024-05-13 17:11:02 +02:00
hengsin 0aa862e105 IDEMPIERE-6106 Performance indicator (the Gauge chart): rendering of needle is wrong when value is > the max interval (#2312) 2024-05-13 17:11:02 +02:00
465 changed files with 43193 additions and 20458 deletions

BIN
._.idpass Normal file

Binary file not shown.

BIN
._.idpass-e Normal file

Binary file not shown.

Binary file not shown.

BIN
._hazelcast.xml Normal file

Binary file not shown.

BIN
._idempiere.properties Normal file

Binary file not shown.

BIN
._idempiereEnv.properties Normal file

Binary file not shown.

View File

@ -35,33 +35,42 @@ jobs:
# Install Java # Install Java
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
java-version: '${{ env.java }}' java-version: '${{ env.java }}'
distribution: ${{ env.java_distribution }} distribution: ${{ env.java_distribution }}
check-latest: true
# setup maven to 3.9 for tycho
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
# on case PR it check out to commit is merger of PR to base (master) # on case PR it check out to commit is merger of PR to base (master)
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
# fetch all commit so sornar can know who change a line, it's resolved Warning: Shallow clone detected, no blame information will be provided. You can convert to non-shallow with 'git fetch --unshallow'. # fetch all commit so sornar can know who change a line, it's resolved Warning: Shallow clone detected, no blame information will be provided. You can convert to non-shallow with 'git fetch --unshallow'.
fetch-depth: 0 fetch-depth: 0
# restore sonar cache
- name: Cache sonar material restore - name: Cache sonar material restore
id: cache-sonar-material-restore id: cache-sonar-material-restore
uses: actions/cache/restore@v3 uses: actions/cache/restore@v4
with: with:
path: | path: |
~/.sonar/cache ~/.sonar/cache
key: ${{ runner.os }}-sonar-${{ env.branch_name }} key: ${{ runner.os }}-sonar-${{ env.branch_name }}
# restore maven cache
- name: Cache maven material restore - name: Cache maven material restore
id: cache-maven-material-restore id: cache-maven-material-restore
uses: actions/cache/restore@v3 uses: actions/cache/restore@v4
with: with:
path: | path: |
~/.m2 ~/.m2/repository
key: ${{ runner.os }}-maven-${{ env.branch_name }} key: ${{ runner.os }}-maven-${{ env.branch_name }}-repository
# run sonar on master only because sonar for PR come from other repository isn't support at moment (already on develop) # run sonar on master only because sonar for PR come from other repository isn't support at moment (already on develop)
# https://stackoverflow.com/a/39720346 # https://stackoverflow.com/a/39720346
@ -78,19 +87,21 @@ jobs:
codeql="-Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Denforcer.skip -Dmaven.javadoc.skip -DskipTests -Dmaven.test.skip.exec -Dlicense.skip=true -Drat.skip=true" codeql="-Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Denforcer.skip -Dmaven.javadoc.skip -DskipTests -Dmaven.test.skip.exec -Dlicense.skip=true -Drat.skip=true"
mvn -B -V -e $codeql $sonar $sonarProject $sonarExclusions package org.sonarsource.scanner.maven:sonar-maven-plugin:sonar mvn -B -V -e $codeql $sonar $sonarProject $sonarExclusions package org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
# save sonar cache
- name: Cache sonar material save - name: Cache sonar material save
uses: actions/cache/save@v3 uses: actions/cache/save@v4
with: with:
path: | path: |
~/.sonar/cache ~/.sonar/cache
key: ${{ steps.cache-sonar-material-restore.outputs.cache-primary-key }} key: ${{ steps.cache-sonar-material-restore.outputs.cache-primary-key }}
# save maven cache
- name: Cache maven material save - name: Cache maven material save
uses: actions/cache/save@v3 uses: actions/cache/save@v4
with: with:
path: | path: |
~/.m2 ~/.m2/repository
key: ${{ steps.cache-maven-material-restore.outputs.cache-primary-key }} key: ${{ steps.cache-maven-material-restore.outputs.cache-primary-key }}-repository
analyze_java_codeQL: analyze_java_codeQL:
name: Analyze java by code QL name: Analyze java by code QL
@ -103,26 +114,34 @@ jobs:
# Install Java # Install Java
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
java-version: '${{ env.java }}' java-version: '${{ env.java }}'
distribution: ${{ env.java_distribution }} distribution: ${{ env.java_distribution }}
check-latest: true
# setup maven to 3.9 for tycho
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
# on case PR it check out to commit is merger of PR to base (master) # on case PR it check out to commit is merger of PR to base (master)
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
# restore maven cache
- name: Cache maven material restore - name: Cache maven material restore
id: cache-maven-material-restore id: cache-maven-material-restore
uses: actions/cache/restore@v3 uses: actions/cache/restore@v4
with: with:
path: | path: |
~/.m2 ~/.m2/repository
key: ${{ runner.os }}-maven-${{ env.branch_name }} key: ${{ runner.os }}-maven-${{ env.branch_name }}-repository
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v2 uses: github/codeql-action/init@v3
with: with:
languages: java languages: java
# If you wish to specify custom queries, you can do so here or in a config file. # If you wish to specify custom queries, you can do so here or in a config file.
@ -131,17 +150,18 @@ jobs:
# queries: ./path/to/local/query, your-org/your-repo/queries@main # queries: ./path/to/local/query, your-org/your-repo/queries@main
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@v2 uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2 uses: github/codeql-action/analyze@v3
# save maven cache
- name: Cache maven material save - name: Cache maven material save
uses: actions/cache/save@v3 uses: actions/cache/save@v4
with: with:
path: | path: |
~/.m2 ~/.m2/repository
key: ${{ steps.cache-maven-material-restore.outputs.cache-primary-key }} key: ${{ steps.cache-maven-material-restore.outputs.cache-primary-key }}-repository
analyze_javascript_codeQL: analyze_javascript_codeQL:
@ -155,12 +175,12 @@ jobs:
# on case PR it check out to commit is merger of PR to base (master) # on case PR it check out to commit is merger of PR to base (master)
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v2 uses: github/codeql-action/init@v3
with: with:
languages: javascript languages: javascript
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2 uses: github/codeql-action/analyze@v3

3
.idpass-e Normal file
View File

@ -0,0 +1,3 @@
ADEMPIERE_MAIL_PASSWORD=
ADEMPIERE_DB_PASSWORD="TTFkNXUxdC1PMkk5Cg=="
ADEMPIERE_DB_SYSTEM="TTFkNXUxdC1PMkk5Cg=="

View File

@ -27,6 +27,7 @@ AS
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID AND b.M_ProductBOM_ID != Product_ID
AND (p.IsBOM='N' OR p.IsVerified='Y')
AND b.IsActive='Y'; AND b.IsActive='Y';
-- --
BEGIN BEGIN
@ -34,7 +35,7 @@ BEGIN
SELECT COALESCE (SUM(PriceLimit), 0) SELECT COALESCE (SUM(PriceLimit), 0)
INTO v_Price INTO v_Price
FROM M_PRODUCTPRICE FROM M_PRODUCTPRICE
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID; WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- DBMS_OUTPUT.PUT_LINE('Price=' || v_Price); -- DBMS_OUTPUT.PUT_LINE('Price=' || v_Price);
-- No Price - Check if BOM -- No Price - Check if BOM

View File

@ -27,6 +27,7 @@ AS
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID AND b.M_ProductBOM_ID != Product_ID
AND (p.IsBOM='N' OR p.IsVerified='Y')
AND b.IsActive='Y'; AND b.IsActive='Y';
-- --
BEGIN BEGIN
@ -34,7 +35,7 @@ BEGIN
SELECT COALESCE (SUM(PriceList), 0) SELECT COALESCE (SUM(PriceList), 0)
INTO v_Price INTO v_Price
FROM M_PRODUCTPRICE FROM M_PRODUCTPRICE
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID; WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- DBMS_OUTPUT.PUT_LINE('Price=' || Price); -- DBMS_OUTPUT.PUT_LINE('Price=' || Price);
-- No Price - Check if BOM -- No Price - Check if BOM

View File

@ -27,6 +27,7 @@ AS
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID AND b.M_ProductBOM_ID != Product_ID
AND (p.IsBOM='N' OR p.IsVerified='Y')
AND b.IsActive='Y'; AND b.IsActive='Y';
-- --
BEGIN BEGIN
@ -34,7 +35,7 @@ BEGIN
SELECT COALESCE(SUM(PriceStd), 0) SELECT COALESCE(SUM(PriceStd), 0)
INTO v_Price INTO v_Price
FROM M_PRODUCTPRICE FROM M_PRODUCTPRICE
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID; WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- DBMS_OUTPUT.PUT_LINE('Price=' || v_Price); -- DBMS_OUTPUT.PUT_LINE('Price=' || v_Price);
-- No Price - Check if BOM -- No Price - Check if BOM

View File

@ -23,13 +23,11 @@ AS
StdPrecision NUMBER; StdPrecision NUMBER;
-- Get BOM Product info -- Get BOM Product info
CURSOR CUR_BOM IS CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID AND b.M_ProductBOM_ID != Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y'; AND b.IsActive='Y';
-- --
BEGIN BEGIN
@ -87,19 +85,14 @@ BEGIN
FROM M_Storageonhand s FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID) JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID; WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID;
-- Get Rounding Precision
SELECT NVL(MAX(u.StdPrecision), 0)
INTO StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product -- How much can we make with this product
ProductQty := ROUND (ProductQty/bom.BOMQty, StdPrecision); ProductQty := ProductQty/bom.BOMQty;
-- How much can we make overall -- How much can we make overall
IF (ProductQty < Quantity) THEN IF (ProductQty < Quantity) THEN
Quantity := ProductQty; Quantity := ProductQty;
END IF; END IF;
-- Another BOM -- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN ELSIF (bom.IsBOM = 'Y' AND BOM.IsVerified = 'Y') THEN
ProductQty := Bomqtyonhand (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID); ProductQty := Bomqtyonhand (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID);
-- How much can we make overall -- How much can we make overall
IF (ProductQty < Quantity) THEN IF (ProductQty < Quantity) THEN
@ -115,7 +108,7 @@ BEGIN
FROM C_UOM u, M_PRODUCT p FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID; WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID;
-- --
RETURN ROUND (Quantity, StdPrecision); RETURN TRUNC(Quantity, StdPrecision); -- RoundDown
END IF; END IF;
RETURN 0; RETURN 0;
END Bomqtyonhand; END Bomqtyonhand;

View File

@ -23,13 +23,11 @@ AS
StdPrecision NUMBER; StdPrecision NUMBER;
-- Get BOM Product info -- Get BOM Product info
CURSOR CUR_BOM IS CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID AND b.M_ProductBOM_ID != Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y'; AND b.IsActive='Y';
-- --
BEGIN BEGIN
@ -90,20 +88,15 @@ BEGIN
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID) JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
LEFT JOIN M_LocatorType lt ON (l.M_LocatorType_ID=lt.M_LocatorType_ID) LEFT JOIN M_LocatorType lt ON (l.M_LocatorType_ID=lt.M_LocatorType_ID)
WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID
AND COALESCE(lt.IsAvailableForReservation,'Y')='Y'; AND COALESCE(lt.IsAvailableForReservation,'Y')='Y';
-- Get Rounding Precision
SELECT NVL(MAX(u.StdPrecision), 0)
INTO StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product -- How much can we make with this product
ProductQty := ROUND (ProductQty/bom.BOMQty, StdPrecision); ProductQty := ProductQty/bom.BOMQty;
-- How much can we make overall -- How much can we make overall
IF (ProductQty < Quantity) THEN IF (ProductQty < Quantity) THEN
Quantity := ProductQty; Quantity := ProductQty;
END IF; END IF;
-- Another BOM -- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN ELSIF (bom.IsBOM = 'Y' AND bom.IsVerified = 'Y') THEN
ProductQty := BomqtyonhandForReservation (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID); ProductQty := BomqtyonhandForReservation (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID);
-- How much can we make overall -- How much can we make overall
IF (ProductQty < Quantity) THEN IF (ProductQty < Quantity) THEN
@ -119,7 +112,7 @@ BEGIN
FROM C_UOM u, M_PRODUCT p FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID; WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID;
-- --
RETURN ROUND (Quantity, StdPrecision); RETURN TRUNC(Quantity, StdPrecision); -- RoundDown
END IF; END IF;
RETURN 0; RETURN 0;
END BOMQTYONHANDFORRESERVATION; END BOMQTYONHANDFORRESERVATION;

View File

@ -23,13 +23,11 @@ AS
v_StdPrecision NUMBER; v_StdPrecision NUMBER;
-- Get BOM Product info -- Get BOM Product info
CURSOR CUR_BOM IS CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=p_Product_ID AND b.M_Product_ID=p_Product_ID
AND b.M_ProductBOM_ID != p_Product_ID AND b.M_ProductBOM_ID != p_Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y'; AND b.IsActive='Y';
-- --
BEGIN BEGIN
@ -91,19 +89,14 @@ BEGIN
AND M_Warehouse_ID=v_Warehouse_ID AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='N' AND IsSOTrx='N'
AND IsActive='Y'; AND IsActive='Y';
-- Get Rounding Precision
SELECT NVL(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product -- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision); v_ProductQty := v_ProductQty/bom.BOMQty;
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty; v_Quantity := v_ProductQty;
END IF; END IF;
-- Another BOM -- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN ELSIF (bom.IsBOM = 'Y' AND BOM.IsVerified = 'Y') THEN
v_ProductQty := Bomqtyordered (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID); v_ProductQty := Bomqtyordered (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID);
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
@ -124,7 +117,7 @@ BEGIN
FROM C_UOM u, M_PRODUCT p FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID; WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID;
-- --
RETURN ROUND (v_Quantity, v_StdPrecision); RETURN TRUNC(v_Quantity, v_StdPrecision); -- RoundDown
END IF; END IF;
-- --
RETURN 0; RETURN 0;

View File

@ -23,13 +23,11 @@ AS
v_StdPrecision NUMBER; v_StdPrecision NUMBER;
-- Get BOM Product info -- Get BOM Product info
CURSOR CUR_BOM IS CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=p_Product_ID AND b.M_Product_ID=p_Product_ID
AND b.M_ProductBOM_ID != p_Product_ID AND b.M_ProductBOM_ID != p_Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y'; AND b.IsActive='Y';
-- --
BEGIN BEGIN
@ -91,19 +89,14 @@ BEGIN
AND M_Warehouse_ID=v_Warehouse_ID AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='Y' AND IsSOTrx='Y'
AND IsActive='Y'; AND IsActive='Y';
-- Get Rounding Precision
SELECT NVL(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product -- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision); v_ProductQty := v_ProductQty/bom.BOMQty;
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty; v_Quantity := v_ProductQty;
END IF; END IF;
-- Another BOM -- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN ELSIF (bom.IsBOM = 'Y' AND BOM.IsVerified = 'Y') THEN
v_ProductQty := Bomqtyreserved (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID); v_ProductQty := Bomqtyreserved (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID);
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
@ -124,7 +117,7 @@ BEGIN
FROM C_UOM u, M_PRODUCT p FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID; WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID;
-- --
RETURN ROUND (v_Quantity, v_StdPrecision); RETURN TRUNC(v_Quantity, v_StdPrecision); -- RoundDown
END IF; END IF;
RETURN 0; RETURN 0;
END Bomqtyreserved; END Bomqtyreserved;

View File

@ -10,7 +10,7 @@ BEGIN
SELECT COALESCE (SUM(PriceLimit), 0) SELECT COALESCE (SUM(PriceLimit), 0)
INTO v_Price INTO v_Price
FROM M_ProductPrice FROM M_ProductPrice
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID; WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM -- No Price - Check if BOM
IF (v_Price = 0) THEN IF (v_Price = 0) THEN
@ -20,6 +20,7 @@ BEGIN
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID AND b.M_ProductBOM_ID != Product_ID
AND (p.IsBOM='N' OR p.IsVerified='Y')
AND b.IsActive='Y' AND b.IsActive='Y'
LOOP LOOP
v_ProductPrice := bomPriceLimit (bom.M_ProductBOM_ID, PriceList_Version_ID); v_ProductPrice := bomPriceLimit (bom.M_ProductBOM_ID, PriceList_Version_ID);
@ -30,7 +31,6 @@ BEGIN
RETURN v_Price; RETURN v_Price;
END; END;
$BODY$ $BODY$
LANGUAGE 'plpgsql' STABLE LANGUAGE 'plpgsql' STABLE
; ;

View File

@ -10,7 +10,7 @@ BEGIN
SELECT COALESCE (SUM(PriceList), 0) SELECT COALESCE (SUM(PriceList), 0)
INTO v_Price INTO v_Price
FROM M_ProductPrice FROM M_ProductPrice
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID; WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM -- No Price - Check if BOM
IF (v_Price = 0) THEN IF (v_Price = 0) THEN
@ -20,6 +20,7 @@ BEGIN
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID AND b.M_ProductBOM_ID != Product_ID
AND (p.IsBOM='N' OR p.IsVerified='Y')
AND b.IsActive='Y' AND b.IsActive='Y'
LOOP LOOP
v_ProductPrice := bomPriceList (bom.M_ProductBOM_ID, PriceList_Version_ID); v_ProductPrice := bomPriceList (bom.M_ProductBOM_ID, PriceList_Version_ID);
@ -30,7 +31,6 @@ BEGIN
RETURN v_Price; RETURN v_Price;
END; END;
$BODY$ $BODY$
LANGUAGE 'plpgsql' STABLE LANGUAGE 'plpgsql' STABLE
; ;

View File

@ -10,7 +10,7 @@ BEGIN
SELECT COALESCE(SUM(PriceStd), 0) SELECT COALESCE(SUM(PriceStd), 0)
INTO v_Price INTO v_Price
FROM M_ProductPrice FROM M_ProductPrice
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID; WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM -- No Price - Check if BOM
IF (v_Price = 0) THEN IF (v_Price = 0) THEN
@ -20,6 +20,7 @@ BEGIN
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID AND b.M_ProductBOM_ID != Product_ID
AND (p.IsBOM='N' OR p.IsVerified='Y')
AND b.IsActive='Y' AND b.IsActive='Y'
LOOP LOOP
v_ProductPrice := bomPriceStd (bom.M_ProductBOM_ID, PriceList_Version_ID); v_ProductPrice := bomPriceStd (bom.M_ProductBOM_ID, PriceList_Version_ID);
@ -30,7 +31,6 @@ BEGIN
RETURN v_Price; RETURN v_Price;
END; END;
$BODY$ $BODY$
LANGUAGE 'plpgsql' STABLE LANGUAGE 'plpgsql' STABLE
; ;

View File

@ -54,13 +54,11 @@ BEGIN
-- Go through BOM -- Go through BOM
FOR bom IN -- Get BOM Product info FOR bom IN -- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=product_ID AND b.M_Product_ID=product_ID
AND b.M_ProductBOM_ID != Product_ID AND b.M_ProductBOM_ID != Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y' AND b.IsActive='Y'
LOOP LOOP
-- Stocked Items "leaf node" -- Stocked Items "leaf node"
@ -71,19 +69,14 @@ BEGIN
FROM M_Storageonhand s FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID) JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID; WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID;
-- Get Rounding Precision
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product -- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision); v_ProductQty := v_ProductQty/bom.BOMQty;
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty; v_Quantity := v_ProductQty;
END IF; END IF;
-- Another BOM -- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN ELSIF (bom.IsBOM = 'Y' AND BOM.IsVerified = 'Y') THEN
v_ProductQty := Bomqtyonhand (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID); v_ProductQty := Bomqtyonhand (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID);
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
@ -99,7 +92,7 @@ BEGIN
FROM C_UOM u, M_PRODUCT p FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID; WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID;
-- --
RETURN ROUND (v_Quantity, v_StdPrecision); RETURN TRUNC(v_Quantity, v_StdPrecision); -- RoundDown
END IF; END IF;
RETURN 0; RETURN 0;
END; END;

View File

@ -56,13 +56,11 @@ BEGIN
-- Go through BOM -- Go through BOM
FOR bom IN -- Get BOM Product info FOR bom IN -- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=product_ID AND b.M_Product_ID=product_ID
AND b.M_ProductBOM_ID != Product_ID AND b.M_ProductBOM_ID != Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y' AND b.IsActive='Y'
LOOP LOOP
-- Stocked Items "leaf node" -- Stocked Items "leaf node"
@ -75,19 +73,14 @@ BEGIN
LEFT JOIN M_LocatorType lt ON (l.M_LocatorType_ID=lt.M_LocatorType_ID) LEFT JOIN M_LocatorType lt ON (l.M_LocatorType_ID=lt.M_LocatorType_ID)
WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID
AND COALESCE(lt.IsAvailableForReservation,'Y')='Y'; AND COALESCE(lt.IsAvailableForReservation,'Y')='Y';
-- Get Rounding Precision
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product -- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision); v_ProductQty := v_ProductQty/bom.BOMQty;
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty; v_Quantity := v_ProductQty;
END IF; END IF;
-- Another BOM -- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN ELSIF (bom.IsBOM = 'Y' AND bom.IsVerified = 'Y') THEN
v_ProductQty := BOMQtyOnHandForReservation (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID); v_ProductQty := BOMQtyOnHandForReservation (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID);
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
@ -103,7 +96,7 @@ BEGIN
FROM C_UOM u, M_PRODUCT p FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID; WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID;
-- --
RETURN ROUND (v_Quantity, v_StdPrecision); RETURN TRUNC(v_Quantity, v_StdPrecision); -- RoundDown
END IF; END IF;
RETURN 0; RETURN 0;
END; END;

View File

@ -57,13 +57,11 @@ BEGIN
-- Go though BOM -- Go though BOM
FOR bom IN FOR bom IN
-- Get BOM Product info -- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=p_Product_ID AND b.M_Product_ID=p_Product_ID
AND b.M_ProductBOM_ID != p_Product_ID AND b.M_ProductBOM_ID != p_Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y' AND b.IsActive='Y'
LOOP LOOP
-- Stocked Items "leaf node" -- Stocked Items "leaf node"
@ -76,20 +74,15 @@ BEGIN
AND M_Warehouse_ID=v_Warehouse_ID AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='N' AND IsSOTrx='N'
AND IsActive='Y'; AND IsActive='Y';
-- Get Rounding Precision
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product -- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision ); v_ProductQty := v_ProductQty/bom.BOMQty;
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty; v_Quantity := v_ProductQty;
END IF; END IF;
-- Another BOM -- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN ELSIF (bom.IsBOM = 'Y' AND BOM.IsVerified = 'Y') THEN
v_ProductQty := Bomqtyordered (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID); v_ProductQty := Bomqtyordered (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID);
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
@ -110,11 +103,12 @@ BEGIN
FROM C_UOM u, M_PRODUCT p FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID; WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID;
-- --
RETURN ROUND (v_Quantity, v_StdPrecision ); RETURN TRUNC(v_Quantity, v_StdPrecision); -- RoundDown
END IF; END IF;
-- --
RETURN 0; RETURN 0;
END; END;
$BODY$ $BODY$
LANGUAGE plpgsql STABLE; LANGUAGE 'plpgsql' STABLE
;

View File

@ -57,13 +57,11 @@ BEGIN
-- Go though BOM -- Go though BOM
FOR bom IN FOR bom IN
-- Get BOM Product info -- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=p_Product_ID AND b.M_Product_ID=p_Product_ID
AND b.M_ProductBOM_ID != p_Product_ID AND b.M_ProductBOM_ID != p_Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y' AND b.IsActive='Y'
LOOP LOOP
-- Stocked Items "leaf node" -- Stocked Items "leaf node"
@ -76,19 +74,14 @@ BEGIN
AND M_Warehouse_ID =v_Warehouse_ID AND M_Warehouse_ID =v_Warehouse_ID
AND IsSOTrx='Y' AND IsSOTrx='Y'
AND IsActive='Y'; AND IsActive='Y';
-- Get Rounding Precision
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product -- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision); v_ProductQty := v_ProductQty/bom.BOMQty;
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty; v_Quantity := v_ProductQty;
END IF; END IF;
-- Another BOM -- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN ELSIF (bom.IsBOM = 'Y' AND BOM.IsVerified = 'Y') THEN
v_ProductQty := Bomqtyreserved (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID); v_ProductQty := Bomqtyreserved (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID);
-- How much can we make overall -- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN IF (v_ProductQty < v_Quantity) THEN
@ -109,11 +102,11 @@ BEGIN
FROM C_UOM u, M_PRODUCT p FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID; WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID;
-- --
RETURN ROUND (v_Quantity, v_StdPrecision); RETURN TRUNC(v_Quantity, v_StdPrecision); -- RoundDown
END IF; END IF;
RETURN 0; RETURN 0;
END; END;
$BODY$ $BODY$
LANGUAGE plpgsql STABLE; LANGUAGE 'plpgsql' STABLE
;

View File

@ -4,7 +4,8 @@ CREATE OR REPLACE FUNCTION ProductAttribute
( (
p_M_AttributeSetInstance_ID NUMERIC p_M_AttributeSetInstance_ID NUMERIC
) )
RETURNS VARCHAR AS $body$ RETURNS VARCHAR AS
$BODY$
/************************************************************************* /*************************************************************************
* The contents of this file are subject to the Compiere License. You may * The contents of this file are subject to the Compiere License. You may
@ -87,6 +88,7 @@ BEGIN
END IF; END IF;
RETURN v_Name; RETURN v_Name;
END; END;
$BODY$
$body$ LANGUAGE plpgsql STABLE; LANGUAGE 'plpgsql' STABLE
;

View File

@ -0,0 +1,29 @@
/*
CREATE TABLE dbreplicasyncverifier (lastupdate date)
;
INSERT INTO dbreplicasyncverifier values (to_date('1900-01-01 00:00:00', 'yyyy-mm-dd HH24:MI:SS'))
;
*/
CREATE OR REPLACE FUNCTION forbid_multiple_rows_in_dbreplicasyncverifier()
RETURNS TRIGGER AS $$
BEGIN
-- Check if the table already contains a row
IF (SELECT COUNT(*) FROM dbreplicasyncverifier) > 0 THEN
RAISE EXCEPTION 'Table can only contain one row.';
END IF;
RETURN NEW;
END;
$$ LANGUAGE plpgsql
;
CREATE TRIGGER single_row_only_trigger_dbreplicasyncverifier
BEFORE INSERT ON dbreplicasyncverifier
FOR EACH ROW
EXECUTE FUNCTION forbid_multiple_rows_in_dbreplicasyncverifier()
;
CREATE OR REPLACE RULE delete_dbreplicasyncverifier AS ON DELETE TO dbreplicasyncverifier DO INSTEAD NOTHING
;

View File

@ -41,13 +41,6 @@ END;
$BODY$ $BODY$
LANGUAGE plpgsql; LANGUAGE plpgsql;
CREATE TABLE dual ( dummy char ); CREATE VIEW dual AS SELECT 'X'::varchar AS dummy
;
INSERT INTO dual values ( 'X' );
CREATE OR REPLACE RULE insert_dual AS ON INSERT TO dual DO INSTEAD NOTHING;
CREATE OR REPLACE RULE update_dual AS ON UPDATE TO dual DO INSTEAD NOTHING;
CREATE OR REPLACE RULE delete_dual AS ON DELETE TO dual DO INSTEAD NOTHING;

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-2981 - Implement JSON Field type
SELECT register_migration_script('202402261300_IDEMPIERE-2981.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Feb 26, 2024, 1:00:29 PM CET
INSERT INTO AD_Reference (AD_Reference_ID,Name,Description,ValidationType,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,IsOrderByValue,AD_Reference_UU,ShowInactive) VALUES (200267,'JSON','JSON format values','D',0,0,'Y',TO_TIMESTAMP('2024-02-26 13:00:28','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-02-26 13:00:28','YYYY-MM-DD HH24:MI:SS'),100,'D','N','b6fcc751-edd8-4421-acd0-3cde02a9576d','N')
;

View File

@ -0,0 +1,30 @@
-- IDEMPIERE-2981 - Implement JSON Field type
SELECT register_migration_script('202402261354_IDEMPIERE-2981.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Feb 26, 2024, 1:54:35 PM CET
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (203924,0,0,'Y',TO_TIMESTAMP('2024-02-26 13:54:35','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-02-26 13:54:35','YYYY-MM-DD HH24:MI:SS'),100,'JsonData','JSON Data','The json field stores json data.','JSON Data','D','c4ea7a81-96a9-4a5d-bb87-e913e1c8ed48')
;
-- Feb 26, 2024, 1:55:37 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,IsHtml,IsPartitionKey) VALUES (216570,0,'JSON Data','The json field stores json data.',135,'JsonData',0,'N','N','N','N','N',0,'N',200267,0,0,'Y',TO_TIMESTAMP('2024-02-26 13:55:36','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-02-26 13:55:36','YYYY-MM-DD HH24:MI:SS'),100,203924,'Y','N','D','N','N','N','Y','927b83df-d161-4332-ad44-8ffed99e8cf4','Y',0,'N','N','N','N')
;
-- Feb 28, 2024, 5:41:55 PM CET
ALTER TABLE Test ADD JsonData CLOB DEFAULT NULL CONSTRAINT test_jsondata_ij CHECK (JsonData IS JSON)
;
-- Feb 26, 2024, 1:56:08 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (208472,'JSON Data','The json field stores json data.',152,216570,'Y',100,310,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-02-26 13:56:08','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-02-26 13:56:08','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','e47ef529-71ba-4f9b-9014-b188e17e8ef4','Y',290,5)
;
-- Feb 29, 2024, 1:52:50 PM CET
UPDATE AD_Field SET NumLines=5,Updated=TO_TIMESTAMP('2024-02-29 13:52:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208472
;
-- Feb 29, 2024, 2:07:30 PM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Invalid JSON',0,0,'Y',TO_TIMESTAMP('2024-02-29 14:07:30','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-02-29 14:07:30','YYYY-MM-DD HH24:MI:SS'),100,200876,'InvalidJSON','D','a263376f-a12e-4943-92f1-7d7ce8a67a2b')
;

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-6110
SELECT register_migration_script('202404171125_IDEMPIERE-6110.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Apr 17, 2024, 11:25:53 AM BRT
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Products or charges configured as ''Freight Product'' or ''Freight Charge'' cannot be added to this order due to the combination of delivery via rule and freight cost rule',0,0,'Y',TO_TIMESTAMP('2024-04-17 11:25:53','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-04-17 11:25:53','YYYY-MM-DD HH24:MI:SS'),100,200897,'FreightOrderLineNotAllowed','D','204c8bb9-d002-4beb-bbc3-1d1a11d7471d')
;

View File

@ -0,0 +1,8 @@
-- IDEMPIERE-5136
SELECT register_migration_script('202404220830_IDEMPIERE-5136_MissingDropIndex.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
DROP INDEX AD_MESSAGE_TRL_KEY
;

View File

@ -0,0 +1,22 @@
-- IDEMPIERE-6123 Query in search window causing slowness and load spikes in the database (FHCA-5356)
SELECT register_migration_script('202404302320_IDEMPIERE-6123.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Apr 30, 2024, 11:20:08 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200244,0,0,TO_TIMESTAMP('2024-04-30 23:20:08','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-04-30 23:20:08','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','GRIDTABLE_INITIAL_COUNT_TIMEOUT_IN_SECONDS','1','Timeout for the initial count on windows','D','C','5fae1af7-74ca-41d8-bbd3-d506c6c23b6a')
;
-- Apr 30, 2024, 11:22:16 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200245,0,0,TO_TIMESTAMP('2024-04-30 23:22:16','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-04-30 23:22:16','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','GLOBAL_MAX_QUERY_RECORDS','100000','Maximum number of records allowed to search in a window, can be overriden per Role or Tab','D','C','840fb67c-4609-41f2-9e20-e0ea9d839065')
;
-- Apr 30, 2024, 11:23:28 PM CEST
UPDATE AD_Message SET MsgText='The query returned more records than allowed, consider adding more filters.',Updated=TO_TIMESTAMP('2024-04-30 23:23:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=852
;
-- Apr 30, 2024, 11:24:06 PM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','The initial count query timed out, loading records ...',0,0,'Y',TO_TIMESTAMP('2024-04-30 23:24:06','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-04-30 23:24:06','YYYY-MM-DD HH24:MI:SS'),100,200887,'CountQueryTimeoutLoadBackground','D','988292d7-175f-41c2-b560-43d62b8326a9')
;

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-6137 Payment Rule does not appear in reports from Sales Order
SELECT register_migration_script('202405071219_IDEMPIERE-6137.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- May 7, 2024, 12:19:00 PM CEST
UPDATE AD_Column SET AD_Reference_Value_ID=195,Updated=TO_TIMESTAMP('2024-05-07 12:19:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=200012 AND COALESCE(AD_Reference_Value_ID,0)!=195
;

View File

@ -0,0 +1,22 @@
-- IDEMPIERE-6123 Query in search window causing slowness and load spikes in the database (FHCA-5356)
SELECT register_migration_script('202405080101_IDEMPIERE-6123.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- May 8, 2024, 1:01:16 AM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200247,0,0,TO_TIMESTAMP('2024-05-08 01:01:16','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-05-08 01:01:16','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','REPORT_LOAD_TIMEOUT_IN_SECONDS','120','Timeout in seconds when loading a report','D','C','14e838b1-c25c-400e-b39c-61da9bf92099')
;
-- May 8, 2024, 1:01:42 AM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200248,0,0,TO_TIMESTAMP('2024-05-08 01:01:41','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-05-08 01:01:41','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','GLOBAL_MAX_REPORT_RECORDS','100000','Max number of records allowed in a report','D','C','7030640a-1aa7-4ac7-a894-b4fe0dfde530')
;
-- May 8, 2024, 1:06:19 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','The data query for the report took too much time to execute (over {0} seconds) exceeding the allowed limit',0,0,'Y',TO_TIMESTAMP('2024-05-08 01:06:18','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-05-08 01:06:18','YYYY-MM-DD HH24:MI:SS'),100,200893,'ReportQueryTimeout','D','5f17f55f-adbe-4d97-bf83-9447983b4946')
;
-- May 8, 2024, 1:07:10 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','The report data exceeds the maximum limit of {0} rows',0,0,'Y',TO_TIMESTAMP('2024-05-08 01:07:09','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-05-08 01:07:09','YYYY-MM-DD HH24:MI:SS'),100,200894,'ReportMaxRowsReached','D','a4b55c31-0df0-4302-a62a-91cb7e79be0d')
;

View File

@ -0,0 +1,25 @@
-- IDEMPIERE-6040 Improvements for CSV import template
SELECT register_migration_script('202405131534_IDEMPIERE-6040.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- May 13, 2024, 3:34:49 PM CEST
UPDATE AD_Ref_List SET Name='Comma-separated values (CSV)',Updated=TO_TIMESTAMP('2024-05-13 15:34:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=200704
;
-- May 13, 2024, 3:35:58 PM CEST
UPDATE AD_Ref_List SET Name='Excel (XLS/XLSX)',Updated=TO_TIMESTAMP('2024-05-13 15:35:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=200706
;
-- May 13, 2024, 3:36:02 PM CEST
UPDATE AD_Ref_List SET IsActive='N',Updated=TO_TIMESTAMP('2024-05-13 15:36:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=200705
;
UPDATE AD_ImportTemplate SET ImportTemplateType='XLSX' WHERE ImportTemplateType='XLS'
;
-- May 13, 2024, 3:59:49 PM CEST
UPDATE AD_Field SET SeqNo=120, ColumnSpan=2,Updated=TO_TIMESTAMP('2024-05-13 15:59:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208476
;

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-5728
SELECT register_migration_script('202405151228_IDEMPIERE-5728.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- May 15, 2024, 12:28:30 PM CEST
UPDATE AD_ViewColumn SET ColumnName='RV_UnPosted_UU',Updated=TO_TIMESTAMP('2024-05-15 12:28:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ViewColumn_ID=217690
;

View File

@ -0,0 +1,5 @@
-- IDEMPIERE-6166 PostgreSQL DUAL table with more than one record
SELECT register_migration_script('202406072107_IDEMPIERE-6166.sql') FROM dual;
-- placeholder, this is just required for postgresql

View File

@ -0,0 +1,161 @@
-- IDEMPIERE-6167 BOM Price List must search just for Verified BOMs
SELECT register_migration_script('202406072206_IDEMPIERE-6167.sql') FROM dual;
CREATE OR REPLACE FUNCTION BOMPRICELIMIT
(
Product_ID IN NUMBER,
PriceList_Version_ID IN NUMBER
)
RETURN NUMBER
/*************************************************************************
* The contents of this file are subject to the Compiere License. You may
* obtain a copy of the License at http://www.compiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Compiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: BOM_PriceLimit.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Return Limit Price of Product/BOM
* Description:
* if not found: 0
************************************************************************/
AS
v_Price NUMBER;
v_ProductPrice NUMBER;
-- Get BOM Product info
CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y';
--
BEGIN
-- Try to get price from PriceList directly
SELECT COALESCE (SUM(PriceLimit), 0)
INTO v_Price
FROM M_PRODUCTPRICE
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- DBMS_OUTPUT.PUT_LINE('Price=' || v_Price);
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN CUR_BOM LOOP
v_ProductPrice := Bompricelimit (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
END LOOP;
END IF;
--
RETURN v_Price;
END Bompricelimit;
/
CREATE OR REPLACE FUNCTION BOMPRICELIST
(
Product_ID IN NUMBER,
PriceList_Version_ID IN NUMBER
)
RETURN NUMBER
/*************************************************************************
* The contents of this file are subject to the Compiere License. You may
* obtain a copy of the License at http://www.compiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Compiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: BOM_PriceList.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Return List Price of Product/BOM
* Description:
* if not found: 0
************************************************************************/
AS
v_Price NUMBER;
v_ProductPrice NUMBER;
-- Get BOM Product info
CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y';
--
BEGIN
-- Try to get price from pricelist directly
SELECT COALESCE (SUM(PriceList), 0)
INTO v_Price
FROM M_PRODUCTPRICE
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- DBMS_OUTPUT.PUT_LINE('Price=' || Price);
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN CUR_BOM LOOP
v_ProductPrice := Bompricelist (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
-- DBMS_OUTPUT.PUT_LINE('Qry=' || bom.BOMQty || ' @ ' || v_ProductPrice || ', Price=' || v_Price);
END LOOP; -- BOM
END IF;
--
RETURN v_Price;
END Bompricelist;
/
CREATE OR REPLACE FUNCTION BOMPRICESTD
(
Product_ID IN NUMBER,
PriceList_Version_ID IN NUMBER
)
RETURN NUMBER
/*************************************************************************
* The contents of this file are subject to the Compiere License. You may
* obtain a copy of the License at http://www.compiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Compiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: BOM_PriceStd.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Return Standard Price of Product/BOM
* Description:
* if not found: 0
************************************************************************/
AS
v_Price NUMBER;
v_ProductPrice NUMBER;
-- Get BOM Product info
CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y';
--
BEGIN
-- Try to get price from pricelist directly
SELECT COALESCE(SUM(PriceStd), 0)
INTO v_Price
FROM M_PRODUCTPRICE
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- DBMS_OUTPUT.PUT_LINE('Price=' || v_Price);
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN CUR_BOM LOOP
v_ProductPrice := Bompricestd (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
-- DBMS_OUTPUT.PUT_LINE('Price=' || v_Price);
END LOOP; -- BOM
END IF;
--
RETURN v_Price;
END Bompricestd;
/

View File

@ -0,0 +1,12 @@
-- IDEMPIERE-6169 Performance on AD_ChangeLog with Record_UU
SELECT register_migration_script('202406131736_IDEMPIERE-6169.sql') FROM dual;
ALTER TABLE ad_changelog DROP CONSTRAINT ad_changelog_key
;
DROP INDEX ad_changelog_key
;
ALTER TABLE ad_changelog ADD CONSTRAINT ad_changelog_pkey PRIMARY KEY (ad_session_id, ad_column_id, ad_changelog_id)
;

View File

@ -0,0 +1,22 @@
-- IDEMPIERE-6176 UUID indexes without constraint
SELECT register_migration_script('202406180027_IDEMPIERE-6176.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Jun 18, 2024, 12:29:20 AM CEST
UPDATE AD_IndexColumn SET IsActive='N',Updated=TO_TIMESTAMP('2024-06-18 00:29:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200980
;
-- Jun 18, 2024, 12:29:27 AM CEST
UPDATE AD_TableIndex SET IsActive='N', IsCreateConstraint='Y',Updated=TO_TIMESTAMP('2024-06-18 00:29:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_TableIndex_ID=200806
;
-- Jun 18, 2024, 12:30:44 AM CEST
UPDATE AD_TableIndex SET IsCreateConstraint='Y',Updated=TO_TIMESTAMP('2024-06-18 00:30:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_TableIndex_ID=201272
;
-- Jun 18, 2024, 12:31:49 AM CEST
UPDATE AD_TableIndex SET IsCreateConstraint='Y',Updated=TO_TIMESTAMP('2024-06-18 00:31:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_TableIndex_ID=201275
;

View File

@ -0,0 +1,50 @@
-- IDEMPIERE-6188 Read-Only Session
SELECT register_migration_script('202407061229_IDEMPIERE-6188.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Jul 6, 2024, 12:29:56 PM CEST
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,Help,PrintName,EntityType,AD_Element_UU) VALUES (203938,0,0,'Y',TO_TIMESTAMP('2024-07-06 12:29:42','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-07-06 12:29:42','YYYY-MM-DD HH24:MI:SS'),100,'IsReadOnlySession','Read Only Session',NULL,NULL,'Read Only Session','D','6ee179e4-9573-4a3d-8815-23723ef241d7')
;
-- Jul 6, 2024, 12:30:19 PM CEST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,IsHtml,IsPartitionKey) VALUES (216614,0,'Read Only Session',200174,'IsReadOnlySession','N',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2024-07-06 12:30:18','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-07-06 12:30:18','YYYY-MM-DD HH24:MI:SS'),100,203938,'Y','N','D','N','N','N','Y','8c255baa-fbec-4a90-a43d-5461060368e9','Y',0,'N','N','N','N')
;
-- Jul 6, 2024, 12:30:29 PM CEST
ALTER TABLE AD_UserPreference ADD IsReadOnlySession CHAR(1) DEFAULT 'N' CHECK (IsReadOnlySession IN ('Y','N')) NOT NULL
;
-- Jul 6, 2024, 12:30:45 PM CEST
INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (208494,'Read Only Session',200189,216614,'Y',1,170,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-07-06 12:30:45','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-07-06 12:30:45','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','f69131e7-4fca-4011-89d5-650ca506c920','Y',170,2,2)
;
-- Jul 6, 2024, 12:31:06 PM CEST
UPDATE AD_Field SET SeqNo=110,Updated=TO_TIMESTAMP('2024-07-06 12:31:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206133
;
-- Jul 6, 2024, 12:31:06 PM CEST
UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2024-07-06 12:31:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206134
;
-- Jul 6, 2024, 12:31:06 PM CEST
UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2024-07-06 12:31:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206407
;
-- Jul 6, 2024, 12:31:06 PM CEST
UPDATE AD_Field SET SeqNo=140,Updated=TO_TIMESTAMP('2024-07-06 12:31:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208189
;
-- Jul 6, 2024, 12:31:06 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=150, XPosition=5,Updated=TO_TIMESTAMP('2024-07-06 12:31:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208494
;
-- Jul 6, 2024, 12:31:25 PM CEST
UPDATE AD_Field SET IsQuickEntry='Y',Updated=TO_TIMESTAMP('2024-07-06 12:31:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208494
;
-- Jul 9, 2024, 7:48:40 PM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Read-only session',0,0,'Y',TO_TIMESTAMP('2024-07-09 19:48:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-07-09 19:48:39','YYYY-MM-DD HH24:MI:SS'),100,200900,'ReadOnlySession','D','dc819f55-662d-4d30-b68d-0a93b46a8458')
;

View File

@ -0,0 +1,18 @@
-- IDEMPIERE-6196
SELECT register_migration_script('202407231647_IDEMPIERE-6196.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Jul 23, 2024, 4:47:40 PM CEST
UPDATE AD_Column SET SeqNoSelection=30,Updated=TO_TIMESTAMP('2024-07-23 16:47:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=103
;
-- Jul 23, 2024, 4:47:43 PM CEST
UPDATE AD_Column SET SeqNoSelection=20,Updated=TO_TIMESTAMP('2024-07-23 16:47:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=102
;
-- Jul 23, 2024, 4:47:52 PM CEST
UPDATE AD_Column SET SeqNoSelection=10,Updated=TO_TIMESTAMP('2024-07-23 16:47:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=107
;

View File

@ -0,0 +1,26 @@
-- IDEMPIERE-6189 Performance: queries on RV_C_Invoice doing unnecesary index or seq scan
SELECT register_migration_script('202408191316_IDEMPIERE-6189.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Aug 19, 2024, 1:16:19 PM CEST
UPDATE AD_ViewComponent SET FromClause='FROM c_invoice i
LEFT JOIN c_doctype d ON i.c_doctype_id = d.c_doctype_id
LEFT JOIN c_bpartner b ON i.c_bpartner_id = b.c_bpartner_id
LEFT JOIN c_bpartner_location bpl ON i.c_bpartner_location_id = bpl.c_bpartner_location_id
LEFT JOIN c_location loc ON bpl.c_location_id = loc.c_location_id',Updated=TO_TIMESTAMP('2024-08-19 13:16:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ViewComponent_ID=200116
;
-- Aug 19, 2024, 1:16:27 PM CEST
CREATE OR REPLACE VIEW RV_C_Invoice(C_Invoice_ID, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, IsSOTrx, DocumentNo, DocStatus, DocAction, IsPrinted, IsDiscountPrinted, Processing, Processed, IsTransferred, IsPaid, C_DocType_ID, C_DocTypeTarget_ID, C_Order_ID, Description, IsApproved, SalesRep_ID, DateInvoiced, DatePrinted, DateAcct, C_BPartner_ID, C_BPartner_Location_ID, AD_User_ID, C_BP_Group_ID, POReference, DateOrdered, C_Currency_ID, C_ConversionType_ID, PaymentRule, C_PaymentTerm_ID, M_PriceList_ID, C_Campaign_ID, C_Project_ID, C_Activity_ID, IsPayScheduleValid, InvoiceCollectionType, C_Country_ID, C_Region_ID, Postal, City, C_Charge_ID, ChargeAmt, TotalLines, GrandTotal, Multiplier, C_Invoice_AD_OrgTrx_ID, C_Invoice_C_ConversionType_ID, C_DunningLevel_ID, C_Payment_ID, c_invoice_dateordered, DunningGrace, GenerateTo, IsInDispute, c_invoice_ispayschedulevalid, c_invoice_isselfservice, IsTaxIncluded, M_RMA_ID, Posted, ProcessedOn, Ref_Invoice_ID, Reversal_ID, SendEMail, User1_ID, User2_ID, c_bp_acqusitioncost, c_bp_actuallifetimevalue, c_bp_ad_language, C_BP_AD_OrgBP_ID, C_BP_AD_Org_ID, C_BP_BPartner_Parent_ID, C_BP_C_Dunning_ID, C_BP_C_Greeting_ID, C_BP_C_InvoiceSchedule_ID, C_BP_C_PaymentTerm_ID, c_bp_created, C_BP_CreatedBy, C_BP_C_TaxGroup_ID, c_bp_deliveryrule, c_bp_deliveryviarule, c_bp_description, c_bp_dunninggrace, c_bp_duns, c_bp_firstsale, c_bp_flatdiscount, c_bp_freightcostrule, c_bp_invoicerule, c_bp_isactive, c_bp_iscustomer, c_bp_isdiscountprinted, c_bp_isemployee, c_bp_ismanufacturer, c_bp_isonetime, c_bp_ispotaxexempt, c_bp_isprospect, c_bp_issalesrep, c_bp_issummary, c_bp_istaxexempt, c_bp_isvendor, C_BP_Logo_ID, C_BP_M_DiscountSchema_ID, C_BP_M_PriceList_ID, c_bp_naics, c_bp_name, c_bp_name2, c_bp_numberemployees, c_bp_paymentrule, c_bp_paymentrulepo, C_BP_PO_DiscountSchema_ID, C_BP_PO_PaymentTerm_ID, C_BP_PO_PriceList_ID, c_bp_poreference, c_bp_potentiallifetimevalue, c_bp_rating, c_bp_referenceno, C_BP_SalesRep_ID, c_bp_salesvolume, c_bp_sendemail, c_bp_shareofcustomer, c_bp_shelflifeminpct, c_bp_so_creditlimit, c_bp_socreditstatus, c_bp_so_creditused, c_bp_so_description, TaxID, c_bp_totalopenbalance, c_bp_updated, C_BP_UpdatedBy, c_bp_url, c_bp_value, C_BP_Location_AD_Org_ID, C_BP_Location_C_BPartner_ID, C_BP_Location_C_Location_ID, c_bp_location_created, C_BP_Location_CreatedBy, C_SalesRegion_ID, c_bp_location_fax, c_bp_location_isactive, IsBillTo, ISDN, IsPayFrom, IsRemitTo, IsShipTo,
c_bp_location_name, c_bp_location_phone, c_bp_location_phone2, c_bp_location_updated, C_BP_Location_UpdatedBy, Address1, Address2, Address3, Address4, C_Location_AD_Org_ID, C_City_ID, c_location_created, C_Location_CreatedBy, c_location_isactive, Postal_Add, RegionName, c_location_updated, C_Location_UpdatedBy) AS
SELECT i.c_invoice_id AS C_Invoice_ID, i.ad_client_id AS AD_Client_ID, i.ad_org_id AS AD_Org_ID, i.isactive AS IsActive, i.created AS Created, i.createdby AS CreatedBy, i.updated AS Updated, i.updatedby AS UpdatedBy, i.issotrx AS IsSOTrx, i.documentno AS DocumentNo, i.docstatus AS DocStatus, i.docaction AS DocAction, i.isprinted AS IsPrinted, i.isdiscountprinted AS IsDiscountPrinted, i.processing AS Processing, i.processed AS Processed, i.istransferred AS IsTransferred, i.ispaid AS IsPaid, i.c_doctype_id AS C_DocType_ID, i.c_doctypetarget_id AS C_DocTypeTarget_ID, i.c_order_id AS C_Order_ID, i.description AS Description, i.isapproved AS IsApproved, i.salesrep_id AS SalesRep_ID, i.dateinvoiced AS DateInvoiced, i.dateprinted AS DatePrinted, i.dateacct AS DateAcct, i.c_bpartner_id AS C_BPartner_ID, i.c_bpartner_location_id AS C_BPartner_Location_ID, i.ad_user_id AS AD_User_ID, b.c_bp_group_id AS C_BP_Group_ID, i.poreference AS POReference, i.dateordered AS DateOrdered, i.c_currency_id AS C_Currency_ID, i.c_conversiontype_id AS C_ConversionType_ID, i.paymentrule AS PaymentRule, i.c_paymentterm_id AS C_PaymentTerm_ID, i.m_pricelist_id AS M_PriceList_ID, i.c_campaign_id AS C_Campaign_ID, i.c_project_id AS C_Project_ID, i.c_activity_id AS C_Activity_ID, i.ispayschedulevalid AS IsPayScheduleValid, i.invoicecollectiontype AS InvoiceCollectionType, loc.c_country_id AS C_Country_ID, loc.c_region_id AS C_Region_ID, loc.postal AS Postal, loc.city AS City, i.c_charge_id AS C_Charge_ID, CASE WHEN charat(d.docbasetype, 3) = 'C' THEN i.chargeamt * '-1' ELSE i.chargeamt END AS ChargeAmt, CASE WHEN charat(d.docbasetype, 3) = 'C' THEN i.totallines * '-1' ELSE i.totallines END AS TotalLines, CASE WHEN charat(d.docbasetype, 3) = 'C' THEN i.grandtotal * '-1' ELSE i.grandtotal END AS GrandTotal, CASE WHEN charat(d.docbasetype, 3) = 'C' THEN -1 ELSE 1 END AS Multiplier, i.ad_orgtrx_id AS C_Invoice_AD_OrgTrx_ID, i.c_conversiontype_id AS C_Invoice_C_ConversionType_ID, i.c_dunninglevel_id AS C_DunningLevel_ID, i.c_payment_id AS C_Payment_ID, i.dateordered AS c_invoice_dateordered, i.dunninggrace AS DunningGrace, i.generateto AS GenerateTo, i.isindispute AS IsInDispute, i.ispayschedulevalid AS c_invoice_ispayschedulevalid, i.isselfservice AS c_invoice_isselfservice, i.istaxincluded AS IsTaxIncluded, i.m_rma_id AS M_RMA_ID, i.posted AS Posted, i.processedon AS ProcessedOn, i.ref_invoice_id AS Ref_Invoice_ID, i.reversal_id AS Reversal_ID, i.sendemail AS SendEMail,
i.user1_id AS User1_ID, i.user2_id AS User2_ID, b.acqusitioncost AS c_bp_acqusitioncost, b.actuallifetimevalue AS c_bp_actuallifetimevalue, b.ad_language AS c_bp_ad_language, b.ad_orgbp_id AS C_BP_AD_OrgBP_ID, b.ad_org_id AS C_BP_AD_Org_ID, b.bpartner_parent_id AS C_BP_BPartner_Parent_ID, b.c_dunning_id AS C_BP_C_Dunning_ID, b.c_greeting_id AS C_BP_C_Greeting_ID, b.c_invoiceschedule_id AS C_BP_C_InvoiceSchedule_ID, b.c_paymentterm_id AS C_BP_C_PaymentTerm_ID, b.created AS c_bp_created, b.createdby AS C_BP_CreatedBy, b.c_taxgroup_id AS C_BP_C_TaxGroup_ID, b.deliveryrule AS c_bp_deliveryrule, b.deliveryviarule AS c_bp_deliveryviarule, b.description AS c_bp_description, b.dunninggrace AS c_bp_dunninggrace, b.duns AS c_bp_duns, b.firstsale AS c_bp_firstsale, b.flatdiscount AS c_bp_flatdiscount, b.freightcostrule AS c_bp_freightcostrule, b.invoicerule AS c_bp_invoicerule, b.isactive AS c_bp_isactive, b.iscustomer AS c_bp_iscustomer, b.isdiscountprinted AS c_bp_isdiscountprinted, b.isemployee AS c_bp_isemployee, b.ismanufacturer AS c_bp_ismanufacturer, b.isonetime AS c_bp_isonetime, b.ispotaxexempt AS c_bp_ispotaxexempt, b.isprospect AS c_bp_isprospect, b.issalesrep AS c_bp_issalesrep, b.issummary AS c_bp_issummary, b.istaxexempt AS c_bp_istaxexempt, b.isvendor AS c_bp_isvendor, b.logo_id AS C_BP_Logo_ID, b.m_discountschema_id AS C_BP_M_DiscountSchema_ID, b.m_pricelist_id AS C_BP_M_PriceList_ID, b.naics AS c_bp_naics, b.name AS c_bp_name, b.name2 AS c_bp_name2, b.numberemployees AS c_bp_numberemployees, b.paymentrule AS c_bp_paymentrule, b.paymentrulepo AS c_bp_paymentrulepo, b.po_discountschema_id AS C_BP_PO_DiscountSchema_ID, b.po_paymentterm_id AS C_BP_PO_PaymentTerm_ID, b.po_pricelist_id AS C_BP_PO_PriceList_ID, b.poreference AS c_bp_poreference, b.potentiallifetimevalue AS c_bp_potentiallifetimevalue, b.rating AS c_bp_rating, b.referenceno AS c_bp_referenceno, b.salesrep_id AS C_BP_SalesRep_ID, b.salesvolume AS c_bp_salesvolume, b.sendemail AS c_bp_sendemail, b.shareofcustomer AS c_bp_shareofcustomer, b.shelflifeminpct AS c_bp_shelflifeminpct, b.so_creditlimit AS c_bp_so_creditlimit, b.socreditstatus AS c_bp_socreditstatus, b.so_creditused AS c_bp_so_creditused, b.so_description AS c_bp_so_description, b.taxid AS TaxID, b.totalopenbalance AS c_bp_totalopenbalance, b.updated AS c_bp_updated, b.updatedby AS C_BP_UpdatedBy, b.url AS c_bp_url, b.value AS c_bp_value, bpl.ad_org_id AS C_BP_Location_AD_Org_ID, bpl.c_bpartner_id AS C_BP_Location_C_BPartner_ID,
bpl.c_location_id AS C_BP_Location_C_Location_ID, bpl.created AS c_bp_location_created, bpl.createdby AS C_BP_Location_CreatedBy, bpl.c_salesregion_id AS C_SalesRegion_ID, bpl.fax AS c_bp_location_fax, bpl.isactive AS c_bp_location_isactive, bpl.isbillto AS IsBillTo, bpl.isdn AS ISDN, bpl.ispayfrom AS IsPayFrom, bpl.isremitto AS IsRemitTo, bpl.isshipto AS IsShipTo, bpl.name AS c_bp_location_name, bpl.phone AS c_bp_location_phone, bpl.phone2 AS c_bp_location_phone2, bpl.updated AS c_bp_location_updated, bpl.updatedby AS C_BP_Location_UpdatedBy, loc.address1 AS Address1, loc.address2 AS Address2, loc.address3 AS Address3, loc.address4 AS Address4, loc.ad_org_id AS C_Location_AD_Org_ID, loc.c_city_id AS C_City_ID, loc.created AS c_location_created, loc.createdby AS C_Location_CreatedBy, loc.isactive AS c_location_isactive, loc.postal_add AS Postal_Add, loc.regionname AS RegionName, loc.updated AS c_location_updated, loc.updatedby AS C_Location_UpdatedBy FROM c_invoice i
LEFT JOIN c_doctype d ON i.c_doctype_id = d.c_doctype_id
LEFT JOIN c_bpartner b ON i.c_bpartner_id = b.c_bpartner_id
LEFT JOIN c_bpartner_location bpl ON i.c_bpartner_location_id = bpl.c_bpartner_location_id
LEFT JOIN c_location loc ON bpl.c_location_id = loc.c_location_id
;

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-6216
SELECT register_migration_script('202408201236_IDEMPIERE-6216.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Aug 20, 2024, 12:36:08 PM CEST
UPDATE AD_Process_Para SET MandatoryLogic='@UseDefaultCoA@=N',Updated=TO_TIMESTAMP('2024-08-20 12:36:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53296
;

View File

@ -0,0 +1,94 @@
-- Adding new fields to AD_PInstance and AD_PInstance_Log
SELECT register_migration_script('202409041533_IDEMPIERE-6223.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Sep 4, 2024, 3:33:12 PM BRT
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml,IsPartitionKey) VALUES (216788,0,'JSON Data','The json field stores json data.',282,'JsonData',0,'N','N','N','N','N',0,'N',200267,0,0,'Y',TO_TIMESTAMP('2024-09-04 15:33:12','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-09-04 15:33:12','YYYY-MM-DD HH24:MI:SS'),100,203924,'Y','N','D','N','N','N','Y','6ec3e423-205d-482f-b7e2-3dea6b66d5d0','Y',0,'N','N','N','N','N')
;
-- Sep 4, 2024, 3:33:16 PM BRT
ALTER TABLE AD_PInstance ADD JsonData CLOB DEFAULT NULL CONSTRAINT AD_PInstance_JsonData_isjson CHECK (JsonData IS JSON)
;
-- Sep 4, 2024, 3:33:39 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan,NumLines) VALUES (208511,'JSON Data','The json field stores json data.',663,216788,'Y',0,210,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-09-04 15:33:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-09-04 15:33:39','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','2455e488-36a8-48d2-8410-2ff0808915e4','Y',200,2,5)
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110, XPosition=1, ColumnSpan=5,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208511
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10501
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207416
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=140,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10495
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202845
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202847
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=170,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207405
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=180,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207407
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=190,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207406
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=200,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207408
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207720
;
-- Sep 4, 2024, 3:34:40 PM BRT
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml,IsPartitionKey) VALUES (216789,0,'JSON Data','The json field stores json data.',578,'JsonData',0,'N','N','N','N','N',0,'N',200267,0,0,'Y',TO_TIMESTAMP('2024-09-04 15:34:40','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-09-04 15:34:40','YYYY-MM-DD HH24:MI:SS'),100,203924,'Y','N','D','N','N','N','Y','7539f67f-922d-4e27-881f-c04f0dc8c160','Y',0,'N','N','N','N','N')
;
-- Sep 4, 2024, 3:34:43 PM BRT
ALTER TABLE AD_PInstance_Log ADD JsonData CLOB DEFAULT NULL CONSTRAINT AD_PInstance_Log_JsonData_isjson CHECK (JsonData IS JSON)
;
-- Sep 4, 2024, 3:35:54 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan,NumLines) VALUES (208512,'JSON Data','The json field stores json data.',665,216789,'Y',0,100,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-09-04 15:35:54','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-09-04 15:35:54','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','27e958ae-9e31-4e8b-824e-e571df7da15c','Y',100,2,5)
;
-- Sep 4, 2024, 3:36:15 PM BRT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=70, XPosition=1, ColumnSpan=5,Updated=TO_TIMESTAMP('2024-09-04 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208512
;
-- Sep 4, 2024, 3:36:15 PM BRT
UPDATE AD_Field SET SeqNo=80,Updated=TO_TIMESTAMP('2024-09-04 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200309
;
-- Sep 4, 2024, 3:36:15 PM BRT
UPDATE AD_Field SET SeqNo=90,Updated=TO_TIMESTAMP('2024-09-04 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200310
;
-- Sep 4, 2024, 3:36:15 PM BRT
UPDATE AD_Field SET SeqNo=100,Updated=TO_TIMESTAMP('2024-09-04 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207622
;
-- Sep 4, 2024, 3:36:15 PM BRT
UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2024-09-04 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204554
;

View File

@ -0,0 +1,22 @@
-- IDEMPIERE-5567 Permalink for UUID multi-key tables
SELECT register_migration_script('202409141654_IDEMPIERE-5567.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Sep 14, 2024, 4:54:43 PM CEST
INSERT INTO AD_ZoomCondition (AD_Client_ID,AD_Org_ID,AD_Table_ID,AD_Window_ID,AD_ZoomCondition_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,SeqNo,Name,AD_ZoomCondition_UU,ZoomLogic,EntityType) VALUES (0,0,201,111,200009,TO_TIMESTAMP('2024-09-14 16:54:42','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2024-09-14 16:54:42','YYYY-MM-DD HH24:MI:SS'),100,10,'Zoom to role on tenants','f8ddf8c5-4bf6-4343-a2f3-c88c1f007344','@#AD_Client_ID@>0','D')
;
-- Sep 14, 2024, 4:56:45 PM CEST
INSERT INTO AD_ZoomCondition (AD_Client_ID,AD_Org_ID,AD_Table_ID,AD_Window_ID,AD_ZoomCondition_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,SeqNo,Name,AD_ZoomCondition_UU,ZoomLogic,EntityType) VALUES (0,0,378,111,200010,TO_TIMESTAMP('2024-09-14 16:56:45','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2024-09-14 16:56:45','YYYY-MM-DD HH24:MI:SS'),100,10,'Zoom to role on tenants','32bab358-373f-476a-a52c-5c700044478d','@#AD_Client_ID@>0','D')
;
-- Sep 14, 2024, 4:57:50 PM CEST
INSERT INTO AD_ZoomCondition (AD_Client_ID,AD_Org_ID,AD_Table_ID,AD_Window_ID,AD_ZoomCondition_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,SeqNo,Name,AD_ZoomCondition_UU,ZoomLogic,EntityType) VALUES (0,0,197,111,200011,TO_TIMESTAMP('2024-09-14 16:57:50','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2024-09-14 16:57:50','YYYY-MM-DD HH24:MI:SS'),100,10,'Zoom to role on tenants','ebea9694-6348-444e-8b7f-f5f1c75a3c65','@#AD_Client_ID@>0','D')
;
-- Sep 14, 2024, 4:58:46 PM CEST
INSERT INTO AD_ZoomCondition (AD_Client_ID,AD_Org_ID,AD_Table_ID,AD_Window_ID,AD_ZoomCondition_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,SeqNo,Name,AD_ZoomCondition_UU,ZoomLogic,EntityType) VALUES (0,0,199,111,200012,TO_TIMESTAMP('2024-09-14 16:58:46','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2024-09-14 16:58:46','YYYY-MM-DD HH24:MI:SS'),100,10,'Zoom to role on tenants','91ce33c0-fb91-4c9e-894e-8e8f49d7677f','@#AD_Client_ID@>0','D')
;

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-6007
SELECT register_migration_script('202409141807_IDEMPIERE-6007.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Sep 14, 2024, 6:07:20 PM CEST
UPDATE AD_Field SET ReadOnlyLogic='@SQL=SELECT 1 FROM AD_Field WHERE AD_Tab_ID=@AD_Tab_ID:0@',Updated=TO_TIMESTAMP('2024-09-14 18:07:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=131
;

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-6248
SELECT register_migration_script('202409231820_IDEMPIERE-6248.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Sep 23, 2024, 6:20:30 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200250,0,0,TO_TIMESTAMP('2024-09-23 18:20:29','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-23 18:20:29','YYYY-MM-DD HH24:MI:SS'),10,10,'Y','FULL_EXCEPTION_TRACE_IN_LOG','N','If set to Y, the stack trace is not cut in the log (see https://idempiere.atlassian.net/browse/IDEMPIERE-6248)','D','S','8308ac18-d0a6-479f-ab59-7edd0bcb0b54')
;

View File

@ -0,0 +1,8 @@
-- IDEMPIERE-6248
SELECT register_migration_script('202409231821_IDEMPIERE-6248_DelSysConfig.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
DELETE FROM AD_SysConfig WHERE AD_SysConfig_ID = 200250
;

View File

@ -0,0 +1,14 @@
-- IDEMPIERE-5760 Manage mail.smtp.timeout using SysConfig
SELECT register_migration_script('202409241248_IDEMPIERE-5760.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Sep 24, 2024, 12:48:56 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200253,0,0,TO_TIMESTAMP('2024-09-24 12:48:55','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 12:48:55','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','MAIL_SMTP_CONNECTIONTIMEOUT','-1','Timeout in milliseconds to wait for SMTP connection, -1 leaves the java default','D','C','36be68b7-7b4b-4725-9a51-aeb11bb7b699')
;
-- Sep 24, 2024, 12:49:10 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200254,0,0,TO_TIMESTAMP('2024-09-24 12:49:09','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 12:49:09','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','MAIL_SMTP_WRITETIMEOUT','-1','Timeout in milliseconds to wait for writing on SMTP connection, -1 leaves the java default','D','C','e11d83c4-8500-400a-b9d2-358c30c910fb')
;

View File

@ -0,0 +1,18 @@
-- IDEMPIERE-6196_SysConfig
SELECT register_migration_script('202410071412_IDEMPIERE-6196.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Oct 7, 2024, 2:12:19 PM CEST
UPDATE AD_Column SET SeqNoSelection=10,Updated=TO_TIMESTAMP('2024-10-07 14:12:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=50195
;
-- Oct 7, 2024, 2:12:23 PM CEST
UPDATE AD_Column SET SeqNoSelection=20,Updated=TO_TIMESTAMP('2024-10-07 14:12:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=50197
;
-- Oct 7, 2024, 2:12:27 PM CEST
UPDATE AD_Column SET SeqNoSelection=30,Updated=TO_TIMESTAMP('2024-10-07 14:12:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=50196
;

View File

@ -0,0 +1,18 @@
-- IDEMPIERE-6317
SELECT register_migration_script('202411260821_IDEMPIERE-6317.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Nov 26, 2024, 8:34:46 AM BRT
UPDATE AD_Message SET Value='Can''t Save Tenant Level',Updated=TO_TIMESTAMP('2024-11-26 08:34:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=53010
;
-- Nov 26, 2024, 8:36:49 AM BRT
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','This is a system or tenant parameter, you can''t save it as organization parameter',0,0,'Y',TO_TIMESTAMP('2024-11-26 08:36:48','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-11-26 08:36:48','YYYY-MM-DD HH24:MI:SS'),100,200914,'ThisIsSystemOrTenantParameter','D','8980c935-1c23-4d83-8b26-70eb3a749797')
;
-- Nov 26, 2024, 8:38:56 AM BRT
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','This is a system parameter, you can''t save it as tenant parameter',0,0,'Y',TO_TIMESTAMP('2024-11-26 08:38:55','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-11-26 08:38:55','YYYY-MM-DD HH24:MI:SS'),100,200915,'ThisIsSystemParameter','D','6e6b2060-ec2d-4d87-b499-7250e93f7cec')
;

View File

@ -0,0 +1,676 @@
-- IDEMPIERE-6329 Bug in BOM* SQL functions not getting the correct BOM children
SELECT register_migration_script('202411301155_IDEMPIERE-6329.sql') FROM dual;
CREATE OR REPLACE FUNCTION BOMPRICELIMIT
(
Product_ID IN NUMBER,
PriceList_Version_ID IN NUMBER
)
RETURN NUMBER
/*************************************************************************
* The contents of this file are subject to the Compiere License. You may
* obtain a copy of the License at http://www.compiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Compiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: BOM_PriceLimit.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Return Limit Price of Product/BOM
* Description:
* if not found: 0
************************************************************************/
AS
v_Price NUMBER;
v_ProductPrice NUMBER;
-- Get BOM Product info
CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y';
--
BEGIN
-- Try to get price from PriceList directly
SELECT COALESCE (SUM(PriceLimit), 0)
INTO v_Price
FROM M_PRODUCTPRICE
WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- DBMS_OUTPUT.PUT_LINE('Price=' || v_Price);
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN CUR_BOM LOOP
v_ProductPrice := Bompricelimit (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
END LOOP;
END IF;
--
RETURN v_Price;
END Bompricelimit;
/
CREATE OR REPLACE FUNCTION BOMPRICELIST
(
Product_ID IN NUMBER,
PriceList_Version_ID IN NUMBER
)
RETURN NUMBER
/*************************************************************************
* The contents of this file are subject to the Compiere License. You may
* obtain a copy of the License at http://www.compiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Compiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: BOM_PriceList.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Return List Price of Product/BOM
* Description:
* if not found: 0
************************************************************************/
AS
v_Price NUMBER;
v_ProductPrice NUMBER;
-- Get BOM Product info
CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y';
--
BEGIN
-- Try to get price from pricelist directly
SELECT COALESCE (SUM(PriceList), 0)
INTO v_Price
FROM M_PRODUCTPRICE
WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- DBMS_OUTPUT.PUT_LINE('Price=' || Price);
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN CUR_BOM LOOP
v_ProductPrice := Bompricelist (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
-- DBMS_OUTPUT.PUT_LINE('Qry=' || bom.BOMQty || ' @ ' || v_ProductPrice || ', Price=' || v_Price);
END LOOP; -- BOM
END IF;
--
RETURN v_Price;
END Bompricelist;
/
CREATE OR REPLACE FUNCTION BOMPRICESTD
(
Product_ID IN NUMBER,
PriceList_Version_ID IN NUMBER
)
RETURN NUMBER
/*************************************************************************
* The contents of this file are subject to the Compiere License. You may
* obtain a copy of the License at http://www.compiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Compiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: BOM_PriceStd.sql,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Return Standard Price of Product/BOM
* Description:
* if not found: 0
************************************************************************/
AS
v_Price NUMBER;
v_ProductPrice NUMBER;
-- Get BOM Product info
CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y';
--
BEGIN
-- Try to get price from pricelist directly
SELECT COALESCE(SUM(PriceStd), 0)
INTO v_Price
FROM M_PRODUCTPRICE
WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- DBMS_OUTPUT.PUT_LINE('Price=' || v_Price);
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN CUR_BOM LOOP
v_ProductPrice := Bompricestd (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
-- DBMS_OUTPUT.PUT_LINE('Price=' || v_Price);
END LOOP; -- BOM
END IF;
--
RETURN v_Price;
END Bompricestd;
/
CREATE OR REPLACE FUNCTION BOMQTYONHANDFORRESERVATION
(
Product_ID IN NUMBER,
Warehouse_ID IN NUMBER,
Locator_ID IN NUMBER -- Only used, if warehouse is null
)
RETURN NUMBER
/******************************************************************************
* ** Compiere Product ** Copyright (c) 1999-2001 Accorto, Inc. USA
* Open Source Software Provided "AS IS" without warranty or liability
* When you use any parts (changed or unchanged), add "Powered by Compiere" to
* your product name; See license details http://www.compiere.org/license.html
******************************************************************************
* Return quantity on hand for BOM
*/
AS
myWarehouse_ID NUMBER;
Quantity NUMBER := 99999; -- unlimited
IsBOM CHAR(1);
IsStocked CHAR(1);
ProductType CHAR(1);
ProductQty NUMBER;
StdPrecision NUMBER;
-- Get BOM Product info
CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y';
--
BEGIN
-- Check Parameters
myWarehouse_ID := Warehouse_ID;
IF (myWarehouse_ID IS NULL) THEN
IF (Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT SUM(M_Warehouse_ID) INTO myWarehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=Locator_ID;
END IF;
END IF;
IF (myWarehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- DBMS_OUTPUT.PUT_LINE('Warehouse=' || myWarehouse_ID);
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO IsBOM, ProductType, IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- Unlimited capacity if no item
IF (IsBOM='N' AND (ProductType<>'I' OR IsStocked='N')) THEN
RETURN Quantity;
-- Stocked item
ELSIF (IsStocked='Y') THEN
-- Get ProductQty
SELECT NVL(SUM(QtyOnHand), 0)
INTO ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
LEFT JOIN M_LocatorType lt ON (l.M_LocatorType_ID=lt.M_LocatorType_ID)
WHERE s.M_Product_ID=Product_ID AND l.M_Warehouse_ID=myWarehouse_ID
AND COALESCE(lt.IsAvailableForReservation,'Y')='Y';
--
-- DBMS_OUTPUT.PUT_LINE('Qty=' || ProductQty);
RETURN ProductQty;
END IF;
-- Go through BOM
-- DBMS_OUTPUT.PUT_LINE('BOM');
FOR bom IN CUR_BOM LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get ProductQty
SELECT NVL(SUM(QtyOnHand), 0)
INTO ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
LEFT JOIN M_LocatorType lt ON (l.M_LocatorType_ID=lt.M_LocatorType_ID)
WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID
AND COALESCE(lt.IsAvailableForReservation,'Y')='Y';
-- Get Rounding Precision
SELECT NVL(MAX(u.StdPrecision), 0)
INTO StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product
ProductQty := ROUND (ProductQty/bom.BOMQty, StdPrecision);
-- How much can we make overall
IF (ProductQty < Quantity) THEN
Quantity := ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN
ProductQty := BomqtyonhandForReservation (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID);
-- How much can we make overall
IF (ProductQty < Quantity) THEN
Quantity := ProductQty;
END IF;
END IF;
END LOOP; -- BOM
IF (Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT NVL(MAX(u.StdPrecision), 0)
INTO StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID;
--
RETURN ROUND (Quantity, StdPrecision);
END IF;
RETURN 0;
END BOMQTYONHANDFORRESERVATION;
/
CREATE OR REPLACE FUNCTION BOMQTYONHAND
(
Product_ID IN NUMBER,
Warehouse_ID IN NUMBER,
Locator_ID IN NUMBER -- Only used, if warehouse is null
)
RETURN NUMBER
/******************************************************************************
* ** Compiere Product ** Copyright (c) 1999-2001 Accorto, Inc. USA
* Open Source Software Provided "AS IS" without warranty or liability
* When you use any parts (changed or unchanged), add "Powered by Compiere" to
* your product name; See license details http://www.compiere.org/license.html
******************************************************************************
* Return quantity on hand for BOM
*/
AS
myWarehouse_ID NUMBER;
Quantity NUMBER := 99999; -- unlimited
IsBOM CHAR(1);
IsStocked CHAR(1);
ProductType CHAR(1);
ProductQty NUMBER;
StdPrecision NUMBER;
-- Get BOM Product info
CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y';
--
BEGIN
-- Check Parameters
myWarehouse_ID := Warehouse_ID;
IF (myWarehouse_ID IS NULL) THEN
IF (Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT SUM(M_Warehouse_ID) INTO myWarehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=Locator_ID;
END IF;
END IF;
IF (myWarehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- DBMS_OUTPUT.PUT_LINE('Warehouse=' || myWarehouse_ID);
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO IsBOM, ProductType, IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- Unlimited capacity if no item
IF (IsBOM='N' AND (ProductType<>'I' OR IsStocked='N')) THEN
RETURN Quantity;
-- Stocked item
ELSIF (IsStocked='Y') THEN
-- Get ProductQty
SELECT NVL(SUM(QtyOnHand), 0)
INTO ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
WHERE s.M_Product_ID=Product_ID AND l.M_Warehouse_ID=myWarehouse_ID;
--
-- DBMS_OUTPUT.PUT_LINE('Qty=' || ProductQty);
RETURN ProductQty;
END IF;
-- Go through BOM
-- DBMS_OUTPUT.PUT_LINE('BOM');
FOR bom IN CUR_BOM LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get ProductQty
SELECT NVL(SUM(QtyOnHand), 0)
INTO ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID;
-- Get Rounding Precision
SELECT NVL(MAX(u.StdPrecision), 0)
INTO StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product
ProductQty := ROUND (ProductQty/bom.BOMQty, StdPrecision);
-- How much can we make overall
IF (ProductQty < Quantity) THEN
Quantity := ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN
ProductQty := Bomqtyonhand (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID);
-- How much can we make overall
IF (ProductQty < Quantity) THEN
Quantity := ProductQty;
END IF;
END IF;
END LOOP; -- BOM
IF (Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT NVL(MAX(u.StdPrecision), 0)
INTO StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID;
--
RETURN ROUND (Quantity, StdPrecision);
END IF;
RETURN 0;
END Bomqtyonhand;
/
CREATE OR REPLACE FUNCTION BOMQTYORDERED
(
p_Product_ID IN NUMBER,
p_Warehouse_ID IN NUMBER,
p_Locator_ID IN NUMBER -- Only used, if warehouse is null
)
RETURN NUMBER
/******************************************************************************
* ** Compiere Product ** Copyright (c) 1999-2001 Accorto, Inc. USA
* Open Source Software Provided "AS IS" without warranty or liability
* When you use any parts (changed or unchanged), add "Powered by Compiere" to
* your product name; See license details http://www.compiere.org/license.html
******************************************************************************
* Return quantity ordered for BOM
*/
AS
v_Warehouse_ID NUMBER;
v_Quantity NUMBER := 99999; -- unlimited
v_IsBOM CHAR(1);
v_IsStocked CHAR(1);
v_ProductType CHAR(1);
v_ProductQty NUMBER;
v_StdPrecision NUMBER;
-- Get BOM Product info
CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=p_Product_ID
AND b.M_ProductBOM_ID != p_Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y';
--
BEGIN
-- Check Parameters
v_Warehouse_ID := p_Warehouse_ID;
IF (v_Warehouse_ID IS NULL) THEN
IF (p_Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT MAX(M_Warehouse_ID) INTO v_Warehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=p_Locator_ID;
END IF;
END IF;
IF (v_Warehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- DBMS_OUTPUT.PUT_LINE('Warehouse=' || v_Warehouse_ID);
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO v_IsBOM, v_ProductType, v_IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=p_Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- No reservation for non-stocked
IF (v_IsBOM='N' AND (v_ProductType<>'I' OR v_IsStocked='N')) THEN
RETURN 0;
-- Stocked item
ELSIF (v_IsStocked='Y') THEN
-- Get ProductQty
SELECT NVL(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=p_Product_ID
AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='N'
AND IsActive='Y';
--
RETURN v_ProductQty;
END IF;
-- Go though BOM
-- DBMS_OUTPUT.PUT_LINE('BOM');
FOR bom IN CUR_BOM LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get ProductQty
SELECT NVL(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=p_Product_ID
AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='N'
AND IsActive='Y';
-- Get Rounding Precision
SELECT NVL(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN
v_ProductQty := Bomqtyordered (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
END IF;
END LOOP; -- BOM
-- Unlimited (e.g. only services)
IF (v_Quantity = 99999) THEN
RETURN 0;
END IF;
IF (v_Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT NVL(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID;
--
RETURN ROUND (v_Quantity, v_StdPrecision);
END IF;
--
RETURN 0;
END Bomqtyordered;
/
CREATE OR REPLACE FUNCTION BOMQTYRESERVED
(
p_Product_ID IN NUMBER,
p_Warehouse_ID IN NUMBER,
p_Locator_ID IN NUMBER -- Only used, if warehouse is null
)
RETURN NUMBER
/******************************************************************************
* ** Compiere Product ** Copyright (c) 1999-2001 Accorto, Inc. USA
* Open Source Software Provided "AS IS" without warranty or liability
* When you use any parts (changed or unchanged), add "Powered by Compiere" to
* your product name; See license details http://www.compiere.org/license.html
******************************************************************************
* Return quantity reserved for BOM
*/
AS
v_Warehouse_ID NUMBER;
v_Quantity NUMBER := 99999; -- unlimited
v_IsBOM CHAR(1);
v_IsStocked CHAR(1);
v_ProductType CHAR(1);
v_ProductQty NUMBER;
v_StdPrecision NUMBER;
-- Get BOM Product info
CURSOR CUR_BOM IS
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=p_Product_ID
AND b.M_ProductBOM_ID != p_Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y';
--
BEGIN
-- Check Parameters
v_Warehouse_ID := p_Warehouse_ID;
IF (v_Warehouse_ID IS NULL) THEN
IF (p_Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT MAX(M_Warehouse_ID) INTO v_Warehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=p_Locator_ID;
END IF;
END IF;
IF (v_Warehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- DBMS_OUTPUT.PUT_LINE('Warehouse=' || v_Warehouse_ID);
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO v_IsBOM, v_ProductType, v_IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=p_Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- No reservation for non-stocked
IF (v_IsBOM='N' AND (v_ProductType<>'I' OR v_IsStocked='N')) THEN
RETURN 0;
-- Stocked item
ELSIF (v_IsStocked='Y') THEN
-- Get ProductQty
SELECT NVL(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=p_Product_ID
AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='Y'
AND IsActive='Y';
--
RETURN v_ProductQty;
END IF;
-- Go though BOM
-- DBMS_OUTPUT.PUT_LINE('BOM');
FOR bom IN CUR_BOM LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get ProductQty
SELECT NVL(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=bom.M_ProductBOM_ID
AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='Y'
AND IsActive='Y';
-- Get Rounding Precision
SELECT NVL(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN
v_ProductQty := Bomqtyreserved (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
END IF;
END LOOP; -- BOM
-- Unlimited (e.g. only services)
IF (v_Quantity = 99999) THEN
RETURN 0;
END IF;
IF (v_Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT NVL(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID;
--
RETURN ROUND (v_Quantity, v_StdPrecision);
END IF;
RETURN 0;
END Bomqtyreserved;
/

View File

@ -0,0 +1,14 @@
-- IDEMPIERE-6327 Interest Area Window: Subscription tab should not enable "Insert Record"
SELECT register_migration_script('202412021125_IDEMPIERE-6327.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Dec 2, 2024, 11:25:16 AM MYT
UPDATE AD_Tab SET IsInsertRecord='N',Updated=TO_TIMESTAMP('2024-12-02 11:25:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=536
;
-- Dec 2, 2024, 11:25:32 AM MYT
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2024-12-02 11:25:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7625
;

View File

@ -0,0 +1,10 @@
--
SELECT register_migration_script('202412041755_IDEMPIERE-6334.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Dec 4, 2024, 5:55:11 PM CET
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_TIMESTAMP('2024-12-04 17:55:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200329
;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-6335
SELECT register_migration_script('202412101102_IDEMPIERE-6335.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Dec 10, 2024, 11:06:45 AM BRT
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted,IsAutocomplete,DateRangeOption,IsShowNegateButton) VALUES (200484,0,0,'Y',TO_TIMESTAMP('2024-12-10 11:06:44','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-12-10 11:06:44','YYYY-MM-DD HH24:MI:SS'),100,'Document Type','Document type or rules','The Document Type determines document sequence and processing rules',142,20,19,'N',52054,0,'N','C_DocType_ID','Y','D',196,'2b9ac743-0893-474a-aa96-c1eafe8fba86','N','N','D','N')
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-2981 - Implement JSON Field type
SELECT register_migration_script('202402261300_IDEMPIERE-2981.sql') FROM dual;
-- Feb 26, 2024, 1:00:29 PM CET
INSERT INTO AD_Reference (AD_Reference_ID,Name,Description,ValidationType,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,IsOrderByValue,AD_Reference_UU,ShowInactive) VALUES (200267,'JSON','JSON format values','D',0,0,'Y',TO_TIMESTAMP('2024-02-26 13:00:28','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-02-26 13:00:28','YYYY-MM-DD HH24:MI:SS'),100,'D','N','b6fcc751-edd8-4421-acd0-3cde02a9576d','N')
;

View File

@ -0,0 +1,27 @@
-- IDEMPIERE-2981 - Implement JSON Field type
SELECT register_migration_script('202402261354_IDEMPIERE-2981.sql') FROM dual;
-- Feb 26, 2024, 1:54:35 PM CET
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,PrintName,EntityType,AD_Element_UU) VALUES (203924,0,0,'Y',TO_TIMESTAMP('2024-02-26 13:54:35','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-02-26 13:54:35','YYYY-MM-DD HH24:MI:SS'),100,'JsonData','JSON Data','The json field stores json data.','JSON Data','D','c4ea7a81-96a9-4a5d-bb87-e913e1c8ed48')
;
-- Feb 26, 2024, 1:55:37 PM CET
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,IsHtml,IsPartitionKey) VALUES (216570,0,'JSON Data','The json field stores json data.',135,'JsonData',0,'N','N','N','N','N',0,'N',200267,0,0,'Y',TO_TIMESTAMP('2024-02-26 13:55:36','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-02-26 13:55:36','YYYY-MM-DD HH24:MI:SS'),100,203924,'Y','N','D','N','N','N','Y','927b83df-d161-4332-ad44-8ffed99e8cf4','Y',0,'N','N','N','N')
;
-- Feb 26, 2024, 1:55:55 PM CET
ALTER TABLE Test ADD COLUMN JsonData JSON DEFAULT NULL
;
-- Feb 26, 2024, 1:56:08 PM CET
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan) VALUES (208472,'JSON Data','The json field stores json data.',152,216570,'Y',100,310,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-02-26 13:56:08','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-02-26 13:56:08','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','e47ef529-71ba-4f9b-9014-b188e17e8ef4','Y',290,5)
;
-- Feb 29, 2024, 1:52:50 PM CET
UPDATE AD_Field SET NumLines=5,Updated=TO_TIMESTAMP('2024-02-29 13:52:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208472
;
-- Feb 29, 2024, 2:07:30 PM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Invalid JSON',0,0,'Y',TO_TIMESTAMP('2024-02-29 14:07:30','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-02-29 14:07:30','YYYY-MM-DD HH24:MI:SS'),100,200876,'InvalidJSON','D','a263376f-a12e-4943-92f1-7d7ce8a67a2b')
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-6110
SELECT register_migration_script('202404171125_IDEMPIERE-6110.sql') FROM dual;
-- Apr 17, 2024, 11:25:53 AM BRT
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','Products or charges configured as ''Freight Product'' or ''Freight Charge'' cannot be added to this order due to the combination of delivery via rule and freight cost rule',0,0,'Y',TO_TIMESTAMP('2024-04-17 11:25:53','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-04-17 11:25:53','YYYY-MM-DD HH24:MI:SS'),100,200897,'FreightOrderLineNotAllowed','D','204c8bb9-d002-4beb-bbc3-1d1a11d7471d')
;

View File

@ -0,0 +1,4 @@
-- IDEMPIERE-5136
SELECT register_migration_script('202404220830_IDEMPIERE-5136_MissingDropIndex.sql') FROM dual;
-- only for Oracle as there was a missing DROP INDEX instruction

View File

@ -0,0 +1,19 @@
-- IDEMPIERE-6123 Query in search window causing slowness and load spikes in the database (FHCA-5356)
SELECT register_migration_script('202404302320_IDEMPIERE-6123.sql') FROM dual;
-- Apr 30, 2024, 11:20:08 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200244,0,0,TO_TIMESTAMP('2024-04-30 23:20:08','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-04-30 23:20:08','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','GRIDTABLE_INITIAL_COUNT_TIMEOUT_IN_SECONDS','1','Timeout for the initial count on windows','D','C','5fae1af7-74ca-41d8-bbd3-d506c6c23b6a')
;
-- Apr 30, 2024, 11:22:16 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200245,0,0,TO_TIMESTAMP('2024-04-30 23:22:16','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-04-30 23:22:16','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','GLOBAL_MAX_QUERY_RECORDS','100000','Maximum number of records allowed to search in a window, can be overriden per Role or Tab','D','C','840fb67c-4609-41f2-9e20-e0ea9d839065')
;
-- Apr 30, 2024, 11:23:28 PM CEST
UPDATE AD_Message SET MsgText='The query returned more records than allowed, consider adding more filters.',Updated=TO_TIMESTAMP('2024-04-30 23:23:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=852
;
-- Apr 30, 2024, 11:24:06 PM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','The initial count query timed out, loading records ...',0,0,'Y',TO_TIMESTAMP('2024-04-30 23:24:06','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-04-30 23:24:06','YYYY-MM-DD HH24:MI:SS'),100,200887,'CountQueryTimeoutLoadBackground','D','988292d7-175f-41c2-b560-43d62b8326a9')
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-6137 Payment Rule does not appear in reports from Sales Order
SELECT register_migration_script('202405071219_IDEMPIERE-6137.sql') FROM dual;
-- May 7, 2024, 12:19:00 PM CEST
UPDATE AD_Column SET AD_Reference_Value_ID=195,Updated=TO_TIMESTAMP('2024-05-07 12:19:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=200012 AND COALESCE(AD_Reference_Value_ID,0)!=195
;

View File

@ -0,0 +1,19 @@
-- IDEMPIERE-6123 Query in search window causing slowness and load spikes in the database (FHCA-5356)
SELECT register_migration_script('202405080101_IDEMPIERE-6123.sql') FROM dual;
-- May 8, 2024, 1:01:16 AM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200247,0,0,TO_TIMESTAMP('2024-05-08 01:01:16','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-05-08 01:01:16','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','REPORT_LOAD_TIMEOUT_IN_SECONDS','120','Timeout in seconds when loading a report','D','C','14e838b1-c25c-400e-b39c-61da9bf92099')
;
-- May 8, 2024, 1:01:42 AM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200248,0,0,TO_TIMESTAMP('2024-05-08 01:01:41','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-05-08 01:01:41','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','GLOBAL_MAX_REPORT_RECORDS','100000','Max number of records allowed in a report','D','C','7030640a-1aa7-4ac7-a894-b4fe0dfde530')
;
-- May 8, 2024, 1:06:19 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','The data query for the report took too much time to execute (over {0} seconds) exceeding the allowed limit',0,0,'Y',TO_TIMESTAMP('2024-05-08 01:06:18','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-05-08 01:06:18','YYYY-MM-DD HH24:MI:SS'),100,200893,'ReportQueryTimeout','D','5f17f55f-adbe-4d97-bf83-9447983b4946')
;
-- May 8, 2024, 1:07:10 AM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','The report data exceeds the maximum limit of {0} rows',0,0,'Y',TO_TIMESTAMP('2024-05-08 01:07:09','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-05-08 01:07:09','YYYY-MM-DD HH24:MI:SS'),100,200894,'ReportMaxRowsReached','D','a4b55c31-0df0-4302-a62a-91cb7e79be0d')
;

View File

@ -0,0 +1,22 @@
-- IDEMPIERE-6040 Improvements for CSV import template
SELECT register_migration_script('202405131534_IDEMPIERE-6040.sql') FROM dual;
-- May 13, 2024, 3:34:49 PM CEST
UPDATE AD_Ref_List SET Name='Comma-separated values (CSV)',Updated=TO_TIMESTAMP('2024-05-13 15:34:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=200704
;
-- May 13, 2024, 3:35:58 PM CEST
UPDATE AD_Ref_List SET Name='Excel (XLS/XLSX)',Updated=TO_TIMESTAMP('2024-05-13 15:35:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=200706
;
-- May 13, 2024, 3:36:02 PM CEST
UPDATE AD_Ref_List SET IsActive='N',Updated=TO_TIMESTAMP('2024-05-13 15:36:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=200705
;
UPDATE AD_ImportTemplate SET ImportTemplateType='XLSX' WHERE ImportTemplateType='XLS'
;
-- May 13, 2024, 3:59:49 PM CEST
UPDATE AD_Field SET SeqNo=120, ColumnSpan=2,Updated=TO_TIMESTAMP('2024-05-13 15:59:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208476
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-5728
SELECT register_migration_script('202405151228_IDEMPIERE-5728.sql') FROM dual;
-- May 15, 2024, 12:28:30 PM CEST
UPDATE AD_ViewColumn SET ColumnName='RV_UnPosted_UU',Updated=TO_TIMESTAMP('2024-05-15 12:28:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_ViewColumn_ID=217690
;

View File

@ -0,0 +1,30 @@
-- IDEMPIERE-6166 PostgreSQL DUAL table with more than one record
SELECT register_migration_script('202406072107_IDEMPIERE-6166.sql') FROM dual;
DROP TABLE IF EXISTS dual
;
CREATE VIEW dual AS SELECT 'X'::varchar AS dummy
;
DROP RULE insert_dbreplicasyncverifier ON dbreplicasyncverifier
;
CREATE OR REPLACE FUNCTION forbid_multiple_rows_in_dbreplicasyncverifier()
RETURNS TRIGGER AS $$
BEGIN
-- Check if the table already contains a row
IF (SELECT COUNT(*) FROM dbreplicasyncverifier) > 0 THEN
RAISE EXCEPTION 'Table dbreplicasyncverifier can only contain one row.';
END IF;
RETURN NEW;
END;
$$ LANGUAGE plpgsql
;
CREATE TRIGGER single_row_only_trigger_dbreplicasyncverifier
BEFORE INSERT ON dbreplicasyncverifier
FOR EACH ROW
EXECUTE FUNCTION forbid_multiple_rows_in_dbreplicasyncverifier()
;

View File

@ -0,0 +1,117 @@
-- IDEMPIERE-6167 BOM Price List must search just for Verified BOMs
SELECT register_migration_script('202406072206_IDEMPIERE-6167.sql') FROM dual;
CREATE OR REPLACE FUNCTION bompricelimit (in product_id numeric, in pricelist_version_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Price NUMERIC;
v_ProductPrice NUMERIC;
bom RECORD;
BEGIN
-- Try to get price from PriceList directly
SELECT COALESCE (SUM(PriceLimit), 0)
INTO v_Price
FROM M_ProductPrice
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_Product_BOM b, M_Product p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y'
LOOP
v_ProductPrice := bomPriceLimit (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
END LOOP;
END IF;
--
RETURN v_Price;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION bompricelist (in product_id numeric, in pricelist_version_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Price NUMERIC;
v_ProductPrice NUMERIC;
bom RECORD;
BEGIN
-- Try to get price from pricelist directly
SELECT COALESCE (SUM(PriceList), 0)
INTO v_Price
FROM M_ProductPrice
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_Product_BOM b, M_Product p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y'
LOOP
v_ProductPrice := bomPriceList (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
END LOOP;
END IF;
--
RETURN v_Price;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION bompricestd (in product_id numeric, in pricelist_version_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Price NUMERIC;
v_ProductPrice NUMERIC;
bom RECORD;
BEGIN
-- Try to get price from PriceList directly
SELECT COALESCE(SUM(PriceStd), 0)
INTO v_Price
FROM M_ProductPrice
WHERE M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_Product_BOM b, M_Product p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y'
LOOP
v_ProductPrice := bomPriceStd (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
END LOOP;
END IF;
--
RETURN v_Price;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;

View File

@ -0,0 +1,9 @@
-- IDEMPIERE-6169 Performance on AD_ChangeLog with Record_UU
SELECT register_migration_script('202406131736_IDEMPIERE-6169.sql') FROM dual;
ALTER TABLE ad_changelog DROP CONSTRAINT ad_changelog_pkey
;
ALTER TABLE ad_changelog ADD CONSTRAINT ad_changelog_pkey PRIMARY KEY (ad_session_id, ad_column_id, ad_changelog_id)
;

View File

@ -0,0 +1,19 @@
-- IDEMPIERE-6176 UUID indexes without constraint
SELECT register_migration_script('202406180027_IDEMPIERE-6176.sql') FROM dual;
-- Jun 18, 2024, 12:29:20 AM CEST
UPDATE AD_IndexColumn SET IsActive='N',Updated=TO_TIMESTAMP('2024-06-18 00:29:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_IndexColumn_ID=200980
;
-- Jun 18, 2024, 12:29:27 AM CEST
UPDATE AD_TableIndex SET IsActive='N', IsCreateConstraint='Y',Updated=TO_TIMESTAMP('2024-06-18 00:29:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_TableIndex_ID=200806
;
-- Jun 18, 2024, 12:30:44 AM CEST
UPDATE AD_TableIndex SET IsCreateConstraint='Y',Updated=TO_TIMESTAMP('2024-06-18 00:30:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_TableIndex_ID=201272
;
-- Jun 18, 2024, 12:31:49 AM CEST
UPDATE AD_TableIndex SET IsCreateConstraint='Y',Updated=TO_TIMESTAMP('2024-06-18 00:31:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_TableIndex_ID=201275
;

View File

@ -0,0 +1,47 @@
-- IDEMPIERE-6188 Read-Only Session
SELECT register_migration_script('202407061229_IDEMPIERE-6188.sql') FROM dual;
-- Jul 6, 2024, 12:29:56 PM CEST
INSERT INTO AD_Element (AD_Element_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,ColumnName,Name,Description,Help,PrintName,EntityType,AD_Element_UU) VALUES (203938,0,0,'Y',TO_TIMESTAMP('2024-07-06 12:29:42','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-07-06 12:29:42','YYYY-MM-DD HH24:MI:SS'),100,'IsReadOnlySession','Read Only Session',NULL,NULL,'Read Only Session','D','6ee179e4-9573-4a3d-8815-23723ef241d7')
;
-- Jul 6, 2024, 12:30:19 PM CEST
INSERT INTO AD_Column (AD_Column_ID,Version,Name,AD_Table_ID,ColumnName,DefaultValue,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,IsHtml,IsPartitionKey) VALUES (216614,0,'Read Only Session',200174,'IsReadOnlySession','N',1,'N','N','Y','N','N',0,'N',20,0,0,'Y',TO_TIMESTAMP('2024-07-06 12:30:18','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-07-06 12:30:18','YYYY-MM-DD HH24:MI:SS'),100,203938,'Y','N','D','N','N','N','Y','8c255baa-fbec-4a90-a43d-5461060368e9','Y',0,'N','N','N','N')
;
-- Jul 6, 2024, 12:30:29 PM CEST
ALTER TABLE AD_UserPreference ADD COLUMN IsReadOnlySession CHAR(1) DEFAULT 'N' CHECK (IsReadOnlySession IN ('Y','N')) NOT NULL
;
-- Jul 6, 2024, 12:30:45 PM CEST
INSERT INTO AD_Field (AD_Field_ID,Name,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,XPosition,ColumnSpan) VALUES (208494,'Read Only Session',200189,216614,'Y',1,170,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-07-06 12:30:45','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-07-06 12:30:45','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','f69131e7-4fca-4011-89d5-650ca506c920','Y',170,2,2)
;
-- Jul 6, 2024, 12:31:06 PM CEST
UPDATE AD_Field SET SeqNo=110,Updated=TO_TIMESTAMP('2024-07-06 12:31:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206133
;
-- Jul 6, 2024, 12:31:06 PM CEST
UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2024-07-06 12:31:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206134
;
-- Jul 6, 2024, 12:31:06 PM CEST
UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2024-07-06 12:31:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=206407
;
-- Jul 6, 2024, 12:31:06 PM CEST
UPDATE AD_Field SET SeqNo=140,Updated=TO_TIMESTAMP('2024-07-06 12:31:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208189
;
-- Jul 6, 2024, 12:31:06 PM CEST
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=150, XPosition=5,Updated=TO_TIMESTAMP('2024-07-06 12:31:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208494
;
-- Jul 6, 2024, 12:31:25 PM CEST
UPDATE AD_Field SET IsQuickEntry='Y',Updated=TO_TIMESTAMP('2024-07-06 12:31:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208494
;
-- Jul 9, 2024, 7:48:40 PM CEST
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','Read-only session',0,0,'Y',TO_TIMESTAMP('2024-07-09 19:48:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-07-09 19:48:39','YYYY-MM-DD HH24:MI:SS'),100,200900,'ReadOnlySession','D','dc819f55-662d-4d30-b68d-0a93b46a8458')
;

View File

@ -0,0 +1,15 @@
-- IDEMPIERE-6196
SELECT register_migration_script('202407231647_IDEMPIERE-6196.sql') FROM dual;
-- Jul 23, 2024, 4:47:40 PM CEST
UPDATE AD_Column SET SeqNoSelection=30,Updated=TO_TIMESTAMP('2024-07-23 16:47:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=103
;
-- Jul 23, 2024, 4:47:43 PM CEST
UPDATE AD_Column SET SeqNoSelection=20,Updated=TO_TIMESTAMP('2024-07-23 16:47:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=102
;
-- Jul 23, 2024, 4:47:52 PM CEST
UPDATE AD_Column SET SeqNoSelection=10,Updated=TO_TIMESTAMP('2024-07-23 16:47:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=107
;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-6216
SELECT register_migration_script('202408201236_IDEMPIERE-6216.sql') FROM dual;
-- Aug 20, 2024, 12:36:08 PM CEST
UPDATE AD_Process_Para SET MandatoryLogic='@UseDefaultCoA@=N',Updated=TO_TIMESTAMP('2024-08-20 12:36:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53296
;

View File

@ -0,0 +1,91 @@
-- Adding new fields to AD_PInstance and AD_PInstance_Log
SELECT register_migration_script('202409041533_IDEMPIERE-6223.sql') FROM dual;
-- Sep 4, 2024, 3:33:12 PM BRT
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml,IsPartitionKey) VALUES (216788,0,'JSON Data','The json field stores json data.',282,'JsonData',0,'N','N','N','N','N',0,'N',200267,0,0,'Y',TO_TIMESTAMP('2024-09-04 15:33:12','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-09-04 15:33:12','YYYY-MM-DD HH24:MI:SS'),100,203924,'Y','N','D','N','N','N','Y','6ec3e423-205d-482f-b7e2-3dea6b66d5d0','Y',0,'N','N','N','N','N')
;
-- Sep 4, 2024, 3:33:16 PM BRT
ALTER TABLE AD_PInstance ADD COLUMN JsonData JSON DEFAULT NULL
;
-- Sep 4, 2024, 3:33:39 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan,NumLines) VALUES (208511,'JSON Data','The json field stores json data.',663,216788,'Y',0,210,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-09-04 15:33:39','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-09-04 15:33:39','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','2455e488-36a8-48d2-8410-2ff0808915e4','Y',200,2,5)
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=110, XPosition=1, ColumnSpan=5,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208511
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=120,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10501
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=130,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207416
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=140,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10495
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=150,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202845
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=160,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202847
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=170,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207405
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=180,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207407
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=190,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207406
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=200,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207408
;
-- Sep 4, 2024, 3:34:12 PM BRT
UPDATE AD_Field SET SeqNo=210,Updated=TO_TIMESTAMP('2024-09-04 15:34:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207720
;
-- Sep 4, 2024, 3:34:40 PM BRT
INSERT INTO AD_Column (AD_Column_ID,Version,Name,Description,AD_Table_ID,ColumnName,FieldLength,IsKey,IsParent,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsEncrypted,AD_Reference_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Element_ID,IsUpdateable,IsSelectionColumn,EntityType,IsSyncDatabase,IsAlwaysUpdateable,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsAllowCopy,SeqNoSelection,IsToolbarButton,IsSecure,FKConstraintType,IsHtml,IsPartitionKey) VALUES (216789,0,'JSON Data','The json field stores json data.',578,'JsonData',0,'N','N','N','N','N',0,'N',200267,0,0,'Y',TO_TIMESTAMP('2024-09-04 15:34:40','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-09-04 15:34:40','YYYY-MM-DD HH24:MI:SS'),100,203924,'Y','N','D','N','N','N','Y','7539f67f-922d-4e27-881f-c04f0dc8c160','Y',0,'N','N','N','N','N')
;
-- Sep 4, 2024, 3:34:43 PM BRT
ALTER TABLE AD_PInstance_Log ADD COLUMN JsonData JSON DEFAULT NULL
;
-- Sep 4, 2024, 3:35:54 PM BRT
INSERT INTO AD_Field (AD_Field_ID,Name,Description,AD_Tab_ID,AD_Column_ID,IsDisplayed,DisplayLength,SeqNo,IsSameLine,IsHeading,IsFieldOnly,IsEncrypted,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadOnly,IsCentrallyMaintained,EntityType,AD_Field_UU,IsDisplayedGrid,SeqNoGrid,ColumnSpan,NumLines) VALUES (208512,'JSON Data','The json field stores json data.',665,216789,'Y',0,100,'N','N','N','N',0,0,'Y',TO_TIMESTAMP('2024-09-04 15:35:54','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-09-04 15:35:54','YYYY-MM-DD HH24:MI:SS'),100,'N','Y','D','27e958ae-9e31-4e8b-824e-e571df7da15c','Y',100,2,5)
;
-- Sep 4, 2024, 3:36:15 PM BRT
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=70, XPosition=1, ColumnSpan=5,Updated=TO_TIMESTAMP('2024-09-04 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=208512
;
-- Sep 4, 2024, 3:36:15 PM BRT
UPDATE AD_Field SET SeqNo=80,Updated=TO_TIMESTAMP('2024-09-04 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200309
;
-- Sep 4, 2024, 3:36:15 PM BRT
UPDATE AD_Field SET SeqNo=90,Updated=TO_TIMESTAMP('2024-09-04 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200310
;
-- Sep 4, 2024, 3:36:15 PM BRT
UPDATE AD_Field SET SeqNo=100,Updated=TO_TIMESTAMP('2024-09-04 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=207622
;
-- Sep 4, 2024, 3:36:15 PM BRT
UPDATE AD_Field SET SeqNo=0,Updated=TO_TIMESTAMP('2024-09-04 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=204554
;

View File

@ -0,0 +1,19 @@
-- IDEMPIERE-5567 Permalink for UUID multi-key tables
SELECT register_migration_script('202409141654_IDEMPIERE-5567.sql') FROM dual;
-- Sep 14, 2024, 4:54:43 PM CEST
INSERT INTO AD_ZoomCondition (AD_Client_ID,AD_Org_ID,AD_Table_ID,AD_Window_ID,AD_ZoomCondition_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,SeqNo,Name,AD_ZoomCondition_UU,ZoomLogic,EntityType) VALUES (0,0,201,111,200009,TO_TIMESTAMP('2024-09-14 16:54:42','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2024-09-14 16:54:42','YYYY-MM-DD HH24:MI:SS'),100,10,'Zoom to role on tenants','f8ddf8c5-4bf6-4343-a2f3-c88c1f007344','@#AD_Client_ID@>0','D')
;
-- Sep 14, 2024, 4:56:45 PM CEST
INSERT INTO AD_ZoomCondition (AD_Client_ID,AD_Org_ID,AD_Table_ID,AD_Window_ID,AD_ZoomCondition_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,SeqNo,Name,AD_ZoomCondition_UU,ZoomLogic,EntityType) VALUES (0,0,378,111,200010,TO_TIMESTAMP('2024-09-14 16:56:45','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2024-09-14 16:56:45','YYYY-MM-DD HH24:MI:SS'),100,10,'Zoom to role on tenants','32bab358-373f-476a-a52c-5c700044478d','@#AD_Client_ID@>0','D')
;
-- Sep 14, 2024, 4:57:50 PM CEST
INSERT INTO AD_ZoomCondition (AD_Client_ID,AD_Org_ID,AD_Table_ID,AD_Window_ID,AD_ZoomCondition_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,SeqNo,Name,AD_ZoomCondition_UU,ZoomLogic,EntityType) VALUES (0,0,197,111,200011,TO_TIMESTAMP('2024-09-14 16:57:50','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2024-09-14 16:57:50','YYYY-MM-DD HH24:MI:SS'),100,10,'Zoom to role on tenants','ebea9694-6348-444e-8b7f-f5f1c75a3c65','@#AD_Client_ID@>0','D')
;
-- Sep 14, 2024, 4:58:46 PM CEST
INSERT INTO AD_ZoomCondition (AD_Client_ID,AD_Org_ID,AD_Table_ID,AD_Window_ID,AD_ZoomCondition_ID,Created,CreatedBy,IsActive,Updated,UpdatedBy,SeqNo,Name,AD_ZoomCondition_UU,ZoomLogic,EntityType) VALUES (0,0,199,111,200012,TO_TIMESTAMP('2024-09-14 16:58:46','YYYY-MM-DD HH24:MI:SS'),100,'Y',TO_TIMESTAMP('2024-09-14 16:58:46','YYYY-MM-DD HH24:MI:SS'),100,10,'Zoom to role on tenants','91ce33c0-fb91-4c9e-894e-8e8f49d7677f','@#AD_Client_ID@>0','D')
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-6007
SELECT register_migration_script('202409141807_IDEMPIERE-6007.sql') FROM dual;
-- Sep 14, 2024, 6:07:20 PM CEST
UPDATE AD_Field SET ReadOnlyLogic='@SQL=SELECT 1 FROM AD_Field WHERE AD_Tab_ID=@AD_Tab_ID:0@',Updated=TO_TIMESTAMP('2024-09-14 18:07:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=131
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-6248
SELECT register_migration_script('202409231820_IDEMPIERE-6248.sql') FROM dual;
-- Sep 23, 2024, 6:20:30 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200250,0,0,TO_TIMESTAMP('2024-09-23 18:20:29','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-23 18:20:29','YYYY-MM-DD HH24:MI:SS'),10,10,'Y','FULL_EXCEPTION_TRACE_IN_LOG','N','If set to Y, the stack trace is not cut in the log (see https://idempiere.atlassian.net/browse/IDEMPIERE-6248)','D','S','8308ac18-d0a6-479f-ab59-7edd0bcb0b54')
;

View File

@ -0,0 +1,5 @@
-- IDEMPIERE-6248
SELECT register_migration_script('202409231821_IDEMPIERE-6248_DelSysConfig.sql') FROM dual;
DELETE FROM AD_SysConfig WHERE AD_SysConfig_ID = 200250
;

View File

@ -0,0 +1,11 @@
-- IDEMPIERE-5760 Manage mail.smtp.timeout using SysConfig
SELECT register_migration_script('202409241248_IDEMPIERE-5760.sql') FROM dual;
-- Sep 24, 2024, 12:48:56 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200253,0,0,TO_TIMESTAMP('2024-09-24 12:48:55','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 12:48:55','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','MAIL_SMTP_CONNECTIONTIMEOUT','-1','Timeout in milliseconds to wait for SMTP connection, -1 leaves the java default','D','C','36be68b7-7b4b-4725-9a51-aeb11bb7b699')
;
-- Sep 24, 2024, 12:49:10 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200254,0,0,TO_TIMESTAMP('2024-09-24 12:49:09','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 12:49:09','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','MAIL_SMTP_WRITETIMEOUT','-1','Timeout in milliseconds to wait for writing on SMTP connection, -1 leaves the java default','D','C','e11d83c4-8500-400a-b9d2-358c30c910fb')
;

View File

@ -0,0 +1,15 @@
-- IDEMPIERE-6196_SysConfig
SELECT register_migration_script('202410071412_IDEMPIERE-6196.sql') FROM dual;
-- Oct 7, 2024, 2:12:19 PM CEST
UPDATE AD_Column SET SeqNoSelection=10,Updated=TO_TIMESTAMP('2024-10-07 14:12:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=50195
;
-- Oct 7, 2024, 2:12:23 PM CEST
UPDATE AD_Column SET SeqNoSelection=20,Updated=TO_TIMESTAMP('2024-10-07 14:12:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=50197
;
-- Oct 7, 2024, 2:12:27 PM CEST
UPDATE AD_Column SET SeqNoSelection=30,Updated=TO_TIMESTAMP('2024-10-07 14:12:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=10 WHERE AD_Column_ID=50196
;

View File

@ -0,0 +1,15 @@
-- IDEMPIERE-6317
SELECT register_migration_script('202411260821_IDEMPIERE-6317.sql') FROM dual;
-- Nov 26, 2024, 8:34:46 AM BRT
UPDATE AD_Message SET Value='Can''t Save Tenant Level',Updated=TO_TIMESTAMP('2024-11-26 08:34:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Message_ID=53010
;
-- Nov 26, 2024, 8:36:49 AM BRT
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','This is a system or tenant parameter, you can''t save it as organization parameter',0,0,'Y',TO_TIMESTAMP('2024-11-26 08:36:48','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-11-26 08:36:48','YYYY-MM-DD HH24:MI:SS'),100,200914,'ThisIsSystemOrTenantParameter','D','8980c935-1c23-4d83-8b26-70eb3a749797')
;
-- Nov 26, 2024, 8:38:56 AM BRT
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('E','This is a system parameter, you can''t save it as tenant parameter',0,0,'Y',TO_TIMESTAMP('2024-11-26 08:38:55','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-11-26 08:38:55','YYYY-MM-DD HH24:MI:SS'),100,200915,'ThisIsSystemParameter','D','6e6b2060-ec2d-4d87-b499-7250e93f7cec')
;

View File

@ -0,0 +1,576 @@
-- IDEMPIERE-6329 Bug in BOM* SQL functions not getting the correct BOM children
SELECT register_migration_script('202411301155_IDEMPIERE-6329.sql') FROM dual;
CREATE OR REPLACE FUNCTION bompricelimit (in product_id numeric, in pricelist_version_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Price NUMERIC;
v_ProductPrice NUMERIC;
bom RECORD;
BEGIN
-- Try to get price from PriceList directly
SELECT COALESCE (SUM(PriceLimit), 0)
INTO v_Price
FROM M_ProductPrice
WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_Product_BOM b, M_Product p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y'
LOOP
v_ProductPrice := bomPriceLimit (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
END LOOP;
END IF;
--
RETURN v_Price;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION bompricelist (in product_id numeric, in pricelist_version_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Price NUMERIC;
v_ProductPrice NUMERIC;
bom RECORD;
BEGIN
-- Try to get price from pricelist directly
SELECT COALESCE (SUM(PriceList), 0)
INTO v_Price
FROM M_ProductPrice
WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_Product_BOM b, M_Product p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y'
LOOP
v_ProductPrice := bomPriceList (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
END LOOP;
END IF;
--
RETURN v_Price;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION bompricestd (in product_id numeric, in pricelist_version_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Price NUMERIC;
v_ProductPrice NUMERIC;
bom RECORD;
BEGIN
-- Try to get price from PriceList directly
SELECT COALESCE(SUM(PriceStd), 0)
INTO v_Price
FROM M_ProductPrice
WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_Product_BOM b, M_Product p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsVerified='Y'
AND b.IsActive='Y'
LOOP
v_ProductPrice := bomPriceStd (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
END LOOP;
END IF;
--
RETURN v_Price;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION BOMQtyOnHandForReservation (in product_id numeric, in warehouse_id numeric, in locator_id numeric) RETURNS numeric AS
$BODY$
DECLARE
myWarehouse_ID numeric;
v_Quantity numeric := 99999; -- unlimited
v_IsBOM CHAR(1);
v_IsStocked CHAR(1);
v_ProductType CHAR(1);
v_ProductQty numeric;
v_StdPrecision int;
bom record;
BEGIN
-- Check Parameters
myWarehouse_ID := Warehouse_ID;
IF (myWarehouse_ID IS NULL) THEN
IF (Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT SUM(M_Warehouse_ID) INTO myWarehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=Locator_ID;
END IF;
END IF;
IF (myWarehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO v_IsBOM, v_ProductType, v_IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- Unlimited capacity if no item
IF (v_IsBOM='N' AND (v_ProductType<>'I' OR v_IsStocked='N')) THEN
RETURN v_Quantity;
-- Stocked item
ELSIF (v_IsStocked='Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(QtyOnHand), 0)
INTO v_ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
LEFT JOIN M_LocatorType lt ON (l.M_LocatorType_ID=lt.M_LocatorType_ID)
WHERE s.M_Product_ID=Product_ID AND l.M_Warehouse_ID=myWarehouse_ID
AND COALESCE(lt.IsAvailableForReservation,'Y')='Y';
--
RETURN v_ProductQty;
END IF;
-- Go through BOM
FOR bom IN -- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y'
LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get v_ProductQty
SELECT COALESCE(SUM(QtyOnHand), 0)
INTO v_ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
LEFT JOIN M_LocatorType lt ON (l.M_LocatorType_ID=lt.M_LocatorType_ID)
WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID
AND COALESCE(lt.IsAvailableForReservation,'Y')='Y';
-- Get Rounding Precision
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN
v_ProductQty := BOMQtyOnHandForReservation (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
END IF;
END LOOP; -- BOM
IF (v_Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID;
--
RETURN ROUND (v_Quantity, v_StdPrecision);
END IF;
RETURN 0;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION BOMQtyOnHand (in product_id numeric, in warehouse_id numeric, in locator_id numeric) RETURNS numeric AS
$BODY$
DECLARE
myWarehouse_ID numeric;
v_Quantity numeric := 99999; -- unlimited
v_IsBOM CHAR(1);
v_IsStocked CHAR(1);
v_ProductType CHAR(1);
v_ProductQty numeric;
v_StdPrecision int;
bom record;
BEGIN
-- Check Parameters
myWarehouse_ID := Warehouse_ID;
IF (myWarehouse_ID IS NULL) THEN
IF (Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT SUM(M_Warehouse_ID) INTO myWarehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=Locator_ID;
END IF;
END IF;
IF (myWarehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO v_IsBOM, v_ProductType, v_IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- Unlimited capacity if no item
IF (v_IsBOM='N' AND (v_ProductType<>'I' OR v_IsStocked='N')) THEN
RETURN v_Quantity;
-- Stocked item
ELSIF (v_IsStocked='Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(QtyOnHand), 0)
INTO v_ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
WHERE s.M_Product_ID=Product_ID AND l.M_Warehouse_ID=myWarehouse_ID;
--
RETURN v_ProductQty;
END IF;
-- Go through BOM
FOR bom IN -- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=product_ID
AND b.M_ProductBOM_ID != Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y'
LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get v_ProductQty
SELECT COALESCE(SUM(QtyOnHand), 0)
INTO v_ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID;
-- Get Rounding Precision
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN
v_ProductQty := Bomqtyonhand (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
END IF;
END LOOP; -- BOM
IF (v_Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID;
--
RETURN ROUND (v_Quantity, v_StdPrecision);
END IF;
RETURN 0;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION bomqtyordered (in p_product_id numeric, in p_warehouse_id numeric, in p_locator_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Warehouse_ID numeric;
v_Quantity numeric := 99999; -- unlimited
v_IsBOM CHAR(1);
v_IsStocked CHAR(1);
v_ProductType CHAR(1);
v_ProductQty numeric;
v_StdPrecision int;
bom record;
BEGIN
-- Check Parameters
v_Warehouse_ID := p_Warehouse_ID;
IF (v_Warehouse_ID IS NULL) THEN
IF (p_Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT MAX(M_Warehouse_ID) INTO v_Warehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=p_Locator_ID;
END IF;
END IF;
IF (v_Warehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO v_IsBOM, v_ProductType, v_IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=p_Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- No reservation for non-stocked
IF (v_IsBOM='N' AND (v_ProductType<>'I' OR v_IsStocked='N')) THEN
RETURN 0;
-- Stocked item
ELSIF (v_IsStocked='Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=p_Product_ID
AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='N'
AND IsActive='Y';
--
RETURN v_ProductQty;
END IF;
-- Go though BOM
FOR bom IN
-- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=p_Product_ID
AND b.M_ProductBOM_ID != p_Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y'
LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=p_Product_ID
AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='N'
AND IsActive='Y';
-- Get Rounding Precision
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision );
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN
v_ProductQty := Bomqtyordered (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
END IF;
END LOOP; -- BOM
-- Unlimited (e.g. only services)
IF (v_Quantity = 99999) THEN
RETURN 0;
END IF;
IF (v_Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID;
--
RETURN ROUND (v_Quantity, v_StdPrecision );
END IF;
--
RETURN 0;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION bomqtyreserved (in p_product_id numeric, in p_warehouse_id numeric, in p_locator_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Warehouse_ID numeric;
v_Quantity numeric := 99999; -- unlimited
v_IsBOM CHAR(1);
v_IsStocked CHAR(1);
v_ProductType CHAR(1);
v_ProductQty numeric;
v_StdPrecision int;
bom record;
BEGIN
-- Check Parameters
v_Warehouse_ID := p_Warehouse_ID;
IF (v_Warehouse_ID IS NULL) THEN
IF (p_Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT MAX(M_Warehouse_ID) INTO v_Warehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=p_Locator_ID;
END IF;
END IF;
IF (v_Warehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO v_IsBOM, v_ProductType, v_IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=p_Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- No reservation for non-stocked
IF (v_IsBOM='N' AND (v_ProductType<>'I' OR v_IsStocked='N')) THEN
RETURN 0;
-- Stocked item
ELSIF (v_IsStocked='Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=p_Product_ID
AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='Y'
AND IsActive='Y';
--
RETURN v_ProductQty;
END IF;
-- Go though BOM
FOR bom IN
-- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_Product_ID=p.M_Product_ID
AND b.M_Product_ID=p_Product_ID
AND b.M_ProductBOM_ID != p_Product_ID
AND p.IsBOM='Y'
AND p.IsVerified='Y'
AND b.IsActive='Y'
LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=bom.M_ProductBOM_ID
AND M_Warehouse_ID =v_Warehouse_ID
AND IsSOTrx='Y'
AND IsActive='Y';
-- Get Rounding Precision
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=bom.M_ProductBOM_ID;
-- How much can we make with this product
v_ProductQty := ROUND (v_ProductQty/bom.BOMQty, v_StdPrecision);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y') THEN
v_ProductQty := Bomqtyreserved (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
END IF;
END LOOP; -- BOM
-- Unlimited (e.g. only services)
IF (v_Quantity = 99999) THEN
RETURN 0;
END IF;
IF (v_Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID;
--
RETURN ROUND (v_Quantity, v_StdPrecision);
END IF;
RETURN 0;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;

View File

@ -0,0 +1,11 @@
-- IDEMPIERE-6327 Interest Area Window: Subscription tab should not enable "Insert Record"
SELECT register_migration_script('202412021125_IDEMPIERE-6327.sql') FROM dual;
-- Dec 2, 2024, 11:25:16 AM MYT
UPDATE AD_Tab SET IsInsertRecord='N',Updated=TO_TIMESTAMP('2024-12-02 11:25:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=536
;
-- Dec 2, 2024, 11:25:32 AM MYT
UPDATE AD_Field SET IsReadOnly='Y',Updated=TO_TIMESTAMP('2024-12-02 11:25:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=7625
;

View File

@ -0,0 +1,7 @@
--
SELECT register_migration_script('202412041755_IDEMPIERE-6334.sql') FROM dual;
-- Dec 4, 2024, 5:55:11 PM CET
UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_TIMESTAMP('2024-12-04 17:55:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200329
;

View File

@ -0,0 +1,548 @@
-- IDEMPIERE-6329 Bug in BOM* SQL functions not getting the correct BOM children
SELECT register_migration_script('202412091327_IDEMPIERE-6329.sql') FROM dual;
CREATE OR REPLACE FUNCTION bompricelimit (in product_id numeric, in pricelist_version_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Price NUMERIC;
v_ProductPrice NUMERIC;
bom RECORD;
BEGIN
-- Try to get price from PriceList directly
SELECT COALESCE (SUM(PriceLimit), 0)
INTO v_Price
FROM M_ProductPrice
WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_Product_BOM b, M_Product p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND (p.IsBOM='N' OR p.IsVerified='Y')
AND b.IsActive='Y'
LOOP
v_ProductPrice := bomPriceLimit (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
END LOOP;
END IF;
--
RETURN v_Price;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION bompricelist (in product_id numeric, in pricelist_version_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Price NUMERIC;
v_ProductPrice NUMERIC;
bom RECORD;
BEGIN
-- Try to get price from pricelist directly
SELECT COALESCE (SUM(PriceList), 0)
INTO v_Price
FROM M_ProductPrice
WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_Product_BOM b, M_Product p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND (p.IsBOM='N' OR p.IsVerified='Y')
AND b.IsActive='Y'
LOOP
v_ProductPrice := bomPriceList (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
END LOOP;
END IF;
--
RETURN v_Price;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION bompricestd (in product_id numeric, in pricelist_version_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Price NUMERIC;
v_ProductPrice NUMERIC;
bom RECORD;
BEGIN
-- Try to get price from PriceList directly
SELECT COALESCE(SUM(PriceStd), 0)
INTO v_Price
FROM M_ProductPrice
WHERE IsActive='Y' AND M_PriceList_Version_ID=PriceList_Version_ID AND M_Product_ID=Product_ID;
-- No Price - Check if BOM
IF (v_Price = 0) THEN
FOR bom IN
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM
FROM M_Product_BOM b, M_Product p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=Product_ID
AND b.M_ProductBOM_ID != Product_ID
AND (p.IsBOM='N' OR p.IsVerified='Y')
AND b.IsActive='Y'
LOOP
v_ProductPrice := bomPriceStd (bom.M_ProductBOM_ID, PriceList_Version_ID);
v_Price := v_Price + (bom.BOMQty * v_ProductPrice);
END LOOP;
END IF;
--
RETURN v_Price;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION BOMQtyOnHandForReservation (in product_id numeric, in warehouse_id numeric, in locator_id numeric) RETURNS numeric AS
$BODY$
DECLARE
myWarehouse_ID numeric;
v_Quantity numeric := 99999; -- unlimited
v_IsBOM CHAR(1);
v_IsStocked CHAR(1);
v_ProductType CHAR(1);
v_ProductQty numeric;
v_StdPrecision int;
bom record;
BEGIN
-- Check Parameters
myWarehouse_ID := Warehouse_ID;
IF (myWarehouse_ID IS NULL) THEN
IF (Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT SUM(M_Warehouse_ID) INTO myWarehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=Locator_ID;
END IF;
END IF;
IF (myWarehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO v_IsBOM, v_ProductType, v_IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- Unlimited capacity if no item
IF (v_IsBOM='N' AND (v_ProductType<>'I' OR v_IsStocked='N')) THEN
RETURN v_Quantity;
-- Stocked item
ELSIF (v_IsStocked='Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(QtyOnHand), 0)
INTO v_ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
LEFT JOIN M_LocatorType lt ON (l.M_LocatorType_ID=lt.M_LocatorType_ID)
WHERE s.M_Product_ID=Product_ID AND l.M_Warehouse_ID=myWarehouse_ID
AND COALESCE(lt.IsAvailableForReservation,'Y')='Y';
--
RETURN v_ProductQty;
END IF;
-- Go through BOM
FOR bom IN -- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=product_ID
AND b.M_ProductBOM_ID != Product_ID
AND b.IsActive='Y'
LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get v_ProductQty
SELECT COALESCE(SUM(QtyOnHand), 0)
INTO v_ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
LEFT JOIN M_LocatorType lt ON (l.M_LocatorType_ID=lt.M_LocatorType_ID)
WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID
AND COALESCE(lt.IsAvailableForReservation,'Y')='Y';
-- How much can we make with this product
v_ProductQty := v_ProductQty/bom.BOMQty;
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y' AND bom.IsVerified = 'Y') THEN
v_ProductQty := BOMQtyOnHandForReservation (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
END IF;
END LOOP; -- BOM
IF (v_Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID;
--
RETURN TRUNC(v_Quantity, v_StdPrecision); -- RoundDown
END IF;
RETURN 0;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION BOMQtyOnHand (in product_id numeric, in warehouse_id numeric, in locator_id numeric) RETURNS numeric AS
$BODY$
DECLARE
myWarehouse_ID numeric;
v_Quantity numeric := 99999; -- unlimited
v_IsBOM CHAR(1);
v_IsStocked CHAR(1);
v_ProductType CHAR(1);
v_ProductQty numeric;
v_StdPrecision int;
bom record;
BEGIN
-- Check Parameters
myWarehouse_ID := Warehouse_ID;
IF (myWarehouse_ID IS NULL) THEN
IF (Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT SUM(M_Warehouse_ID) INTO myWarehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=Locator_ID;
END IF;
END IF;
IF (myWarehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO v_IsBOM, v_ProductType, v_IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- Unlimited capacity if no item
IF (v_IsBOM='N' AND (v_ProductType<>'I' OR v_IsStocked='N')) THEN
RETURN v_Quantity;
-- Stocked item
ELSIF (v_IsStocked='Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(QtyOnHand), 0)
INTO v_ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
WHERE s.M_Product_ID=Product_ID AND l.M_Warehouse_ID=myWarehouse_ID;
--
RETURN v_ProductQty;
END IF;
-- Go through BOM
FOR bom IN -- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=product_ID
AND b.M_ProductBOM_ID != Product_ID
AND b.IsActive='Y'
LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get v_ProductQty
SELECT COALESCE(SUM(QtyOnHand), 0)
INTO v_ProductQty
FROM M_Storageonhand s
JOIN M_Locator l ON (s.M_Locator_ID=l.M_Locator_ID)
WHERE s.M_Product_ID=bom.M_ProductBOM_ID AND l.M_Warehouse_ID=myWarehouse_ID;
-- How much can we make with this product
v_ProductQty := v_ProductQty/bom.BOMQty;
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y' AND BOM.IsVerified = 'Y') THEN
v_ProductQty := Bomqtyonhand (bom.M_ProductBOM_ID, myWarehouse_ID, Locator_ID);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
END IF;
END LOOP; -- BOM
IF (v_Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=Product_ID;
--
RETURN TRUNC(v_Quantity, v_StdPrecision); -- RoundDown
END IF;
RETURN 0;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION bomqtyordered (in p_product_id numeric, in p_warehouse_id numeric, in p_locator_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Warehouse_ID numeric;
v_Quantity numeric := 99999; -- unlimited
v_IsBOM CHAR(1);
v_IsStocked CHAR(1);
v_ProductType CHAR(1);
v_ProductQty numeric;
v_StdPrecision int;
bom record;
BEGIN
-- Check Parameters
v_Warehouse_ID := p_Warehouse_ID;
IF (v_Warehouse_ID IS NULL) THEN
IF (p_Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT MAX(M_Warehouse_ID) INTO v_Warehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=p_Locator_ID;
END IF;
END IF;
IF (v_Warehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO v_IsBOM, v_ProductType, v_IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=p_Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- No reservation for non-stocked
IF (v_IsBOM='N' AND (v_ProductType<>'I' OR v_IsStocked='N')) THEN
RETURN 0;
-- Stocked item
ELSIF (v_IsStocked='Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=p_Product_ID
AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='N'
AND IsActive='Y';
--
RETURN v_ProductQty;
END IF;
-- Go though BOM
FOR bom IN
-- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=p_Product_ID
AND b.M_ProductBOM_ID != p_Product_ID
AND b.IsActive='Y'
LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=p_Product_ID
AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='N'
AND IsActive='Y';
-- How much can we make with this product
v_ProductQty := v_ProductQty/bom.BOMQty;
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y' AND BOM.IsVerified = 'Y') THEN
v_ProductQty := Bomqtyordered (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
END IF;
END LOOP; -- BOM
-- Unlimited (e.g. only services)
IF (v_Quantity = 99999) THEN
RETURN 0;
END IF;
IF (v_Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID;
--
RETURN TRUNC(v_Quantity, v_StdPrecision); -- RoundDown
END IF;
--
RETURN 0;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;
CREATE OR REPLACE FUNCTION bomqtyreserved (in p_product_id numeric, in p_warehouse_id numeric, in p_locator_id numeric) RETURNS numeric AS
$BODY$
DECLARE
v_Warehouse_ID numeric;
v_Quantity numeric := 99999; -- unlimited
v_IsBOM CHAR(1);
v_IsStocked CHAR(1);
v_ProductType CHAR(1);
v_ProductQty numeric;
v_StdPrecision int;
bom record;
BEGIN
-- Check Parameters
v_Warehouse_ID := p_Warehouse_ID;
IF (v_Warehouse_ID IS NULL) THEN
IF (p_Locator_ID IS NULL) THEN
RETURN 0;
ELSE
SELECT MAX(M_Warehouse_ID) INTO v_Warehouse_ID
FROM M_LOCATOR
WHERE M_Locator_ID=p_Locator_ID;
END IF;
END IF;
IF (v_Warehouse_ID IS NULL) THEN
RETURN 0;
END IF;
-- Check, if product exists and if it is stocked
BEGIN
SELECT IsBOM, ProductType, IsStocked
INTO v_IsBOM, v_ProductType, v_IsStocked
FROM M_PRODUCT
WHERE M_Product_ID=p_Product_ID;
--
EXCEPTION -- not found
WHEN OTHERS THEN
RETURN 0;
END;
-- No reservation for non-stocked
IF (v_IsBOM='N' AND (v_ProductType<>'I' OR v_IsStocked='N')) THEN
RETURN 0;
-- Stocked item
ELSIF (v_IsStocked='Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=p_Product_ID
AND M_Warehouse_ID=v_Warehouse_ID
AND IsSOTrx='Y'
AND IsActive='Y';
--
RETURN v_ProductQty;
END IF;
-- Go though BOM
FOR bom IN
-- Get BOM Product info
SELECT b.M_ProductBOM_ID, b.BOMQty, p.IsBOM, p.IsStocked, p.ProductType, p.IsVerified
FROM M_PRODUCT_BOM b, M_PRODUCT p
WHERE b.M_ProductBOM_ID=p.M_Product_ID
AND b.M_Product_ID=p_Product_ID
AND b.M_ProductBOM_ID != p_Product_ID
AND b.IsActive='Y'
LOOP
-- Stocked Items "leaf node"
IF (bom.ProductType = 'I' AND bom.IsStocked = 'Y') THEN
-- Get ProductQty
SELECT COALESCE(SUM(Qty), 0)
INTO v_ProductQty
FROM M_StorageReservation
WHERE M_Product_ID=bom.M_ProductBOM_ID
AND M_Warehouse_ID =v_Warehouse_ID
AND IsSOTrx='Y'
AND IsActive='Y';
-- How much can we make with this product
v_ProductQty := v_ProductQty/bom.BOMQty;
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
-- Another BOM
ELSIF (bom.IsBOM = 'Y' AND BOM.IsVerified = 'Y') THEN
v_ProductQty := Bomqtyreserved (bom.M_ProductBOM_ID, v_Warehouse_ID, p_Locator_ID);
-- How much can we make overall
IF (v_ProductQty < v_Quantity) THEN
v_Quantity := v_ProductQty;
END IF;
END IF;
END LOOP; -- BOM
-- Unlimited (e.g. only services)
IF (v_Quantity = 99999) THEN
RETURN 0;
END IF;
IF (v_Quantity > 0) THEN
-- Get Rounding Precision for Product
SELECT COALESCE(MAX(u.StdPrecision), 0)
INTO v_StdPrecision
FROM C_UOM u, M_PRODUCT p
WHERE u.C_UOM_ID=p.C_UOM_ID AND p.M_Product_ID=p_Product_ID;
--
RETURN TRUNC(v_Quantity, v_StdPrecision); -- RoundDown
END IF;
RETURN 0;
END;
$BODY$
LANGUAGE 'plpgsql' STABLE
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-6335
SELECT register_migration_script('202412101102_IDEMPIERE-6335.sql') FROM dual;
-- Dec 10, 2024, 11:06:45 AM BRT
INSERT INTO AD_Process_Para (AD_Process_Para_ID,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,Name,Description,Help,AD_Process_ID,SeqNo,AD_Reference_ID,IsRange,AD_Val_Rule_ID,FieldLength,IsMandatory,ColumnName,IsCentrallyMaintained,EntityType,AD_Element_ID,AD_Process_Para_UU,IsEncrypted,IsAutocomplete,DateRangeOption,IsShowNegateButton) VALUES (200484,0,0,'Y',TO_TIMESTAMP('2024-12-10 11:06:44','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-12-10 11:06:44','YYYY-MM-DD HH24:MI:SS'),100,'Document Type','Document type or rules','The Document Type determines document sequence and processing rules',142,20,19,'N',52054,0,'N','C_DocType_ID','Y','D',196,'2b9ac743-0893-474a-aa96-c1eafe8fba86','N','N','D','N')
;

View File

@ -32,12 +32,14 @@ BEGIN
ins := ins :=
'INSERT INTO ' 'INSERT INTO '
|| t.tablename || t.tablename
|| '_TRL (' || '_Trl ('
|| 'ad_language,ad_client_id,ad_org_id,created,createdby,updated,updatedby,isactive,istranslated,' || 'ad_language,ad_client_id,ad_org_id,created,createdby,updated,updatedby,isactive,istranslated,'
|| t.tablename || t.tablename
|| '_Trl_UU,'
|| t.tablename
|| suffix; || suffix;
sel := sel :=
'SELECT l.ad_language,t.ad_client_id,t.ad_org_id,t.created,t.createdby,t.updated,t.updatedby,t.isactive,''N'' as istranslated,' 'SELECT l.ad_language,t.ad_client_id,t.ad_org_id,SYSDATE,10,SYSDATE,10,t.isactive,''N'' as istranslated,generate_uuid(),'
|| t.tablename || t.tablename
|| suffix; || suffix;
@ -65,7 +67,7 @@ BEGIN
|| t.tablename || t.tablename
|| ' t, ad_language l WHERE l.issystemlanguage=''Y'' AND NOT EXISTS (SELECT 1 FROM ' || ' t, ad_language l WHERE l.issystemlanguage=''Y'' AND NOT EXISTS (SELECT 1 FROM '
|| t.tablename || t.tablename
|| '_TRL b WHERE b.' || '_Trl b WHERE b.'
|| t.tablename || t.tablename
|| suffix || '=t.' || suffix || '=t.'
|| t.tablename || t.tablename

View File

@ -28,12 +28,14 @@ BEGIN
ins := ins :=
'INSERT INTO ' 'INSERT INTO '
|| t.tablename || t.tablename
|| '_TRL (' || '_Trl ('
|| 'ad_language,ad_client_id,ad_org_id,created,createdby,updated,updatedby,isactive,istranslated,' || 'ad_language,ad_client_id,ad_org_id,created,createdby,updated,updatedby,isactive,istranslated,'
|| t.tablename || t.tablename
|| '_Trl_UU,'
|| t.tablename
|| suffix; || suffix;
sel := sel :=
'SELECT l.ad_language,t.ad_client_id,t.ad_org_id,t.created,t.createdby,t.updated,t.updatedby,t.isactive,''N'' as istranslated,' 'SELECT l.ad_language,t.ad_client_id,t.ad_org_id,statement_timestamp(),10,statement_timestamp(),10,t.isactive,''N'' as istranslated,generate_uuid(),'
|| t.tablename || t.tablename
|| suffix; || suffix;

Binary file not shown.

View File

@ -273,6 +273,10 @@
id="org.apache.commons.commons-compress" id="org.apache.commons.commons-compress"
version="0.0.0"/> version="0.0.0"/>
<plugin
id="org.apache.commons.commons-io"
version="0.0.0"/>
<plugin <plugin
id="org.apache.commons.commons-net" id="org.apache.commons.commons-net"
version="0.0.0"/> version="0.0.0"/>

View File

@ -23,6 +23,8 @@
</listAttribute> </listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/> <booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/> <booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.JAVA_COMMAND" value="java"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/> <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/> <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
@ -60,6 +62,7 @@
<setEntry value="org.apache.commons.commons-codec@default:default"/> <setEntry value="org.apache.commons.commons-codec@default:default"/>
<setEntry value="org.apache.commons.commons-collections4@default:default"/> <setEntry value="org.apache.commons.commons-collections4@default:default"/>
<setEntry value="org.apache.commons.commons-compress@default:default"/> <setEntry value="org.apache.commons.commons-compress@default:default"/>
<setEntry value="org.apache.commons.commons-io@default:default"/>
<setEntry value="org.apache.commons.commons-net@default:default"/> <setEntry value="org.apache.commons.commons-net@default:default"/>
<setEntry value="org.apache.commons.logging@default:default"/> <setEntry value="org.apache.commons.logging@default:default"/>
<setEntry value="org.apache.felix.gogo.runtime@default:default"/> <setEntry value="org.apache.felix.gogo.runtime@default:default"/>

View File

@ -68,6 +68,7 @@
<setEntry value="org.apache.commons.commons-codec@default:default"/> <setEntry value="org.apache.commons.commons-codec@default:default"/>
<setEntry value="org.apache.commons.commons-collections4@default:default"/> <setEntry value="org.apache.commons.commons-collections4@default:default"/>
<setEntry value="org.apache.commons.commons-compress@default:default"/> <setEntry value="org.apache.commons.commons-compress@default:default"/>
<setEntry value="org.apache.commons.commons-io@default:default"/>
<setEntry value="org.apache.commons.commons-net@default:default"/> <setEntry value="org.apache.commons.commons-net@default:default"/>
<setEntry value="org.apache.commons.logging@default:default"/> <setEntry value="org.apache.commons.logging@default:default"/>
<setEntry value="org.apache.felix.gogo.runtime@default:default"/> <setEntry value="org.apache.felix.gogo.runtime@default:default"/>

View File

@ -69,6 +69,7 @@
<setEntry value="org.apache.commons.commons-codec@default:default"/> <setEntry value="org.apache.commons.commons-codec@default:default"/>
<setEntry value="org.apache.commons.commons-collections4@default:default"/> <setEntry value="org.apache.commons.commons-collections4@default:default"/>
<setEntry value="org.apache.commons.commons-compress@default:default"/> <setEntry value="org.apache.commons.commons-compress@default:default"/>
<setEntry value="org.apache.commons.commons-io@default:default"/>
<setEntry value="org.apache.commons.commons-net@default:default"/> <setEntry value="org.apache.commons.commons-net@default:default"/>
<setEntry value="org.apache.commons.logging@default:default"/> <setEntry value="org.apache.commons.logging@default:default"/>
<setEntry value="org.apache.felix.gogo.runtime@default:default"/> <setEntry value="org.apache.felix.gogo.runtime@default:default"/>

View File

@ -69,6 +69,7 @@
<setEntry value="org.apache.commons.commons-codec@default:default"/> <setEntry value="org.apache.commons.commons-codec@default:default"/>
<setEntry value="org.apache.commons.commons-collections4@default:default"/> <setEntry value="org.apache.commons.commons-collections4@default:default"/>
<setEntry value="org.apache.commons.commons-compress@default:default"/> <setEntry value="org.apache.commons.commons-compress@default:default"/>
<setEntry value="org.apache.commons.commons-io@default:default"/>
<setEntry value="org.apache.commons.commons-net@default:default"/> <setEntry value="org.apache.commons.commons-net@default:default"/>
<setEntry value="org.apache.commons.logging@default:default"/> <setEntry value="org.apache.commons.logging@default:default"/>
<setEntry value="org.apache.felix.gogo.runtime@default:default"/> <setEntry value="org.apache.felix.gogo.runtime@default:default"/>

View File

@ -69,6 +69,7 @@
<setEntry value="org.apache.commons.commons-codec@default:default"/> <setEntry value="org.apache.commons.commons-codec@default:default"/>
<setEntry value="org.apache.commons.commons-collections4@default:default"/> <setEntry value="org.apache.commons.commons-collections4@default:default"/>
<setEntry value="org.apache.commons.commons-compress@default:default"/> <setEntry value="org.apache.commons.commons-compress@default:default"/>
<setEntry value="org.apache.commons.commons-io@default:default"/>
<setEntry value="org.apache.commons.commons-net@default:default"/> <setEntry value="org.apache.commons.commons-net@default:default"/>
<setEntry value="org.apache.commons.logging@default:default"/> <setEntry value="org.apache.commons.logging@default:default"/>
<setEntry value="org.apache.felix.gogo.runtime@default:default"/> <setEntry value="org.apache.felix.gogo.runtime@default:default"/>

Binary file not shown.

View File

@ -0,0 +1,59 @@
/***********************************************************************
* This file is part of iDempiere ERP Open Source *
* http://www.idempiere.org *
* *
* Copyright (C) Contributors *
* *
* 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 2 *
* 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, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
* MA 02110-1301, USA. *
* *
* Contributors: *
* - Nicolas Micoud (TGI) *
**********************************************************************/
package org.adempiere.base.callout;
import java.util.Properties;
import org.adempiere.base.IColumnCallout;
import org.adempiere.base.annotation.Callout;
import org.compiere.model.GridField;
import org.compiere.model.GridTab;
import org.compiere.model.MTable;
/**
*
* @author Nicolas Micoud (TGI)
*
*/
@Callout(tableName = "AD_Package_Exp_Detail", columnName = {"SQLStatement"})
public class PackageExpDetail implements IColumnCallout {
@Override
public String start(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value, Object oldValue) {
if (value != null && mTab.getValue("AD_Table_ID") == null) {
String sql = value.toString();
if (sql.startsWith("SELECT ") && sql.contains(" FROM ")) {
int start = sql.indexOf(" FROM ") + 6;
int end = sql.indexOf(" ", start + 1);
String tablename = sql.substring(start, end);
if (MTable.get(ctx, tablename) != null)
mTab.setValue("AD_Table_ID", MTable.get(ctx, tablename).getAD_Table_ID());
}
}
return null;
}
}

View File

@ -156,6 +156,11 @@ public class CalloutRMA extends CalloutEngine {
MInvoice invoice = rma.getOriginalInvoice(); MInvoice invoice = rma.getOriginalInvoice();
if (invoice != null) if (invoice != null)
{ {
int dropshipLocationId = -1;
MOrder order = invoice.getOriginalOrder();
if (order != null)
dropshipLocationId = order.getDropShip_Location_ID();
pp.setM_PriceList_ID(invoice.getM_PriceList_ID()); pp.setM_PriceList_ID(invoice.getM_PriceList_ID());
pp.setPriceDate(invoice.getDateInvoiced()); pp.setPriceDate(invoice.getDateInvoiced());
@ -168,7 +173,7 @@ public class CalloutRMA extends CalloutEngine {
invoice.getDateInvoiced(), invoice.getDateInvoiced(), invoice.getDateInvoiced(), invoice.getDateInvoiced(),
AD_Org_ID, rma.getShipment().getM_Warehouse_ID(), AD_Org_ID, rma.getShipment().getM_Warehouse_ID(),
invoice.getC_BPartner_Location_ID(), // should be bill to invoice.getC_BPartner_Location_ID(), // should be bill to
invoice.getC_BPartner_Location_ID(), rma.isSOTrx(), deliveryViaRule, null); invoice.getC_BPartner_Location_ID(), dropshipLocationId, rma.isSOTrx(), deliveryViaRule, null);
} }
else else
{ {
@ -183,7 +188,7 @@ public class CalloutRMA extends CalloutEngine {
order.getDateOrdered(), order.getDateOrdered(), order.getDateOrdered(), order.getDateOrdered(),
AD_Org_ID, order.getM_Warehouse_ID(), AD_Org_ID, order.getM_Warehouse_ID(),
order.getC_BPartner_Location_ID(), // should be bill to order.getC_BPartner_Location_ID(), // should be bill to
order.getC_BPartner_Location_ID(), rma.isSOTrx(), order.getDeliveryViaRule(), null); order.getC_BPartner_Location_ID(), order.getDropShip_Location_ID(), rma.isSOTrx(), order.getDeliveryViaRule(), null);
} }
else else
return "No Invoice/Order found the Shipment/Receipt associated"; return "No Invoice/Order found the Shipment/Receipt associated";

View File

@ -525,7 +525,7 @@ public class CalloutInOut extends CalloutEngine
mTab.setValue("M_Locator_ID", Integer.valueOf(M_Locator_ID)); mTab.setValue("M_Locator_ID", Integer.valueOf(M_Locator_ID));
} }
else else
mTab.setValue("M_AttributeSetInstance_ID", null); mTab.setValue("M_AttributeSetInstance_ID", 0);
// //
int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID"); int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID");
boolean IsSOTrx = "Y".equals(Env.getContext(ctx, WindowNo, "IsSOTrx")); boolean IsSOTrx = "Y".equals(Env.getContext(ctx, WindowNo, "IsSOTrx"));

View File

@ -60,7 +60,7 @@ public class CalloutInventory extends CalloutEngine
if ("M_Product_ID".equals(mField.getColumnName())) { if ("M_Product_ID".equals(mField.getColumnName())) {
// product changed - remove old ASI // product changed - remove old ASI
mTab.setValue("M_AttributeSetInstance_ID", null); mTab.setValue("M_AttributeSetInstance_ID", 0);
} }
// Get Book Value // Get Book Value
@ -96,7 +96,7 @@ public class CalloutInventory extends CalloutEngine
if (M_AttributeSetInstance_ID != 0) if (M_AttributeSetInstance_ID != 0)
mTab.setValue(MInventoryLine.COLUMNNAME_M_AttributeSetInstance_ID, M_AttributeSetInstance_ID); mTab.setValue(MInventoryLine.COLUMNNAME_M_AttributeSetInstance_ID, M_AttributeSetInstance_ID);
else else
mTab.setValue(MInventoryLine.COLUMNNAME_M_AttributeSetInstance_ID, null); mTab.setValue(MInventoryLine.COLUMNNAME_M_AttributeSetInstance_ID, 0);
} }
// Set QtyBook from first storage location // Set QtyBook from first storage location

View File

@ -325,7 +325,7 @@ public class CalloutInvoice extends CalloutEngine
&& Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0) && Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID") != 0)
mTab.setValue("M_AttributeSetInstance_ID", Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID")); mTab.setValue("M_AttributeSetInstance_ID", Env.getContextAsInt(ctx, WindowNo, Env.TAB_INFO, "M_AttributeSetInstance_ID"));
else else
mTab.setValue("M_AttributeSetInstance_ID", null); mTab.setValue("M_AttributeSetInstance_ID", 0);
/***** Price Calculation see also qty ****/ /***** Price Calculation see also qty ****/
boolean IsSOTrx = Env.getContext(ctx, WindowNo, "IsSOTrx").equals("Y"); boolean IsSOTrx = Env.getContext(ctx, WindowNo, "IsSOTrx").equals("Y");
@ -488,8 +488,9 @@ public class CalloutInvoice extends CalloutEngine
// //
String deliveryViaRule = getLineDeliveryViaRule(ctx, WindowNo, mTab); String deliveryViaRule = getLineDeliveryViaRule(ctx, WindowNo, mTab);
int dropshipLocationId = getDropShipLocationId(ctx, WindowNo, mTab);
int C_Tax_ID = Core.getTaxLookup().get(ctx, M_Product_ID, C_Charge_ID, billDate, shipDate, int C_Tax_ID = Core.getTaxLookup().get(ctx, M_Product_ID, C_Charge_ID, billDate, shipDate,
AD_Org_ID, M_Warehouse_ID, billC_BPartner_Location_ID, shipC_BPartner_Location_ID, AD_Org_ID, M_Warehouse_ID, billC_BPartner_Location_ID, shipC_BPartner_Location_ID, dropshipLocationId,
Env.getContext(ctx, WindowNo, "IsSOTrx").equals("Y"), deliveryViaRule, null); Env.getContext(ctx, WindowNo, "IsSOTrx").equals("Y"), deliveryViaRule, null);
if (log.isLoggable(Level.INFO)) log.info("Tax ID=" + C_Tax_ID); if (log.isLoggable(Level.INFO)) log.info("Tax ID=" + C_Tax_ID);
// //
@ -501,6 +502,13 @@ public class CalloutInvoice extends CalloutEngine
return amt (ctx, WindowNo, mTab, mField, value); return amt (ctx, WindowNo, mTab, mField, value);
} // tax } // tax
/**
* Get the delivery via rule from the related order
* @param ctx
* @param windowNo
* @param mTab
* @return
*/
private String getLineDeliveryViaRule(Properties ctx, int windowNo, GridTab mTab) { private String getLineDeliveryViaRule(Properties ctx, int windowNo, GridTab mTab) {
if (mTab.getValue("C_OrderLine_ID") != null) { if (mTab.getValue("C_OrderLine_ID") != null) {
int C_OrderLine_ID = (Integer) mTab.getValue("C_OrderLine_ID"); int C_OrderLine_ID = (Integer) mTab.getValue("C_OrderLine_ID");
@ -524,6 +532,29 @@ public class CalloutInvoice extends CalloutEngine
return null; return null;
} }
/**
* Get the drop shipment location ID from the related order
* @param ctx
* @param windowNo
* @param mTab
* @return
*/
private int getDropShipLocationId(Properties ctx, int windowNo, GridTab mTab) {
if (mTab.getValue("C_OrderLine_ID") != null) {
int C_OrderLine_ID = (Integer) mTab.getValue("C_OrderLine_ID");
if (C_OrderLine_ID > 0) {
MOrderLine orderLine = new MOrderLine(ctx, C_OrderLine_ID, null);
return orderLine.getParent().getDropShip_Location_ID();
}
}
int C_Order_ID = Env.getContextAsInt(ctx, windowNo, "C_Order_ID", true);
if (C_Order_ID > 0) {
MOrder order = new MOrder(ctx, C_Order_ID, null);
return order.getDropShip_Location_ID();
}
return -1;
}
/** /**
* Invoice - Amount. * Invoice - Amount.
* - called from QtyInvoiced, PriceActual * - called from QtyInvoiced, PriceActual

Some files were not shown because too many files have changed in this diff Show More