Skip to content

Commit

Permalink
Merge pull request #761 from Luis-Cruz/feature/FIST-890
Browse files Browse the repository at this point in the history
Add flag to block sap sync FIST-890 #resolve
  • Loading branch information
Luis-Cruz authored Oct 13, 2020
2 parents bfa44bb + f8261d1 commit ab5f6f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions fenixedu-ist-giaf-invoices/src/main/dml/invoices.dml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ enum pt.ist.fenixedu.domain.SapRequestType as SapRequestType;
class SapRoot {
Long sapDocumentNumber;
Integer openYear;
boolean allowCommunication;
}

class SapRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ private SapRoot() {
super();
setBennu(Bennu.getInstance());
super.setSapDocumentNumber(Long.valueOf(0));
setAllowCommunication(true);
}

public static SapRoot getInstance() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,9 @@ public boolean processPendingRequests(final Event event, final ErrorLogConsumer
}

public boolean processPendingRequests(final SapRequest sr, final ErrorLogConsumer errorLog, final EventLogger elogger) {
if (!SapRoot.getInstance().getAllowCommunication()) {
return false;
}
if (!sr.getIntegrated() && sr.allowedToSend()) {
final JsonParser jsonParser = new JsonParser();
final JsonObject data = (JsonObject) jsonParser.parse(sr.getRequest());
Expand Down

0 comments on commit ab5f6f2

Please sign in to comment.