diff --git a/src/main/java/org/spin/grpc/service/ReportManagement.java b/src/main/java/org/spin/grpc/service/ReportManagement.java index 6ef09a5ec..eacc66f40 100644 --- a/src/main/java/org/spin/grpc/service/ReportManagement.java +++ b/src/main/java/org/spin/grpc/service/ReportManagement.java @@ -102,7 +102,7 @@ public class ReportManagement extends ReportManagementImplBase { private CLogger log = CLogger.getCLogger(ReportManagement.class); - + @Override public void generateReport(GenerateReportRequest request, StreamObserver responseObserver) { try { @@ -116,10 +116,11 @@ public void generateReport(GenerateReportRequest request, StreamObserver responseObserver) { try { @@ -488,11 +505,12 @@ public void getReportOutput(GetReportOutputRequest request, StreamObserver responseObserver) { try { @@ -739,7 +760,11 @@ public void printEntitiesBatch(PrintEntitiesBatchRequest request, StreamObserver if(fileType.equals("pdf")) { File outFile = File.createTempFile("BatchPrint_", ".pdf"); IText7Document.mergePdf(files, outFile); - printResponse.setFileName(ValueManager.validateNull(S3Manager.putTemporaryFile(outFile))); + printResponse.setFileName( + StringManager.getValidString( + S3Manager.putTemporaryFile(outFile) + ) + ); } else { File outFile = File.createTempFile("BatchPrint_", ".zip"); try (ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(outFile))) { @@ -748,7 +773,11 @@ public void printEntitiesBatch(PrintEntitiesBatchRequest request, StreamObserver Files.copy(file.toPath(), zipOut); } } - printResponse.setFileName(ValueManager.validateNull(S3Manager.putTemporaryFile(outFile))); + printResponse.setFileName( + StringManager.getValidString( + S3Manager.putTemporaryFile(outFile) + ) + ); } printResponse.setRecordCount(files.size()); } @@ -756,10 +785,12 @@ public void printEntitiesBatch(PrintEntitiesBatchRequest request, StreamObserver responseObserver.onCompleted(); } catch (Exception e) { log.severe(e.getLocalizedMessage()); - responseObserver.onError(Status.INTERNAL + responseObserver.onError( + Status.INTERNAL .withDescription(e.getLocalizedMessage()) .withCause(e) - .asRuntimeException()); + .asRuntimeException() + ); } } @@ -836,17 +867,17 @@ private ListPrintFormatsResponse.Builder listPrintFormats(Properties context, Li printFormat.getAD_PrintFormat_ID() ) .setUuid( - ValueManager.validateNull( + StringManager.getValidString( printFormat.getUUID() ) ) .setName( - ValueManager.validateNull( + StringManager.getValidString( printFormat.getName() ) ) .setDescription( - ValueManager.validateNull( + StringManager.getValidString( printFormat.getDescription() ) ) @@ -858,7 +889,7 @@ private ListPrintFormatsResponse.Builder listPrintFormats(Properties context, Li if (printFormat.getAD_Table_ID() > 0) { MTable table = MTable.get(Env.getCtx(), printFormat.getAD_Table_ID()); printFormatBuilder.setTableName( - ValueManager.validateNull( + StringManager.getValidString( table.getTableName() ) ); @@ -968,7 +999,8 @@ private ListReportViewsResponse.Builder listReportViews(ListReportViewsRequest r ) .setParameters(reportView.get_ID(), "Y", language) .setOnlyActiveRecords(true) - .first(); + .first() + ; if (translation != null) { String nameTranslated = translation.get_ValueAsString(I_AD_ReportView.COLUMNNAME_Name); @@ -987,22 +1019,22 @@ private ListReportViewsResponse.Builder listReportViews(ListReportViewsRequest r reportView.getAD_ReportView_ID() ) .setUuid( - ValueManager.validateNull( + StringManager.getValidString( reportView.getUUID() ) ) .setName( - ValueManager.validateNull(name) + StringManager.getValidString(name) ) .setDescription( - ValueManager.validateNull(description) + StringManager.getValidString(description) ) ; if (reportView.getAD_ReportView_ID() > 0) { MTable table = MTable.get(context, reportView.getAD_Table_ID()); reportViewBuilder.setTableName( - ValueManager.validateNull( + StringManager.getValidString( table.getTableName() ) ); @@ -1028,10 +1060,12 @@ public void listDrillTables(ListDrillTablesRequest request, StreamObserver ta List processList = WindowUtil.getProcessActionFromTab(context, tab); if(processList != null && processList.size() > 0) { + processList = processList.stream() + .sorted(Comparator.comparing(MProcess::getName)) + .collect(Collectors.toList()) + ; for(MProcess process : processList) { // get process associated without parameters Process.Builder processBuilder = ProcessConvertUtil.convertProcess( @@ -501,46 +504,66 @@ public static Field.Builder convertField(Properties context, MField field, boole // Convert Field.Builder builder = Field.newBuilder() .setId( - ValueManager.validateNull( + StringManager.getValidString( field.getUUID() ) ) .setUuid( - ValueManager.validateNull(field.getUUID()) + StringManager.getValidString( + field.getUUID() + ) ) .setInternalId( field.getAD_Field_ID() ) .setName( - ValueManager.validateNull(field.getName()) + StringManager.getValidString( + field.getName() + ) ) .setDescription( - ValueManager.validateNull(field.getDescription()) + StringManager.getValidString( + field.getDescription() + ) ) .setHelp( - ValueManager.validateNull(field.getHelp()) + StringManager.getValidString( + field.getHelp() + ) ) .setCallout( - ValueManager.validateNull(column.getCallout()) + StringManager.getValidString( + column.getCallout() + ) ) .setColumnName( - ValueManager.validateNull(column.getColumnName()) + StringManager.getValidString( + column.getColumnName() + ) ) // .setElementName( - // ValueManager.validateNull(element.getColumnName()) + // StringManager.getValidString( + // element.getColumnName() + // ) // ) .setColumnSql( - ValueManager.validateNull(column.getColumnSQL()) + StringManager.getValidString( + column.getColumnSQL() + ) ) .setDefaultValue( - ValueManager.validateNull(defaultValue) + StringManager.getValidString(defaultValue) ) .setDisplayLogic( - ValueManager.validateNull(field.getDisplayLogic()) + StringManager.getValidString( + field.getDisplayLogic() + ) ) .setDisplayType(displayTypeId) .setFormatPattern( - ValueManager.validateNull(column.getFormatPattern()) + StringManager.getValidString( + column.getFormatPattern() + ) ) .setIdentifierSequence(column.getSeqNo()) .setIsAllowCopy(field.isAllowCopy()) @@ -563,20 +586,30 @@ public static Field.Builder convertField(Properties context, MField field, boole .setIsTranslated(column.isTranslated()) .setIsUpdateable(column.isUpdateable()) .setMandatoryLogic( - ValueManager.validateNull(column.getMandatoryLogic()) + StringManager.getValidString( + column.getMandatoryLogic() + ) ) .setReadOnlyLogic( - ValueManager.validateNull(column.getReadOnlyLogic()) + StringManager.getValidString( + column.getReadOnlyLogic() + ) ) .setSequence(field.getSeqNo()) .setSeqNoGrid(field.getSeqNoGrid()) .setValueMax( - ValueManager.validateNull(column.getValueMax()) + StringManager.getValidString( + column.getValueMax() + ) ) .setValueMin( - ValueManager.validateNull(column.getValueMin()) + StringManager.getValidString( + column.getValueMin() + ) + ) + .setFieldLength( + column.getFieldLength() ) - .setFieldLength(column.getFieldLength()) .addAllContextColumnNames( ContextManager.getContextColumnNames( Optional.ofNullable(field.getDefaultValue()).orElse( @@ -662,7 +695,7 @@ public static Field.Builder convertField(Properties context, MField field, boole // ASP default displayed field as panel if (fieldCustom.get_ColumnIndex(org.spin.dictionary.util.DictionaryUtil.IS_DISPLAYED_AS_PANEL_COLUMN_NAME) >= 0) { builder.setIsDisplayedAsPanel( - ValueManager.validateNull( + StringManager.getValidString( fieldCustom.get_ValueAsString( org.spin.dictionary.util.DictionaryUtil.IS_DISPLAYED_AS_PANEL_COLUMN_NAME ) @@ -672,7 +705,7 @@ public static Field.Builder convertField(Properties context, MField field, boole // ASP default displayed field as table if (fieldCustom.get_ColumnIndex(org.spin.dictionary.util.DictionaryUtil.IS_DISPLAYED_AS_TABLE_COLUMN_NAME) >= 0) { builder.setIsDisplayedAsTable( - ValueManager.validateNull( + StringManager.getValidString( fieldCustom.get_ValueAsString( org.spin.dictionary.util.DictionaryUtil.IS_DISPLAYED_AS_TABLE_COLUMN_NAME ) @@ -773,12 +806,12 @@ public static List generateDependentFields(MField field) { ); DependentField.Builder builder = DependentField.newBuilder() .setId( - ValueManager.validateNull( + StringManager.getValidString( currentField.getUUID() ) ) .setUuid( - ValueManager.validateNull( + StringManager.getValidString( currentField.getUUID() ) ) @@ -786,7 +819,7 @@ public static List generateDependentFields(MField field) { currentField.getAD_Field_ID() ) .setColumnName( - ValueManager.validateNull( + StringManager.getValidString( currentColumnName ) ) @@ -794,12 +827,12 @@ public static List generateDependentFields(MField field) { tab.getAD_Tab_ID() ) .setParentUuid( - ValueManager.validateNull( + StringManager.getValidString( tab.getUUID() ) ) .setParentName( - ValueManager.validateNull( + StringManager.getValidString( tab.getName() ) ) @@ -837,12 +870,16 @@ public static FieldGroup.Builder convertFieldGroup(Properties context, int field builder = FieldGroup.newBuilder() .setId(fieldGroup.getAD_FieldGroup_ID()) .setUuid( - ValueManager.validateNull(fieldGroup.getUUID()) + StringManager.getValidString( + fieldGroup.getUUID() + ) ) .setName( - ValueManager.validateNull(name)) + StringManager.getValidString(name)) .setFieldGroupType( - ValueManager.validateNull(fieldGroup.getFieldGroupType()) + StringManager.getValidString( + fieldGroup.getFieldGroupType() + ) ) ; return builder; @@ -864,13 +901,19 @@ public static FieldDefinition.Builder convertFieldDefinition(Properties context, builder = FieldDefinition.newBuilder() .setId(fieldDefinition.getAD_FieldDefinition_ID()) .setUuid( - ValueManager.validateNull(fieldDefinition.getUUID()) + StringManager.getValidString( + fieldDefinition.getUUID() + ) ) .setValue( - ValueManager.validateNull(fieldDefinition.getValue()) + StringManager.getValidString( + fieldDefinition.getValue() + ) ) .setName( - ValueManager.validateNull(fieldDefinition.getName()) + StringManager.getValidString( + fieldDefinition.getName() + ) ) ; // Get conditions @@ -879,15 +922,23 @@ public static FieldDefinition.Builder convertFieldDefinition(Properties context, continue; } FieldCondition.Builder fieldConditionBuilder = FieldCondition.newBuilder() - .setId(condition.getAD_FieldCondition_ID()) + .setId( + condition.getAD_FieldCondition_ID() + ) .setUuid( - ValueManager.validateNull(condition.getUUID()) + StringManager.getValidString( + condition.getUUID() + ) ) .setCondition( - ValueManager.validateNull(condition.getCondition()) + StringManager.getValidString( + condition.getCondition() + ) ) .setStylesheet( - ValueManager.validateNull(condition.getStylesheet()) + StringManager.getValidString( + condition.getStylesheet() + ) ) ; // Add to parent diff --git a/src/main/java/org/spin/grpc/service/field/business_partner/BusinessPartnerConvert.java b/src/main/java/org/spin/grpc/service/field/business_partner/BusinessPartnerConvert.java index 96dab5efd..9ab276db6 100644 --- a/src/main/java/org/spin/grpc/service/field/business_partner/BusinessPartnerConvert.java +++ b/src/main/java/org/spin/grpc/service/field/business_partner/BusinessPartnerConvert.java @@ -25,6 +25,7 @@ import org.spin.backend.grpc.field.business_partner.BusinessPartnerContact; import org.spin.backend.grpc.field.business_partner.BusinessPartnerInfo; import org.spin.service.grpc.util.value.NumberManager; +import org.spin.service.grpc.util.value.StringManager; import org.spin.service.grpc.util.value.ValueManager; public class BusinessPartnerConvert { @@ -51,42 +52,42 @@ public static BusinessPartnerInfo.Builder convertBusinessPartner(MBPartner busin businessPartner.getC_BPartner_ID() ) .setUuid( - ValueManager.validateNull( + StringManager.getValidString( businessPartner.getUUID() ) ) .setDisplayValue( - ValueManager.validateNull( + StringManager.getValidString( businessPartner.getDisplayValue() ) ) .setValue( - ValueManager.validateNull( + StringManager.getValidString( businessPartner.getValue() ) ) .setTaxId( - ValueManager.validateNull( + StringManager.getValidString( businessPartner.getTaxID() ) ) .setName( - ValueManager.validateNull( + StringManager.getValidString( businessPartner.getName() ) ) .setName2( - ValueManager.validateNull( + StringManager.getValidString( businessPartner.getName2() ) ) .setDescription( - ValueManager.validateNull( + StringManager.getValidString( businessPartner.getDescription() ) ) .setBusinessPartnerGroup( - ValueManager.validateNull( + StringManager.getValidString( businessPartneGroup.getName() ) ) @@ -157,47 +158,47 @@ public static BusinessPartnerContact.Builder convertBusinessPartnerContact(MUser businessPartnerContact.getAD_User_ID() ) .setUuid( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerContact.getUUID() ) ) .setGreeting( - ValueManager.validateNull( + StringManager.getValidString( greetingName ) ) .setName( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerContact.getName() ) ) .setTitle( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerContact.getTitle() ) ) .setAddress( - ValueManager.validateNull( + StringManager.getValidString( locationName ) ) .setPhone( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerContact.getPhone() ) ) .setPhone2( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerContact.getPhone2() ) ) .setFax( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerContact.getFax() ) ) .setEmail( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerContact.getEMail() ) ) @@ -207,7 +208,7 @@ public static BusinessPartnerContact.Builder convertBusinessPartnerContact(MUser ) ) .setLastResult( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerContact.getLastResult() ) ) @@ -249,30 +250,45 @@ public static BusinessPartnerAddressLocation.Builder convertBusinessPartnerLocat businessPartnerLocation.getC_BPartner_Location_ID() ) .setUuid( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerLocation.getUUID() ) ) + .setName( + StringManager.getValidString( + businessPartnerLocation.getName() + ) + ) + .setDescription( + StringManager.getValidString( + businessPartnerLocation.getDescription() + ) + ) .setPhone( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerLocation.getPhone() ) ) .setPhone2( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerLocation.getPhone2() ) ) .setFax( - ValueManager.validateNull( + StringManager.getValidString( businessPartnerLocation.getFax() ) ) .setAddress( - ValueManager.validateNull( + StringManager.getValidString( locationName ) ) + .setMapUrl( + StringManager.getValidString( + businessPartnerLocation.getMapURL() + ) + ) .setIsShipToAddress( businessPartnerLocation.isShipTo() ) @@ -288,6 +304,12 @@ public static BusinessPartnerAddressLocation.Builder convertBusinessPartnerLocat .setIsActive( businessPartnerLocation.isActive() ) + .setIsDefaultBilling( + businessPartnerLocation.isDefaultBilling() + ) + .setIsDefaultShipping( + businessPartnerLocation.isDefaultShipping() + ) ; return builder; } diff --git a/src/main/java/org/spin/grpc/service/field/business_partner/BusinessPartnerLogic.java b/src/main/java/org/spin/grpc/service/field/business_partner/BusinessPartnerLogic.java index 54bbaeb63..cb8b555bd 100644 --- a/src/main/java/org/spin/grpc/service/field/business_partner/BusinessPartnerLogic.java +++ b/src/main/java/org/spin/grpc/service/field/business_partner/BusinessPartnerLogic.java @@ -43,6 +43,7 @@ import org.spin.base.util.ReferenceInfo; import org.spin.service.grpc.authentication.SessionManager; import org.spin.service.grpc.util.db.LimitUtil; +import org.spin.service.grpc.util.value.StringManager; import org.spin.service.grpc.util.value.ValueManager; public class BusinessPartnerLogic { @@ -223,7 +224,7 @@ public static ListBusinessPartnersInfoResponse.Builder listBusinessPartnersInfo( ListBusinessPartnersInfoResponse.Builder builderList = ListBusinessPartnersInfoResponse.newBuilder() .setRecordCount(recordCount) .setNextPageToken( - ValueManager.validateNull( + StringManager.getValidString( nexPageToken ) ) @@ -304,7 +305,7 @@ public static ListBusinessPartnerAddressLocationsResponse.Builder listBusinessPa ListBusinessPartnerAddressLocationsResponse.Builder builderList = ListBusinessPartnerAddressLocationsResponse.newBuilder() .setRecordCount(recordCount) .setNextPageToken( - ValueManager.validateNull( + StringManager.getValidString( nexPageToken ) ) diff --git a/src/main/proto/field.business_partner.proto b/src/main/proto/field.business_partner.proto index d667da247..b407e6741 100644 --- a/src/main/proto/field.business_partner.proto +++ b/src/main/proto/field.business_partner.proto @@ -163,15 +163,20 @@ message ListBusinessPartnerContactsRequest { message BusinessPartnerAddressLocation { int32 id = 1; string uuid = 2; - string phone = 3; - string phone2 = 4; - string fax = 5; - string address = 6; - bool is_ship_to_address = 7; // Ship Adrress - bool is_bill_to_address = 8; // Invoice Address - bool is_remit_to_address = 9; // Pay-From Address - bool is_pay_form_address = 10; // Remit-To Address - bool is_active = 11; + string name = 3; + string description = 4; + string phone = 5; + string phone2 = 6; + string fax = 7; + string address = 8; + string map_url = 9; + bool is_ship_to_address = 10; // Ship Adrress + bool is_bill_to_address = 11; // Invoice Address + bool is_remit_to_address = 12; // Pay-From Address + bool is_pay_form_address = 13; // Remit-To Address + bool is_active = 14; + bool is_default_shipping = 15; + bool is_default_billing = 16; } message ListBusinessPartnerAddressLocationsResponse {