Skip to content

Commit

Permalink
Merge branch 'main' into hotfix/#320-EPL-1160
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbarrozo authored Jul 12, 2024
2 parents 83fffb3 + 1cb3bc1 commit 796e695
Show file tree
Hide file tree
Showing 16 changed files with 180 additions and 151 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/auto-reviewer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
if: github.head_ref != 'develop' && github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
env:
PULL_REQUEST: ${{ github.event.pull_request.number }}
PROJECT: ${{ github.event.repository.owner.login }}
REPO_SLUG: ${{ github.event.repository.name }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand All @@ -22,21 +21,29 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Fetch pull request number
id: fetch-pr
run: |
PR_NUMBER=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ env.PROJECT }}/${{ env.REPO_SLUG }}/pulls?head=${{ env.PROJECT }}:${{ github.head_ref }}" \
| jq '.[0].number')
echo "PULL_REQUEST=$PR_NUMBER" >> $GITHUB_ENV
- name: Run Docker container
id: run-docker
run: |
printenv
echo "-------------------------------------------------------------------------"
echo ${{ env.DOCKERHUB_PASSWORD }} | docker login --username "${{ env.DOCKERHUB_USERNAME }}" --password-stdin
docker run -d -p 5000:5000 -e REPO_API_TOKEN="${{ env.ETENDOBOT_TOKEN }}" -e PULL_REQUEST=${{ env.PULL_REQUEST }} -e PROJECT=${{ env.PROJECT }} -e REPO_SLUG=${{ env.REPO_SLUG }} -e OPENAI_API_KEY="${{ env.OPENAI_API_KEY }}" etendo/code-reviewer:latest
- name: Make Reviewer API call
id: call-api
run: |
sleep 10s
response=$(curl -s -o response.txt -w "%{http_code}" -X GET http://localhost:5000/review/github)
if [ $response -ne 200 ]; then
echo "API call failed with status code $response. This is likely an error related to the PR data, or an internal API error"
echo "Response text:"
cat response.txt
exit 1
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ dependencies {

}

final String CURRENT_VERSION = "24.1.6"
final String NEXT_RELEASE = "24.2.0"
final String NEXT_HOTFIX = "24.1.7"
final String CURRENT_VERSION = "24.2.1"
final String NEXT_RELEASE = "24.3.0"
final String NEXT_HOTFIX = "24.2.2"

final String DEV_URL = "https://repo.futit.cloud/repository/maven-snapshots/"
final String PROD_URL = uri("https://maven.pkg.github.com/etendosoftware/etendo_core/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
ic.salesOrder.id,
o.name as adorgname,
ic.documentType as cdoctypename,
ic.documentNo,
ic.documentNo as documentNo,
bp.name as cbpartnername,
ic.orderDate,
ic.orderDate as orderDate,
case when @linesIncludeTaxes@ = 'Y' then ic.amountlinesgross else ic.amountlines end as amountlines,
case
when ic.term = 'N'
Expand All @@ -36,7 +36,7 @@ case
else
case when @linesIncludeTaxes@ = 'Y' then ic.notinvoicedlinesgross else ic.notinvoicedlines end
end as notinvoicedlines,
ic.term AS TermName,
ic.term as TermName,
case
when ic.term = 'N'
then 0.0
Expand All @@ -55,14 +55,14 @@ case
then 0.0
else ic.pendinglines
end as pendinglines,
ic.orderedQuantity,
ic.deliveredQuantity,
((case when @linesIncludeTaxes@ = 'Y' then ic.amountlinesgross else ic.amountlines end)-(case when @linesIncludeTaxes@ = 'Y' then ic.notinvoicedlinesgross else ic.notinvoicedlines end)) AS linesinvoiced,
ic.orderedQuantity as orderedQuantity,
ic.deliveredQuantity as deliveredQuantity,
((case when @linesIncludeTaxes@ = 'Y' then ic.amountlinesgross else ic.amountlines end)-(case when @linesIncludeTaxes@ = 'Y' then ic.notinvoicedlinesgross else ic.notinvoicedlines end)) as linesinvoiced,
ic.amountlinesgross as totalgross,
ic.creationDate,
ic.createdBy,
ic.updated,
ic.updatedBy
ic.creationDate as creationDate,
ic.createdBy as createdBy,
ic.updated as updated,
ic.updatedBy as updatedBy
from
InvoiceCandidateV ic
join ic.salesOrder ord
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ private DataEntityQueryService createSetQueryService(Map<String, String> paramet
// this is the main entity of a 'contains' (used in FK drop down lists), it will create also
// info for subentity

if ("true".equals(parameters.get(JsonConstants.SHOW_FK_DROPDOWN_UNFILTERED_PARAMETER))) {
if (StringUtils.equals("true", parameters.get(JsonConstants.SHOW_FK_DROPDOWN_UNFILTERED_PARAMETER))) {
// Do not filter out the rows of the referenced tables if
// they are not referenced from the referencing tables
// Showing the records unfiltered improves the performance if the referenced table has just
Expand Down Expand Up @@ -435,7 +435,7 @@ private DataEntityQueryService createSetQueryService(Map<String, String> paramet
removeWhereParameter(parameters);
} else {

final String distinctPropertyPath = parameters.get(JsonConstants.DISTINCT_PARAMETER);
final String distinctPropertyPath = StringUtils.lowerCase(parameters.get(JsonConstants.DISTINCT_PARAMETER));
final Property distinctProperty = DalUtil.getPropertyFromPath(
ModelProvider.getInstance().getEntity(entityName), distinctPropertyPath);
final Entity distinctEntity = distinctProperty.getTargetEntity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ paths:
$ref: "#/components/schemas/LogResp"
401:
description: No auth.
/sws/com.smf.securewebservices.obRest/{modelName}:
/sws/com.smf.securewebservices.obRest/{_entityName}:
get:
summary: List records
security:
Expand Down Expand Up @@ -132,10 +132,10 @@ paths:
- name: distinct
in: query
required: false
description: Only filters by entities. Returns the specified entity from the model.
description: Specifies that only unique values will be returned of the described entity.
schema:
type: string
example: Organization
example: organization
- name: identifiers
in: query
required: false
Expand Down Expand Up @@ -229,7 +229,7 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/Error"
/sws/com.smf.securewebservices.obRest/{modelName}/{recordID}:
/sws/com.smf.securewebservices.obRest/{_entityName}/{recordID}:
get:
summary: Get a record by ID
security:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private void massiveMessageHandler(ActionResult result, List<FIN_Payment> regist
}

private void callPaymentProcess(ActionResult actionResult, JSONObject content,
String paymentId, boolean isWebService) throws JSONException {
String paymentId, boolean isWebService) throws Exception {
// process payments
JSONObject resultProcess = oldProcessPaymentHandler(getRequestParameters(), content, paymentId, isWebService);
JSONObject resultMessage = resultProcess.has(MESSAGE) ? resultProcess.getJSONObject(MESSAGE) : new JSONObject();
Expand Down Expand Up @@ -228,12 +228,12 @@ private void callPaymentProcess(ActionResult actionResult, JSONObject content,
}

protected JSONObject oldProcessPaymentHandler(Map<String, Object> parameters, JSONObject content, String paymentId,
boolean isWebService) {
boolean isWebService) throws Exception {
JSONObject jsonResponse = new JSONObject();
OBContext.setAdminMode(true);
boolean openedFromMenu = false;
String comingFrom = null;
try {
OBContext.setAdminMode(true);
if (isWebService) {
FIN_Payment payment = OBDal.getInstance().get(FIN_Payment.class, paymentId);
if (payment.isProcessed()) {
Expand Down Expand Up @@ -328,17 +328,8 @@ protected JSONObject oldProcessPaymentHandler(Map<String, Object> parameters, JS
// Load existing lines to be deleted.
pdToRemove = OBDao.getIDListFromOBObject(payment.getFINPaymentDetailList());
} else {
try {
payment = createNewPayment(jsonParams, isReceipt, org, businessPartner, paymentDate,
currency, exchangeRate, convertedAmount, strActualPayment);
} catch (OBException e) {
JSONObject errorMessage = new JSONObject();
errorMessage.put(SEVERITY, ERROR);
errorMessage.put(TEXT, e.getMessage());
jsonResponse.put(RETRY_EXECUTION, openedFromMenu);
jsonResponse.put(MESSAGE, errorMessage);
return jsonResponse;
}
}
payment.setAmount(new BigDecimal(strActualPayment));
FIN_AddPayment.setFinancialTransactionAmountAndRate(vars, payment, exchangeRate,
Expand Down Expand Up @@ -384,21 +375,6 @@ protected JSONObject oldProcessPaymentHandler(Map<String, Object> parameters, JS
return resultPost;
}
}
} catch (Exception e) {
log.error("Exception handling the new payment", e);

try {
jsonResponse = new JSONObject();
Throwable ex = DbUtility.getUnderlyingSQLException(e);
String message = OBMessageUtils.translateError(ex.getMessage()).getMessage();
JSONObject errorMessage = new JSONObject();
errorMessage.put(SEVERITY, ERROR);
errorMessage.put(TEXT, message);
jsonResponse.put(RETRY_EXECUTION, openedFromMenu);
jsonResponse.put(MESSAGE, errorMessage);

} catch (Exception ignore) {
}
} finally {
OBContext.restorePreviousMode();
}
Expand Down Expand Up @@ -468,13 +444,17 @@ private FIN_Payment createNewPayment(JSONObject jsonParams, boolean isReceipt, O
strPaymentDocumentNo = FIN_Utility.getDocumentNo(documentType, FIN_PAYMENT);
}

OBContext.setAdminMode(false);
try {
OBContext.setAdminMode(false);
FIN_Payment payment = (new AdvPaymentMngtDao()).getNewPayment(isReceipt, org, documentType,
strPaymentDocumentNo, bPartner, paymentMethod, finAccount, strPaymentAmount, paymentDate,
strReferenceNo, currency, conversionRate, convertedAmt);
OBDal.getInstance().getConnection(true).commit();
return payment;
} catch (Exception e) {
final Throwable ex = DbUtility.getUnderlyingSQLException(e.getCause() != null ? e.getCause() : e);
final String message = OBMessageUtils.translateError(ex.getMessage()).getMessage();
throw new OBException(message);
} finally {
OBContext.restorePreviousMode();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ OB.ViewFormProperties = {
// showing focused style in multiple fields
if (this.getFocusItem()) {
this.getFocusItem().hasFocus = false;
this.getFocusItem().elementBlur();
}
this.setFocusItem(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!--0138E7A89B5E4DC3932462252801FFBC--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--0138E7A89B5E4DC3932462252801FFBC--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
<!--0138E7A89B5E4DC3932462252801FFBC--> <NAME><![CDATA[Openbravo 3.0]]></NAME>
<!--0138E7A89B5E4DC3932462252801FFBC--> <VERSION><![CDATA[24.1.6]]></VERSION>
<!--0138E7A89B5E4DC3932462252801FFBC--> <VERSION><![CDATA[24.2.1]]></VERSION>
<!--0138E7A89B5E4DC3932462252801FFBC--> <DESCRIPTION><![CDATA[Openbravo 3.0 distribution template]]></DESCRIPTION>
<!--0138E7A89B5E4DC3932462252801FFBC--> <HELP><![CDATA[Openbravo 3.0 is a collection (distribution) of modules. This template is a container of all the modules and configuration changes that compose Openbravo 3.0.]]></HELP>
<!--0138E7A89B5E4DC3932462252801FFBC--> <URL><![CDATA[http://forge.openbravo.com/projects/vthree]]></URL>
Expand All @@ -20,8 +20,8 @@
<!--0138E7A89B5E4DC3932462252801FFBC--> <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
<!--0138E7A89B5E4DC3932462252801FFBC--> <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
<!--0138E7A89B5E4DC3932462252801FFBC--> <HASREFERENCEDATA><![CDATA[N]]></HASREFERENCEDATA>
<!--0138E7A89B5E4DC3932462252801FFBC--> <UPDATEINFO><![CDATA[https://docs.etendo.software/whats-new/release-notes/etendo-classic/versions/24Q1-6]]></UPDATEINFO>
<!--0138E7A89B5E4DC3932462252801FFBC--> <VERSION_LABEL><![CDATA[24Q1.6]]></VERSION_LABEL>
<!--0138E7A89B5E4DC3932462252801FFBC--> <UPDATEINFO><![CDATA[https://docs.etendo.software/whats-new/release-notes/etendo-classic/versions/24Q2-1]]></UPDATEINFO>
<!--0138E7A89B5E4DC3932462252801FFBC--> <VERSION_LABEL><![CDATA[24Q2.1]]></VERSION_LABEL>
<!--0138E7A89B5E4DC3932462252801FFBC--> <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
<!--0138E7A89B5E4DC3932462252801FFBC--> <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
<!--0138E7A89B5E4DC3932462252801FFBC--></AD_MODULE>
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"author": "Openbravo SLU",
"license": "SEE LICENSE IN legal/Openbravo_license.txt",
"dependencies": {
"prettier": "~3.2.0",
"prettier": "~3.2.5",
"eslint-config-prettier": "~9.0.0",
"eslint-plugin-prettier": "~5.1.2"
"eslint-plugin-prettier": "~5.1.3"
},
"devDependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.12.7",
Expand Down
2 changes: 1 addition & 1 deletion pipelines/unittests/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pipeline {
GITHUB_TOKEN = credentials('github-read-package-token')
LANG = 'en_US.UTF-8'

ACCESS_TOKEN = credentials('access_token')
ACCESS_TOKEN = credentials('access_token_github')
EMAIL_ADDRESS = credentials('email_builds')

URL_REPO = 'https://github.com/etendosoftware/etendo_core'
Expand Down
2 changes: 1 addition & 1 deletion pipelines/unittests/build-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DESCRIPTION=$3
TARGET_URL="$6"
ACCESS_TOKEN=$4
GIT_STATUS_URL="https://$ACCESS_TOKEN:x-oauth-basic@$URI/repos/$OWNER/$REPO_SLUG/statuses/${REVISION}"
TEMPLATE='{"state":"%s", "target_url":"%s", "description":"%s", "context":"build/job"}'
TEMPLATE='{"state":"%s", "target_url":"%s", "description":"%s", "context":"Etendo Core Unit Tests"}'
PAYLOAD=$(printf "$TEMPLATE" "$STATUS" "$TARGET_URL" "$DESCRIPTION")

echo $PAYLOAD
Expand Down
6 changes: 3 additions & 3 deletions src-db/database/sourcedata/AD_MODULE.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!--0--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--0--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
<!--0--> <NAME><![CDATA[Core]]></NAME>
<!--0--> <VERSION><![CDATA[24.1.6]]></VERSION>
<!--0--> <VERSION><![CDATA[24.2.1]]></VERSION>
<!--0--> <DESCRIPTION><![CDATA[Core module is the base one]]></DESCRIPTION>
<!--0--> <HELP><![CDATA[Core module is the base one, all developments in core are included as part of the standard Etendo ERP.]]></HELP>
<!--0--> <URL><![CDATA[www.etendo.software]]></URL>
Expand All @@ -21,9 +21,9 @@ You may obtain a copy of the License at support@etendo.software or in the legal
<!--0--> <HASCHARTOFACCOUNTS><![CDATA[N]]></HASCHARTOFACCOUNTS>
<!--0--> <ISTRANSLATIONMODULE><![CDATA[N]]></ISTRANSLATIONMODULE>
<!--0--> <HASREFERENCEDATA><![CDATA[Y]]></HASREFERENCEDATA>
<!--0--> <UPDATEINFO><![CDATA[https://docs.etendo.software/whats-new/release-notes/etendo-classic/versions/24Q1-6]]></UPDATEINFO>
<!--0--> <UPDATEINFO><![CDATA[https://docs.etendo.software/whats-new/release-notes/etendo-classic/versions/24Q2-1]]></UPDATEINFO>
<!--0--> <REFERENCEDATAINFO><![CDATA[Standard document types for orders, invoices, etc. and settings]]></REFERENCEDATAINFO>
<!--0--> <VERSION_LABEL><![CDATA[24Q1.6]]></VERSION_LABEL>
<!--0--> <VERSION_LABEL><![CDATA[24Q2.1]]></VERSION_LABEL>
<!--0--> <ISCOMMERCIAL><![CDATA[N]]></ISCOMMERCIAL>
<!--0--> <ISTRIALALLOWED><![CDATA[N]]></ISTRIALALLOWED>
<!--0--></AD_MODULE>
Expand Down
Loading

0 comments on commit 796e695

Please sign in to comment.